@dxos/ui-theme 0.0.0 → 0.8.4-main.05e74ebcff

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 (260) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/browser/index.mjs +1370 -0
  4. package/dist/lib/browser/index.mjs.map +7 -0
  5. package/dist/lib/browser/meta.json +1 -0
  6. package/dist/lib/node-esm/index.mjs +1372 -0
  7. package/dist/lib/node-esm/index.mjs.map +7 -0
  8. package/dist/lib/node-esm/meta.json +1 -0
  9. package/dist/plugin/node-cjs/main.css +1573 -0
  10. package/dist/plugin/node-cjs/main.css.map +7 -0
  11. package/dist/plugin/node-cjs/meta.json +1 -0
  12. package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +137 -0
  13. package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +7 -0
  14. package/dist/plugin/node-esm/main.css +1573 -0
  15. package/dist/plugin/node-esm/main.css.map +7 -0
  16. package/dist/plugin/node-esm/meta.json +1 -0
  17. package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +105 -0
  18. package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +7 -0
  19. package/dist/types/src/Theme.stories.d.ts +27 -0
  20. package/dist/types/src/Theme.stories.d.ts.map +1 -0
  21. package/dist/types/src/defs.d.ts +21 -0
  22. package/dist/types/src/defs.d.ts.map +1 -0
  23. package/dist/types/src/fragments/density.d.ts +4 -0
  24. package/dist/types/src/fragments/density.d.ts.map +1 -0
  25. package/dist/types/src/fragments/disabled.d.ts +3 -0
  26. package/dist/types/src/fragments/disabled.d.ts.map +1 -0
  27. package/dist/types/src/fragments/hover.d.ts +9 -0
  28. package/dist/types/src/fragments/hover.d.ts.map +1 -0
  29. package/dist/types/src/fragments/index.d.ts +5 -0
  30. package/dist/types/src/fragments/index.d.ts.map +1 -0
  31. package/dist/types/src/fragments/text.d.ts +2 -0
  32. package/dist/types/src/fragments/text.d.ts.map +1 -0
  33. package/dist/types/src/index.d.ts +5 -0
  34. package/dist/types/src/index.d.ts.map +1 -0
  35. package/dist/types/src/plugins/ThemePlugin.d.ts +16 -0
  36. package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -0
  37. package/dist/types/src/plugins/dark-mode.d.ts +1 -0
  38. package/dist/types/src/plugins/dark-mode.d.ts.map +1 -0
  39. package/dist/types/src/theme/components/avatar.d.ts +21 -0
  40. package/dist/types/src/theme/components/avatar.d.ts.map +1 -0
  41. package/dist/types/src/theme/components/breadcrumb.d.ts +9 -0
  42. package/dist/types/src/theme/components/breadcrumb.d.ts.map +1 -0
  43. package/dist/types/src/theme/components/button.d.ts +15 -0
  44. package/dist/types/src/theme/components/button.d.ts.map +1 -0
  45. package/dist/types/src/theme/components/card.d.ts +12 -0
  46. package/dist/types/src/theme/components/card.d.ts.map +1 -0
  47. package/dist/types/src/theme/components/dialog.d.ts +17 -0
  48. package/dist/types/src/theme/components/dialog.d.ts.map +1 -0
  49. package/dist/types/src/theme/components/focus.d.ts +6 -0
  50. package/dist/types/src/theme/components/focus.d.ts.map +1 -0
  51. package/dist/types/src/theme/components/icon-button.d.ts +9 -0
  52. package/dist/types/src/theme/components/icon-button.d.ts.map +1 -0
  53. package/dist/types/src/theme/components/icon.d.ts +10 -0
  54. package/dist/types/src/theme/components/icon.d.ts.map +1 -0
  55. package/dist/types/src/theme/components/index.d.ts +27 -0
  56. package/dist/types/src/theme/components/index.d.ts.map +1 -0
  57. package/dist/types/src/theme/components/input.d.ts +115 -0
  58. package/dist/types/src/theme/components/input.d.ts.map +1 -0
  59. package/dist/types/src/theme/components/link.d.ts +7 -0
  60. package/dist/types/src/theme/components/link.d.ts.map +1 -0
  61. package/dist/types/src/theme/components/list.d.ts +14 -0
  62. package/dist/types/src/theme/components/list.d.ts.map +1 -0
  63. package/dist/types/src/theme/components/main.d.ts +28 -0
  64. package/dist/types/src/theme/components/main.d.ts.map +1 -0
  65. package/dist/types/src/theme/components/menu.d.ts +13 -0
  66. package/dist/types/src/theme/components/menu.d.ts.map +1 -0
  67. package/dist/types/src/theme/components/message.d.ts +12 -0
  68. package/dist/types/src/theme/components/message.d.ts.map +1 -0
  69. package/dist/types/src/theme/components/popover.d.ts +11 -0
  70. package/dist/types/src/theme/components/popover.d.ts.map +1 -0
  71. package/dist/types/src/theme/components/scroll-area.d.ts +32 -0
  72. package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -0
  73. package/dist/types/src/theme/components/select.d.ts +13 -0
  74. package/dist/types/src/theme/components/select.d.ts.map +1 -0
  75. package/dist/types/src/theme/components/separator.d.ts +8 -0
  76. package/dist/types/src/theme/components/separator.d.ts.map +1 -0
  77. package/dist/types/src/theme/components/skeleton.d.ts +7 -0
  78. package/dist/types/src/theme/components/skeleton.d.ts.map +1 -0
  79. package/dist/types/src/theme/components/splitter.d.ts +4 -0
  80. package/dist/types/src/theme/components/splitter.d.ts.map +1 -0
  81. package/dist/types/src/theme/components/status.d.ts +9 -0
  82. package/dist/types/src/theme/components/status.d.ts.map +1 -0
  83. package/dist/types/src/theme/components/tag.d.ts +7 -0
  84. package/dist/types/src/theme/components/tag.d.ts.map +1 -0
  85. package/dist/types/src/theme/components/toast.d.ts +12 -0
  86. package/dist/types/src/theme/components/toast.d.ts.map +1 -0
  87. package/dist/types/src/theme/components/toolbar.d.ts +11 -0
  88. package/dist/types/src/theme/components/toolbar.d.ts.map +1 -0
  89. package/dist/types/src/theme/components/tooltip.d.ts +8 -0
  90. package/dist/types/src/theme/components/tooltip.d.ts.map +1 -0
  91. package/dist/types/src/theme/components/treegrid.d.ts +10 -0
  92. package/dist/types/src/theme/components/treegrid.d.ts.map +1 -0
  93. package/dist/types/src/theme/index.d.ts +4 -0
  94. package/dist/types/src/theme/index.d.ts.map +1 -0
  95. package/dist/types/src/theme/primitives/column.d.ts +29 -0
  96. package/dist/types/src/theme/primitives/column.d.ts.map +1 -0
  97. package/dist/types/src/theme/primitives/index.d.ts +3 -0
  98. package/dist/types/src/theme/primitives/index.d.ts.map +1 -0
  99. package/dist/types/src/theme/primitives/panel.d.ts +13 -0
  100. package/dist/types/src/theme/primitives/panel.d.ts.map +1 -0
  101. package/dist/types/src/theme/theme.d.ts +5 -0
  102. package/dist/types/src/theme/theme.d.ts.map +1 -0
  103. package/dist/types/src/util/elevation.d.ts +9 -0
  104. package/dist/types/src/util/elevation.d.ts.map +1 -0
  105. package/dist/types/src/util/hash-styles.d.ts +18 -0
  106. package/dist/types/src/util/hash-styles.d.ts.map +1 -0
  107. package/dist/types/src/util/index.d.ts +6 -0
  108. package/dist/types/src/util/index.d.ts.map +1 -0
  109. package/dist/types/src/util/mx.d.ts +58 -0
  110. package/dist/types/src/util/mx.d.ts.map +1 -0
  111. package/dist/types/src/util/size.d.ts +27 -0
  112. package/dist/types/src/util/size.d.ts.map +1 -0
  113. package/dist/types/src/util/valence.d.ts +4 -0
  114. package/dist/types/src/util/valence.d.ts.map +1 -0
  115. package/dist/types/tsconfig.tsbuildinfo +1 -0
  116. package/package.json +32 -39
  117. package/src/Theme.stories.tsx +224 -0
  118. package/src/css/DESIGN_SYSTEM.md +159 -0
  119. package/src/css/base/base.css +43 -0
  120. package/src/{styles/layers → css/base}/typography.css +21 -3
  121. package/src/{styles/layers → css/components}/button.css +23 -14
  122. package/src/{styles/layers → css/components}/checkbox.css +12 -8
  123. package/src/css/components/dialog.css +78 -0
  124. package/src/{styles/layers/focus-ring.css → css/components/focus.css} +60 -41
  125. package/src/css/components/icon.css +9 -0
  126. package/src/css/components/link.css +12 -0
  127. package/src/css/components/panel.css +117 -0
  128. package/src/css/components/scrollbar.css +24 -0
  129. package/src/css/components/selected.css +76 -0
  130. package/src/css/components/selected.md +101 -0
  131. package/src/css/components/surface.css +34 -0
  132. package/src/css/components/tag.css +132 -0
  133. package/src/css/components/text.css +124 -0
  134. package/src/css/integrations/codemirror.css +34 -0
  135. package/src/css/integrations/tldraw.css +14 -0
  136. package/src/css/layout/main.css +205 -0
  137. package/src/{styles/layers → css/layout}/native.css +6 -4
  138. package/src/css/layout/positioning.css +19 -0
  139. package/src/{styles/layers → css/layout}/size.css +130 -102
  140. package/src/css/theme/animation.css +260 -0
  141. package/src/css/theme/border.css +23 -0
  142. package/src/css/theme/palette.css +36 -0
  143. package/src/css/theme/semantic.css +112 -0
  144. package/src/css/theme/spacing.css +147 -0
  145. package/src/css/theme/styles.css +145 -0
  146. package/src/css/theme/text.css +37 -0
  147. package/src/css/utilities.css +118 -0
  148. package/src/defs.ts +48 -0
  149. package/src/fragments/AUDIT.md +55 -0
  150. package/src/fragments/density.ts +16 -0
  151. package/src/fragments/hover.ts +16 -0
  152. package/src/fragments/index.ts +10 -0
  153. package/src/fragments/text.ts +6 -0
  154. package/src/index.ts +3 -14
  155. package/src/main.css +121 -0
  156. package/src/plugins/ThemePlugin.ts +125 -0
  157. package/src/plugins/dark-mode.ts +22 -0
  158. package/src/plugins/main.css +45 -0
  159. package/src/{styles → theme}/components/avatar.ts +12 -13
  160. package/src/theme/components/button.ts +48 -0
  161. package/src/theme/components/card.ts +102 -0
  162. package/src/theme/components/dialog.ts +61 -0
  163. package/src/theme/components/focus.ts +33 -0
  164. package/src/{styles → theme}/components/icon-button.ts +6 -5
  165. package/src/theme/components/icon.ts +28 -0
  166. package/src/{styles → theme}/components/index.ts +4 -1
  167. package/src/theme/components/input.ts +171 -0
  168. package/src/{styles → theme}/components/link.ts +3 -4
  169. package/src/{styles → theme}/components/list.ts +5 -5
  170. package/src/{styles → theme}/components/main.ts +9 -11
  171. package/src/{styles → theme}/components/menu.ts +11 -21
  172. package/src/{styles → theme}/components/message.ts +11 -7
  173. package/src/{styles → theme}/components/popover.ts +13 -12
  174. package/src/theme/components/scroll-area.ts +115 -0
  175. package/src/{styles → theme}/components/select.ts +8 -16
  176. package/src/{styles → theme}/components/separator.ts +3 -3
  177. package/src/theme/components/skeleton.ts +23 -0
  178. package/src/theme/components/splitter.ts +20 -0
  179. package/src/{styles → theme}/components/status.ts +7 -7
  180. package/src/{styles → theme}/components/tag.ts +1 -1
  181. package/src/{styles → theme}/components/toast.ts +6 -8
  182. package/src/theme/components/toolbar.ts +35 -0
  183. package/src/{styles → theme}/components/tooltip.ts +4 -6
  184. package/src/{styles → theme}/components/treegrid.ts +9 -9
  185. package/src/{styles → theme}/index.ts +2 -2
  186. package/src/theme/primitives/column.ts +71 -0
  187. package/src/theme/primitives/index.ts +6 -0
  188. package/src/theme/primitives/panel.ts +43 -0
  189. package/src/{styles → theme}/theme.ts +27 -9
  190. package/src/typings.d.ts +3 -1
  191. package/src/{styles/fragments → util}/elevation.ts +6 -8
  192. package/src/util/hash-styles.ts +118 -98
  193. package/src/util/index.ts +3 -0
  194. package/src/util/mx.ts +165 -43
  195. package/src/util/size.ts +103 -0
  196. package/src/util/valence.ts +33 -0
  197. package/src/Tokens.stories.tsx +0 -88
  198. package/src/config/index.ts +0 -6
  199. package/src/config/tailwind.ts +0 -250
  200. package/src/config/tokens/alias-colors.ts +0 -39
  201. package/src/config/tokens/index.ts +0 -92
  202. package/src/config/tokens/lengths.ts +0 -97
  203. package/src/config/tokens/physical-colors.ts +0 -125
  204. package/src/config/tokens/semantic-colors.ts +0 -27
  205. package/src/config/tokens/sememes-calls.ts +0 -17
  206. package/src/config/tokens/sememes-codemirror.ts +0 -50
  207. package/src/config/tokens/sememes-hue.ts +0 -54
  208. package/src/config/tokens/sememes-sheet.ts +0 -62
  209. package/src/config/tokens/sememes-system.ts +0 -302
  210. package/src/config/tokens/sizes.ts +0 -7
  211. package/src/config/tokens/types.ts +0 -9
  212. package/src/docs/theme.drawio.svg +0 -635
  213. package/src/plugins/esbuild-plugin.ts +0 -65
  214. package/src/plugins/plugin.ts +0 -130
  215. package/src/plugins/resolveContent.ts +0 -51
  216. package/src/styles/components/README.md +0 -6
  217. package/src/styles/components/anchored-overflow.ts +0 -20
  218. package/src/styles/components/button.ts +0 -48
  219. package/src/styles/components/dialog.ts +0 -36
  220. package/src/styles/components/icon.ts +0 -19
  221. package/src/styles/components/input.ts +0 -177
  222. package/src/styles/components/scroll-area.ts +0 -43
  223. package/src/styles/components/toolbar.ts +0 -29
  224. package/src/styles/fragments/density.ts +0 -17
  225. package/src/styles/fragments/dimension.ts +0 -8
  226. package/src/styles/fragments/focus.ts +0 -16
  227. package/src/styles/fragments/group.ts +0 -12
  228. package/src/styles/fragments/hover.ts +0 -25
  229. package/src/styles/fragments/index.ts +0 -20
  230. package/src/styles/fragments/layout.ts +0 -7
  231. package/src/styles/fragments/motion.ts +0 -6
  232. package/src/styles/fragments/ornament.ts +0 -10
  233. package/src/styles/fragments/selected.ts +0 -45
  234. package/src/styles/fragments/shimmer.ts +0 -9
  235. package/src/styles/fragments/size.ts +0 -117
  236. package/src/styles/fragments/surface.ts +0 -29
  237. package/src/styles/fragments/text.ts +0 -12
  238. package/src/styles/fragments/valence.ts +0 -46
  239. package/src/styles/layers/README.md +0 -15
  240. package/src/styles/layers/anchored-overflow.css +0 -9
  241. package/src/styles/layers/animation.css +0 -17
  242. package/src/styles/layers/attention.css +0 -8
  243. package/src/styles/layers/base.css +0 -25
  244. package/src/styles/layers/can-scroll.css +0 -26
  245. package/src/styles/layers/dialog.css +0 -42
  246. package/src/styles/layers/drag-preview.css +0 -18
  247. package/src/styles/layers/hues.css +0 -110
  248. package/src/styles/layers/index.css +0 -26
  249. package/src/styles/layers/main.css +0 -160
  250. package/src/styles/layers/positioning.css +0 -23
  251. package/src/styles/layers/surfaces.css +0 -31
  252. package/src/styles/layers/tag.css +0 -132
  253. package/src/styles/layers/tldraw.css +0 -91
  254. package/src/styles/layers/tokens.css +0 -45
  255. package/src/tailwind.ts +0 -5
  256. package/src/theme.css +0 -9
  257. package/src/types.ts +0 -7
  258. package/src/util/withLogical.ts +0 -114
  259. /package/src/{styles/fragments → fragments}/disabled.ts +0 -0
  260. /package/src/{styles → theme}/components/breadcrumb.ts +0 -0
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Panel — applies bg-{hue}-surface / text-{hue}-foreground / border-{hue}-border tokens via data-hue attribute or BEM modifier.
3
+ * Example: <div className='dx-panel' data-hue='blue'>...</div>
4
+ * Example: <div className='dx-panel dx-panel--blue'>...</div>
5
+ */
6
+
7
+ @layer dx-components {
8
+ [data-hue='neutral'] .dx-panel,
9
+ .dx-panel--neutral {
10
+ @apply bg-neutral-surface text-neutral-foreground border-neutral-border;
11
+ }
12
+
13
+ [data-hue='red'] .dx-panel,
14
+ .dx-panel--red {
15
+ @apply bg-red-surface text-red-foreground border-red-border;
16
+ }
17
+
18
+ [data-hue='orange'] .dx-panel,
19
+ .dx-panel--orange {
20
+ @apply bg-orange-surface text-orange-foreground border-orange-border;
21
+ }
22
+
23
+ [data-hue='amber'] .dx-panel,
24
+ .dx-panel--amber {
25
+ @apply bg-amber-surface text-amber-foreground border-amber-border;
26
+ }
27
+
28
+ [data-hue='yellow'] .dx-panel,
29
+ .dx-panel--yellow {
30
+ @apply bg-yellow-surface text-yellow-foreground border-yellow-border;
31
+ }
32
+
33
+ [data-hue='lime'] .dx-panel,
34
+ .dx-panel--lime {
35
+ @apply bg-lime-surface text-lime-foreground border-lime-border;
36
+ }
37
+
38
+ [data-hue='green'] .dx-panel,
39
+ .dx-panel--green {
40
+ @apply bg-green-surface text-green-foreground border-green-border;
41
+ }
42
+
43
+ [data-hue='emerald'] .dx-panel,
44
+ .dx-panel--emerald {
45
+ @apply bg-emerald-surface text-emerald-foreground border-emerald-border;
46
+ }
47
+
48
+ [data-hue='teal'] .dx-panel,
49
+ .dx-panel--teal {
50
+ @apply bg-teal-surface text-teal-foreground border-teal-border;
51
+ }
52
+
53
+ [data-hue='cyan'] .dx-panel,
54
+ .dx-panel--cyan {
55
+ @apply bg-cyan-surface text-cyan-foreground border-cyan-border;
56
+ }
57
+
58
+ [data-hue='sky'] .dx-panel,
59
+ .dx-panel--sky {
60
+ @apply bg-sky-surface text-sky-foreground border-sky-border;
61
+ }
62
+
63
+ [data-hue='blue'] .dx-panel,
64
+ .dx-panel--blue {
65
+ @apply bg-blue-surface text-blue-foreground border-blue-border;
66
+ }
67
+
68
+ [data-hue='indigo'] .dx-panel,
69
+ .dx-panel--indigo {
70
+ @apply bg-indigo-surface text-indigo-foreground border-indigo-border;
71
+ }
72
+
73
+ [data-hue='violet'] .dx-panel,
74
+ .dx-panel--violet {
75
+ @apply bg-violet-surface text-violet-foreground border-violet-border;
76
+ }
77
+
78
+ [data-hue='purple'] .dx-panel,
79
+ .dx-panel--purple {
80
+ @apply bg-purple-surface text-purple-foreground border-purple-border;
81
+ }
82
+
83
+ [data-hue='fuchsia'] .dx-panel,
84
+ .dx-panel--fuchsia {
85
+ @apply bg-fuchsia-surface text-fuchsia-foreground border-fuchsia-border;
86
+ }
87
+
88
+ [data-hue='pink'] .dx-panel,
89
+ .dx-panel--pink {
90
+ @apply bg-pink-surface text-pink-foreground border-pink-border;
91
+ }
92
+
93
+ [data-hue='rose'] .dx-panel,
94
+ .dx-panel--rose {
95
+ @apply bg-rose-surface text-rose-foreground border-rose-border;
96
+ }
97
+
98
+ [data-hue='info'] .dx-panel,
99
+ .dx-panel--info {
100
+ @apply bg-info-surface text-info-foreground border-info-border;
101
+ }
102
+
103
+ [data-hue='success'] .dx-panel,
104
+ .dx-panel--success {
105
+ @apply bg-success-surface text-success-foreground border-success-border;
106
+ }
107
+
108
+ [data-hue='warning'] .dx-panel,
109
+ .dx-panel--warning {
110
+ @apply bg-warning-surface text-warning-foreground border-warning-border;
111
+ }
112
+
113
+ [data-hue='error'] .dx-panel,
114
+ .dx-panel--error {
115
+ @apply bg-error-surface text-error-foreground border-error-border;
116
+ }
117
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Scrolling
3
+ * Pseudo-classes are not supported by Tailwind.
4
+ */
5
+
6
+ @layer dx-components {
7
+ ::-webkit-scrollbar-thumb:hover {
8
+ @apply bg-scrollbar-thumb-hover!;
9
+ }
10
+ ::-webkit-scrollbar-thumb:active {
11
+ @apply bg-scrollbar-thumb-active!;
12
+ }
13
+
14
+ .dx-scrollbar-thin::-webkit-scrollbar {
15
+ @apply w-[4px];
16
+ }
17
+ .dx-scrollbar-thin::-webkit-scrollbar-thumb {
18
+ @apply bg-transparent;
19
+ transition: background 0.15s;
20
+ }
21
+ .dx-scrollbar-thin:hover::-webkit-scrollbar-thumb {
22
+ @apply bg-scrollbar-thumb;
23
+ }
24
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Selected / Current / Highlighted state utilities.
3
+ *
4
+ * See `./selected.md` for the ARIA pairing grammar — every class below
5
+ * fires off a specific attribute and silently does nothing without it.
6
+ */
7
+
8
+ @layer dx-components {
9
+ /*
10
+ * Pure visual affordance, no ARIA pair. Combine with dx-selected or dx-current.
11
+ *
12
+ * Picks the hover variant matching the element's underlying state:
13
+ * - neither aria-selected nor aria-current → hover-surface
14
+ * - aria-selected="true" → selected-surface-hover
15
+ * - aria-current="true" → current-surface-hover (wins if both)
16
+ *
17
+ * Higher-specificity rules (attribute selectors) override the plain :hover rule,
18
+ * and `aria-current` is listed last so it beats `aria-selected` at equal specificity.
19
+ */
20
+ .dx-hover {
21
+ @apply cursor-pointer
22
+ hover:bg-hover-surface! hover:text-hover-foreground!
23
+ hover:aria-selected:bg-selected-surface-hover! hover:aria-selected:text-selected-foreground!
24
+ hover:aria-[current=true]:bg-current-surface-hover! hover:aria-[current=true]:text-current-foreground!;
25
+ }
26
+ .dx-hover-row {
27
+ @apply group-hover/row:bg-hover-surface! group-hover/row:text-hover-foreground!
28
+ group-hover/row:group-aria-selected/row:bg-selected-surface-hover!
29
+ group-hover/row:group-aria-selected/row:text-selected-foreground!
30
+ group-hover/row:group-aria-[current=true]/row:bg-current-surface-hover!
31
+ group-hover/row:group-aria-[current=true]/row:text-current-foreground!;
32
+ }
33
+
34
+ /*
35
+ * Pairs with `aria-selected`. Use for listbox/option selection (master/detail).
36
+ * `!` is required: these utilities live in the `dx-components` layer, but
37
+ * background utilities like `bg-card-surface` live in Tailwind's
38
+ * `utilities` layer (declared later in the cascade), so without
39
+ * `!important` the card background would override the state colour.
40
+ *
41
+ * NOTE: Declared before `.dx-current` so that when an element has both
42
+ * `aria-selected="true"` and `aria-current="true"`, `dx-current` wins at
43
+ * equal specificity (consistent with how `dx-hover` resolves the same
44
+ * conflict).
45
+ */
46
+ .dx-selected {
47
+ @apply aria-selected:bg-selected-surface! aria-selected:text-selected-foreground!
48
+ aria-selected:font-semibold aria-selected:tracking-normal
49
+ transition-[color,font-variation-settings,letter-spacing];
50
+ }
51
+
52
+ /*
53
+ * Pairs with `aria-current="true|page|…"`. Use for "you are here" navigation.
54
+ *
55
+ * The ring uses the subdued focus indicator (neutral) rather than the
56
+ * accent blue — `dx-current` marks position, not focus, so a saturated
57
+ * ring would compete with the actual keyboard focus ring.
58
+ */
59
+ .dx-current {
60
+ @apply dx-ring-pseudo
61
+ aria-[current=true]:bg-current-surface! aria-[current=true]:text-current-foreground!
62
+ aria-[current=true]:after:ring-focus-ring-subtle!;
63
+ }
64
+ .dx-current-row {
65
+ @apply group-aria-[current=true]/row:bg-current-surface! group-aria-[current=true]/row:text-current-foreground!;
66
+ }
67
+
68
+ /*
69
+ * Pairs with Radix-managed `data-highlighted`. Don't set the attribute manually.
70
+ */
71
+ .dx-highlighted {
72
+ @apply data-[highlighted]:bg-current-surface
73
+ data-[highlighted]:text-current-foreground
74
+ hover:data-[highlighted]:bg-current-surface-hover;
75
+ }
76
+ }
@@ -0,0 +1,101 @@
1
+ # `dx-*` selection / navigation grammar
2
+
3
+ Companion to `selected.css`. The four selection-state utilities below are
4
+ each bound to a specific ARIA attribute (or `data-*`) selector. **The
5
+ class only fires when the matching ARIA attribute is set on the same
6
+ element.** Mismatches (e.g. `dx-current` paired with `aria-selected`)
7
+ silently render as a plain row.
8
+
9
+ | Class | Bound selector | Pair with | Use when |
10
+ | ---------------- | ---------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
+ | `dx-hover` | `hover:` | (no ARIA — pure visual affordance) | Always, on any clickable row. Adds the cursor + hover bg/text. |
12
+ | `dx-selected` | `aria-selected:` | `aria-selected={boolean}` | A row is "the chosen one" driving a master/detail panel. Listbox / option pattern. Multi-select OK. |
13
+ | `dx-current` | `aria-[current=true]:` | `aria-current='true'` | A row is "where you are" in a navigation set (current page, current step). At most one current per group. The CSS variant fires only on `aria-current='true'`, so use that literal even on `<a>`/nav links. |
14
+ | `dx-highlighted` | `data-[highlighted]:` | Radix `data-highlighted` (managed) | A Radix-managed transient highlight (menu / combobox active option). Don't set the attribute manually. |
15
+
16
+ ## Rules
17
+
18
+ 1. **Never combine `dx-selected` and `dx-current` on the same element**
19
+ unless you also set both `aria-selected` and `aria-current`. They
20
+ express different things (chosen vs you-are-here) and the visual
21
+ weight is similar enough that combining them defeats both.
22
+ 2. **`aria-pressed`, `aria-checked`, `aria-expanded`, `aria-disabled`
23
+ are not selection-row attributes.** None of the `dx-*` selection
24
+ utilities pair with them. Toggle buttons (mute/unmute) want
25
+ `aria-pressed`; a selection row wants `aria-selected`.
26
+ 3. **`aria-selected` is only valid on roles that admit it** — `option`,
27
+ `tab`, `gridcell`, `row`, `treeitem`, `columnheader`, `rowheader`.
28
+ On a plain `<button>` inside a `<ul role='listbox'>`, give the button
29
+ `role='option'` so assistive tech sees the attribute.
30
+ 4. **`dx-active` does not exist.** If you see it in code it's a no-op
31
+ string. Use `dx-selected` (selection) or `dx-current` (navigation)
32
+ instead.
33
+ 5. **Set ARIA before adding the class.** The class is inert without
34
+ the attribute; it's not a fallback styler. Reviewers should reject
35
+ PRs that add `dx-selected` without `aria-selected`.
36
+
37
+ ## Canonical patterns
38
+
39
+ ### Selectable row in a list (master/detail)
40
+
41
+ ```tsx
42
+ <ul role='listbox' aria-label='…'>
43
+ {items.map((item) => (
44
+ <li key={item.id} role='presentation'>
45
+ <button
46
+ type='button'
47
+ role='option'
48
+ aria-selected={item.id === selectedId}
49
+ className='dx-hover dx-selected'
50
+ onClick={() => onSelect(item.id)}
51
+ >
52
+ {item.label}
53
+ </button>
54
+ </li>
55
+ ))}
56
+ </ul>
57
+ ```
58
+
59
+ ### "You are here" in a navigation list
60
+
61
+ ```tsx
62
+ <nav>
63
+ <ul>
64
+ {pages.map((page) => (
65
+ <li key={page.href}>
66
+ <a
67
+ href={page.href}
68
+ aria-current={page.href === currentHref ? 'true' : undefined}
69
+ className='dx-hover dx-current'
70
+ >
71
+ {page.label}
72
+ </a>
73
+ </li>
74
+ ))}
75
+ </ul>
76
+ </nav>
77
+ ```
78
+
79
+ ### Toggle button (NOT a row)
80
+
81
+ Don't reach for `dx-selected` here. Toggle buttons want their own
82
+ visual treatment via `aria-pressed:` variants — out of scope for this
83
+ file.
84
+
85
+ ```tsx
86
+ <button type='button' aria-pressed={muted} onClick={toggleMute}>
87
+ {muted ? 'Unmute' : 'Mute'}
88
+ </button>
89
+ ```
90
+
91
+ ## Enforcing the grammar
92
+
93
+ A future ESLint rule could flag:
94
+
95
+ - `dx-selected` without `aria-selected` on the same element.
96
+ - `dx-current` without `aria-current` on the same element.
97
+ - `dx-active` literal anywhere.
98
+
99
+ Until that exists, reviewers and the `react-ui-list` `RowList` /
100
+ `CardList` containers (which set both attribute and class together)
101
+ are the enforcement.
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Surfaces
3
+ */
4
+
5
+ @layer dx-components {
6
+ .dx-base-surface {
7
+ @apply bg-base-surface text-base-foreground;
8
+ --surface-bg: var(--color-base-surface);
9
+ }
10
+
11
+ .dx-sidebar-surface {
12
+ @apply bg-sidebar-surface text-base-foreground;
13
+ --surface-bg: var(--color-sidebar-surface);
14
+ }
15
+
16
+ .dx-modal-surface {
17
+ @apply bg-modal-surface text-base-foreground backdrop-blur-md;
18
+ --surface-bg: var(--color-modal-surface);
19
+ }
20
+
21
+ .dx-attention-surface {
22
+ @apply bg-attention-surface text-base-foreground;
23
+ --surface-bg: var(--color-attention-surface);
24
+ }
25
+ }
26
+
27
+ /* TODO(burdon): Resolve. */
28
+ /* @layer dx-tokens {
29
+ .dx-sidebar-surface, .dx-modal-surface {
30
+ --color-hover-surface: light-dark(var(--color-neutral-300), var(--color-neutral-700));
31
+ --color-input-surface: light-dark(var(--color-neutral-200), var(--color-neutral-800));
32
+ --color-separator: light-dark(var(--color-neutral-300), var(--color-neutral-700));
33
+ }
34
+ } */
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Tag
3
+ */
4
+
5
+ @layer dx-components {
6
+ .dx-tag {
7
+ @apply inline-block text-xs font-semibold m-0.5 px-1 rounded-sm cursor-default truncate;
8
+ padding-block: var(--spacing-tag-padding-block);
9
+ user-select: none;
10
+ }
11
+
12
+ .dx-tag--anchor {
13
+ /* NOTE: Margin offsets padding so that border is flush with text. This should only apply to anchor tags inside of Codemirror. */
14
+ @apply inline cursor-pointer -mx-[3px] px-[2px] py-0.5 border rounded-xs transition-colors;
15
+ /** TODO(burdon): Configure secondary color. */
16
+ @apply bg-group-surface text-sky-foreground border-sky-border;
17
+
18
+ &:hover {
19
+ @apply bg-hover-surface;
20
+ }
21
+ }
22
+
23
+ .dx-tag[data-hue='neutral'],
24
+ .dx-tag--neutral {
25
+ @apply bg-neutral-surface text-neutral-foreground;
26
+ }
27
+
28
+ .dx-tag[data-hue='red'],
29
+ .dx-tag--red {
30
+ @apply bg-red-surface text-red-foreground;
31
+ }
32
+
33
+ .dx-tag[data-hue='orange'],
34
+ .dx-tag--orange {
35
+ @apply bg-orange-surface text-orange-foreground;
36
+ }
37
+
38
+ .dx-tag[data-hue='amber'],
39
+ .dx-tag--amber {
40
+ @apply bg-amber-surface text-amber-foreground;
41
+ }
42
+
43
+ .dx-tag[data-hue='yellow'],
44
+ .dx-tag--yellow {
45
+ @apply bg-yellow-surface text-yellow-foreground;
46
+ }
47
+
48
+ .dx-tag[data-hue='lime'],
49
+ .dx-tag--lime {
50
+ @apply bg-lime-surface text-lime-foreground;
51
+ }
52
+
53
+ .dx-tag[data-hue='green'],
54
+ .dx-tag--green {
55
+ @apply bg-green-surface text-green-foreground;
56
+ }
57
+
58
+ .dx-tag[data-hue='emerald'],
59
+ .dx-tag--emerald {
60
+ @apply bg-emerald-surface text-emerald-foreground;
61
+ }
62
+
63
+ .dx-tag[data-hue='teal'],
64
+ .dx-tag--teal {
65
+ @apply bg-teal-surface text-teal-foreground;
66
+ }
67
+
68
+ .dx-tag[data-hue='cyan'],
69
+ .dx-tag--cyan {
70
+ @apply bg-cyan-surface text-cyan-foreground;
71
+ }
72
+
73
+ .dx-tag[data-hue='sky'],
74
+ .dx-tag--sky {
75
+ @apply bg-sky-surface text-sky-foreground;
76
+ }
77
+
78
+ .dx-tag[data-hue='blue'],
79
+ .dx-tag--blue {
80
+ @apply bg-blue-surface text-blue-foreground;
81
+ }
82
+
83
+ .dx-tag[data-hue='indigo'],
84
+ .dx-tag--indigo {
85
+ @apply bg-indigo-surface text-indigo-foreground;
86
+ }
87
+
88
+ .dx-tag[data-hue='violet'],
89
+ .dx-tag--violet {
90
+ @apply bg-violet-surface text-violet-foreground;
91
+ }
92
+
93
+ .dx-tag[data-hue='purple'],
94
+ .dx-tag--purple {
95
+ @apply bg-purple-surface text-purple-foreground;
96
+ }
97
+
98
+ .dx-tag[data-hue='fuchsia'],
99
+ .dx-tag--fuchsia {
100
+ @apply bg-fuchsia-surface text-fuchsia-foreground;
101
+ }
102
+
103
+ .dx-tag[data-hue='pink'],
104
+ .dx-tag--pink {
105
+ @apply bg-pink-surface text-pink-foreground;
106
+ }
107
+
108
+ .dx-tag[data-hue='rose'],
109
+ .dx-tag--rose {
110
+ @apply bg-rose-surface text-rose-foreground;
111
+ }
112
+
113
+ .dx-tag[data-hue='info'],
114
+ .dx-tag--info {
115
+ @apply bg-cyan-surface text-cyan-foreground;
116
+ }
117
+
118
+ .dx-tag[data-hue='success'],
119
+ .dx-tag--success {
120
+ @apply bg-emerald-surface text-emerald-foreground;
121
+ }
122
+
123
+ .dx-tag[data-hue='warning'],
124
+ .dx-tag--warning {
125
+ @apply bg-amber-surface text-amber-foreground;
126
+ }
127
+
128
+ .dx-tag[data-hue='error'],
129
+ .dx-tag--error {
130
+ @apply bg-rose-surface text-rose-foreground;
131
+ }
132
+ }
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Text
3
+ * Example: <span className='dx-text' data-hue={getHashHue(object.id)}>
4
+ */
5
+
6
+ @layer dx-components {
7
+ /*
8
+ * System
9
+ */
10
+
11
+ .dx-text[data-hue='info'],
12
+ .dx-text--info {
13
+ @apply text-cyan-text;
14
+ }
15
+
16
+ .dx-text[data-hue='success'],
17
+ .dx-text--success {
18
+ @apply text-emerald-text;
19
+ }
20
+
21
+ .dx-text[data-hue='warning'],
22
+ .dx-text--warning {
23
+ @apply text-amber-text;
24
+ }
25
+
26
+ .dx-text[data-hue='error'],
27
+ .dx-text--error {
28
+ @apply text-rose-text;
29
+ }
30
+
31
+ /*
32
+ * Colors
33
+ */
34
+
35
+ .dx-text[data-hue='neutral'],
36
+ .dx-text--neutral {
37
+ @apply text-neutral-text;
38
+ }
39
+
40
+ .dx-text[data-hue='red'],
41
+ .dx-text--red {
42
+ @apply text-red-text;
43
+ }
44
+
45
+ .dx-text[data-hue='orange'],
46
+ .dx-text--orange {
47
+ @apply text-orange-text;
48
+ }
49
+
50
+ .dx-text[data-hue='amber'],
51
+ .dx-text--amber {
52
+ @apply text-amber-text;
53
+ }
54
+
55
+ .dx-text[data-hue='yellow'],
56
+ .dx-text--yellow {
57
+ @apply text-yellow-text;
58
+ }
59
+
60
+ .dx-text[data-hue='lime'],
61
+ .dx-text--lime {
62
+ @apply text-lime-text;
63
+ }
64
+
65
+ .dx-text[data-hue='green'],
66
+ .dx-text--green {
67
+ @apply text-green-text;
68
+ }
69
+
70
+ .dx-text[data-hue='emerald'],
71
+ .dx-text--emerald {
72
+ @apply text-emerald-text;
73
+ }
74
+
75
+ .dx-text[data-hue='teal'],
76
+ .dx-text--teal {
77
+ @apply text-teal-text;
78
+ }
79
+
80
+ .dx-text[data-hue='cyan'],
81
+ .dx-text--cyan {
82
+ @apply text-cyan-text;
83
+ }
84
+
85
+ .dx-text[data-hue='sky'],
86
+ .dx-text--sky {
87
+ @apply text-sky-text;
88
+ }
89
+
90
+ .dx-text[data-hue='blue'],
91
+ .dx-text--blue {
92
+ @apply text-blue-text;
93
+ }
94
+
95
+ .dx-text[data-hue='indigo'],
96
+ .dx-text--indigo {
97
+ @apply text-indigo-text;
98
+ }
99
+
100
+ .dx-text[data-hue='violet'],
101
+ .dx-text--violet {
102
+ @apply text-violet-text;
103
+ }
104
+
105
+ .dx-text[data-hue='purple'],
106
+ .dx-text--purple {
107
+ @apply text-purple-text;
108
+ }
109
+
110
+ .dx-text[data-hue='fuchsia'],
111
+ .dx-text--fuchsia {
112
+ @apply text-fuchsia-text;
113
+ }
114
+
115
+ .dx-text[data-hue='pink'],
116
+ .dx-text--pink {
117
+ @apply text-pink-text;
118
+ }
119
+
120
+ .dx-text[data-hue='rose'],
121
+ .dx-text--rose {
122
+ @apply text-rose-text;
123
+ }
124
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * CodeMirror
3
+ * Uses @theme (not @layer) so Tailwind generates text-cm-* / bg-cm-* utility classes
4
+ * consumed by ui-editor. Compare: tldraw.css uses @layer to map tokens onto tldraw's
5
+ * own variables without generating utilities.
6
+ * TODO(burdon): This could move into the ui-editor package (similar to graph.css).
7
+ */
8
+
9
+ /** TODO(burdon): Move to ui-editor */
10
+ @theme {
11
+ --color-cm-codeblock: oklch(from var(--color-neutral-500) l c h / 0.1);
12
+ --color-cm-active-line: light-dark(
13
+ oklch(from var(--color-neutral-200) l c h / 0.5),
14
+ oklch(from var(--color-neutral-800) l c h / 0.5)
15
+ );
16
+ --color-cm-separator: var(--color-blue-500);
17
+ --color-cm-cursor: light-dark(var(--color-neutral-900), var(--color-neutral-100));
18
+ --color-cm-selection: light-dark(
19
+ oklch(from var(--color-blue-400) l c h / 0.5),
20
+ oklch(from var(--color-blue-600) l c h / 0.5)
21
+ );
22
+ --color-cm-focused-selection: light-dark(var(--color-blue-400), var(--color-blue-600));
23
+ --color-cm-highlight: light-dark(var(--color-neutral-950), var(--color-neutral-50));
24
+ --color-cm-highlight-surface: light-dark(var(--color-sky-200), var(--color-cyan-800));
25
+ --color-cm-comment-text: light-dark(var(--color-neutral-50), var(--color-neutral-950));
26
+ --color-cm-comment-surface: light-dark(var(--color-amber-800), var(--color-amber-200));
27
+
28
+ /* Markdown syntax highlighting */
29
+ --color-cm-code: light-dark(var(--color-stone-600), var(--color-stone-400));
30
+ --color-cm-code-inline: light-dark(var(--color-green-500), var(--color-green-500));
31
+ --color-cm-code-mark: var(--color-blue-500);
32
+ --color-cm-heading: light-dark(var(--color-blue-700), var(--color-blue-300));
33
+ --color-cm-heading-number: light-dark(var(--color-blue-600), var(--color-blue-400));
34
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Tldraw
3
+ */
4
+
5
+ /** TODO(burdon): Move to tldraw */
6
+ .tl-background {
7
+ --color-background: var(--color-base-surface);
8
+ }
9
+ .tl-container.tl-theme__light,
10
+ .tl-container.tl-theme__dark {
11
+ --color-selected: var(--color-accent-surface);
12
+ --color-panel: var(--color-modal-surface);
13
+ --color-panel-contrast: var(--color-separator);
14
+ }