@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
@@ -7,22 +7,22 @@ import type { ComponentFunction, Theme } from '@dxos/ui-types';
7
7
  import { mx } from '../../util';
8
8
 
9
9
  export type StatusStyleProps = {
10
- indeterminate?: boolean;
11
10
  variant?: 'default' | 'main-bottom';
11
+ indeterminate?: boolean;
12
12
  };
13
13
 
14
14
  export const statusRoot: ComponentFunction<StatusStyleProps> = ({ variant = 'default' }, ...etc) =>
15
15
  mx(
16
- 'bs-1 relative bg-hoverOverlay rounded-full overflow-hidden',
17
- variant === 'main-bottom' ? 'is-full block' : 'is-20 inline-block',
16
+ 'h-1 relative rounded-full overflow-hidden',
17
+ variant === 'main-bottom' ? 'w-full block' : 'inline-20 inline-block bg-base-surface',
18
18
  ...etc,
19
19
  );
20
20
 
21
- export const statusBar: ComponentFunction<StatusStyleProps> = ({ indeterminate, variant = 'default' }, ...etc) =>
21
+ export const statusBar: ComponentFunction<StatusStyleProps> = ({ variant = 'default', indeterminate }, ...etc) =>
22
22
  mx(
23
- 'absolute inset-block-0 block rounded-full',
24
- variant === 'main-bottom' ? 'bg-accentSurface' : 'bg-unAccent',
25
- indeterminate ? 'animate-progress-indeterminate' : 'inline-start-0',
23
+ 'absolute inset-y-0 block rounded-full',
24
+ variant === 'main-bottom' ? 'bg-composer-300' : 'bg-un-accent',
25
+ indeterminate ? 'animate-progress-indeterminate' : 'start-0',
26
26
  ...etc,
27
27
  );
28
28
 
@@ -16,7 +16,7 @@ export type TagStyleProps = {
16
16
  palette?: ChromaticPalette | NeutralPalette | MessageValence;
17
17
  };
18
18
 
19
- export const tagRoot: ComponentFunction<TagStyleProps> = ({ palette = 'neutral' }, ...etc) => mx('dx-tag', ...etc);
19
+ export const tagRoot: ComponentFunction<TagStyleProps> = (_, ...etc) => mx('dx-tag', ...etc);
20
20
 
21
21
  export const tagTheme: Theme<TagStyleProps> = {
22
22
  root: tagRoot,
@@ -4,8 +4,7 @@
4
4
 
5
5
  import { type ComponentFunction, type Theme } from '@dxos/ui-types';
6
6
 
7
- import { mx } from '../../util';
8
- import { descriptionText, focusRing, modalSurface, surfaceShadow } from '../fragments';
7
+ import { mx, surfaceShadow } from '../../util';
9
8
 
10
9
  export type ToastStyleProps = Partial<{
11
10
  srOnly: boolean;
@@ -14,27 +13,26 @@ export type ToastStyleProps = Partial<{
14
13
  export const toastViewport: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
15
14
  mx(
16
15
  // TODO(burdon): block-end should take into account status bar.
17
- 'z-40 fixed block-end-[calc(env(safe-area-inset-bottom)+1rem)] inset-start-[calc(env(safe-area-inset-left)+1rem)] inset-end-[calc(env(safe-area-inset-right)+1rem)] is-auto md:inline-end-[calc(env(safe-area-inset-right)+1rem)] md:inline-start-auto md:is-full md:max-is-sm',
16
+ 'z-40 fixed bottom-[calc(env(safe-area-inset-bottom)+1rem)] inset-start-[calc(env(safe-area-inset-left)+1rem)] inset-end-[calc(env(safe-area-inset-right)+1rem)] w-auto md:end-[calc(env(safe-area-inset-right)+1rem)] md:left-auto md:w-full md:max-w-sm',
18
17
  'rounded-md flex flex-col gap-2',
19
18
  ...etc,
20
19
  );
21
20
 
22
21
  export const toastRoot: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
23
22
  mx(
24
- 'rounded-md flex p-2 gap-2',
25
- modalSurface,
23
+ 'dx-modal-surface rounded-md flex p-2 gap-2',
26
24
  surfaceShadow({ elevation: 'toast' }),
27
25
  'radix-state-open:animate-toast-slide-in-bottom md:radix-state-open:animate-toast-slide-in-right',
28
26
  'radix-state-closed:animate-toast-hide',
29
27
  'radix-swipe-end:animate-toast-swipe-out',
30
28
  'translate-x-radix-toast-swipe-move-x',
31
29
  'radix-swipe-cancel:translate-x-0 radix-swipe-cancel:duration-200 radix-swipe-cancel:ease-[ease]',
32
- focusRing,
30
+ 'dx-focus-ring',
33
31
  ...etc,
34
32
  );
35
33
 
36
34
  export const toastBody: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
37
- mx('grow flex flex-col gap-1 justify-center pis-2', ...etc);
35
+ mx('grow flex flex-col gap-1 justify-center pl-2', ...etc);
38
36
 
39
37
  export const toastActions: ComponentFunction<ToastStyleProps> = (_props, ...etc) =>
40
38
  mx('shrink-0 flex flex-col gap-1 justify-center', ...etc);
@@ -43,7 +41,7 @@ export const toastTitle: ComponentFunction<ToastStyleProps> = ({ srOnly }, ...et
43
41
  mx('shrink-0 font-medium', srOnly && 'sr-only', ...etc);
44
42
 
45
43
  export const toastDescription: ComponentFunction<ToastStyleProps> = ({ srOnly }, ...etc) =>
46
- mx(descriptionText, 'shrink-0', srOnly && 'sr-only', ...etc);
44
+ mx('text-description', 'shrink-0', srOnly && 'sr-only', ...etc);
47
45
 
48
46
  export const toastTheme: Theme<ToastStyleProps> = {
49
47
  viewport: toastViewport,
@@ -0,0 +1,35 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ import { type ComponentFunction, type Density, type Theme } from '@dxos/ui-types';
6
+
7
+ import { mx } from '../../util';
8
+
9
+ export type ToolbarStyleProps = Partial<{
10
+ density: Density;
11
+ disabled: boolean;
12
+ layoutManaged: boolean;
13
+ }>;
14
+
15
+ export const toolbarLayout =
16
+ 'w-full shrink-0 flex flex-nowrap p-1 gap-1 items-center overflow-x-auto scrollbar-none dx-contain-layout';
17
+
18
+ export const toolbarRoot: ComponentFunction<ToolbarStyleProps> = ({ density, disabled, layoutManaged }, ...etc) => {
19
+ return mx(
20
+ 'bg-toolbar-surface dx-toolbar',
21
+ density === 'coarse' && 'h-(--dx-rail-size) px-3!',
22
+ disabled && '*:opacity-20',
23
+ !layoutManaged && toolbarLayout,
24
+ ...etc,
25
+ );
26
+ };
27
+
28
+ export const toolbarText: ComponentFunction<ToolbarStyleProps> = (_, ...etc) => {
29
+ return mx('px-2 grow truncate items-center', ...etc);
30
+ };
31
+
32
+ export const toolbarTheme: Theme<ToolbarStyleProps> = {
33
+ root: toolbarRoot,
34
+ text: toolbarText,
35
+ };
@@ -4,8 +4,7 @@
4
4
 
5
5
  import { type ComponentFunction, type Elevation, type Theme } from '@dxos/ui-types';
6
6
 
7
- import { mx } from '../../util';
8
- import { chromeText, popperMotion, surfaceShadow, surfaceZIndex } from '../fragments';
7
+ import { mx, surfaceShadow, surfaceZIndex } from '../../util';
9
8
 
10
9
  export type TooltipStyleProps = Partial<{
11
10
  elevation: Elevation;
@@ -13,15 +12,14 @@ export type TooltipStyleProps = Partial<{
13
12
 
14
13
  export const tooltipContent: ComponentFunction<TooltipStyleProps> = ({ elevation }, ...etc) =>
15
14
  mx(
16
- 'inline-flex items-center rounded-sm plb-1 pli-2 max-is-64 bg-inverseSurface text-inverseSurfaceText',
17
- popperMotion,
15
+ 'inline-flex items-center p-1 max-w-64 text-sm bg-inverse-surface text-inverse-surface-text rounded-sm',
18
16
  surfaceShadow({ elevation: 'positioned' }),
19
17
  surfaceZIndex({ elevation, level: 'tooltip' }),
20
- chromeText,
21
18
  ...etc,
22
19
  );
23
20
 
24
- export const tooltipArrow: ComponentFunction<TooltipStyleProps> = (_props, ...etc) => mx('fill-inverseSurface', ...etc);
21
+ export const tooltipArrow: ComponentFunction<TooltipStyleProps> = (_props, ...etc) =>
22
+ mx('fill-inverse-surface', ...etc);
25
23
 
26
24
  export const tooltipTheme: Theme<TooltipStyleProps> = {
27
25
  content: tooltipContent,
@@ -12,20 +12,20 @@ export type TreegridStyleProps = Partial<{
12
12
  }>;
13
13
 
14
14
  const levelStyles = new Map<number, string>([
15
- [1, '[&>.indent:first-of-type]:pis-0 font-medium'],
16
- [2, '[&>.indent:first-of-type]:pis-0'],
17
- [3, '[&>.indent:first-of-type]:pis-1'],
18
- [4, '[&>.indent:first-of-type]:pis-2'],
19
- [5, '[&>.indent:first-of-type]:pis-3'],
20
- [6, '[&>.indent:first-of-type]:pis-4'],
21
- [7, '[&>.indent:first-of-type]:pis-5'],
22
- [8, '[&>.indent:first-of-type]:pis-6'],
15
+ [1, '[&>.indent:first-of-type]:pl-0 font-medium'],
16
+ [2, '[&>.indent:first-of-type]:pl-0'],
17
+ [3, '[&>.indent:first-of-type]:pl-1'],
18
+ [4, '[&>.indent:first-of-type]:pl-2'],
19
+ [5, '[&>.indent:first-of-type]:pl-3'],
20
+ [6, '[&>.indent:first-of-type]:pl-4'],
21
+ [7, '[&>.indent:first-of-type]:pl-5'],
22
+ [8, '[&>.indent:first-of-type]:pl-6'],
23
23
  ]);
24
24
 
25
25
  export const treegridRoot: ComponentFunction<TreegridStyleProps> = (_, ...etc) => mx('grid', ...etc);
26
26
 
27
27
  export const treegridRow: ComponentFunction<TreegridStyleProps> = ({ level = 1 }, ...etc) =>
28
- mx('contents', levelStyles.get(Math.min(Math.max(Math.round(level), 1), 8)), ...etc);
28
+ mx(levelStyles.get(Math.min(Math.max(Math.round(level), 1), 8)), ...etc);
29
29
 
30
30
  export const treegridCell: ComponentFunction<TreegridStyleProps> = ({ indent }, ...etc) =>
31
31
  mx(indent && 'indent', ...etc);
@@ -1,7 +1,7 @@
1
1
  //
2
- // Copyright 2023 DXOS.org
2
+ // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- export * from './fragments';
6
5
  export * from './components';
6
+ export * from './primitives';
7
7
  export * from './theme';
@@ -0,0 +1,71 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { type ComponentFunction } from '@dxos/ui-types';
6
+
7
+ import { mx } from '../../util';
8
+
9
+ /**
10
+ * Column-aware theme utilities.
11
+ * Components apply these in their theme functions to participate in the Column grid
12
+ * without importing Column React components.
13
+ *
14
+ * CSS custom property cascade:
15
+ * - Column.Root sets `--dx-col: 2 / span 1` (center column placement).
16
+ * - ScrollArea.Viewport resets `--dx-col: auto` after consuming `--gutter`.
17
+ * - Components apply `grid-column: var(--dx-col, auto)` to auto-center in Column
18
+ * or do nothing outside Column / inside ScrollArea.
19
+ */
20
+ export const withColumn = {
21
+ /** Centers element in the Column grid via --dx-col. No-op outside Column or inside ScrollArea. */
22
+ center: () => '[grid-column:var(--dx-col,auto)]',
23
+
24
+ /** Propagates the Column grid to children via subgrid. No-op outside Column.
25
+ * Direct children default to center column unless they are a dx-container (ScrollArea). */
26
+ propagate: () =>
27
+ '[.dx-column-root_&]:col-span-full [.dx-column-root_&]:grid [.dx-column-root_&]:grid-cols-subgrid [.dx-column-root_&]:[&>*:not(.dx-container)]:[grid-column:var(--dx-col,auto)]',
28
+
29
+ /** Resets --dx-col after consuming --gutter. Applied by ScrollArea.Viewport. */
30
+ consumed: () => '[--dx-col:auto]',
31
+ };
32
+
33
+ export type ColumnStyleProps = {};
34
+
35
+ const columnRoot: ComponentFunction<ColumnStyleProps> = (_, ...etc) => {
36
+ return mx('dx-column-root grid', ...etc);
37
+ };
38
+
39
+ /**
40
+ * Three-column icon-slot row: spans all 3 columns of the parent Column.Root grid.
41
+ * Uses CSS subgrid to inherit column sizing from the parent Column.
42
+ * Children map to: [col-1: icon/slot] [col-2: content] [col-3: icon/action].
43
+ * NOTE: Must not use overflow-hidden here since it will clip input focus rings.
44
+ */
45
+ const columnRow: ComponentFunction<ColumnStyleProps> = (_, ...etc) => {
46
+ return mx('col-span-3 grid grid-cols-subgrid', ...etc);
47
+ };
48
+
49
+ /**
50
+ * Bleed placement: spans all 3 columns of the parent Column.Root grid (gutter-to-gutter).
51
+ * Use for `ScrollArea`, full-width dividers, tables, or any content that should ignore gutters.
52
+ */
53
+ const columnBleed: ComponentFunction<ColumnStyleProps> = (_, ...etc) => {
54
+ return mx('col-span-full grid grid-cols-subgrid min-h-0', ...etc);
55
+ };
56
+
57
+ /**
58
+ * Center placement: places the element in column 2 (the central track between gutters) of the
59
+ * parent Column.Root grid. Does NOT use subgrid — placement is explicit on this element only.
60
+ * Safe to nest arbitrary compound components (including those that render `display: contents`).
61
+ */
62
+ const columnCenter: ComponentFunction<ColumnStyleProps> = (_, ...etc) => {
63
+ return mx(withColumn.center(), 'min-h-0', ...etc);
64
+ };
65
+
66
+ export const columnTheme = {
67
+ root: columnRoot,
68
+ row: columnRow,
69
+ bleed: columnBleed,
70
+ center: columnCenter,
71
+ };
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ export * from './column';
6
+ export * from './panel';
@@ -0,0 +1,43 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { type ComponentFunction } from '@dxos/ui-types';
6
+
7
+ import { mx } from '../../util';
8
+
9
+ type Size = 'lg' | 'md' | 'sm';
10
+
11
+ export type PanelStyleProps = {
12
+ size?: Size;
13
+ };
14
+
15
+ const sizes: Record<Size, string> = {
16
+ lg: 'h-(--dx-topbar-size)',
17
+ md: 'h-(--dx-toolbar-size)',
18
+ sm: 'h-(--dx-statusbar-size)',
19
+ };
20
+
21
+ const panelRoot: ComponentFunction<PanelStyleProps> = (_, ...etc) =>
22
+ mx(
23
+ // prettier-ignore
24
+ 'dx-container grid grid-cols-[100%] overflow-hidden',
25
+ // Add uncategorized children to content slot.
26
+ '[&>*:not([data-slot])]:[grid-area:content]',
27
+ ...etc,
28
+ );
29
+
30
+ const panelToolbar: ComponentFunction<PanelStyleProps> = ({ size = 'md' }, ...etc) =>
31
+ mx('[grid-area:toolbar]', 'shrink-0', sizes[size], ...etc);
32
+
33
+ const panelContent: ComponentFunction<PanelStyleProps> = (_, ...etc) => mx('[grid-area:content] min-h-0', ...etc);
34
+
35
+ const panelStatusbar: ComponentFunction<PanelStyleProps> = ({ size = 'md' }, ...etc) =>
36
+ mx('[grid-area:statusbar]', 'shrink-0', sizes[size], ...etc);
37
+
38
+ export const panelTheme = {
39
+ root: panelRoot,
40
+ toolbar: panelToolbar,
41
+ content: panelContent,
42
+ statusbar: panelStatusbar,
43
+ };
@@ -2,15 +2,16 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type ComponentFunction, type Theme } from '@dxos/ui-types';
6
- import { get } from '@dxos/util';
5
+ import { type ClassNameArray, type ComponentFunction, type Theme, type ThemeFunction } from '@dxos/ui-types';
6
+ import { getDeep } from '@dxos/util';
7
7
 
8
8
  import {
9
- anchoredOverflowTheme,
10
9
  avatarTheme,
11
10
  breadcrumbTheme,
12
11
  buttonTheme,
12
+ cardTheme,
13
13
  dialogTheme,
14
+ focusTheme,
14
15
  iconButtonTheme,
15
16
  iconTheme,
16
17
  inputTheme,
@@ -23,6 +24,8 @@ import {
23
24
  scrollAreaTheme,
24
25
  selectTheme,
25
26
  separatorTheme,
27
+ skeletonTheme,
28
+ splitterTheme,
26
29
  statusTheme,
27
30
  tagTheme,
28
31
  toastTheme,
@@ -30,15 +33,28 @@ import {
30
33
  tooltipTheme,
31
34
  treegridTheme,
32
35
  } from './components';
36
+ import { columnTheme, panelTheme } from './primitives';
33
37
 
34
38
  export const defaultTheme: Theme<Record<string, any>> = {
35
39
  themeName: () => 'default',
36
40
 
37
- anchoredOverflow: anchoredOverflowTheme,
41
+ //
42
+ // Primitives
43
+ //
44
+
45
+ column: columnTheme,
46
+ panel: panelTheme,
47
+
48
+ //
49
+ // Components
50
+ //
51
+
38
52
  avatar: avatarTheme,
39
53
  breadcrumb: breadcrumbTheme,
40
54
  button: buttonTheme,
55
+ card: cardTheme,
41
56
  dialog: dialogTheme,
57
+ focus: focusTheme,
42
58
  icon: iconTheme,
43
59
  iconButton: iconButtonTheme,
44
60
  input: inputTheme,
@@ -48,9 +64,11 @@ export const defaultTheme: Theme<Record<string, any>> = {
48
64
  message: messageTheme,
49
65
  menu: menuTheme,
50
66
  popover: popoverTheme,
51
- select: selectTheme,
52
67
  scrollArea: scrollAreaTheme,
68
+ select: selectTheme,
53
69
  separator: separatorTheme,
70
+ skeleton: skeletonTheme,
71
+ splitter: splitterTheme,
54
72
  status: statusTheme,
55
73
  tag: tagTheme,
56
74
  toast: toastTheme,
@@ -59,10 +77,10 @@ export const defaultTheme: Theme<Record<string, any>> = {
59
77
  treegrid: treegridTheme,
60
78
  };
61
79
 
62
- export const bindTheme = <P extends Record<string, any>>(theme: Theme<Record<string, any>>) => {
63
- return (path: string, defaultClassName: string, styleProps: P, ...options: any[]): string => {
64
- const result: Theme<P> | ComponentFunction<P> = get(theme, path);
65
- return typeof result === 'function' ? result(styleProps, ...options) : defaultClassName;
80
+ export const bindTheme = <P extends Record<string, any>>(theme: Theme<Record<string, any>>): ThemeFunction<P> => {
81
+ return (path: string, styleProps?: P, ...etc: ClassNameArray) => {
82
+ const result = getDeep<Theme<P> | ComponentFunction<P>>(theme, path.split('.'));
83
+ return typeof result === 'function' ? result(styleProps ?? ({} as P), ...etc) : undefined;
66
84
  };
67
85
  };
68
86
 
package/src/typings.d.ts CHANGED
@@ -5,4 +5,6 @@
5
5
  declare module 'fast-glob';
6
6
  declare module 'tailwindcss/stubs/config.full.js';
7
7
  declare module 'tailwindcss-radix';
8
- declare module 'tailwindcss-logical';
8
+
9
+ /** Virtual CSS entry from ThemePlugin (`virtualFileId: '@dxos-theme'`). */
10
+ declare module '@dxos-theme';
@@ -4,14 +4,12 @@
4
4
 
5
5
  import { type ComponentFragment, type Elevation, type SurfaceLevel } from '@dxos/ui-types';
6
6
 
7
- /**
8
- * @deprecated
9
- */
10
- export const contentShadow: ComponentFragment<{ elevation?: Elevation }> = (_) => ['shadow-none'];
11
-
12
- // TODO(thure): These should become tokens.
13
7
  export const surfaceShadow: ComponentFragment<{ elevation?: Elevation }> = ({ elevation }) => [
14
- elevation === 'positioned' ? 'shadow' : elevation === 'dialog' || elevation === 'toast' ? 'shadow-md' : 'shadow-none',
8
+ elevation === 'positioned'
9
+ ? 'shadow-sm'
10
+ : elevation === 'dialog' || elevation === 'toast'
11
+ ? 'shadow-md'
12
+ : 'shadow-none',
15
13
  ];
16
14
 
17
15
  export const surfaceZIndex: ComponentFragment<{ level?: SurfaceLevel; elevation?: Elevation }> = ({
@@ -20,7 +18,7 @@ export const surfaceZIndex: ComponentFragment<{ level?: SurfaceLevel; elevation?
20
18
  }) => {
21
19
  switch (level) {
22
20
  case 'tooltip':
23
- return elevation === 'dialog' ? ['z-[53]'] : elevation === 'toast' ? ['z-[43]'] : ['z-30'];
21
+ return elevation === 'dialog' ? ['z-[53]'] : elevation === 'toast' ? ['z-[43]'] : ['z-50'];
24
22
  case 'menu':
25
23
  return elevation === 'dialog' ? ['z-[52]'] : elevation === 'toast' ? ['z-[42]'] : ['z-20'];
26
24
  default: