@dxos/ui-theme 0.0.0 → 0.8.4-main.16b68245aa

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 (257) hide show
  1. package/dist/lib/browser/index.mjs +1372 -0
  2. package/dist/lib/browser/index.mjs.map +7 -0
  3. package/dist/lib/browser/meta.json +1 -0
  4. package/dist/lib/node-esm/index.mjs +1374 -0
  5. package/dist/lib/node-esm/index.mjs.map +7 -0
  6. package/dist/lib/node-esm/meta.json +1 -0
  7. package/dist/plugin/node-cjs/main.css +1564 -0
  8. package/dist/plugin/node-cjs/main.css.map +7 -0
  9. package/dist/plugin/node-cjs/meta.json +1 -0
  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 +1564 -0
  13. package/dist/plugin/node-esm/main.css.map +7 -0
  14. package/dist/plugin/node-esm/meta.json +1 -0
  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 +3 -0
  24. package/dist/types/src/fragments/disabled.d.ts.map +1 -0
  25. package/dist/types/src/fragments/hover.d.ts +10 -0
  26. package/dist/types/src/fragments/hover.d.ts.map +1 -0
  27. package/dist/types/src/fragments/index.d.ts +5 -0
  28. package/dist/types/src/fragments/index.d.ts.map +1 -0
  29. package/dist/types/src/fragments/text.d.ts +2 -0
  30. package/dist/types/src/fragments/text.d.ts.map +1 -0
  31. package/dist/types/src/index.d.ts +5 -0
  32. package/dist/types/src/index.d.ts.map +1 -0
  33. package/dist/types/src/plugins/ThemePlugin.d.ts +16 -0
  34. package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -0
  35. package/dist/types/src/plugins/dark-mode.d.ts +1 -0
  36. package/dist/types/src/plugins/dark-mode.d.ts.map +1 -0
  37. package/dist/types/src/theme/components/avatar.d.ts +21 -0
  38. package/dist/types/src/theme/components/avatar.d.ts.map +1 -0
  39. package/dist/types/src/theme/components/breadcrumb.d.ts +9 -0
  40. package/dist/types/src/theme/components/breadcrumb.d.ts.map +1 -0
  41. package/dist/types/src/theme/components/button.d.ts +15 -0
  42. package/dist/types/src/theme/components/button.d.ts.map +1 -0
  43. package/dist/types/src/theme/components/card.d.ts +12 -0
  44. package/dist/types/src/theme/components/card.d.ts.map +1 -0
  45. package/dist/types/src/theme/components/dialog.d.ts +17 -0
  46. package/dist/types/src/theme/components/dialog.d.ts.map +1 -0
  47. package/dist/types/src/theme/components/focus.d.ts +6 -0
  48. package/dist/types/src/theme/components/focus.d.ts.map +1 -0
  49. package/dist/types/src/theme/components/icon-button.d.ts +9 -0
  50. package/dist/types/src/theme/components/icon-button.d.ts.map +1 -0
  51. package/dist/types/src/theme/components/icon.d.ts +10 -0
  52. package/dist/types/src/theme/components/icon.d.ts.map +1 -0
  53. package/dist/types/src/theme/components/index.d.ts +27 -0
  54. package/dist/types/src/theme/components/index.d.ts.map +1 -0
  55. package/dist/types/src/theme/components/input.d.ts +115 -0
  56. package/dist/types/src/theme/components/input.d.ts.map +1 -0
  57. package/dist/types/src/theme/components/link.d.ts +7 -0
  58. package/dist/types/src/theme/components/link.d.ts.map +1 -0
  59. package/dist/types/src/theme/components/list.d.ts +14 -0
  60. package/dist/types/src/theme/components/list.d.ts.map +1 -0
  61. package/dist/types/src/theme/components/main.d.ts +28 -0
  62. package/dist/types/src/theme/components/main.d.ts.map +1 -0
  63. package/dist/types/src/theme/components/menu.d.ts +13 -0
  64. package/dist/types/src/theme/components/menu.d.ts.map +1 -0
  65. package/dist/types/src/theme/components/message.d.ts +12 -0
  66. package/dist/types/src/theme/components/message.d.ts.map +1 -0
  67. package/dist/types/src/theme/components/popover.d.ts +11 -0
  68. package/dist/types/src/theme/components/popover.d.ts.map +1 -0
  69. package/dist/types/src/theme/components/scroll-area.d.ts +32 -0
  70. package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -0
  71. package/dist/types/src/theme/components/select.d.ts +13 -0
  72. package/dist/types/src/theme/components/select.d.ts.map +1 -0
  73. package/dist/types/src/theme/components/separator.d.ts +8 -0
  74. package/dist/types/src/theme/components/separator.d.ts.map +1 -0
  75. package/dist/types/src/theme/components/skeleton.d.ts +7 -0
  76. package/dist/types/src/theme/components/skeleton.d.ts.map +1 -0
  77. package/dist/types/src/theme/components/splitter.d.ts +4 -0
  78. package/dist/types/src/theme/components/splitter.d.ts.map +1 -0
  79. package/dist/types/src/theme/components/status.d.ts +9 -0
  80. package/dist/types/src/theme/components/status.d.ts.map +1 -0
  81. package/dist/types/src/theme/components/tag.d.ts +7 -0
  82. package/dist/types/src/theme/components/tag.d.ts.map +1 -0
  83. package/dist/types/src/theme/components/toast.d.ts +12 -0
  84. package/dist/types/src/theme/components/toast.d.ts.map +1 -0
  85. package/dist/types/src/theme/components/toolbar.d.ts +11 -0
  86. package/dist/types/src/theme/components/toolbar.d.ts.map +1 -0
  87. package/dist/types/src/theme/components/tooltip.d.ts +8 -0
  88. package/dist/types/src/theme/components/tooltip.d.ts.map +1 -0
  89. package/dist/types/src/theme/components/treegrid.d.ts +10 -0
  90. package/dist/types/src/theme/components/treegrid.d.ts.map +1 -0
  91. package/dist/types/src/theme/index.d.ts +4 -0
  92. package/dist/types/src/theme/index.d.ts.map +1 -0
  93. package/dist/types/src/theme/primitives/column.d.ts +29 -0
  94. package/dist/types/src/theme/primitives/column.d.ts.map +1 -0
  95. package/dist/types/src/theme/primitives/index.d.ts +3 -0
  96. package/dist/types/src/theme/primitives/index.d.ts.map +1 -0
  97. package/dist/types/src/theme/primitives/panel.d.ts +13 -0
  98. package/dist/types/src/theme/primitives/panel.d.ts.map +1 -0
  99. package/dist/types/src/theme/theme.d.ts +5 -0
  100. package/dist/types/src/theme/theme.d.ts.map +1 -0
  101. package/dist/types/src/util/elevation.d.ts +9 -0
  102. package/dist/types/src/util/elevation.d.ts.map +1 -0
  103. package/dist/types/src/util/hash-styles.d.ts +18 -0
  104. package/dist/types/src/util/hash-styles.d.ts.map +1 -0
  105. package/dist/types/src/util/index.d.ts +6 -0
  106. package/dist/types/src/util/index.d.ts.map +1 -0
  107. package/dist/types/src/util/mx.d.ts +58 -0
  108. package/dist/types/src/util/mx.d.ts.map +1 -0
  109. package/dist/types/src/util/size.d.ts +27 -0
  110. package/dist/types/src/util/size.d.ts.map +1 -0
  111. package/dist/types/src/util/valence.d.ts +4 -0
  112. package/dist/types/src/util/valence.d.ts.map +1 -0
  113. package/dist/types/tsconfig.tsbuildinfo +1 -0
  114. package/package.json +30 -36
  115. package/src/Theme.stories.tsx +224 -0
  116. package/src/css/base/base.css +43 -0
  117. package/src/{styles/layers → css/base}/typography.css +21 -3
  118. package/src/{styles/layers → css/components}/button.css +23 -14
  119. package/src/{styles/layers → css/components}/checkbox.css +12 -8
  120. package/src/css/components/dialog.css +78 -0
  121. package/src/{styles/layers/focus-ring.css → css/components/focus.css} +60 -41
  122. package/src/css/components/icon.css +9 -0
  123. package/src/css/components/link.css +9 -0
  124. package/src/css/components/panel.css +117 -0
  125. package/src/css/components/scrollbar.css +24 -0
  126. package/src/css/components/selected.css +35 -0
  127. package/src/css/components/selected.md +101 -0
  128. package/src/css/components/surface.css +34 -0
  129. package/src/css/components/tag.css +132 -0
  130. package/src/css/components/text.css +124 -0
  131. package/src/css/integrations/codemirror.css +34 -0
  132. package/src/css/integrations/tldraw.css +14 -0
  133. package/src/css/layout/main.css +205 -0
  134. package/src/{styles/layers → css/layout}/native.css +6 -4
  135. package/src/css/layout/positioning.css +19 -0
  136. package/src/{styles/layers → css/layout}/size.css +130 -102
  137. package/src/css/theme/animation.css +260 -0
  138. package/src/css/theme/border.css +23 -0
  139. package/src/css/theme/palette.css +36 -0
  140. package/src/css/theme/semantic.css +116 -0
  141. package/src/css/theme/spacing.css +147 -0
  142. package/src/css/theme/styles.css +145 -0
  143. package/src/css/theme/text.css +37 -0
  144. package/src/css/utilities.css +118 -0
  145. package/src/defs.ts +48 -0
  146. package/src/fragments/AUDIT.md +57 -0
  147. package/src/fragments/density.ts +16 -0
  148. package/src/fragments/hover.ts +18 -0
  149. package/src/fragments/index.ts +10 -0
  150. package/src/fragments/text.ts +6 -0
  151. package/src/index.ts +3 -14
  152. package/src/main.css +121 -0
  153. package/src/plugins/ThemePlugin.ts +125 -0
  154. package/src/plugins/dark-mode.ts +22 -0
  155. package/src/plugins/main.css +45 -0
  156. package/src/{styles → theme}/components/avatar.ts +12 -13
  157. package/src/theme/components/button.ts +48 -0
  158. package/src/theme/components/card.ts +102 -0
  159. package/src/theme/components/dialog.ts +61 -0
  160. package/src/theme/components/focus.ts +33 -0
  161. package/src/{styles → theme}/components/icon-button.ts +6 -5
  162. package/src/theme/components/icon.ts +28 -0
  163. package/src/{styles → theme}/components/index.ts +4 -1
  164. package/src/theme/components/input.ts +171 -0
  165. package/src/{styles → theme}/components/link.ts +3 -4
  166. package/src/{styles → theme}/components/list.ts +5 -5
  167. package/src/{styles → theme}/components/main.ts +9 -11
  168. package/src/{styles → theme}/components/menu.ts +11 -21
  169. package/src/{styles → theme}/components/message.ts +11 -7
  170. package/src/{styles → theme}/components/popover.ts +13 -12
  171. package/src/theme/components/scroll-area.ts +115 -0
  172. package/src/{styles → theme}/components/select.ts +8 -16
  173. package/src/{styles → theme}/components/separator.ts +3 -3
  174. package/src/theme/components/skeleton.ts +23 -0
  175. package/src/theme/components/splitter.ts +20 -0
  176. package/src/{styles → theme}/components/status.ts +7 -7
  177. package/src/{styles → theme}/components/tag.ts +1 -1
  178. package/src/{styles → theme}/components/toast.ts +6 -8
  179. package/src/theme/components/toolbar.ts +35 -0
  180. package/src/{styles → theme}/components/tooltip.ts +4 -6
  181. package/src/{styles → theme}/components/treegrid.ts +9 -9
  182. package/src/{styles → theme}/index.ts +2 -2
  183. package/src/theme/primitives/column.ts +71 -0
  184. package/src/theme/primitives/index.ts +6 -0
  185. package/src/theme/primitives/panel.ts +43 -0
  186. package/src/{styles → theme}/theme.ts +27 -9
  187. package/src/typings.d.ts +3 -1
  188. package/src/{styles/fragments → util}/elevation.ts +6 -8
  189. package/src/util/hash-styles.ts +118 -98
  190. package/src/util/index.ts +3 -0
  191. package/src/util/mx.ts +165 -43
  192. package/src/util/size.ts +103 -0
  193. package/src/util/valence.ts +33 -0
  194. package/src/Tokens.stories.tsx +0 -88
  195. package/src/config/index.ts +0 -6
  196. package/src/config/tailwind.ts +0 -250
  197. package/src/config/tokens/alias-colors.ts +0 -39
  198. package/src/config/tokens/index.ts +0 -92
  199. package/src/config/tokens/lengths.ts +0 -97
  200. package/src/config/tokens/physical-colors.ts +0 -125
  201. package/src/config/tokens/semantic-colors.ts +0 -27
  202. package/src/config/tokens/sememes-calls.ts +0 -17
  203. package/src/config/tokens/sememes-codemirror.ts +0 -50
  204. package/src/config/tokens/sememes-hue.ts +0 -54
  205. package/src/config/tokens/sememes-sheet.ts +0 -62
  206. package/src/config/tokens/sememes-system.ts +0 -302
  207. package/src/config/tokens/sizes.ts +0 -7
  208. package/src/config/tokens/types.ts +0 -9
  209. package/src/docs/theme.drawio.svg +0 -635
  210. package/src/plugins/esbuild-plugin.ts +0 -65
  211. package/src/plugins/plugin.ts +0 -130
  212. package/src/plugins/resolveContent.ts +0 -51
  213. package/src/styles/components/README.md +0 -6
  214. package/src/styles/components/anchored-overflow.ts +0 -20
  215. package/src/styles/components/button.ts +0 -48
  216. package/src/styles/components/dialog.ts +0 -36
  217. package/src/styles/components/icon.ts +0 -19
  218. package/src/styles/components/input.ts +0 -177
  219. package/src/styles/components/scroll-area.ts +0 -43
  220. package/src/styles/components/toolbar.ts +0 -29
  221. package/src/styles/fragments/density.ts +0 -17
  222. package/src/styles/fragments/dimension.ts +0 -8
  223. package/src/styles/fragments/focus.ts +0 -16
  224. package/src/styles/fragments/group.ts +0 -12
  225. package/src/styles/fragments/hover.ts +0 -25
  226. package/src/styles/fragments/index.ts +0 -20
  227. package/src/styles/fragments/layout.ts +0 -7
  228. package/src/styles/fragments/motion.ts +0 -6
  229. package/src/styles/fragments/ornament.ts +0 -10
  230. package/src/styles/fragments/selected.ts +0 -45
  231. package/src/styles/fragments/shimmer.ts +0 -9
  232. package/src/styles/fragments/size.ts +0 -117
  233. package/src/styles/fragments/surface.ts +0 -29
  234. package/src/styles/fragments/text.ts +0 -12
  235. package/src/styles/fragments/valence.ts +0 -46
  236. package/src/styles/layers/README.md +0 -15
  237. package/src/styles/layers/anchored-overflow.css +0 -9
  238. package/src/styles/layers/animation.css +0 -17
  239. package/src/styles/layers/attention.css +0 -8
  240. package/src/styles/layers/base.css +0 -25
  241. package/src/styles/layers/can-scroll.css +0 -26
  242. package/src/styles/layers/dialog.css +0 -42
  243. package/src/styles/layers/drag-preview.css +0 -18
  244. package/src/styles/layers/hues.css +0 -110
  245. package/src/styles/layers/index.css +0 -26
  246. package/src/styles/layers/main.css +0 -160
  247. package/src/styles/layers/positioning.css +0 -23
  248. package/src/styles/layers/surfaces.css +0 -31
  249. package/src/styles/layers/tag.css +0 -132
  250. package/src/styles/layers/tldraw.css +0 -91
  251. package/src/styles/layers/tokens.css +0 -45
  252. package/src/tailwind.ts +0 -5
  253. package/src/theme.css +0 -9
  254. package/src/types.ts +0 -7
  255. package/src/util/withLogical.ts +0 -114
  256. /package/src/{styles/fragments → fragments}/disabled.ts +0 -0
  257. /package/src/{styles → theme}/components/breadcrumb.ts +0 -0
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Color styles
3
+ */
4
+
5
+ @theme {
6
+ /*
7
+ * Semantic
8
+ */
9
+
10
+ --color-info-fill: var(--color-cyan-fill);
11
+ --color-info-surface: var(--color-cyan-surface);
12
+ --color-info-surface-text: var(--color-cyan-surface-text);
13
+ --color-info-text: var(--color-cyan-text);
14
+ --color-info-border: var(--color-cyan-border);
15
+
16
+ --color-success-fill: var(--color-emerald-fill);
17
+ --color-success-surface: var(--color-emerald-surface);
18
+ --color-success-surface-text: var(--color-emerald-surface-text);
19
+ --color-success-text: var(--color-emerald-text);
20
+ --color-success-border: var(--color-emerald-border);
21
+
22
+ --color-warning-fill: var(--color-amber-fill);
23
+ --color-warning-surface: var(--color-amber-surface);
24
+ --color-warning-surface-text: var(--color-amber-surface-text);
25
+ --color-warning-text: var(--color-amber-text);
26
+ --color-warning-border: var(--color-amber-border);
27
+
28
+ --color-error-fill: var(--color-rose-fill);
29
+ --color-error-surface: var(--color-rose-surface);
30
+ --color-error-surface-text: var(--color-rose-surface-text);
31
+ --color-error-text: var(--color-rose-text);
32
+ --color-error-border: var(--color-rose-border);
33
+
34
+ /**
35
+ * Hue
36
+ */
37
+
38
+ --color-neutral-fill: light-dark(var(--color-neutral-300), var(--color-neutral-700));
39
+ --color-neutral-surface: light-dark(var(--color-neutral-200), var(--color-neutral-800));
40
+ --color-neutral-surface-text: light-dark(var(--color-neutral-800), var(--color-neutral-200));
41
+ --color-neutral-text: light-dark(var(--color-neutral-700), var(--color-neutral-300));
42
+ --color-neutral-border: light-dark(var(--color-neutral-400), var(--color-neutral-600));
43
+
44
+ --color-red-fill: light-dark(var(--color-red-300), var(--color-red-700));
45
+ --color-red-surface: light-dark(var(--color-red-200), var(--color-red-800));
46
+ --color-red-surface-text: light-dark(var(--color-red-800), var(--color-red-200));
47
+ --color-red-text: light-dark(var(--color-red-700), var(--color-red-300));
48
+ --color-red-border: light-dark(var(--color-red-400), var(--color-red-600));
49
+
50
+ --color-orange-fill: light-dark(var(--color-orange-300), var(--color-orange-700));
51
+ --color-orange-surface: light-dark(var(--color-orange-200), var(--color-orange-800));
52
+ --color-orange-surface-text: light-dark(var(--color-orange-800), var(--color-orange-200));
53
+ --color-orange-text: light-dark(var(--color-orange-700), var(--color-orange-300));
54
+ --color-orange-border: light-dark(var(--color-orange-400), var(--color-orange-600));
55
+
56
+ --color-amber-fill: light-dark(var(--color-amber-300), var(--color-amber-700));
57
+ --color-amber-surface: light-dark(var(--color-amber-200), var(--color-amber-800));
58
+ --color-amber-surface-text: light-dark(var(--color-amber-800), var(--color-amber-200));
59
+ --color-amber-text: light-dark(var(--color-amber-700), var(--color-amber-300));
60
+ --color-amber-border: light-dark(var(--color-amber-400), var(--color-amber-600));
61
+
62
+ --color-yellow-fill: light-dark(var(--color-yellow-300), var(--color-yellow-700));
63
+ --color-yellow-surface: light-dark(var(--color-yellow-200), var(--color-yellow-800));
64
+ --color-yellow-surface-text: light-dark(var(--color-yellow-800), var(--color-yellow-200));
65
+ --color-yellow-text: light-dark(var(--color-yellow-700), var(--color-yellow-300));
66
+ --color-yellow-border: light-dark(var(--color-yellow-400), var(--color-yellow-600));
67
+
68
+ --color-lime-fill: light-dark(var(--color-lime-300), var(--color-lime-700));
69
+ --color-lime-surface: light-dark(var(--color-lime-200), var(--color-lime-800));
70
+ --color-lime-surface-text: light-dark(var(--color-lime-800), var(--color-lime-200));
71
+ --color-lime-text: light-dark(var(--color-lime-700), var(--color-lime-300));
72
+ --color-lime-border: light-dark(var(--color-lime-400), var(--color-lime-600));
73
+
74
+ --color-green-fill: light-dark(var(--color-green-300), var(--color-green-700));
75
+ --color-green-surface: light-dark(var(--color-green-200), var(--color-green-800));
76
+ --color-green-surface-text: light-dark(var(--color-green-800), var(--color-green-200));
77
+ --color-green-text: light-dark(var(--color-green-700), var(--color-green-300));
78
+ --color-green-border: light-dark(var(--color-green-400), var(--color-green-600));
79
+
80
+ --color-emerald-fill: light-dark(var(--color-emerald-300), var(--color-emerald-700));
81
+ --color-emerald-surface: light-dark(var(--color-emerald-200), var(--color-emerald-800));
82
+ --color-emerald-surface-text: light-dark(var(--color-emerald-800), var(--color-emerald-200));
83
+ --color-emerald-text: light-dark(var(--color-emerald-700), var(--color-emerald-300));
84
+ --color-emerald-border: light-dark(var(--color-emerald-400), var(--color-emerald-600));
85
+
86
+ --color-teal-fill: light-dark(var(--color-teal-300), var(--color-teal-700));
87
+ --color-teal-surface: light-dark(var(--color-teal-200), var(--color-teal-800));
88
+ --color-teal-surface-text: light-dark(var(--color-teal-800), var(--color-teal-200));
89
+ --color-teal-text: light-dark(var(--color-teal-700), var(--color-teal-300));
90
+ --color-teal-border: light-dark(var(--color-teal-400), var(--color-teal-600));
91
+
92
+ --color-cyan-fill: light-dark(var(--color-cyan-300), var(--color-cyan-700));
93
+ --color-cyan-surface: light-dark(var(--color-cyan-200), var(--color-cyan-800));
94
+ --color-cyan-surface-text: light-dark(var(--color-cyan-800), var(--color-cyan-200));
95
+ --color-cyan-text: light-dark(var(--color-cyan-700), var(--color-cyan-300));
96
+ --color-cyan-border: light-dark(var(--color-cyan-400), var(--color-cyan-600));
97
+
98
+ --color-sky-fill: light-dark(var(--color-sky-300), var(--color-sky-700));
99
+ --color-sky-surface: light-dark(var(--color-sky-200), var(--color-sky-800));
100
+ --color-sky-surface-text: light-dark(var(--color-sky-800), var(--color-sky-200));
101
+ --color-sky-text: light-dark(var(--color-sky-700), var(--color-sky-300));
102
+ --color-sky-border: light-dark(var(--color-sky-400), var(--color-sky-600));
103
+
104
+ --color-blue-fill: light-dark(var(--color-blue-300), var(--color-blue-700));
105
+ --color-blue-surface: light-dark(var(--color-blue-200), var(--color-blue-800));
106
+ --color-blue-surface-text: light-dark(var(--color-blue-800), var(--color-blue-200));
107
+ --color-blue-text: light-dark(var(--color-blue-700), var(--color-blue-300));
108
+ --color-blue-border: light-dark(var(--color-blue-400), var(--color-blue-600));
109
+
110
+ --color-indigo-fill: light-dark(var(--color-indigo-300), var(--color-indigo-700));
111
+ --color-indigo-surface: light-dark(var(--color-indigo-200), var(--color-indigo-800));
112
+ --color-indigo-surface-text: light-dark(var(--color-indigo-800), var(--color-indigo-200));
113
+ --color-indigo-text: light-dark(var(--color-indigo-700), var(--color-indigo-300));
114
+ --color-indigo-border: light-dark(var(--color-indigo-400), var(--color-indigo-600));
115
+
116
+ --color-violet-fill: light-dark(var(--color-violet-300), var(--color-violet-700));
117
+ --color-violet-surface: light-dark(var(--color-violet-200), var(--color-violet-800));
118
+ --color-violet-surface-text: light-dark(var(--color-violet-800), var(--color-violet-200));
119
+ --color-violet-text: light-dark(var(--color-violet-700), var(--color-violet-300));
120
+ --color-violet-border: light-dark(var(--color-violet-400), var(--color-violet-600));
121
+
122
+ --color-purple-fill: light-dark(var(--color-purple-300), var(--color-purple-700));
123
+ --color-purple-surface: light-dark(var(--color-purple-200), var(--color-purple-800));
124
+ --color-purple-surface-text: light-dark(var(--color-purple-800), var(--color-purple-200));
125
+ --color-purple-text: light-dark(var(--color-purple-700), var(--color-purple-300));
126
+ --color-purple-border: light-dark(var(--color-purple-400), var(--color-purple-600));
127
+
128
+ --color-fuchsia-fill: light-dark(var(--color-fuchsia-300), var(--color-fuchsia-700));
129
+ --color-fuchsia-surface: light-dark(var(--color-fuchsia-200), var(--color-fuchsia-800));
130
+ --color-fuchsia-surface-text: light-dark(var(--color-fuchsia-800), var(--color-fuchsia-200));
131
+ --color-fuchsia-text: light-dark(var(--color-fuchsia-700), var(--color-fuchsia-300));
132
+ --color-fuchsia-border: light-dark(var(--color-fuchsia-400), var(--color-fuchsia-600));
133
+
134
+ --color-pink-fill: light-dark(var(--color-pink-300), var(--color-pink-700));
135
+ --color-pink-surface: light-dark(var(--color-pink-200), var(--color-pink-800));
136
+ --color-pink-surface-text: light-dark(var(--color-pink-800), var(--color-pink-200));
137
+ --color-pink-text: light-dark(var(--color-pink-700), var(--color-pink-300));
138
+ --color-pink-border: light-dark(var(--color-pink-400), var(--color-pink-600));
139
+
140
+ --color-rose-fill: light-dark(var(--color-rose-300), var(--color-rose-700));
141
+ --color-rose-surface: light-dark(var(--color-rose-200), var(--color-rose-800));
142
+ --color-rose-surface-text: light-dark(var(--color-rose-800), var(--color-rose-200));
143
+ --color-rose-text: light-dark(var(--color-rose-700), var(--color-rose-300));
144
+ --color-rose-border: light-dark(var(--color-rose-400), var(--color-rose-600));
145
+ }
@@ -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,118 @@
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
+ }
77
+
78
+ /**
79
+ * Shimmer text — animates opacity left → right across the contained text.
80
+ * See @keyframes shimmer-text in theme/animation.css for the keyframe definition.
81
+ * Geometry: mask-size 200% 100% with mask-repeat: repeat-x means each tile is
82
+ * 2× the element width; the keyframe slides mask-position-x by 200% (one full
83
+ * tile period), giving a seamless loop. The 5-stop gradient (0.4 → 1.0 → 0.4)
84
+ * produces a single bright pulse per cycle that traverses left → right during
85
+ * the first half, with a brief calm interval during the second half.
86
+ */
87
+ @utility shimmer-text {
88
+ mask-image: linear-gradient(
89
+ 90deg,
90
+ rgba(0, 0, 0, 0.4) 0%,
91
+ rgba(0, 0, 0, 0.4) 30%,
92
+ rgba(0, 0, 0, 1) 50%,
93
+ rgba(0, 0, 0, 0.4) 70%,
94
+ rgba(0, 0, 0, 0.4) 100%
95
+ );
96
+ -webkit-mask-image: linear-gradient(
97
+ 90deg,
98
+ rgba(0, 0, 0, 0.4) 0%,
99
+ rgba(0, 0, 0, 0.4) 30%,
100
+ rgba(0, 0, 0, 1) 50%,
101
+ rgba(0, 0, 0, 0.4) 70%,
102
+ rgba(0, 0, 0, 0.4) 100%
103
+ );
104
+ mask-size: 200% 100%;
105
+ -webkit-mask-size: 200% 100%;
106
+ mask-repeat: repeat-x;
107
+ -webkit-mask-repeat: repeat-x;
108
+ animation: shimmer-text 2s linear infinite;
109
+ }
110
+
111
+ @media (prefers-reduced-motion: reduce) {
112
+ .shimmer-text {
113
+ animation: none;
114
+ mask-image: none;
115
+ -webkit-mask-image: none;
116
+ opacity: 0.6;
117
+ }
118
+ }
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 { 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,121 @@
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
+ /**
15
+ * `source(none)` disables Tailwind 4's automatic content discovery (which
16
+ * scans the project root, including `publicDir`). With auto-detection on,
17
+ * every write to `public/icons.svg` from `vite-plugin-icons` triggers a
18
+ * Tailwind CSS regeneration, which invalidates `main.css` through its
19
+ * import graph and produces a 3–5-ping HMR storm per icon-sprite write
20
+ * during cold-start (icons land in tight bursts as plugin chunks stream
21
+ * in). Explicit `@source` directives below replace the auto-scan with a
22
+ * stable, source-only set.
23
+ */
24
+ @import 'tailwindcss' source(none);
25
+
26
+ /* @theme extensions */
27
+ @import './css/theme/animation.css';
28
+ @import './css/theme/border.css';
29
+ @import './css/theme/palette.css';
30
+ @import './css/theme/semantic.css';
31
+ @import './css/theme/spacing.css';
32
+ @import './css/theme/styles.css';
33
+ @import './css/theme/text.css';
34
+
35
+ /* @layer dx-base, dx-tokens */
36
+ @import './css/base/base.css';
37
+ @import './css/base/typography.css';
38
+
39
+ /* @layer dx-components (components) */
40
+ @import './css/components/button.css';
41
+ @import './css/components/checkbox.css';
42
+ @import './css/components/dialog.css';
43
+ @import './css/components/focus.css';
44
+ @import './css/components/icon.css';
45
+ @import './css/components/panel.css';
46
+ @import './css/components/link.css';
47
+ @import './css/components/scrollbar.css';
48
+ @import './css/components/selected.css';
49
+ @import './css/components/surface.css';
50
+ @import './css/components/tag.css';
51
+ @import './css/components/text.css';
52
+
53
+ /* @layer dx-components (layout) */
54
+ @import './css/layout/main.css';
55
+ @import './css/layout/native.css';
56
+ @import './css/layout/positioning.css';
57
+ @import './css/layout/size.css';
58
+
59
+ /* @layer dx-utilities */
60
+ @import './css/utilities.css';
61
+
62
+ /* Third-party integrations */
63
+ @import './css/integrations/codemirror.css';
64
+ @import './css/integrations/tldraw.css';
65
+
66
+ /**
67
+ * With `source(none)` on the Tailwind import above, these are the *only*
68
+ * paths Tailwind scans for utility classes. Cover every workspace source
69
+ * directory so lazy-loaded plugin / UI / SDK chunks don't surface new
70
+ * utilities mid-session, and root-level HTML entrypoints (index.html,
71
+ * internal.html, …) are visible too.
72
+ *
73
+ * Paths are relative to this file (`packages/ui/ui-theme/src/main.css`):
74
+ * ../../../ → `packages/`
75
+ * ../../../../tools/ → `tools/`
76
+ *
77
+ * Tailwind ignores `node_modules` and common build/output dirs by default,
78
+ * so a broad workspace glob is safe.
79
+ */
80
+ @source "../../../**/*.{ts,tsx,html}";
81
+ @source "../../../../tools/**/*.{ts,tsx,html}";
82
+
83
+ /**
84
+ * Force-emit CSS variables for the full color palette for all:
85
+ * --color-{hue}-{shade}
86
+ * --color-{hue}-{style}
87
+ */
88
+ @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}");
89
+ @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}");
90
+ @source inline("border-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-border");
91
+ @source inline("bg-{info,success,warning,error}-{fill,surface,surface-text,text,border}");
92
+ @source inline("border-{info,success,warning,error}-border");
93
+
94
+ /**
95
+ * Force-emit tokens consumed by web components / .pcss files outside the
96
+ * Tailwind source-scan graph (e.g. lit-grid's dx-grid.pcss uses
97
+ * var(--color-grid-line)).
98
+ */
99
+ @source inline("bg-grid-{surface,highlight,comment,comment-active,hover-overlay,selection-overlay,line,focus-indicator}");
100
+
101
+ /**
102
+ * Plugins must come after all imports.
103
+ */
104
+ @plugin '@tailwindcss/forms';
105
+ @plugin 'tailwind-scrollbar';
106
+ @plugin 'tailwindcss-radix';
107
+
108
+ /**
109
+ * Class-based dark mode.
110
+ * The `.dark` class on an ancestor toggles `dark:` utilities.
111
+ */
112
+ @variant dark (&:where(.dark, .dark *));
113
+
114
+ /** Mobile */
115
+ @custom-variant pointer-coarse (@media (pointer: coarse));
116
+ /** Web */
117
+ @custom-variant pointer-fine (@media (pointer: fine));
118
+ /** Supports mouse/trackpad (Web) */
119
+ @custom-variant hover-hover (@media (hover: hover));
120
+ /** Active navigation */
121
+ @custom-variant is-current (&[aria-current]:not([aria-current="false"]));