@dxos/ui-theme 0.8.4-main.9be5663bfe → 0.8.4-main.bc2380dfbc

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 (86) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/browser/index.mjs +88 -84
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/node-esm/index.mjs +88 -84
  7. package/dist/lib/node-esm/index.mjs.map +4 -4
  8. package/dist/lib/node-esm/meta.json +1 -1
  9. package/dist/plugin/node-cjs/main.css +147 -106
  10. package/dist/plugin/node-cjs/main.css.map +2 -2
  11. package/dist/plugin/node-cjs/meta.json +1 -1
  12. package/dist/plugin/node-esm/main.css +147 -106
  13. package/dist/plugin/node-esm/main.css.map +2 -2
  14. package/dist/plugin/node-esm/meta.json +1 -1
  15. package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +2 -2
  16. package/dist/types/src/Theme.stories.d.ts.map +1 -1
  17. package/dist/types/src/defs.d.ts +1 -1
  18. package/dist/types/src/defs.d.ts.map +1 -1
  19. package/dist/types/src/fragments/density.d.ts +1 -4
  20. package/dist/types/src/fragments/density.d.ts.map +1 -1
  21. package/dist/types/src/fragments/hover.d.ts +0 -1
  22. package/dist/types/src/fragments/hover.d.ts.map +1 -1
  23. package/dist/types/src/fragments/text.d.ts +0 -1
  24. package/dist/types/src/fragments/text.d.ts.map +1 -1
  25. package/dist/types/src/plugins/ThemePlugin.d.ts +1 -1
  26. package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -1
  27. package/dist/types/src/theme/components/button.d.ts +2 -2
  28. package/dist/types/src/theme/components/button.d.ts.map +1 -1
  29. package/dist/types/src/theme/components/card.d.ts.map +1 -1
  30. package/dist/types/src/theme/components/dialog.d.ts.map +1 -1
  31. package/dist/types/src/theme/components/icon-button.d.ts +1 -0
  32. package/dist/types/src/theme/components/icon-button.d.ts.map +1 -1
  33. package/dist/types/src/theme/components/input.d.ts +8 -8
  34. package/dist/types/src/theme/components/input.d.ts.map +1 -1
  35. package/dist/types/src/theme/components/main.d.ts.map +1 -1
  36. package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -1
  37. package/dist/types/src/theme/primitives/column.d.ts +22 -5
  38. package/dist/types/src/theme/primitives/column.d.ts.map +1 -1
  39. package/dist/types/src/theme/primitives/panel.d.ts.map +1 -1
  40. package/dist/types/src/theme/theme.d.ts.map +1 -1
  41. package/dist/types/src/util/hash-styles.d.ts +1 -1
  42. package/dist/types/src/util/hash-styles.d.ts.map +1 -1
  43. package/dist/types/src/util/mx.d.ts +21 -1
  44. package/dist/types/src/util/mx.d.ts.map +1 -1
  45. package/dist/types/src/util/size.d.ts.map +1 -1
  46. package/dist/types/src/util/valence.d.ts +2 -2
  47. package/dist/types/src/util/valence.d.ts.map +1 -1
  48. package/dist/types/tsconfig.tsbuildinfo +1 -1
  49. package/package.json +11 -19
  50. package/src/Theme.stories.tsx +5 -5
  51. package/src/css/DESIGN_SYSTEM.md +159 -0
  52. package/src/css/base/base.css +2 -2
  53. package/src/css/components/button.css +3 -3
  54. package/src/css/components/checkbox.css +1 -1
  55. package/src/css/components/focus.css +12 -12
  56. package/src/css/components/panel.css +45 -45
  57. package/src/css/components/selected.css +61 -15
  58. package/src/css/components/selected.md +101 -0
  59. package/src/css/components/surface.css +4 -4
  60. package/src/css/components/tag.css +25 -23
  61. package/src/css/layout/size.css +16 -3
  62. package/src/css/theme/animation.css +31 -0
  63. package/src/css/theme/semantic.css +36 -40
  64. package/src/css/theme/spacing.css +7 -8
  65. package/src/css/theme/styles.css +22 -22
  66. package/src/css/utilities.css +48 -6
  67. package/src/defs.ts +1 -1
  68. package/src/fragments/AUDIT.md +0 -3
  69. package/src/fragments/density.ts +8 -5
  70. package/src/fragments/hover.ts +0 -2
  71. package/src/fragments/text.ts +1 -1
  72. package/src/main.css +38 -4
  73. package/src/theme/components/button.ts +2 -2
  74. package/src/theme/components/card.ts +4 -0
  75. package/src/theme/components/dialog.ts +5 -3
  76. package/src/theme/components/focus.ts +2 -2
  77. package/src/theme/components/icon-button.ts +6 -3
  78. package/src/theme/components/input.ts +9 -9
  79. package/src/theme/components/message.ts +5 -5
  80. package/src/theme/components/popover.ts +1 -1
  81. package/src/theme/components/scroll-area.ts +10 -5
  82. package/src/theme/components/select.ts +1 -1
  83. package/src/theme/components/tooltip.ts +1 -1
  84. package/src/theme/primitives/column.ts +44 -20
  85. package/src/util/hash-styles.ts +19 -19
  86. package/src/util/mx.ts +3 -3
@@ -9,25 +9,25 @@
9
9
 
10
10
  --color-info-fill: var(--color-cyan-fill);
11
11
  --color-info-surface: var(--color-cyan-surface);
12
- --color-info-surface-text: var(--color-cyan-surface-text);
12
+ --color-info-foreground: var(--color-cyan-foreground);
13
13
  --color-info-text: var(--color-cyan-text);
14
14
  --color-info-border: var(--color-cyan-border);
15
15
 
16
16
  --color-success-fill: var(--color-emerald-fill);
17
17
  --color-success-surface: var(--color-emerald-surface);
18
- --color-success-surface-text: var(--color-emerald-surface-text);
18
+ --color-success-foreground: var(--color-emerald-foreground);
19
19
  --color-success-text: var(--color-emerald-text);
20
20
  --color-success-border: var(--color-emerald-border);
21
21
 
22
22
  --color-warning-fill: var(--color-amber-fill);
23
23
  --color-warning-surface: var(--color-amber-surface);
24
- --color-warning-surface-text: var(--color-amber-surface-text);
24
+ --color-warning-foreground: var(--color-amber-foreground);
25
25
  --color-warning-text: var(--color-amber-text);
26
26
  --color-warning-border: var(--color-amber-border);
27
27
 
28
28
  --color-error-fill: var(--color-rose-fill);
29
29
  --color-error-surface: var(--color-rose-surface);
30
- --color-error-surface-text: var(--color-rose-surface-text);
30
+ --color-error-foreground: var(--color-rose-foreground);
31
31
  --color-error-text: var(--color-rose-text);
32
32
  --color-error-border: var(--color-rose-border);
33
33
 
@@ -37,109 +37,109 @@
37
37
 
38
38
  --color-neutral-fill: light-dark(var(--color-neutral-300), var(--color-neutral-700));
39
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));
40
+ --color-neutral-foreground: light-dark(var(--color-neutral-800), var(--color-neutral-200));
41
41
  --color-neutral-text: light-dark(var(--color-neutral-700), var(--color-neutral-300));
42
42
  --color-neutral-border: light-dark(var(--color-neutral-400), var(--color-neutral-600));
43
43
 
44
44
  --color-red-fill: light-dark(var(--color-red-300), var(--color-red-700));
45
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));
46
+ --color-red-foreground: light-dark(var(--color-red-800), var(--color-red-200));
47
47
  --color-red-text: light-dark(var(--color-red-700), var(--color-red-300));
48
48
  --color-red-border: light-dark(var(--color-red-400), var(--color-red-600));
49
49
 
50
50
  --color-orange-fill: light-dark(var(--color-orange-300), var(--color-orange-700));
51
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));
52
+ --color-orange-foreground: light-dark(var(--color-orange-800), var(--color-orange-200));
53
53
  --color-orange-text: light-dark(var(--color-orange-700), var(--color-orange-300));
54
54
  --color-orange-border: light-dark(var(--color-orange-400), var(--color-orange-600));
55
55
 
56
56
  --color-amber-fill: light-dark(var(--color-amber-300), var(--color-amber-700));
57
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));
58
+ --color-amber-foreground: light-dark(var(--color-amber-800), var(--color-amber-200));
59
59
  --color-amber-text: light-dark(var(--color-amber-700), var(--color-amber-300));
60
60
  --color-amber-border: light-dark(var(--color-amber-400), var(--color-amber-600));
61
61
 
62
62
  --color-yellow-fill: light-dark(var(--color-yellow-300), var(--color-yellow-700));
63
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));
64
+ --color-yellow-foreground: light-dark(var(--color-yellow-800), var(--color-yellow-200));
65
65
  --color-yellow-text: light-dark(var(--color-yellow-700), var(--color-yellow-300));
66
66
  --color-yellow-border: light-dark(var(--color-yellow-400), var(--color-yellow-600));
67
67
 
68
68
  --color-lime-fill: light-dark(var(--color-lime-300), var(--color-lime-700));
69
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));
70
+ --color-lime-foreground: light-dark(var(--color-lime-800), var(--color-lime-200));
71
71
  --color-lime-text: light-dark(var(--color-lime-700), var(--color-lime-300));
72
72
  --color-lime-border: light-dark(var(--color-lime-400), var(--color-lime-600));
73
73
 
74
74
  --color-green-fill: light-dark(var(--color-green-300), var(--color-green-700));
75
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));
76
+ --color-green-foreground: light-dark(var(--color-green-800), var(--color-green-200));
77
77
  --color-green-text: light-dark(var(--color-green-700), var(--color-green-300));
78
78
  --color-green-border: light-dark(var(--color-green-400), var(--color-green-600));
79
79
 
80
80
  --color-emerald-fill: light-dark(var(--color-emerald-300), var(--color-emerald-700));
81
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));
82
+ --color-emerald-foreground: light-dark(var(--color-emerald-800), var(--color-emerald-200));
83
83
  --color-emerald-text: light-dark(var(--color-emerald-700), var(--color-emerald-300));
84
84
  --color-emerald-border: light-dark(var(--color-emerald-400), var(--color-emerald-600));
85
85
 
86
86
  --color-teal-fill: light-dark(var(--color-teal-300), var(--color-teal-700));
87
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));
88
+ --color-teal-foreground: light-dark(var(--color-teal-800), var(--color-teal-200));
89
89
  --color-teal-text: light-dark(var(--color-teal-700), var(--color-teal-300));
90
90
  --color-teal-border: light-dark(var(--color-teal-400), var(--color-teal-600));
91
91
 
92
92
  --color-cyan-fill: light-dark(var(--color-cyan-300), var(--color-cyan-700));
93
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));
94
+ --color-cyan-foreground: light-dark(var(--color-cyan-800), var(--color-cyan-200));
95
95
  --color-cyan-text: light-dark(var(--color-cyan-700), var(--color-cyan-300));
96
96
  --color-cyan-border: light-dark(var(--color-cyan-400), var(--color-cyan-600));
97
97
 
98
98
  --color-sky-fill: light-dark(var(--color-sky-300), var(--color-sky-700));
99
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));
100
+ --color-sky-foreground: light-dark(var(--color-sky-800), var(--color-sky-200));
101
101
  --color-sky-text: light-dark(var(--color-sky-700), var(--color-sky-300));
102
102
  --color-sky-border: light-dark(var(--color-sky-400), var(--color-sky-600));
103
103
 
104
104
  --color-blue-fill: light-dark(var(--color-blue-300), var(--color-blue-700));
105
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));
106
+ --color-blue-foreground: light-dark(var(--color-blue-800), var(--color-blue-200));
107
107
  --color-blue-text: light-dark(var(--color-blue-700), var(--color-blue-300));
108
108
  --color-blue-border: light-dark(var(--color-blue-400), var(--color-blue-600));
109
109
 
110
110
  --color-indigo-fill: light-dark(var(--color-indigo-300), var(--color-indigo-700));
111
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));
112
+ --color-indigo-foreground: light-dark(var(--color-indigo-800), var(--color-indigo-200));
113
113
  --color-indigo-text: light-dark(var(--color-indigo-700), var(--color-indigo-300));
114
114
  --color-indigo-border: light-dark(var(--color-indigo-400), var(--color-indigo-600));
115
115
 
116
116
  --color-violet-fill: light-dark(var(--color-violet-300), var(--color-violet-700));
117
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));
118
+ --color-violet-foreground: light-dark(var(--color-violet-800), var(--color-violet-200));
119
119
  --color-violet-text: light-dark(var(--color-violet-700), var(--color-violet-300));
120
120
  --color-violet-border: light-dark(var(--color-violet-400), var(--color-violet-600));
121
121
 
122
122
  --color-purple-fill: light-dark(var(--color-purple-300), var(--color-purple-700));
123
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));
124
+ --color-purple-foreground: light-dark(var(--color-purple-800), var(--color-purple-200));
125
125
  --color-purple-text: light-dark(var(--color-purple-700), var(--color-purple-300));
126
126
  --color-purple-border: light-dark(var(--color-purple-400), var(--color-purple-600));
127
127
 
128
128
  --color-fuchsia-fill: light-dark(var(--color-fuchsia-300), var(--color-fuchsia-700));
129
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));
130
+ --color-fuchsia-foreground: light-dark(var(--color-fuchsia-800), var(--color-fuchsia-200));
131
131
  --color-fuchsia-text: light-dark(var(--color-fuchsia-700), var(--color-fuchsia-300));
132
132
  --color-fuchsia-border: light-dark(var(--color-fuchsia-400), var(--color-fuchsia-600));
133
133
 
134
134
  --color-pink-fill: light-dark(var(--color-pink-300), var(--color-pink-700));
135
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));
136
+ --color-pink-foreground: light-dark(var(--color-pink-800), var(--color-pink-200));
137
137
  --color-pink-text: light-dark(var(--color-pink-700), var(--color-pink-300));
138
138
  --color-pink-border: light-dark(var(--color-pink-400), var(--color-pink-600));
139
139
 
140
140
  --color-rose-fill: light-dark(var(--color-rose-300), var(--color-rose-700));
141
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));
142
+ --color-rose-foreground: light-dark(var(--color-rose-800), var(--color-rose-200));
143
143
  --color-rose-text: light-dark(var(--color-rose-700), var(--color-rose-300));
144
144
  --color-rose-border: light-dark(var(--color-rose-400), var(--color-rose-600));
145
145
  }
@@ -31,17 +31,17 @@
31
31
  }
32
32
 
33
33
  /**
34
- * Column that fills the available space (extends dx-expander with overflow clipping).
34
+ * Container that fills the available space (extends dx-expander with overflow clipping).
35
35
  */
36
- @utility dx-column {
37
- @apply flex-1 min-w-0 w-full;
36
+ @utility dx-container {
37
+ @apply dx-expander overflow-hidden;
38
38
  }
39
39
 
40
40
  /**
41
- * Container that fills the available space (extends dx-expander with overflow clipping).
41
+ * Column that fills the available space (extends dx-expander with overflow clipping).
42
42
  */
43
- @utility dx-container {
44
- @apply dx-expander overflow-hidden;
43
+ @utility dx-column {
44
+ @apply flex-1 min-w-0 w-full;
45
45
  }
46
46
 
47
47
  /**
@@ -74,3 +74,45 @@
74
74
  @apply relative after:content-[""] after:absolute after:inset-0 after:rounded-[inherit]
75
75
  after:pointer-events-none after:ring after:ring-inset after:ring-transparent;
76
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 CHANGED
@@ -34,7 +34,7 @@ export const hues: ChromaticPalette[] = [
34
34
 
35
35
  export const hueShades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950] as const;
36
36
 
37
- export const roles = ['fill', 'surface', 'surface-text', 'text', 'border'] as const;
37
+ export const roles = ['fill', 'surface', 'foreground', 'text', 'border'] as const;
38
38
 
39
39
  /**
40
40
  * Card size constants (Tailwind spacing units).
@@ -16,7 +16,6 @@ External packages importing fragment definitions from `ui-theme/src/fragments`.
16
16
  | `focus.ts` | `focusRing` | 2 | 5 |
17
17
  | `focus.ts` | `subduedFocus` | - | 2 |
18
18
  | `focus.ts` | `staticFocusRing` | - | 1 |
19
- | `hover.ts` | `subtleHover` | 4 | - |
20
19
  | `hover.ts` | `ghostHover` | 8 | 2 |
21
20
  | `hover.ts` | `ghostFocusWithin` | 1 | - |
22
21
  | `hover.ts` | `hoverableControls` | 9 | - |
@@ -53,6 +52,4 @@ External packages importing fragment definitions from `ui-theme/src/fragments`.
53
52
 
54
53
  **Completely unused:** 7 fragments
55
54
 
56
- - `subtleHover` from `hover.ts`
57
55
  - `hoverableOpenControlItem`, `groupHoverControlItemWithTransition` from `hover.ts` (only 2-3 uses)
58
- - `descriptionTextPrimary` from `text.ts` (only 1 use)
@@ -4,10 +4,13 @@
4
4
 
5
5
  import { type Density } from '@dxos/ui-types';
6
6
 
7
- export const coarseBlockSize = 'min-h-[2.5rem]';
8
- export const coarseDimensions = `${coarseBlockSize} px-3`;
7
+ const fineBlockSize = 'min-h-[2.5rem] pointer-fine:min-h-[2rem]';
8
+ const coarseBlockSize = 'min-h-[2.5rem]';
9
9
 
10
- export const fineBlockSize = 'min-h-[2.5rem] pointer-fine:min-h-[2rem]';
11
- export const fineDimensions = `${fineBlockSize} px-2`;
10
+ const fineDimensions = `${fineBlockSize} px-2`;
11
+ const coarseDimensions = `${coarseBlockSize} px-3`;
12
12
 
13
- export const densityBlockSize = (density: Density = 'coarse') => (density === 'fine' ? fineBlockSize : coarseBlockSize);
13
+ export const densityDimensions = (density: Density = 'fine') =>
14
+ density === 'fine' ? fineDimensions : coarseDimensions;
15
+
16
+ export const densityBlockSize = (density: Density = 'fine') => (density === 'fine' ? fineBlockSize : coarseBlockSize);
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- export const subtleHover = 'hover:bg-hover-overlay';
6
-
7
5
  export const ghostHover = 'hover:bg-hover-surface';
8
6
  export const ghostFocusWithin = 'focus-within:bg-hover-surface';
9
7
 
@@ -2,5 +2,5 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- export const descriptionTextPrimary = 'text-sm font-normal text-base-surface-text';
5
+ // TODO(burdon): Replace with Message component.
6
6
  export const descriptionMessage = 'text-description border border-dashed border-separator rounded-sm p-4';
package/src/main.css CHANGED
@@ -11,7 +11,17 @@
11
11
  */
12
12
  @layer properties, theme, dx-tokens, user-tokens, base, tw-base, dx-base, components, tw-components, dx-components, utilities;
13
13
 
14
- @import 'tailwindcss';
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);
15
25
 
16
26
  /* @theme extensions */
17
27
  @import './css/theme/animation.css';
@@ -54,16 +64,40 @@
54
64
  @import './css/integrations/tldraw.css';
55
65
 
56
66
  /**
57
- * Force-emit CSS variables for the full color palette for all:
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:
58
85
  * --color-{hue}-{shade}
59
86
  * --color-{hue}-{style}
60
87
  */
61
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}");
62
- @source inline("bg-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-{fill,surface,surface-text,text,border}");
89
+ @source inline("bg-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-{fill,surface,foreground,text,border}");
63
90
  @source inline("border-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-border");
64
- @source inline("bg-{info,success,warning,error}-{fill,surface,surface-text,text,border}");
91
+ @source inline("bg-{info,success,warning,error}-{fill,surface,foreground,text,border}");
65
92
  @source inline("border-{info,success,warning,error}-border");
66
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,foreground,line,highlight,comment,comment-active,selection-surface,selection-foreground}");
100
+
67
101
  /**
68
102
  * Plugins must come after all imports.
69
103
  */
@@ -8,9 +8,9 @@ import { ghostHover } from '../../fragments';
8
8
  import { mx } from '../../util';
9
9
 
10
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';
11
+ 'text-accent-foreground 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
12
 
13
- export const staticDefaultButtonColors = 'bg-input-surface text-input-surface-text';
13
+ export const staticDefaultButtonColors = 'bg-input-surface text-input-foreground';
14
14
 
15
15
  export const defaultButtonColors = mx(
16
16
  staticDefaultButtonColors,
@@ -73,6 +73,9 @@ const cardLink: ComponentFunction<CardStyleProps> = (_props, ...etc) =>
73
73
  const cardLinkLabel: ComponentFunction<CardStyleProps> = (_props, ...etc) =>
74
74
  mx('dx-card__link-label min-w-0 flex-1 truncate', ...etc);
75
75
 
76
+ const cardRow: ComponentFunction<CardStyleProps> = (_, ...etc) =>
77
+ mx('dx-card__row col-span-3 grid grid-cols-subgrid', ...etc);
78
+
76
79
  const cardIconBlock: ComponentFunction<CardStyleProps> = ({ padding }, ...etc) =>
77
80
  mx(
78
81
  'dx-card__icon-block grid h-[var(--dx-rail-item)] w-[var(--dx-rail-item)] place-items-center',
@@ -85,6 +88,7 @@ export const cardTheme: Theme<CardStyleProps> = {
85
88
  toolbar: cardToolbar,
86
89
  title: cardTitle,
87
90
  content: cardContent,
91
+ row: cardRow,
88
92
  heading: cardHeading,
89
93
  text: cardText,
90
94
  'text-span': cardTextSpan,
@@ -5,6 +5,7 @@
5
5
  import { type ComponentFunction, type Elevation, type Theme } from '@dxos/ui-types';
6
6
 
7
7
  import { mx } from '../../util';
8
+ import { withColumn } from '../primitives/column';
8
9
 
9
10
  export type DialogSize = 'sm' | 'md' | 'lg' | 'xl';
10
11
 
@@ -35,12 +36,13 @@ export const dialogContent: ComponentFunction<DialogStyleProps> = ({ inOverlayLa
35
36
  };
36
37
 
37
38
  export const dialogHeader: ComponentFunction<DialogStyleProps> = (_props, ...etc) =>
38
- mx('dx-dialog__header flex pb-4 items-center justify-between', ...etc);
39
+ mx('dx-dialog__header flex pb-4 items-center justify-between', withColumn.center(), ...etc);
39
40
 
40
- export const dialogBody: ComponentFunction<DialogStyleProps> = (_props, ...etc) => mx('dx-dialog__body', ...etc);
41
+ export const dialogBody: ComponentFunction<DialogStyleProps> = (_props, ...etc) =>
42
+ mx('dx-dialog__body dx-expander', withColumn.propagate(), ...etc);
41
43
 
42
44
  export const dialogActionBar: ComponentFunction<DialogStyleProps> = (_props, ...etc) =>
43
- mx('dx-dialog__actionbar flex items-center pt-4 gap-2 dx-density-coarse', ...etc);
45
+ mx('dx-dialog__actionbar flex items-center pt-4 gap-2 dx-density-coarse', withColumn.center(), ...etc);
44
46
 
45
47
  export const dialogTitle: ComponentFunction<DialogStyleProps> = ({ srOnly }, ...etc) =>
46
48
  mx('dx-dialog__title', srOnly && 'sr-only', ...etc);
@@ -20,8 +20,8 @@ export type FocusStyleProps = {
20
20
  const focusRing: ComponentFunction<FocusStyleProps> = ({ border }, ...etc) =>
21
21
  mx(
22
22
  'dx-ring-pseudo outline-hidden',
23
- 'focus:after:ring-neutral-focus-indicator',
24
- 'data-[focus-state=active]:after:ring-neutral-focus-indicator',
23
+ 'focus:after:ring-focus-ring-subtle',
24
+ 'data-[focus-state=active]:after:ring-focus-ring-subtle',
25
25
  'data-[focus-state=error]:after:ring-rose-500',
26
26
  border && 'border border-separator',
27
27
  ...etc,
@@ -7,10 +7,13 @@ import type { ComponentFunction, Theme } from '@dxos/ui-types';
7
7
  import { mx } from '../../util';
8
8
  import { type ButtonStyleProps } from './button';
9
9
 
10
- export type IconButtonStyleProps = ButtonStyleProps & { iconOnly?: boolean };
10
+ export type IconButtonStyleProps = ButtonStyleProps & {
11
+ iconOnly?: boolean;
12
+ square?: boolean;
13
+ };
11
14
 
12
- export const iconButtonRoot: ComponentFunction<IconButtonStyleProps> = ({ iconOnly }, ...etc) => {
13
- return mx('px-1.5', !iconOnly && 'gap-2', ...etc);
15
+ export const iconButtonRoot: ComponentFunction<IconButtonStyleProps> = ({ iconOnly, square }, ...etc) => {
16
+ return mx('px-1.5', !iconOnly && 'gap-1.5', square && 'aspect-square', ...etc);
14
17
  };
15
18
 
16
19
  export const iconButtonTheme: Theme<IconButtonStyleProps> = {
@@ -11,7 +11,7 @@ import {
11
11
  type Size,
12
12
  } from '@dxos/ui-types';
13
13
 
14
- import { coarseBlockSize, coarseDimensions, fineBlockSize, fineDimensions, staticDisabled } from '../../fragments';
14
+ import { densityDimensions, staticDisabled } from '../../fragments';
15
15
  import { getSize, getHeight, getWidth, mx, snapSize, sizeValue, textValence } from '../../util';
16
16
 
17
17
  export type InputStyleProps = Partial<{
@@ -58,24 +58,24 @@ const inputValence = (valence?: MessageValence) => {
58
58
  };
59
59
 
60
60
  const sharedSubduedInputStyles: ComponentFragment<InputStyleProps> = (props) => [
61
- 'py-0 w-full bg-transparent text-current placeholder-placeholder',
62
61
  '[[data-drag-autoscroll="active"]_&]:pointer-events-none',
63
- props.density === 'fine' ? fineBlockSize : coarseBlockSize,
62
+ 'py-0 w-full bg-transparent text-current placeholder-placeholder',
64
63
  'dx-focus-subdued',
64
+ densityDimensions(props.density),
65
65
  props.disabled && staticDisabled,
66
66
  ];
67
67
 
68
68
  const sharedDefaultInputStyles: ComponentFragment<InputStyleProps> = (props) => [
69
- 'py-0 w-full text-base-surface-text rounded-xs placeholder-placeholder',
70
69
  '[[data-drag-autoscroll="active"]_&]:pointer-events-none',
70
+ 'py-0 w-full text-base-foreground rounded-xs placeholder-placeholder',
71
71
  textInputSurfaceFocus,
72
- props.density === 'fine' ? fineDimensions : coarseDimensions,
72
+ densityDimensions(props.density),
73
73
  props.disabled ? staticDisabled : textInputSurfaceHover,
74
74
  ];
75
75
 
76
76
  const sharedStaticInputStyles: ComponentFragment<InputStyleProps> = (props) => [
77
- 'py-0 w-full text-base-surface-text rounded-xs placeholder-placeholder',
78
77
  '[[data-drag-autoscroll="active"]_&]:pointer-events-none',
78
+ 'py-0 w-full text-base-foreground rounded-xs placeholder-placeholder',
79
79
  textInputSurfaceFocus,
80
80
  textInputSurfaceHover,
81
81
  props.focused && 'bg-attention-surface',
@@ -135,9 +135,9 @@ const inputSegment: ComponentFunction<InputStyleProps> = (props, ...etc) =>
135
135
  mx(
136
136
  'flex items-center justify-center font-mono',
137
137
  props.density === 'fine' ? 'size-10 pointer-fine:size-8 rounded-xs' : 'size-12 rounded-xs',
138
- 'bg-input-surface text-base-surface-text transition-colors border border-separator',
139
- 'data-[focused]:bg-attention-surface data-[focused]:border-neutral-focus-indicator',
140
- 'data-[focused]:ring-2 data-[focused]:ring-offset-0 data-[focused]:ring-neutral-focus-indicator',
138
+ 'bg-input-surface text-base-foreground transition-colors border border-separator',
139
+ 'data-[focused]:bg-attention-surface data-[focused]:border-focus-ring-subtle',
140
+ 'data-[focused]:ring-2 data-[focused]:ring-offset-0 data-[focused]:ring-focus-ring-subtle',
141
141
  inputValence(props.validationValence),
142
142
  props.disabled && staticDisabled,
143
143
  ...etc,
@@ -12,23 +12,23 @@ export type MessageStyleProps = {
12
12
  };
13
13
 
14
14
  export const messageRoot: ComponentFunction<MessageStyleProps> = ({ valence }, etc) => {
15
- return mx('grid grid-cols-[min-content_1fr] gap-x-2 p-trim-sm rounded-sm', messageValence(valence), etc);
15
+ return mx('grid grid-cols-[2rem_1fr_2rem] p-1 rounded-sm', messageValence(valence), etc);
16
16
  };
17
17
 
18
18
  export const messageHeader: ComponentFunction<MessageStyleProps> = (_, etc) => {
19
- return mx('col-span-2 grid grid-cols-subgrid items-center', etc);
19
+ return mx('col-span-full grid grid-cols-subgrid items-center', etc);
20
20
  };
21
21
 
22
22
  export const messageTitle: ComponentFunction<MessageStyleProps> = (_, etc) => {
23
- return mx('col-start-2 gap-trim-sm [&>svg]:inline-block', etc);
23
+ return mx('col-start-2 truncate', etc);
24
24
  };
25
25
 
26
26
  export const messageIcon: ComponentFunction<MessageStyleProps> = (_, etc) => {
27
- return mx('col-start-1', etc);
27
+ return mx('col-start-1 grid place-items-center', etc);
28
28
  };
29
29
 
30
30
  export const messageContent: ComponentFunction<MessageStyleProps> = (_, etc) => {
31
- return mx('grid grid-cols-subgrid col-start-2 first:font-medium', etc);
31
+ return mx('col-start-2 grid grid-cols-subgrid inline first:font-medium', etc);
32
32
  };
33
33
 
34
34
  export const messageTheme: Theme<MessageStyleProps> = {
@@ -23,7 +23,7 @@ export const popoverContent: ComponentFunction<PopoverStyleProps> = ({ elevation
23
23
 
24
24
  export const popoverViewport: ComponentFunction<PopoverStyleProps> = ({ constrainBlock, constrainInline }, ...etc) =>
25
25
  mx(
26
- 'flex flex-col min-h-0 min-w-popover-min-width',
26
+ 'grid grid-rows-[1fr] min-h-0 min-w-popover-min-width',
27
27
  (constrainBlock || constrainInline) && 'overflow-hidden',
28
28
  constrainBlock && 'max-h-(--radix-popover-content-available-height)',
29
29
  constrainBlock &&
@@ -5,6 +5,7 @@
5
5
  import { type AllowedAxis, type ComponentFunction, type Theme } from '@dxos/ui-types';
6
6
 
7
7
  import { mx } from '../../util';
8
+ import { withColumn } from '../primitives/column';
8
9
 
9
10
  export const scrollbar = {
10
11
  thin: {
@@ -41,8 +42,8 @@ export const scrollAreaRoot: ComponentFunction<ScrollAreaStyleProps> = ({ orient
41
42
  orientation === 'horizontal' && 'group/scroll-h flex',
42
43
  orientation === 'all' && 'group/scroll-all',
43
44
 
44
- // Apply col-span-full only when inside a Column.Root grid (detected via dx-column marker).
45
- '[.dx-column_&]:col-span-full',
45
+ // Apply col-span-full only when inside a Column.Root grid (detected via dx-column-root marker).
46
+ '[.dx-column-root_&]:col-span-full',
46
47
 
47
48
  ...etc,
48
49
  );
@@ -51,13 +52,17 @@ export const scrollAreaRoot: ComponentFunction<ScrollAreaStyleProps> = ({ orient
51
52
  * NOTE: The browser reserves space for scrollbars.
52
53
  */
53
54
  export const scrollAreaViewport: ComponentFunction<ScrollAreaStyleProps> = (
54
- { orientation, centered, padding, snap, thin, autoHide },
55
+ { orientation, centered, padding, snap, autoHide },
55
56
  ...etc
56
57
  ) => {
57
58
  return mx(
58
- 'h-full w-full',
59
+ 'flex-1 min-h-0 w-full',
59
60
 
60
- orientation === 'vertical' && 'flex flex-col overflow-y-scroll',
61
+ // Reset --dx-col so nested components don't try to grid-position themselves.
62
+ // ScrollArea has already consumed --gutter for padding.
63
+ withColumn.consumed(),
64
+
65
+ orientation === 'vertical' && 'overflow-y-scroll',
61
66
  orientation === 'horizontal' && 'flex overflow-x-scroll overscroll-x-contain',
62
67
  orientation === 'all' && 'overflow-scroll',
63
68
 
@@ -25,7 +25,7 @@ export const selectViewport: ComponentFunction<SelectStyleProps> = (_props, ...e
25
25
  export const selectItem: ComponentFunction<SelectStyleProps> = (_props, ...etc) =>
26
26
  mx(
27
27
  'flex items-center min-h-[2rem] px-3 py-1 gap-2',
28
- 'text-base-surface-text leading-none select-none outline-hidden',
28
+ 'text-base-foreground leading-none select-none outline-hidden',
29
29
  '[&>svg]:invisible [&[data-state=checked]>svg]:visible',
30
30
  'dx-highlighted',
31
31
  ...etc,
@@ -12,7 +12,7 @@ export type TooltipStyleProps = Partial<{
12
12
 
13
13
  export const tooltipContent: ComponentFunction<TooltipStyleProps> = ({ elevation }, ...etc) =>
14
14
  mx(
15
- 'inline-flex items-center p-1 max-w-64 text-sm bg-inverse-surface text-inverse-surface-text rounded-sm',
15
+ 'inline-flex items-center p-1 max-w-64 text-sm bg-inverse-surface text-inverse-foreground rounded-sm',
16
16
  surfaceShadow({ elevation: 'positioned' }),
17
17
  surfaceZIndex({ elevation, level: 'tooltip' }),
18
18
  ...etc,