@dxos/ui-theme 0.8.4-main.bc674ce → 0.8.4-main.c85a9c8dae

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 (371) hide show
  1. package/dist/lib/browser/index.mjs +556 -2523
  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 +556 -2523
  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/meta.json +1 -1
  8. package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +144 -0
  9. package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +7 -0
  10. package/dist/plugin/node-cjs/theme.css +893 -817
  11. package/dist/plugin/node-cjs/theme.css.map +3 -3
  12. package/dist/plugin/node-esm/meta.json +1 -1
  13. package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +112 -0
  14. package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +7 -0
  15. package/dist/plugin/node-esm/theme.css +893 -817
  16. package/dist/plugin/node-esm/theme.css.map +3 -3
  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 +7 -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/{styles/fragments → fragments}/elevation.d.ts +0 -6
  25. package/dist/types/src/fragments/elevation.d.ts.map +1 -0
  26. package/dist/types/src/fragments/focus.d.ts +4 -0
  27. package/dist/types/src/fragments/focus.d.ts.map +1 -0
  28. package/dist/types/src/fragments/hover.d.ts +10 -0
  29. package/dist/types/src/fragments/hover.d.ts.map +1 -0
  30. package/dist/types/src/{styles/fragments → fragments}/index.d.ts +0 -7
  31. package/dist/types/src/fragments/index.d.ts.map +1 -0
  32. package/dist/types/src/fragments/selected.d.ts +4 -0
  33. package/dist/types/src/fragments/selected.d.ts.map +1 -0
  34. package/dist/types/src/{styles/fragments → fragments}/size.d.ts +0 -2
  35. package/dist/types/src/fragments/size.d.ts.map +1 -0
  36. package/dist/types/src/fragments/text.d.ts +7 -0
  37. package/dist/types/src/fragments/text.d.ts.map +1 -0
  38. package/dist/types/src/fragments/valence.d.ts +4 -0
  39. package/dist/types/src/fragments/valence.d.ts.map +1 -0
  40. package/dist/types/src/index.d.ts +3 -10
  41. package/dist/types/src/index.d.ts.map +1 -1
  42. package/dist/types/src/plugins/ThemePlugin.d.ts +16 -0
  43. package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -0
  44. package/dist/types/src/plugins/dark-mode.d.ts +1 -0
  45. package/dist/types/src/plugins/dark-mode.d.ts.map +1 -0
  46. package/dist/types/src/theme/components/avatar.d.ts.map +1 -0
  47. package/dist/types/src/theme/components/breadcrumb.d.ts.map +1 -0
  48. package/dist/types/src/theme/components/button.d.ts +15 -0
  49. package/dist/types/src/theme/components/button.d.ts.map +1 -0
  50. package/dist/types/src/theme/components/card.d.ts +11 -0
  51. package/dist/types/src/theme/components/card.d.ts.map +1 -0
  52. package/dist/types/src/{styles → theme}/components/dialog.d.ts +2 -0
  53. package/dist/types/src/theme/components/dialog.d.ts.map +1 -0
  54. package/dist/types/src/theme/components/icon-button.d.ts.map +1 -0
  55. package/dist/types/src/theme/components/icon.d.ts.map +1 -0
  56. package/dist/types/src/{styles → theme}/components/index.d.ts +3 -1
  57. package/dist/types/src/theme/components/index.d.ts.map +1 -0
  58. package/dist/types/src/{styles → theme}/components/input.d.ts +25 -21
  59. package/dist/types/src/theme/components/input.d.ts.map +1 -0
  60. package/dist/types/src/theme/components/link.d.ts.map +1 -0
  61. package/dist/types/src/theme/components/list.d.ts.map +1 -0
  62. package/dist/types/src/{styles → theme}/components/main.d.ts +2 -7
  63. package/dist/types/src/theme/components/main.d.ts.map +1 -0
  64. package/dist/types/src/{styles → theme}/components/menu.d.ts +1 -1
  65. package/dist/types/src/theme/components/menu.d.ts.map +1 -0
  66. package/dist/types/src/{styles → theme}/components/message.d.ts +1 -0
  67. package/dist/types/src/theme/components/message.d.ts.map +1 -0
  68. package/dist/types/src/{styles → theme}/components/popover.d.ts +1 -1
  69. package/dist/types/src/theme/components/popover.d.ts.map +1 -0
  70. package/dist/types/src/theme/components/scroll-area.d.ts +22 -0
  71. package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -0
  72. package/dist/types/src/theme/components/select.d.ts.map +1 -0
  73. package/dist/types/src/theme/components/separator.d.ts.map +1 -0
  74. package/dist/types/src/theme/components/skeleton.d.ts +7 -0
  75. package/dist/types/src/theme/components/skeleton.d.ts.map +1 -0
  76. package/dist/types/src/theme/components/splitter.d.ts +4 -0
  77. package/dist/types/src/theme/components/splitter.d.ts.map +1 -0
  78. package/dist/types/src/theme/components/status.d.ts.map +1 -0
  79. package/dist/types/src/theme/components/tag.d.ts.map +1 -0
  80. package/dist/types/src/theme/components/toast.d.ts.map +1 -0
  81. package/dist/types/src/theme/components/toolbar.d.ts +12 -0
  82. package/dist/types/src/theme/components/toolbar.d.ts.map +1 -0
  83. package/dist/types/src/theme/components/tooltip.d.ts.map +1 -0
  84. package/dist/types/src/theme/components/treegrid.d.ts.map +1 -0
  85. package/dist/types/src/theme/index.d.ts +3 -0
  86. package/dist/types/src/theme/index.d.ts.map +1 -0
  87. package/dist/types/src/theme/primitives/column.d.ts +7 -0
  88. package/dist/types/src/theme/primitives/column.d.ts.map +1 -0
  89. package/dist/types/src/theme/primitives/index.d.ts +3 -0
  90. package/dist/types/src/theme/primitives/index.d.ts.map +1 -0
  91. package/dist/types/src/theme/primitives/panel.d.ts +9 -0
  92. package/dist/types/src/theme/primitives/panel.d.ts.map +1 -0
  93. package/dist/types/src/theme/theme.d.ts +5 -0
  94. package/dist/types/src/theme/theme.d.ts.map +1 -0
  95. package/dist/types/src/util/hash-styles.d.ts +8 -5
  96. package/dist/types/src/util/hash-styles.d.ts.map +1 -1
  97. package/dist/types/src/util/mx.d.ts +8 -0
  98. package/dist/types/src/util/mx.d.ts.map +1 -1
  99. package/dist/types/tsconfig.tsbuildinfo +1 -1
  100. package/package.json +19 -27
  101. package/src/Theme.stories.tsx +224 -0
  102. package/src/css/base/base.css +43 -0
  103. package/src/{styles/layers → css/base}/typography.css +3 -5
  104. package/src/{styles/layers → css/components}/button.css +22 -14
  105. package/src/{styles/layers → css/components}/checkbox.css +12 -8
  106. package/src/{styles/layers → css/components}/dialog.css +16 -15
  107. package/src/{styles/layers → css/components}/focus-ring.css +45 -40
  108. package/src/css/components/link.css +9 -0
  109. package/src/css/components/panel.css +117 -0
  110. package/src/css/components/scrollbar.css +24 -0
  111. package/src/css/components/surface.css +34 -0
  112. package/src/css/components/tag.css +130 -0
  113. package/src/css/components/text.css +124 -0
  114. package/src/css/integrations/codemirror.css +32 -0
  115. package/src/css/integrations/tldraw.css +13 -0
  116. package/src/css/layout/main.css +212 -0
  117. package/src/{styles/layers → css/layout}/native.css +6 -4
  118. package/src/css/layout/positioning.css +19 -0
  119. package/src/{styles/layers → css/layout}/size.css +137 -108
  120. package/src/css/theme/animation.css +229 -0
  121. package/src/css/theme/border.css +23 -0
  122. package/src/css/theme/palette.css +28 -0
  123. package/src/css/theme/semantic.css +100 -0
  124. package/src/css/theme/spacing.css +130 -0
  125. package/src/css/theme/styles.css +145 -0
  126. package/src/css/theme/text.css +37 -0
  127. package/src/css/utilities.css +7 -0
  128. package/src/defs.ts +48 -0
  129. package/src/fragments/density.ts +13 -0
  130. package/src/{styles/fragments → fragments}/elevation.ts +6 -8
  131. package/src/fragments/focus.ts +11 -0
  132. package/src/fragments/hover.ts +18 -0
  133. package/src/{styles/fragments → fragments}/index.ts +2 -7
  134. package/src/fragments/selected.ts +12 -0
  135. package/src/fragments/size.ts +117 -0
  136. package/src/fragments/text.ts +11 -0
  137. package/src/fragments/valence.ts +33 -0
  138. package/src/index.ts +3 -14
  139. package/src/plugins/ThemePlugin.ts +137 -0
  140. package/src/plugins/dark-mode.ts +22 -0
  141. package/src/{styles → theme}/components/avatar.ts +11 -11
  142. package/src/theme/components/button.ts +48 -0
  143. package/src/theme/components/card.ts +94 -0
  144. package/src/{styles → theme}/components/dialog.ts +18 -10
  145. package/src/{styles → theme}/components/icon-button.ts +1 -1
  146. package/src/{styles → theme}/components/icon.ts +2 -2
  147. package/src/{styles → theme}/components/index.ts +3 -1
  148. package/src/theme/components/input.ts +186 -0
  149. package/src/{styles → theme}/components/link.ts +3 -3
  150. package/src/{styles → theme}/components/list.ts +3 -3
  151. package/src/{styles → theme}/components/main.ts +2 -6
  152. package/src/{styles → theme}/components/menu.ts +9 -19
  153. package/src/{styles → theme}/components/message.ts +11 -6
  154. package/src/{styles → theme}/components/popover.ts +13 -11
  155. package/src/theme/components/scroll-area.ts +103 -0
  156. package/src/{styles → theme}/components/select.ts +7 -14
  157. package/src/{styles → theme}/components/separator.ts +3 -3
  158. package/src/theme/components/skeleton.ts +23 -0
  159. package/src/theme/components/splitter.ts +20 -0
  160. package/src/{styles → theme}/components/status.ts +5 -5
  161. package/src/{styles → theme}/components/tag.ts +1 -1
  162. package/src/{styles → theme}/components/toast.ts +5 -6
  163. package/src/theme/components/toolbar.ts +41 -0
  164. package/src/{styles → theme}/components/tooltip.ts +4 -5
  165. package/src/{styles → theme}/components/treegrid.ts +8 -8
  166. package/src/{styles → theme}/index.ts +1 -2
  167. package/src/theme/primitives/column.ts +30 -0
  168. package/src/theme/primitives/index.ts +6 -0
  169. package/src/theme/primitives/panel.ts +47 -0
  170. package/src/{styles → theme}/theme.ts +25 -9
  171. package/src/theme.css +78 -4
  172. package/src/typings.d.ts +0 -1
  173. package/src/util/hash-styles.ts +118 -98
  174. package/src/util/mx.ts +54 -43
  175. package/dist/plugin/node-cjs/chunk-UUMDOU7E.cjs +0 -79
  176. package/dist/plugin/node-cjs/chunk-UUMDOU7E.cjs.map +0 -7
  177. package/dist/plugin/node-cjs/chunk-ZVALPM6U.cjs +0 -1619
  178. package/dist/plugin/node-cjs/chunk-ZVALPM6U.cjs.map +0 -7
  179. package/dist/plugin/node-cjs/config/tailwind.cjs +0 -29
  180. package/dist/plugin/node-cjs/config/tailwind.cjs.map +0 -7
  181. package/dist/plugin/node-cjs/plugins/esbuild-plugin.cjs +0 -90
  182. package/dist/plugin/node-cjs/plugins/esbuild-plugin.cjs.map +0 -7
  183. package/dist/plugin/node-cjs/plugins/plugin.cjs +0 -124
  184. package/dist/plugin/node-cjs/plugins/plugin.cjs.map +0 -7
  185. package/dist/plugin/node-esm/chunk-AFRHJHP4.mjs +0 -49
  186. package/dist/plugin/node-esm/chunk-AFRHJHP4.mjs.map +0 -7
  187. package/dist/plugin/node-esm/chunk-HJE6EZWE.mjs +0 -1614
  188. package/dist/plugin/node-esm/chunk-HJE6EZWE.mjs.map +0 -7
  189. package/dist/plugin/node-esm/config/tailwind.mjs +0 -8
  190. package/dist/plugin/node-esm/config/tailwind.mjs.map +0 -7
  191. package/dist/plugin/node-esm/plugins/esbuild-plugin.mjs +0 -63
  192. package/dist/plugin/node-esm/plugins/esbuild-plugin.mjs.map +0 -7
  193. package/dist/plugin/node-esm/plugins/plugin.mjs +0 -98
  194. package/dist/plugin/node-esm/plugins/plugin.mjs.map +0 -7
  195. package/dist/types/src/Tokens.stories.d.ts +0 -10
  196. package/dist/types/src/Tokens.stories.d.ts.map +0 -1
  197. package/dist/types/src/config/index.d.ts +0 -3
  198. package/dist/types/src/config/index.d.ts.map +0 -1
  199. package/dist/types/src/config/tailwind.d.ts +0 -9
  200. package/dist/types/src/config/tailwind.d.ts.map +0 -1
  201. package/dist/types/src/config/tokens/alias-colors.d.ts +0 -21
  202. package/dist/types/src/config/tokens/alias-colors.d.ts.map +0 -1
  203. package/dist/types/src/config/tokens/index.d.ts +0 -486
  204. package/dist/types/src/config/tokens/index.d.ts.map +0 -1
  205. package/dist/types/src/config/tokens/lengths.d.ts +0 -139
  206. package/dist/types/src/config/tokens/lengths.d.ts.map +0 -1
  207. package/dist/types/src/config/tokens/physical-colors.d.ts +0 -23
  208. package/dist/types/src/config/tokens/physical-colors.d.ts.map +0 -1
  209. package/dist/types/src/config/tokens/semantic-colors.d.ts +0 -187
  210. package/dist/types/src/config/tokens/semantic-colors.d.ts.map +0 -1
  211. package/dist/types/src/config/tokens/sememes-calls.d.ts +0 -3
  212. package/dist/types/src/config/tokens/sememes-calls.d.ts.map +0 -1
  213. package/dist/types/src/config/tokens/sememes-codemirror.d.ts +0 -43
  214. package/dist/types/src/config/tokens/sememes-codemirror.d.ts.map +0 -1
  215. package/dist/types/src/config/tokens/sememes-hue.d.ts +0 -4
  216. package/dist/types/src/config/tokens/sememes-hue.d.ts.map +0 -1
  217. package/dist/types/src/config/tokens/sememes-sheet.d.ts +0 -58
  218. package/dist/types/src/config/tokens/sememes-sheet.d.ts.map +0 -1
  219. package/dist/types/src/config/tokens/sememes-system.d.ts +0 -99
  220. package/dist/types/src/config/tokens/sememes-system.d.ts.map +0 -1
  221. package/dist/types/src/config/tokens/sizes.d.ts +0 -7
  222. package/dist/types/src/config/tokens/sizes.d.ts.map +0 -1
  223. package/dist/types/src/config/tokens/types.d.ts +0 -5
  224. package/dist/types/src/config/tokens/types.d.ts.map +0 -1
  225. package/dist/types/src/plugins/esbuild-plugin.d.ts +0 -9
  226. package/dist/types/src/plugins/esbuild-plugin.d.ts.map +0 -1
  227. package/dist/types/src/plugins/plugin.d.ts +0 -20
  228. package/dist/types/src/plugins/plugin.d.ts.map +0 -1
  229. package/dist/types/src/plugins/resolveContent.d.ts +0 -2
  230. package/dist/types/src/plugins/resolveContent.d.ts.map +0 -1
  231. package/dist/types/src/styles/components/anchored-overflow.d.ts +0 -6
  232. package/dist/types/src/styles/components/anchored-overflow.d.ts.map +0 -1
  233. package/dist/types/src/styles/components/avatar.d.ts.map +0 -1
  234. package/dist/types/src/styles/components/breadcrumb.d.ts.map +0 -1
  235. package/dist/types/src/styles/components/button.d.ts +0 -19
  236. package/dist/types/src/styles/components/button.d.ts.map +0 -1
  237. package/dist/types/src/styles/components/dialog.d.ts.map +0 -1
  238. package/dist/types/src/styles/components/icon-button.d.ts.map +0 -1
  239. package/dist/types/src/styles/components/icon.d.ts.map +0 -1
  240. package/dist/types/src/styles/components/index.d.ts.map +0 -1
  241. package/dist/types/src/styles/components/input.d.ts.map +0 -1
  242. package/dist/types/src/styles/components/link.d.ts.map +0 -1
  243. package/dist/types/src/styles/components/list.d.ts.map +0 -1
  244. package/dist/types/src/styles/components/main.d.ts.map +0 -1
  245. package/dist/types/src/styles/components/menu.d.ts.map +0 -1
  246. package/dist/types/src/styles/components/message.d.ts.map +0 -1
  247. package/dist/types/src/styles/components/popover.d.ts.map +0 -1
  248. package/dist/types/src/styles/components/scroll-area.d.ts +0 -9
  249. package/dist/types/src/styles/components/scroll-area.d.ts.map +0 -1
  250. package/dist/types/src/styles/components/select.d.ts.map +0 -1
  251. package/dist/types/src/styles/components/separator.d.ts.map +0 -1
  252. package/dist/types/src/styles/components/status.d.ts.map +0 -1
  253. package/dist/types/src/styles/components/tag.d.ts.map +0 -1
  254. package/dist/types/src/styles/components/toast.d.ts.map +0 -1
  255. package/dist/types/src/styles/components/toolbar.d.ts +0 -11
  256. package/dist/types/src/styles/components/toolbar.d.ts.map +0 -1
  257. package/dist/types/src/styles/components/tooltip.d.ts.map +0 -1
  258. package/dist/types/src/styles/components/treegrid.d.ts.map +0 -1
  259. package/dist/types/src/styles/fragments/density.d.ts +0 -13
  260. package/dist/types/src/styles/fragments/density.d.ts.map +0 -1
  261. package/dist/types/src/styles/fragments/dimension.d.ts +0 -5
  262. package/dist/types/src/styles/fragments/dimension.d.ts.map +0 -1
  263. package/dist/types/src/styles/fragments/disabled.d.ts.map +0 -1
  264. package/dist/types/src/styles/fragments/elevation.d.ts.map +0 -1
  265. package/dist/types/src/styles/fragments/focus.d.ts +0 -6
  266. package/dist/types/src/styles/fragments/focus.d.ts.map +0 -1
  267. package/dist/types/src/styles/fragments/group.d.ts +0 -5
  268. package/dist/types/src/styles/fragments/group.d.ts.map +0 -1
  269. package/dist/types/src/styles/fragments/hover.d.ts +0 -17
  270. package/dist/types/src/styles/fragments/hover.d.ts.map +0 -1
  271. package/dist/types/src/styles/fragments/index.d.ts.map +0 -1
  272. package/dist/types/src/styles/fragments/layout.d.ts +0 -3
  273. package/dist/types/src/styles/fragments/layout.d.ts.map +0 -1
  274. package/dist/types/src/styles/fragments/motion.d.ts +0 -2
  275. package/dist/types/src/styles/fragments/motion.d.ts.map +0 -1
  276. package/dist/types/src/styles/fragments/ornament.d.ts +0 -5
  277. package/dist/types/src/styles/fragments/ornament.d.ts.map +0 -1
  278. package/dist/types/src/styles/fragments/selected.d.ts +0 -13
  279. package/dist/types/src/styles/fragments/selected.d.ts.map +0 -1
  280. package/dist/types/src/styles/fragments/shimmer.d.ts +0 -3
  281. package/dist/types/src/styles/fragments/shimmer.d.ts.map +0 -1
  282. package/dist/types/src/styles/fragments/size.d.ts.map +0 -1
  283. package/dist/types/src/styles/fragments/surface.d.ts +0 -9
  284. package/dist/types/src/styles/fragments/surface.d.ts.map +0 -1
  285. package/dist/types/src/styles/fragments/text.d.ts +0 -7
  286. package/dist/types/src/styles/fragments/text.d.ts.map +0 -1
  287. package/dist/types/src/styles/fragments/valence.d.ts +0 -13
  288. package/dist/types/src/styles/fragments/valence.d.ts.map +0 -1
  289. package/dist/types/src/styles/index.d.ts +0 -4
  290. package/dist/types/src/styles/index.d.ts.map +0 -1
  291. package/dist/types/src/styles/theme.d.ts +0 -5
  292. package/dist/types/src/styles/theme.d.ts.map +0 -1
  293. package/dist/types/src/tailwind.d.ts +0 -3
  294. package/dist/types/src/tailwind.d.ts.map +0 -1
  295. package/dist/types/src/types.d.ts +0 -3
  296. package/dist/types/src/types.d.ts.map +0 -1
  297. package/dist/types/src/util/withLogical.d.ts +0 -164
  298. package/dist/types/src/util/withLogical.d.ts.map +0 -1
  299. package/src/Tokens.stories.tsx +0 -88
  300. package/src/config/index.ts +0 -6
  301. package/src/config/tailwind.ts +0 -264
  302. package/src/config/tokens/alias-colors.ts +0 -39
  303. package/src/config/tokens/index.ts +0 -92
  304. package/src/config/tokens/lengths.ts +0 -97
  305. package/src/config/tokens/physical-colors.ts +0 -125
  306. package/src/config/tokens/semantic-colors.ts +0 -27
  307. package/src/config/tokens/sememes-calls.ts +0 -17
  308. package/src/config/tokens/sememes-codemirror.ts +0 -50
  309. package/src/config/tokens/sememes-hue.ts +0 -54
  310. package/src/config/tokens/sememes-sheet.ts +0 -62
  311. package/src/config/tokens/sememes-system.ts +0 -302
  312. package/src/config/tokens/sizes.ts +0 -10
  313. package/src/config/tokens/types.ts +0 -9
  314. package/src/docs/theme.drawio.svg +0 -635
  315. package/src/plugins/esbuild-plugin.ts +0 -65
  316. package/src/plugins/plugin.ts +0 -130
  317. package/src/plugins/resolveContent.ts +0 -51
  318. package/src/styles/components/README.md +0 -6
  319. package/src/styles/components/anchored-overflow.ts +0 -20
  320. package/src/styles/components/button.ts +0 -48
  321. package/src/styles/components/input.ts +0 -177
  322. package/src/styles/components/scroll-area.ts +0 -43
  323. package/src/styles/components/toolbar.ts +0 -29
  324. package/src/styles/fragments/density.ts +0 -17
  325. package/src/styles/fragments/dimension.ts +0 -8
  326. package/src/styles/fragments/focus.ts +0 -16
  327. package/src/styles/fragments/group.ts +0 -12
  328. package/src/styles/fragments/hover.ts +0 -25
  329. package/src/styles/fragments/layout.ts +0 -7
  330. package/src/styles/fragments/motion.ts +0 -6
  331. package/src/styles/fragments/ornament.ts +0 -10
  332. package/src/styles/fragments/selected.ts +0 -45
  333. package/src/styles/fragments/shimmer.ts +0 -9
  334. package/src/styles/fragments/size.ts +0 -117
  335. package/src/styles/fragments/surface.ts +0 -29
  336. package/src/styles/fragments/text.ts +0 -12
  337. package/src/styles/fragments/valence.ts +0 -46
  338. package/src/styles/layers/README.md +0 -15
  339. package/src/styles/layers/anchored-overflow.css +0 -9
  340. package/src/styles/layers/animation.css +0 -17
  341. package/src/styles/layers/attention.css +0 -8
  342. package/src/styles/layers/base.css +0 -25
  343. package/src/styles/layers/can-scroll.css +0 -26
  344. package/src/styles/layers/drag-preview.css +0 -18
  345. package/src/styles/layers/hues.css +0 -110
  346. package/src/styles/layers/index.css +0 -26
  347. package/src/styles/layers/main.css +0 -227
  348. package/src/styles/layers/positioning.css +0 -23
  349. package/src/styles/layers/surfaces.css +0 -31
  350. package/src/styles/layers/tag.css +0 -132
  351. package/src/styles/layers/tldraw.css +0 -91
  352. package/src/styles/layers/tokens.css +0 -46
  353. package/src/tailwind.ts +0 -7
  354. package/src/types.ts +0 -7
  355. package/src/util/withLogical.ts +0 -114
  356. /package/dist/types/src/{styles/fragments → fragments}/disabled.d.ts +0 -0
  357. /package/dist/types/src/{styles → theme}/components/avatar.d.ts +0 -0
  358. /package/dist/types/src/{styles → theme}/components/breadcrumb.d.ts +0 -0
  359. /package/dist/types/src/{styles → theme}/components/icon-button.d.ts +0 -0
  360. /package/dist/types/src/{styles → theme}/components/icon.d.ts +0 -0
  361. /package/dist/types/src/{styles → theme}/components/link.d.ts +0 -0
  362. /package/dist/types/src/{styles → theme}/components/list.d.ts +0 -0
  363. /package/dist/types/src/{styles → theme}/components/select.d.ts +0 -0
  364. /package/dist/types/src/{styles → theme}/components/separator.d.ts +0 -0
  365. /package/dist/types/src/{styles → theme}/components/status.d.ts +0 -0
  366. /package/dist/types/src/{styles → theme}/components/tag.d.ts +0 -0
  367. /package/dist/types/src/{styles → theme}/components/toast.d.ts +0 -0
  368. /package/dist/types/src/{styles → theme}/components/tooltip.d.ts +0 -0
  369. /package/dist/types/src/{styles → theme}/components/treegrid.d.ts +0 -0
  370. /package/src/{styles/fragments → fragments}/disabled.ts +0 -0
  371. /package/src/{styles → theme}/components/breadcrumb.ts +0 -0
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Misc
3
+ */
4
+
5
+ @utility dx-icon-inline {
6
+ @apply inline-block align-[-0.125em];
7
+ }
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 = 'dxos.org/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,13 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { type Density } from '@dxos/ui-types';
6
+
7
+ export const coarseBlockSize = 'min-h-[2.5rem]';
8
+ export const coarseDimensions = `${coarseBlockSize} px-3`;
9
+
10
+ export const fineBlockSize = 'min-h-[2.5rem] pointer-fine:min-h-[2rem]';
11
+ export const fineDimensions = `${fineBlockSize} px-2`;
12
+
13
+ export const densityBlockSize = (density: Density = 'coarse') => (density === 'fine' ? fineBlockSize : coarseBlockSize);
@@ -4,14 +4,12 @@
4
4
 
5
5
  import { type ComponentFragment, type Elevation, type SurfaceLevel } from '@dxos/ui-types';
6
6
 
7
- /**
8
- * @deprecated
9
- */
10
- export const contentShadow: ComponentFragment<{ elevation?: Elevation }> = (_) => ['shadow-none'];
11
-
12
- // TODO(thure): These should become tokens.
13
7
  export const surfaceShadow: ComponentFragment<{ elevation?: Elevation }> = ({ elevation }) => [
14
- elevation === 'positioned' ? 'shadow' : elevation === 'dialog' || elevation === 'toast' ? 'shadow-md' : 'shadow-none',
8
+ elevation === 'positioned'
9
+ ? 'shadow-sm'
10
+ : elevation === 'dialog' || elevation === 'toast'
11
+ ? 'shadow-md'
12
+ : 'shadow-none',
15
13
  ];
16
14
 
17
15
  export const surfaceZIndex: ComponentFragment<{ level?: SurfaceLevel; elevation?: Elevation }> = ({
@@ -20,7 +18,7 @@ export const surfaceZIndex: ComponentFragment<{ level?: SurfaceLevel; elevation?
20
18
  }) => {
21
19
  switch (level) {
22
20
  case 'tooltip':
23
- return elevation === 'dialog' ? ['z-[53]'] : elevation === 'toast' ? ['z-[43]'] : ['z-30'];
21
+ return elevation === 'dialog' ? ['z-[53]'] : elevation === 'toast' ? ['z-[43]'] : ['z-50'];
24
22
  case 'menu':
25
23
  return elevation === 'dialog' ? ['z-[52]'] : elevation === 'toast' ? ['z-[42]'] : ['z-20'];
26
24
  default:
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ export const focusRing = 'dx-focus-ring';
6
+
7
+ export const subduedFocus =
8
+ 'focus:outline-hidden focus-visible:outline-hidden focus:ring-0 ring-0 focus:border-0 border-0';
9
+
10
+ export const staticFocusRing =
11
+ 'ring-2 ring-offset-0 ring-primary-350 ring-offset-white dark:ring-primary-450 dark:ring-offset-black';
@@ -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)';
@@ -2,19 +2,14 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
+ // TODO(burdon): Replace fragments with utility and component classes.
6
+
5
7
  export * from './density';
6
8
  export * from './disabled';
7
- export * from './dimension';
8
9
  export * from './elevation';
9
10
  export * from './focus';
10
- export * from './group';
11
11
  export * from './hover';
12
- export * from './layout';
13
- export * from './motion';
14
- export * from './ornament';
15
12
  export * from './selected';
16
- export * from './shimmer';
17
- export * from './surface';
18
13
  export * from './size';
19
14
  export * from './text';
20
15
  export * from './valence';
@@ -0,0 +1,12 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export const ghostHighlighted =
6
+ 'data-[highlighted]:bg-primary-100 dark:data-[highlighted]:bg-primary-600 hover:data-[highlighted]:bg-primary-150 hover:dark:data-[highlighted]:bg-primary-500';
7
+
8
+ export const ghostSelected =
9
+ 'aria-selected:bg-base-surface aria-selected:text-accent-text hover:aria-selected:text-accent-text-hover aria-selected:font-semibold aria-selected:tracking-normal transition-[color,font-variation-settings,letter-spacing]';
10
+
11
+ export const ghostSelectedContainerMd =
12
+ '@md:aria-selected:bg-base-surface @md:aria-selected:text-accent-text @md:hover:aria-selected:text-accent-text-hover @md:aria-selected:font-semibold @md:aria-selected:tracking-normal @md:transition-[color,font-variation-settings,letter-spacing]';
@@ -0,0 +1,117 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ import { type Size } from '@dxos/ui-types';
6
+
7
+ import { mx } from '../util';
8
+
9
+ const sizeWidthMap = new Map<Size, string>([
10
+ [0, 'w-0'],
11
+ ['px', 'w-px'], // 1px
12
+ [0.5, 'w-0.5'],
13
+ [1, 'w-1'],
14
+ [1.5, 'w-1.5'],
15
+ [2, 'w-2'],
16
+ [2.5, 'w-2.5'],
17
+ [3, 'w-3'],
18
+ [3.5, 'w-3.5'],
19
+ [4, 'w-4'],
20
+ [5, 'w-5'],
21
+ [6, 'w-6'],
22
+ [7, 'w-7'],
23
+ [8, 'w-8'],
24
+ [9, 'w-9'],
25
+ [10, 'w-10'],
26
+ [11, 'w-11'],
27
+ [12, 'w-12'],
28
+ [14, 'w-14'],
29
+ [16, 'w-16'],
30
+ [20, 'w-20'],
31
+ [24, 'w-24'],
32
+ [28, 'w-28'],
33
+ [32, 'w-32'],
34
+ [36, 'w-36'],
35
+ [40, 'w-40'],
36
+ [44, 'w-44'],
37
+ [48, 'w-48'],
38
+ [52, 'w-52'],
39
+ [56, 'w-56'],
40
+ [60, 'w-60'],
41
+ [64, 'w-64'],
42
+ [72, 'w-72'],
43
+ [80, 'w-80'],
44
+ [96, 'w-96'],
45
+ ]);
46
+
47
+ const sizeHeightMap = new Map<Size, string>([
48
+ [0, 'h-0'],
49
+ ['px', 'h-px'], // 1px
50
+ [0.5, 'h-0.5'],
51
+ [1, 'h-1'],
52
+ [1.5, 'h-1.5'],
53
+ [2, 'h-2'],
54
+ [2.5, 'h-2.5'],
55
+ [3, 'h-3'],
56
+ [3.5, 'h-3.5'],
57
+ [4, 'h-4'],
58
+ [5, 'h-5'],
59
+ [6, 'h-6'],
60
+ [7, 'h-7'],
61
+ [8, 'h-8'],
62
+ [9, 'h-9'],
63
+ [10, 'h-10'],
64
+ [11, 'h-11'],
65
+ [12, 'h-12'],
66
+ [14, 'h-14'],
67
+ [16, 'h-16'],
68
+ [20, 'h-20'],
69
+ [24, 'h-24'],
70
+ [28, 'h-28'],
71
+ [32, 'h-32'],
72
+ [36, 'h-36'],
73
+ [40, 'h-40'],
74
+ [44, 'h-44'],
75
+ [48, 'h-48'],
76
+ [52, 'h-52'],
77
+ [56, 'h-56'],
78
+ [60, 'h-60'],
79
+ [64, 'h-64'],
80
+ [72, 'h-72'],
81
+ [80, 'h-80'],
82
+ [96, 'h-96'],
83
+ ]);
84
+
85
+ const sizes = new Set(sizeWidthMap.keys());
86
+
87
+ export const getSizeHeight = sizeHeightMap.get.bind(sizeHeightMap);
88
+ export const getSizeWidth = sizeWidthMap.get.bind(sizeWidthMap);
89
+ export const getSize = (size: Size) => mx(getSizeHeight(size), getSizeWidth(size));
90
+
91
+ export const computeSize = (value: number, defaultSize: Size) => {
92
+ if (sizes.has(value as Size)) {
93
+ return value as Size;
94
+ } else if (value <= 0) {
95
+ return 0;
96
+ } else if (value === 1) {
97
+ return 'px';
98
+ } else {
99
+ const wholeSeries = Math.floor(value);
100
+ const halfSeries = Math.floor(value * 2) / 2;
101
+ const doubleSeries = Math.floor(value / 2) * 2;
102
+ const quadrupleSeries = Math.floor(value / 4) * 4;
103
+ if (sizes.has(halfSeries as Size)) {
104
+ return halfSeries as Size;
105
+ } else if (sizes.has(wholeSeries as Size)) {
106
+ return wholeSeries as Size;
107
+ } else if (sizes.has(doubleSeries as Size)) {
108
+ return doubleSeries as Size;
109
+ } else if (sizes.has(quadrupleSeries as Size)) {
110
+ return quadrupleSeries as Size;
111
+ } else {
112
+ return defaultSize;
113
+ }
114
+ }
115
+ };
116
+
117
+ export const sizeValue = (size: Size): number => (size === 'px' ? 1 : size);
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ /**
6
+ * Content areas that contain the text editor.
7
+ */
8
+ export const textBlockWidth = 'w-full max-w-text-content mx-auto';
9
+
10
+ export const descriptionTextPrimary = 'text-sm font-normal text-base-surface-text';
11
+ export const descriptionMessage = 'text-description border border-dashed border-separator rounded-sm p-4';
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ import { type MessageValence } from '@dxos/ui-types';
6
+
7
+ export const textValence = (valence?: MessageValence) => {
8
+ switch (valence) {
9
+ case 'success':
10
+ return 'font-medium text-success-text';
11
+ case 'info':
12
+ return 'font-medium text-info-text';
13
+ case 'warning':
14
+ return 'font-medium text-warning-text';
15
+ case 'error':
16
+ return 'font-medium text-error-text';
17
+ }
18
+ };
19
+
20
+ export const messageValence = (valence?: MessageValence) => {
21
+ switch (valence) {
22
+ case 'success':
23
+ return 'font-medium text-success-text border-success-text bg-success-surface';
24
+ case 'info':
25
+ return 'font-medium text-info-text border-info-text bg-info-surface';
26
+ case 'warning':
27
+ return 'font-medium text-warning-text border-warning-text bg-warning-surface';
28
+ case 'error':
29
+ return 'font-medium text-error-text border-error-text bg-error-surface';
30
+ default:
31
+ return 'font-medium text-neutral-text border-neutral-text bg-neutral-surface';
32
+ }
33
+ };
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/index';
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';
@@ -0,0 +1,137 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ /* eslint-disable no-console */
6
+
7
+ import { existsSync, readFileSync } from 'node:fs';
8
+ import { dirname, resolve } from 'node:path';
9
+
10
+ import tailwindcss from '@tailwindcss/postcss';
11
+ import autoprefixer from 'autoprefixer';
12
+ import postcssImport from 'postcss-import';
13
+ import postcssNesting from 'postcss-nesting';
14
+ import { type HtmlTagDescriptor, type Plugin, type UserConfig } from 'vite';
15
+
16
+ /**
17
+ * CSS cascade layer order.
18
+ * Must be established before any stylesheets load so that Tailwind's own @layer declarations don't override our ordering. Exported so consuming
19
+ */
20
+ export const LAYER_ORDER = [
21
+ 'properties',
22
+ 'theme',
23
+ 'dx-tokens',
24
+ 'user-tokens',
25
+ 'base',
26
+ 'tw-base',
27
+ 'dx-base',
28
+ 'components',
29
+ 'tw-components',
30
+ 'dx-components',
31
+ 'utilities',
32
+ ] as const;
33
+
34
+ const ROOT = '../../../../';
35
+
36
+ export type ThemePluginOptions = {
37
+ srcCssPath?: string;
38
+ virtualFileId?: string;
39
+ verbose?: boolean;
40
+ };
41
+
42
+ /**
43
+ * Vite plugin to configure theme.
44
+ */
45
+ export const ThemePlugin = (options: ThemePluginOptions): Plugin => {
46
+ // Prefer source CSS if available (monorepo dev), fall back to dist for installed package.
47
+ const srcThemePath = resolve(import.meta.dirname, ROOT, 'src/theme.css');
48
+ const distThemePath = resolve(import.meta.dirname, '../theme.css');
49
+ const isMonorepo = existsSync(srcThemePath);
50
+
51
+ // dark-mode.ts is always read from src (ships via "files": ["src"] in package.json).
52
+ // In monorepo: import.meta.dirname = src/plugins/, so the file is right here.
53
+ // In installed package: import.meta.dirname = dist/plugin/{format}/plugins/, so go up 4 levels.
54
+ const srcDarkModePath = resolve(import.meta.dirname, ROOT, 'src/plugins/dark-mode.ts');
55
+ const distDarkModePath = resolve(import.meta.dirname, ROOT, 'src/plugins/dark-mode.ts');
56
+ const darkModeScriptPath = existsSync(srcDarkModePath) ? srcDarkModePath : distDarkModePath;
57
+
58
+ const config: ThemePluginOptions = {
59
+ srcCssPath: isMonorepo ? srcThemePath : distThemePath,
60
+ virtualFileId: '@dxos-theme',
61
+ ...options,
62
+ };
63
+
64
+ // Derive project root from the source location so Tailwind scans all packages.
65
+ const base = isMonorepo ? resolve(dirname(srcThemePath), ROOT) : undefined;
66
+
67
+ if (process.env.DEBUG || options.verbose) {
68
+ console.log('ThemePlugin:\n', JSON.stringify(config, null, 2));
69
+ }
70
+
71
+ return {
72
+ name: 'vite-plugin-dxos-ui-theme',
73
+ config: (): UserConfig => {
74
+ return {
75
+ css: {
76
+ postcss: {
77
+ plugins: [
78
+ // Handles @import statements in CSS.
79
+ postcssImport(),
80
+ // Processes CSS nesting syntax.
81
+ postcssNesting(),
82
+ // Processes Tailwind directives and generates utilities from scanned content.
83
+ // base points to project root so all packages are scanned (not just ui-theme).
84
+ tailwindcss(base !== undefined ? { base } : {}),
85
+ // Adds vendor prefixes.
86
+ autoprefixer,
87
+ ],
88
+ },
89
+ },
90
+ };
91
+ },
92
+ resolveId: (id) => {
93
+ if (id === config.virtualFileId) {
94
+ return config.srcCssPath;
95
+ }
96
+ },
97
+ transformIndexHtml: () => {
98
+ // Apply .dark class to <html> synchronously before any scripts run, so that
99
+ // the critical CSS html.dark rules apply on the very first paint.
100
+ const darkModeTag: HtmlTagDescriptor = {
101
+ tag: 'script',
102
+ attrs: { 'data-dxos-theme': '' },
103
+ injectTo: 'head-prepend',
104
+ children: readFileSync(darkModeScriptPath, 'utf-8'),
105
+ };
106
+
107
+ // Establish cascade layer order before any stylesheet loads.
108
+ const layersTag: HtmlTagDescriptor = {
109
+ tag: 'style',
110
+ attrs: { 'data-dxos-layers': '' },
111
+ children: `@layer ${LAYER_ORDER.join(', ')};`,
112
+ injectTo: 'head-prepend',
113
+ };
114
+
115
+ // Critical pre-CSS fallbacks so text is readable before (and during) Vite HMR.
116
+ // In dev mode Vite injects CSS via JS; when an HMR update fires the old style tag is
117
+ // removed before the new one is inserted, briefly leaving all --color-* vars undefined.
118
+ // These static approximations of neutral-50/950 survive that gap.
119
+ // Values are intentionally kept in sync with @theme tokens in semantic.css.
120
+ const criticalTag: HtmlTagDescriptor = {
121
+ tag: 'style',
122
+ attrs: { 'data-dxos-critical': '' },
123
+ injectTo: 'head-prepend',
124
+ children: [
125
+ ':root { color-scheme: light; }',
126
+ 'html { color: oklch(0.145 0 0); background-color: oklch(0.985 0 0); }', // ≈ neutral-950 / neutral-50
127
+ 'html.dark { color-scheme: dark; color: oklch(0.985 0 0); background-color: oklch(0.145 0 0); }',
128
+ '@media (prefers-color-scheme: dark) {',
129
+ ' html:not(.dark) { color: oklch(0.985 0 0); background-color: oklch(0.145 0 0); }',
130
+ '}',
131
+ ].join('\n'),
132
+ };
133
+
134
+ return [darkModeTag, layersTag, criticalTag];
135
+ },
136
+ };
137
+ };
@@ -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
+ })();
@@ -4,8 +4,8 @@
4
4
 
5
5
  import { type ComponentFunction, type Size, type Theme } from '@dxos/ui-types';
6
6
 
7
+ import { getSize, getSizeHeight } from '../../fragments';
7
8
  import { mx } from '../../util';
8
- import { descriptionText, getSize, getSizeHeight } from '../fragments';
9
9
 
10
10
  export type AvatarStyleProps = Partial<{
11
11
  size: Size;
@@ -20,34 +20,34 @@ export const avatarRoot: ComponentFunction<AvatarStyleProps> = ({ size = 10, inG
20
20
  mx(
21
21
  'relative inline-flex shrink-0',
22
22
  getSize(size),
23
- inGroup && (size === 'px' || size <= 3 ? '-mie-1' : '-mie-2'),
23
+ inGroup && (size === 'px' || size <= 3 ? '-mr-1' : '-mr-2'),
24
24
  ...etc,
25
25
  );
26
26
 
27
27
  export const avatarLabel: ComponentFunction<AvatarStyleProps> = ({ srOnly }, ...etc) => mx(srOnly && 'sr-only', ...etc);
28
28
 
29
29
  export const avatarDescription: ComponentFunction<AvatarStyleProps> = ({ srOnly }, ...etc) =>
30
- mx(descriptionText, srOnly && 'sr-only', ...etc);
30
+ mx('text-description', srOnly && 'sr-only', ...etc);
31
31
 
32
32
  export const avatarFrame: ComponentFunction<AvatarStyleProps> = ({ variant }, ...etc) =>
33
- mx('is-full bs-full bg-[--surface-bg]', variant === 'circle' ? 'rounded-full' : 'rounded', ...etc);
33
+ mx('w-full h-full bg-(--surface-bg)', variant === 'circle' ? 'rounded-full' : 'rounded-sm', ...etc);
34
34
 
35
35
  export const avatarStatusIcon: ComponentFunction<AvatarStyleProps> = ({ status, size = 3 }, ...etc) =>
36
36
  mx(
37
- 'absolute block-end-0 inline-end-0',
37
+ 'absolute bottom-0 end-0',
38
38
  getSize(size),
39
39
  status === 'inactive'
40
- ? 'text-amber-350 dark:text-amber-250'
40
+ ? 'text-amber-400 dark:text-amber-300'
41
41
  : status === 'active'
42
- ? 'text-emerald-350 dark:text-emerald-250'
43
- : 'text-neutral-350 dark:text-neutral-250',
42
+ ? 'text-emerald-400 dark:text-emerald-300'
43
+ : 'text-neutral-400 dark:text-neutral-300',
44
44
  ...etc,
45
45
  );
46
46
 
47
47
  export const avatarRing: ComponentFunction<AvatarStyleProps> = ({ status, variant, animation }, ...etc) =>
48
48
  mx(
49
49
  'absolute inset-0 border-2',
50
- variant === 'circle' ? 'rounded-full' : 'rounded',
50
+ variant === 'circle' ? 'rounded-full' : 'rounded-sm',
51
51
  status === 'current'
52
52
  ? 'border-primary-400 dark:border-primary-500'
53
53
  : status === 'active'
@@ -74,13 +74,13 @@ export const avatarGroupLabel: ComponentFunction<AvatarStyleProps> = ({ size, sr
74
74
  mx(
75
75
  srOnly
76
76
  ? 'sr-only'
77
- : 'rounded-full truncate text-sm leading-none plb-1 pli-2 relative z-[1] flex items-center justify-center',
77
+ : 'rounded-full truncate text-sm leading-none py-1 px-2 relative z-[1] flex items-center justify-center',
78
78
  size && getSizeHeight(size),
79
79
  ...etc,
80
80
  );
81
81
 
82
82
  export const avatarGroupDescription: ComponentFunction<AvatarStyleProps> = ({ srOnly }, ...etc) =>
83
- mx(srOnly ? 'sr-only' : descriptionText, ...etc);
83
+ mx(srOnly ? 'sr-only' : 'text-description', ...etc);
84
84
 
85
85
  export const avatarTheme: Theme<AvatarStyleProps> = {
86
86
  root: avatarRoot,
@@ -0,0 +1,48 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ import type { ComponentFunction, Density, Elevation, Theme } from '@dxos/ui-types';
6
+
7
+ import { ghostHover } from '../../fragments';
8
+ import { mx } from '../../util';
9
+
10
+ export const primaryButtonColors =
11
+ 'text-accent-surface-text bg-accent-surface hover:bg-accent-surface-hover aria-pressed:bg-primary-500 dark:aria-pressed:bg-primary-500 data-[state=open]:bg-primary-500 dark:data-[state=open]:bg-primary-500 aria-checked:bg-primary-500 dark:aria-checked:bg-primary-500 aria-checked:text-primary-100';
12
+
13
+ export const staticDefaultButtonColors = 'bg-input-surface text-input-surface-text';
14
+
15
+ export const defaultButtonColors = mx(
16
+ staticDefaultButtonColors,
17
+ 'data-[state=open]:bg-input-surface aria-pressed:text-accent-text aria-pressed:bg-base-surface aria-checked:text-accent-text aria-checked:bg-base-surface',
18
+ );
19
+
20
+ export const ghostButtonColors = mx(
21
+ ghostHover,
22
+ 'hover:text-inherit data-[state=open]:bg-input-surface aria-pressed:text-accent-text aria-pressed:bg-base-surface aria-checked:text-accent-text aria-checked:bg-base-surface',
23
+ );
24
+
25
+ export type ButtonStyleProps = Partial<{
26
+ inGroup?: boolean;
27
+ textWrap?: boolean;
28
+ density: Density;
29
+ elevation: Elevation;
30
+ disabled: boolean;
31
+ variant: 'default' | 'primary' | 'ghost' | 'outline';
32
+ }>;
33
+
34
+ const buttonRoot: ComponentFunction<ButtonStyleProps> = (_props, ...etc) => {
35
+ return mx('dx-button dx-focus-ring group max-w-full [&_span]:truncate', ...etc);
36
+ };
37
+
38
+ const buttonGroup: ComponentFunction<{ elevation?: Elevation }> = (_props, ...etc) => {
39
+ return mx(
40
+ 'inline-flex rounded-xs [&>:first-child]:rounded-w-sm [&>:last-child]:rounded-ie-sm [&>button]:relative',
41
+ ...etc,
42
+ );
43
+ };
44
+
45
+ export const buttonTheme: Theme<ButtonStyleProps> = {
46
+ root: buttonRoot,
47
+ group: buttonGroup,
48
+ };