@dxos/ui-theme 0.8.4-main.6fa680abb7 → 0.8.4-main.74a063c4e0

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 (131) hide show
  1. package/dist/lib/browser/index.mjs +355 -443
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +355 -443
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/plugin/node-cjs/{theme.css → main.css} +66 -31
  8. package/dist/plugin/node-cjs/main.css.map +7 -0
  9. package/dist/plugin/node-cjs/meta.json +1 -1
  10. package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +8 -15
  11. package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +3 -3
  12. package/dist/plugin/node-esm/{theme.css → main.css} +66 -31
  13. package/dist/plugin/node-esm/main.css.map +7 -0
  14. package/dist/plugin/node-esm/meta.json +1 -1
  15. package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +8 -15
  16. package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +3 -3
  17. package/dist/types/src/fragments/index.d.ts +0 -5
  18. package/dist/types/src/fragments/index.d.ts.map +1 -1
  19. package/dist/types/src/fragments/text.d.ts +0 -4
  20. package/dist/types/src/fragments/text.d.ts.map +1 -1
  21. package/dist/types/src/index.d.ts +1 -1
  22. package/dist/types/src/index.d.ts.map +1 -1
  23. package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -1
  24. package/dist/types/src/theme/components/avatar.d.ts.map +1 -1
  25. package/dist/types/src/theme/components/card.d.ts +3 -2
  26. package/dist/types/src/theme/components/card.d.ts.map +1 -1
  27. package/dist/types/src/theme/components/dialog.d.ts.map +1 -1
  28. package/dist/types/src/theme/components/focus.d.ts +6 -0
  29. package/dist/types/src/theme/components/focus.d.ts.map +1 -0
  30. package/dist/types/src/theme/components/icon-button.d.ts.map +1 -1
  31. package/dist/types/src/theme/components/icon.d.ts +3 -0
  32. package/dist/types/src/theme/components/icon.d.ts.map +1 -1
  33. package/dist/types/src/theme/components/index.d.ts +1 -0
  34. package/dist/types/src/theme/components/index.d.ts.map +1 -1
  35. package/dist/types/src/theme/components/input.d.ts.map +1 -1
  36. package/dist/types/src/theme/components/link.d.ts.map +1 -1
  37. package/dist/types/src/theme/components/list.d.ts.map +1 -1
  38. package/dist/types/src/theme/components/message.d.ts.map +1 -1
  39. package/dist/types/src/theme/components/popover.d.ts.map +1 -1
  40. package/dist/types/src/theme/components/scroll-area.d.ts +12 -2
  41. package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -1
  42. package/dist/types/src/theme/components/select.d.ts.map +1 -1
  43. package/dist/types/src/theme/components/status.d.ts +1 -1
  44. package/dist/types/src/theme/components/status.d.ts.map +1 -1
  45. package/dist/types/src/theme/components/toast.d.ts.map +1 -1
  46. package/dist/types/src/theme/components/toolbar.d.ts +0 -1
  47. package/dist/types/src/theme/components/toolbar.d.ts.map +1 -1
  48. package/dist/types/src/theme/components/tooltip.d.ts.map +1 -1
  49. package/dist/types/src/theme/components/treegrid.d.ts.map +1 -1
  50. package/dist/types/src/theme/index.d.ts +1 -0
  51. package/dist/types/src/theme/index.d.ts.map +1 -1
  52. package/dist/types/src/theme/primitives/column.d.ts +8 -3
  53. package/dist/types/src/theme/primitives/column.d.ts.map +1 -1
  54. package/dist/types/src/theme/primitives/panel.d.ts +9 -5
  55. package/dist/types/src/theme/primitives/panel.d.ts.map +1 -1
  56. package/dist/types/src/theme/theme.d.ts.map +1 -1
  57. package/dist/types/src/util/elevation.d.ts.map +1 -0
  58. package/dist/types/src/util/index.d.ts +3 -0
  59. package/dist/types/src/util/index.d.ts.map +1 -1
  60. package/dist/types/src/util/mx.d.ts +28 -284
  61. package/dist/types/src/util/mx.d.ts.map +1 -1
  62. package/dist/types/src/util/size.d.ts +27 -0
  63. package/dist/types/src/util/size.d.ts.map +1 -0
  64. package/dist/types/src/util/valence.d.ts.map +1 -0
  65. package/dist/types/tsconfig.tsbuildinfo +1 -1
  66. package/package.json +8 -4
  67. package/src/css/components/button.css +2 -1
  68. package/src/css/components/{focus-ring.css → focus.css} +15 -1
  69. package/src/css/components/icon.css +9 -0
  70. package/src/css/components/selected.css +30 -0
  71. package/src/css/integrations/codemirror.css +5 -3
  72. package/src/css/integrations/tldraw.css +1 -0
  73. package/src/css/layout/main.css +0 -7
  74. package/src/css/layout/size.css +8 -31
  75. package/src/css/theme/palette.css +8 -0
  76. package/src/css/theme/semantic.css +24 -9
  77. package/src/css/theme/spacing.css +35 -18
  78. package/src/css/utilities.css +72 -3
  79. package/src/fragments/AUDIT.md +58 -0
  80. package/src/fragments/index.ts +1 -6
  81. package/src/fragments/text.ts +0 -5
  82. package/src/index.ts +1 -1
  83. package/src/{theme.css → main.css} +10 -6
  84. package/src/plugins/ThemePlugin.ts +12 -24
  85. package/src/plugins/main.css +45 -0
  86. package/src/theme/components/avatar.ts +3 -4
  87. package/src/theme/components/button.ts +1 -1
  88. package/src/theme/components/card.ts +14 -10
  89. package/src/theme/components/dialog.ts +1 -2
  90. package/src/theme/components/focus.ts +33 -0
  91. package/src/theme/components/icon-button.ts +1 -3
  92. package/src/theme/components/icon.ts +13 -4
  93. package/src/theme/components/index.ts +1 -0
  94. package/src/theme/components/input.ts +10 -25
  95. package/src/theme/components/link.ts +1 -2
  96. package/src/theme/components/list.ts +4 -4
  97. package/src/theme/components/menu.ts +4 -4
  98. package/src/theme/components/message.ts +2 -3
  99. package/src/theme/components/popover.ts +3 -4
  100. package/src/theme/components/scroll-area.ts +47 -40
  101. package/src/theme/components/select.ts +2 -3
  102. package/src/theme/components/status.ts +5 -5
  103. package/src/theme/components/toast.ts +2 -3
  104. package/src/theme/components/toolbar.ts +1 -7
  105. package/src/theme/components/tooltip.ts +1 -2
  106. package/src/theme/components/treegrid.ts +1 -1
  107. package/src/theme/index.ts +1 -0
  108. package/src/theme/primitives/column.ts +27 -10
  109. package/src/theme/primitives/panel.ts +18 -25
  110. package/src/theme/theme.ts +2 -0
  111. package/src/typings.d.ts +3 -0
  112. package/src/util/index.ts +3 -0
  113. package/src/util/mx.ts +106 -7
  114. package/src/util/size.ts +103 -0
  115. package/dist/plugin/node-cjs/theme.css.map +0 -7
  116. package/dist/plugin/node-esm/theme.css.map +0 -7
  117. package/dist/types/src/fragments/elevation.d.ts.map +0 -1
  118. package/dist/types/src/fragments/focus.d.ts +0 -4
  119. package/dist/types/src/fragments/focus.d.ts.map +0 -1
  120. package/dist/types/src/fragments/selected.d.ts +0 -4
  121. package/dist/types/src/fragments/selected.d.ts.map +0 -1
  122. package/dist/types/src/fragments/size.d.ts +0 -7
  123. package/dist/types/src/fragments/size.d.ts.map +0 -1
  124. package/dist/types/src/fragments/valence.d.ts.map +0 -1
  125. package/src/fragments/focus.ts +0 -11
  126. package/src/fragments/selected.ts +0 -12
  127. package/src/fragments/size.ts +0 -117
  128. /package/dist/types/src/{fragments → util}/elevation.d.ts +0 -0
  129. /package/dist/types/src/{fragments → util}/valence.d.ts +0 -0
  130. /package/src/{fragments → util}/elevation.ts +0 -0
  131. /package/src/{fragments → util}/valence.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/ui-theme",
3
- "version": "0.8.4-main.6fa680abb7",
3
+ "version": "0.8.4-main.74a063c4e0",
4
4
  "description": "A set of design system tokens to use with DXOS UI.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -57,15 +57,19 @@
57
57
  "tailwind-scrollbar": "^4.0.0",
58
58
  "tailwindcss": "^4.2.0",
59
59
  "tailwindcss-radix": "^4.0.2",
60
- "@dxos/node-std": "0.8.4-main.6fa680abb7",
61
- "@dxos/util": "0.8.4-main.6fa680abb7"
60
+ "@dxos/log": "0.8.4-main.74a063c4e0",
61
+ "@dxos/node-std": "0.8.4-main.74a063c4e0",
62
+ "@dxos/util": "0.8.4-main.74a063c4e0"
62
63
  },
63
64
  "devDependencies": {
64
65
  "@types/lodash.merge": "^4.6.6",
65
66
  "@types/postcss-import": "^14.0.3",
66
67
  "esbuild": "0.25.11",
67
68
  "vite": "^7.1.11",
68
- "@dxos/ui-types": "0.8.4-main.6fa680abb7"
69
+ "@dxos/ui-types": "0.8.4-main.74a063c4e0"
70
+ },
71
+ "peerDependencies": {
72
+ "react": "~19.2.3"
69
73
  },
70
74
  "publishConfig": {
71
75
  "access": "public"
@@ -10,7 +10,8 @@
10
10
 
11
11
  /* Base styles */
12
12
  .dx-button {
13
- @apply font-medium shrink-0 inline-flex select-none items-center justify-center overflow-hidden transition-colors duration-100 ease-linear bg-input-surface min-h-[2.5rem] px-3;
13
+ @apply shrink-0 inline-flex select-none items-center justify-center overflow-hidden min-h-[2.5rem] px-3;
14
+ @apply font-medium transition-colors duration-100 ease-linear bg-input-surface;
14
15
  &[aria-pressed='true'],
15
16
  &[aria-checked='true'] {
16
17
  @apply text-accent-text bg-attention-surface;
@@ -29,6 +29,13 @@
29
29
  }
30
30
  }
31
31
 
32
+ .dx-focus-ring-none {
33
+ &:focus,
34
+ &:focus-visible {
35
+ @apply outline-hidden! ring-0!;
36
+ }
37
+ }
38
+
32
39
  .dx-focus-ring-always,
33
40
  .dx-focus-ring-inset-always {
34
41
  &:not([disabled]),
@@ -180,7 +187,6 @@
180
187
 
181
188
  &:hover {
182
189
  @apply outline-hidden;
183
-
184
190
  .dark & {
185
191
  @apply outline-hidden;
186
192
  }
@@ -226,4 +232,12 @@
226
232
  }
227
233
  }
228
234
  }
235
+
236
+ .dx-focus-subdued {
237
+ @apply focus:outline-hidden focus-visible:outline-hidden focus:ring-0 ring-0 focus:border-0 border-0;
238
+ }
239
+
240
+ .dx-focus-static {
241
+ @apply ring-2 ring-offset-0 ring-primary-300 ring-offset-white dark:ring-primary-400 dark:ring-offset-black;
242
+ }
229
243
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Icons
3
+ */
4
+
5
+ @layer dx-components {
6
+ .dx-icon-inline {
7
+ @apply inline-block align-[-0.125em];
8
+ }
9
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Selected / Highlighted state utilities
3
+ */
4
+
5
+ @layer dx-components {
6
+ .dx-hover {
7
+ @apply cursor-pointer hover:bg-highlight-surface! hover:text-highlight-surface-text!;
8
+ }
9
+
10
+ /** TODO(burdon): Disambiguate from dx-hover */
11
+ .dx-highlighted {
12
+ @apply data-[highlighted]:bg-highlight-surface
13
+ data-[highlighted]:text-highlight-surface-text
14
+ hover:data-[highlighted]:bg-highlight-surface-hover;
15
+ }
16
+
17
+ /** TODO(burdon): Only show active if container has attention. */
18
+ .dx-current {
19
+ @apply dx-ring-pseudo
20
+ aria-[current=true]:bg-highlight-surface aria-[current=true]:text-highlight-surface-text
21
+ aria-[current=true]:after:ring-active-separator!;
22
+ }
23
+
24
+ .dx-selected {
25
+ @apply aria-selected:bg-selected-surface
26
+ aria-selected:text-selected-surface-text hover:aria-selected:text-selected-surface-text
27
+ aria-selected:font-semibold aria-selected:tracking-normal
28
+ transition-[color,font-variation-settings,letter-spacing];
29
+ }
30
+ }
@@ -6,6 +6,7 @@
6
6
  * TODO(burdon): This could move into the ui-editor package (similar to graph.css).
7
7
  */
8
8
 
9
+ /** TODO(burdon): Move to ui-editor */
9
10
  @theme {
10
11
  --color-cm-codeblock: oklch(from var(--color-neutral-500) l c h / 0.1);
11
12
  --color-cm-active-line: light-dark(
@@ -25,8 +26,9 @@
25
26
  --color-cm-comment-surface: light-dark(var(--color-amber-800), var(--color-amber-200));
26
27
 
27
28
  /* Markdown syntax highlighting */
28
- --color-cm-code: light-dark(var(--color-neutral-700), var(--color-neutral-300));
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));
29
31
  --color-cm-code-mark: var(--color-blue-500);
30
- --color-cm-mark-opacity: 0.5;
31
- --color-cm-heading: light-dark(var(--color-neutral-900), var(--color-neutral-400));
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));
32
34
  }
@@ -2,6 +2,7 @@
2
2
  * Tldraw
3
3
  */
4
4
 
5
+ /** TODO(burdon): Move to tldraw */
5
6
  .tl-background {
6
7
  --color-background: var(--color-base-surface);
7
8
  }
@@ -18,13 +18,6 @@
18
18
  z-index: 0;
19
19
  }
20
20
 
21
- /**
22
- * Main Mobile app.
23
- */
24
- .dx-main-mobile-layout {
25
- @apply absolute inset-0 overflow-hidden flex flex-col;
26
- }
27
-
28
21
  /** TODO(burdon): Reconcile with dx-main-bounce-layout */
29
22
  .dx-main-content-padding-transitions {
30
23
  transition-duration: 200ms;
@@ -6,50 +6,27 @@
6
6
  /**
7
7
  * Registers the element as a size query container.
8
8
  * Children can use @container queries to apply styles based on the container's dimensions (both width and height).
9
+ * Also enables children to use cqi units (e.g., max-w-[100cqi])
9
10
  */
10
11
  .dx-size-container {
11
12
  container-type: size;
12
13
  }
13
14
 
14
15
  /**
15
- * Layout rules for flex-based scroll containment:
16
- * `flex flex-col`
17
- * On a container: makes it a flex column so children stack and can use `flex-1`.
18
- * `flex-1`
19
- * On a child: grows to fill the flex parent. Requires the parent to be `flex`.
20
- * `min-h-0` (alongside `flex-1`):
21
- * Overrides default flex children: `min-height:auto` (sized to content), which prevents shrinking.
22
- * Allows element to shrink and trigger overflow/scrolling.
23
- * Always pair with `flex-1` when scroll is needed.
24
- * `h-full`:
25
- * Fills 100% of the parent's *computed* height.
26
- * Use when the parent has a definite height but is not a flex container (e.g. `overflow:hidden` wrapper).
27
- * Unlike `flex-1`, does not require the parent to be flex.
28
- *
29
- * Pattern for a scrollable region inside a flex ancestor:
30
- * ancestor → `flex flex-col` (or `flex flex-row`)
31
- * scroll root → `flex-1 min-h-0` (fills ancestor, can shrink)
32
- * scroll viewport → `h-full overflow-y-scroll` (fills root, scrolls)
16
+ * Document width.
33
17
  */
34
-
35
- /**
36
- * Container that fills the available space.
37
- */
38
- .dx-container {
39
- @apply flex-1 min-h-0 min-w-0 h-full w-full;
40
- }
41
-
42
- /**
43
- * Article width.
44
- */
45
- .dx-article {
46
- @apply mx-auto w-full max-w-article-max-width;
18
+ .dx-document {
19
+ @apply mx-auto w-full max-w-document-max-width;
47
20
  }
48
21
 
49
22
  /**
50
23
  * Card
51
24
  */
52
25
 
26
+ .dx-card {
27
+ @apply flex flex-col w-full;
28
+ }
29
+
53
30
  .dx-card-square {
54
31
  inline-size: min(
55
32
  min(var(--radix-popper-available-width), var(--spacing-card-max-width)),
@@ -10,8 +10,10 @@
10
10
 
11
11
  @theme {
12
12
  --color-neutral-75: color-mix(in oklch, var(--color-neutral-50) 50%, var(--color-neutral-100) 50%);
13
+ --color-neutral-150: color-mix(in oklch, var(--color-neutral-100) 50%, var(--color-neutral-200) 50%);
13
14
  --color-neutral-250: color-mix(in oklch, var(--color-neutral-200) 50%, var(--color-neutral-300) 50%);
14
15
  --color-neutral-750: color-mix(in oklch, var(--color-neutral-700) 50%, var(--color-neutral-800) 50%);
16
+ --color-neutral-850: color-mix(in oklch, var(--color-neutral-800) 50%, var(--color-neutral-900) 50%);
15
17
  --color-neutral-925: color-mix(in oklch, var(--color-neutral-900) 50%, var(--color-neutral-950) 50%);
16
18
 
17
19
  --color-primary-50: var(--color-blue-50);
@@ -25,4 +27,10 @@
25
27
  --color-primary-800: var(--color-blue-800);
26
28
  --color-primary-900: var(--color-blue-900);
27
29
  --color-primary-950: var(--color-blue-950);
30
+
31
+ /* Composer logo colors */
32
+ --color-composer-100: rgb(5 40 61);
33
+ --color-composer-200: rgb(10 75 105);
34
+ --color-composer-300: rgb(1 122 183);
35
+ --color-composer-400: rgb(6 197 253);
28
36
  }
@@ -17,25 +17,28 @@
17
17
  --color-inverse-surface: light-dark(var(--color-neutral-800), var(--color-neutral-200));
18
18
  --color-inverse-surface-text: light-dark(var(--color-neutral-50), var(--color-neutral-950));
19
19
 
20
- --color-input-surface: light-dark(var(--color-neutral-200), var(--color-neutral-800));
21
- --color-input-surface-text: light-dark(var(--color-neutral-950), var(--color-neutral-50));
22
-
23
20
  --color-deck-surface: light-dark(var(--color-neutral-50), var(--color-neutral-950));
24
21
  --color-scrim-surface: light-dark(
25
22
  oklch(from var(--color-neutral-50) l c h / 0.5),
26
23
  oklch(from var(--color-neutral-950) l c h / 0.25)
27
24
  );
25
+
28
26
  --color-toolbar-surface: light-dark(var(--color-neutral-75), var(--color-neutral-925));
27
+ --color-card-surface: light-dark(var(--color-neutral-75), var(--color-neutral-925));
28
+
29
29
  --color-group-surface: light-dark(var(--color-neutral-100), var(--color-neutral-900));
30
30
  --color-modal-surface: light-dark(var(--color-neutral-100), var(--color-neutral-900));
31
- --color-card-surface: light-dark(var(--color-neutral-100), var(--color-neutral-900));
32
31
  --color-sidebar-surface: light-dark(var(--color-neutral-100), var(--color-neutral-900));
33
32
  --color-header-surface: light-dark(var(--color-neutral-100), var(--color-neutral-900));
34
33
 
34
+ --color-input-surface: light-dark(var(--color-neutral-200), var(--color-neutral-800));
35
+ --color-input-surface-text: light-dark(var(--color-neutral-950), var(--color-neutral-50));
36
+
35
37
  /** TODO(burdon): current vs active vs selected */
36
38
  --color-current-surface: light-dark(var(--color-neutral-200), var(--color-neutral-800));
37
39
  --color-active-surface: light-dark(var(--color-neutral-200), var(--color-neutral-800));
38
40
  --color-active-text: light-dark(var(--color-neutral-950), var(--color-neutral-50));
41
+
39
42
  /** TODO(burdon): Merge overlay/surface? */
40
43
  --color-hover-overlay: light-dark(var(--color-neutral-250), var(--color-neutral-750));
41
44
  --color-hover-surface: light-dark(var(--color-neutral-250), var(--color-neutral-750));
@@ -47,12 +50,23 @@
47
50
  --color-focus-surface: light-dark(var(--color-neutral-50), var(--color-neutral-950));
48
51
  --color-neutral-focus-indicator: light-dark(var(--color-neutral-400), var(--color-neutral-600));
49
52
 
50
- /* Accent */
53
+ /* Highlight and Selected */
54
+
55
+ --color-highlight-surface: light-dark(var(--color-neutral-100), var(--color-neutral-900));
56
+ --color-highlight-surface-hover: light-dark(var(--color-neutral-250), var(--color-neutral-750));
57
+ --color-highlight-surface-text: light-dark(var(--color-neutral-950), var(--color-neutral-50));
58
+
59
+ --color-selected-surface: light-dark(var(--color-neutral-150), var(--color-neutral-850));
60
+ --color-selected-surface-hover: light-dark(var(--color-neutral-250), var(--color-neutral-750));
61
+ --color-selected-surface-text: light-dark(var(--color-neutral-950), var(--color-neutral-50));
62
+
63
+ /* Accent (primary) */
64
+ /* TODO(burdon): Rename primary */
51
65
 
52
- --color-accent-surface: light-dark(var(--color-blue-600), var(--color-blue-600));
66
+ --color-accent-surface: light-dark(var(--color-blue-500), var(--color-blue-700));
53
67
  --color-accent-surface-hover: light-dark(var(--color-blue-800), var(--color-blue-800));
54
68
  --color-accent-surface-text: var(--color-blue-100);
55
- --color-accent-text: light-dark(var(--color-blue-600), var(--color-blue-600));
69
+ --color-accent-text: light-dark(var(--color-blue-600), var(--color-blue-400));
56
70
  --color-accent-text-hover: light-dark(var(--color-blue-500), var(--color-blue-500));
57
71
  --color-accent-focus-indicator: light-dark(var(--color-blue-600), var(--color-blue-600));
58
72
 
@@ -62,8 +76,9 @@
62
76
  /* Separator */
63
77
 
64
78
  --color-separator: light-dark(var(--color-neutral-200), var(--color-neutral-800));
65
- --color-primary-separator: light-dark(var(--color-neutral-400), var(--color-neutral-800));
66
- --color-subdued-separator: light-dark(var(--color-neutral-300), var(--color-neutral-900));
79
+ --color-subdued-separator: light-dark(var(--color-neutral-150), var(--color-neutral-850));
80
+ --color-primary-separator: light-dark(var(--color-neutral-500), var(--color-neutral-700));
81
+ --color-active-separator: light-dark(var(--color-blue-500), var(--color-blue-500));
67
82
 
68
83
  /* Scrollbar */
69
84
 
@@ -2,31 +2,36 @@
2
2
  * Tokens
3
3
  */
4
4
 
5
+ /**
6
+ * Utility classes
7
+ */
5
8
  @theme {
6
9
  /** Minimum inset from the viewport edge for floating surfaces. */
7
- --spacing-screen-border: 1rem;
8
-
9
- --spacing-article-max-width: 50rem;
10
- --spacing-prose-max-width: 50rem;
10
+ --spacing-screen-border: 2rem;
11
11
 
12
12
  --spacing-popover-min-width: 12rem;
13
13
 
14
+ --spacing-document-max-width: 50rem;
15
+ --spacing-document-width: calc(50rem - env(safe-area-inset-left) - env(safe-area-inset-right));
16
+
17
+ --spacing-popover-min-width: 16rem;
18
+
14
19
  --spacing-card-default-width: 20rem;
15
20
  --spacing-card-min-width: 18rem;
16
21
  --spacing-card-max-width: 22rem;
17
22
  --spacing-card-min-height: 18rem;
18
23
  --spacing-card-max-height: 30rem;
19
24
 
20
- --spacing-trim-xs: 0.375rem;
25
+ --spacing-tag-padding-block: 0.125rem;
26
+
27
+ --spacing-trim-xs: 0.25rem;
21
28
  --spacing-trim-sm: 0.5rem;
22
29
  --spacing-trim-md: 0.75rem;
23
30
  --spacing-trim-lg: 1.5rem;
24
31
 
25
- --spacing-tag-padding-block: 0.125rem;
26
- --spacing-text-content: calc(50rem - env(safe-area-inset-left) - env(safe-area-inset-right));
27
-
28
32
  /** Minimal trim to allow for ring/outline. */
29
33
  --spacing-form-chrome: var(--spacing-trim-xs);
34
+ --spacing-form-gap: var(--spacing-trim-sm);
30
35
 
31
36
  /**
32
37
  * Density: fine
@@ -38,15 +43,20 @@
38
43
 
39
44
  @layer dx-tokens {
40
45
  /**
41
- * Density: coarse
46
+ * TODO(burdon): Density: coarse
42
47
  */
48
+ /*
43
49
  .dx-density-coarse {
44
50
  --spacing-form-padding: var(--spacing-trim-md);
45
51
  --spacing-icon-button-padding: var(--spacing-trim-sm);
46
52
  --spacing-scroll-padding: 8px;
47
53
  }
54
+ */
48
55
  }
49
56
 
57
+ /**
58
+ * CSS variables.
59
+ */
50
60
  @layer dx-tokens {
51
61
  :root {
52
62
  --dx-line-0: 0px;
@@ -58,10 +68,10 @@
58
68
  --dx-lacuna-4: 0.5rem;
59
69
  --dx-lacuna-6: 0.75rem;
60
70
 
61
- --dx-gutter-xs: 0.125rem;
62
- --dx-gutter-sm: 0.5rem;
63
- --dx-gutter-md: 1rem;
64
- --dx-gutter-lg: 2rem;
71
+ --dx-gutter-xs: 0.25rem; /* Input rings */
72
+ --dx-gutter-sm: 1rem;
73
+ --dx-gutter-md: 2rem; /* 32px (fine card) */
74
+ --dx-gutter-lg: 2.5rem; /* 40px (dialog, coarse card) */
65
75
  }
66
76
 
67
77
  :root {
@@ -83,6 +93,8 @@
83
93
 
84
94
  --dx-input-fine: var(--dx-lacuna-3);
85
95
  --dx-input-coarse: var(--dx-lacuna-4);
96
+
97
+ --dx-default-icons-size: 1.25rem; /* size=5 */
86
98
  }
87
99
 
88
100
  [data-grid-focus-indicator-variant='stack'] {
@@ -91,15 +103,20 @@
91
103
 
92
104
  :root {
93
105
  --dx-rail-content: 3rem;
106
+ /** TODO(burdon): Audit. */
107
+ /** TODO(burdon): Density (2 sizes). */
94
108
  --dx-rail-size: calc(var(--dx-rail-content) + 1px);
95
109
  --dx-rail-item: calc(var(--dx-rail-content) - 1rem);
96
- --dx-rail-action: calc(var(--dx-rail-content) - 0.5rem + 1px);
110
+ /* TODO(burdon): Added 1px for border. */
111
+ /* TODO(burdon): Remove direct usage. */
112
+ --dx-rail-action: calc(var(--dx-rail-content) - 0.5rem);
97
113
 
98
- --dx-topbar-size: var(--dx-rail-size);
99
- --dx-toolbar-size: var(--dx-rail-content);
100
- --dx-statusbar-size: var(--dx-rail-content);
114
+ --dx-topbar-size: var(--dx-rail-size); /* 50px */
115
+ --dx-toolbar-size: var(--dx-rail-action); /* 40px */
116
+ --dx-statusbar-size: var(--dx-rail-item); /* 32px */
101
117
 
102
- --dx-nav-sidebar-size: 23rem;
118
+ /** NOTE: On MBP, should have nav sidebare open with 4 column mosaic board. */
119
+ --dx-nav-sidebar-size: 21.5rem;
103
120
  --dx-complementary-sidebar-size: 25rem;
104
121
  --dx-drawer-size: 50dvh;
105
122
 
@@ -1,7 +1,76 @@
1
1
  /**
2
- * Misc
2
+ * Tailwind utility classes.
3
3
  */
4
4
 
5
- @utility dx-icon-inline {
6
- @apply inline-block align-[-0.125em];
5
+ /**
6
+ * Layout rules for flex-based scroll containment:
7
+ * `flex flex-col`
8
+ * On a container: makes it a flex column so children stack and can use `flex-1`.
9
+ * `flex-1`
10
+ * On a child: grows to fill the flex parent. Requires the parent to be `flex`.
11
+ * `min-h-0` (alongside `flex-1`):
12
+ * Overrides default flex children: `min-height:auto` (sized to content), which prevents shrinking.
13
+ * Allows element to shrink and trigger overflow/scrolling.
14
+ * Always pair with `flex-1` when scroll is needed.
15
+ * `h-full`:
16
+ * Fills 100% of the parent's *computed* height.
17
+ * Use when the parent has a definite height but is not a flex container (e.g. `overflow:hidden` wrapper).
18
+ * Unlike `flex-1`, does not require the parent to be flex.
19
+ *
20
+ * Pattern for a scrollable region inside a flex ancestor:
21
+ * ancestor → `flex flex-col` (or `flex flex-row`)
22
+ * scroll root → `flex-1 min-h-0` (fills ancestor, can shrink)
23
+ * scroll viewport → `h-full overflow-y-scroll` (fills root, scrolls)
24
+ */
25
+
26
+ /**
27
+ * Fills the available space.
28
+ */
29
+ @utility dx-expander {
30
+ @apply flex-1 min-h-0 min-w-0 h-full w-full;
31
+ }
32
+
33
+ /**
34
+ * Column that fills the available space (extends dx-expander with overflow clipping).
35
+ */
36
+ @utility dx-column {
37
+ @apply flex-1 min-w-0 w-full;
38
+ }
39
+
40
+ /**
41
+ * Container that fills the available space (extends dx-expander with overflow clipping).
42
+ */
43
+ @utility dx-container {
44
+ @apply dx-expander overflow-hidden;
45
+ }
46
+
47
+ /**
48
+ * Fullscreen
49
+ */
50
+ @utility dx-fullscreen {
51
+ @apply absolute inset-0;
52
+ }
53
+
54
+ /**
55
+ * Visual warning to indicate incorrect usage of `slottable`.
56
+ */
57
+ @utility dx-slot-warning {
58
+ @apply border border-rose-500 border-dashed;
59
+ }
60
+
61
+ /**
62
+ * Pseudo-element overlay for ring indicators (focus, current, etc.).
63
+ *
64
+ * A standard CSS `box-shadow` ring is painted behind child content, so children with
65
+ * opaque backgrounds (e.g., cards, avatars) obscure it. By painting the ring on an
66
+ * absolutely-positioned `::after` pseudo-element that sits above the element's children
67
+ * in stacking order, the ring is always visible regardless of child backgrounds.
68
+ *
69
+ * The pseudo-element inherits `border-radius` from its parent and is `pointer-events-none`
70
+ * so it doesn't interfere with interactions. The ring starts transparent; consumers
71
+ * activate it conditionally (e.g., `focus:after:ring-*`, `aria-[current=true]:after:ring-*`).
72
+ */
73
+ @utility dx-ring-pseudo {
74
+ @apply relative after:content-[""] after:absolute after:inset-0 after:rounded-[inherit]
75
+ after:pointer-events-none after:ring after:ring-inset after:ring-transparent;
7
76
  }
@@ -0,0 +1,58 @@
1
+ # Fragment Definitions Audit
2
+
3
+ External packages importing fragment definitions from `ui-theme/src/fragments`.
4
+
5
+ ## Current Fragment Exports
6
+
7
+ | File | Definition | External | Internal |
8
+ | ------------- | ------------------------------------- | -------- | -------- |
9
+ | `density.ts` | `densityBlockSize` | - | 1 |
10
+ | `density.ts` | `coarseBlockSize` | - | 1 |
11
+ | `density.ts` | `coarseDimensions` | - | 1 |
12
+ | `density.ts` | `fineBlockSize` | - | 1 |
13
+ | `density.ts` | `fineDimensions` | - | 1 |
14
+ | `disabled.ts` | `staticDisabled` | - | 1 |
15
+ | `disabled.ts` | `dataDisabled` | - | 1 |
16
+ | `focus.ts` | `focusRing` | 2 | 5 |
17
+ | `focus.ts` | `subduedFocus` | - | 2 |
18
+ | `focus.ts` | `staticFocusRing` | - | 1 |
19
+ | `hover.ts` | `subtleHover` | 4 | - |
20
+ | `hover.ts` | `ghostHover` | 8 | 2 |
21
+ | `hover.ts` | `ghostFocusWithin` | 1 | - |
22
+ | `hover.ts` | `hoverableControls` | 9 | - |
23
+ | `hover.ts` | `groupHoverControlItemWithTransition` | 2 | - |
24
+ | `hover.ts` | `hoverableFocusedKeyboardControls` | 1 | - |
25
+ | `hover.ts` | `hoverableFocusedWithinControls` | 9 | - |
26
+ | `hover.ts` | `hoverableOpenControlItem` | 3 | - |
27
+ | `hover.ts` | `hoverableControlItem` | 7 | - |
28
+ | `text.ts` | `descriptionTextPrimary` | 1 | - |
29
+ | `text.ts` | `descriptionMessage` | 5 | - |
30
+
31
+ ## Summary
32
+
33
+ **Total fragments:** 21
34
+ **Total imports (external + internal):** 96
35
+
36
+ - **External:** 63
37
+ - **Internal:** 33
38
+
39
+ **Most imported overall:**
40
+
41
+ - `hoverableControls` (9 external)
42
+ - `hoverableFocusedWithinControls` (9 external)
43
+ - `ghostHover` (8 external + 2 internal = 10 total)
44
+ - `hoverableControlItem` (7 external)
45
+ - `focusRing` (2 external + 5 internal = 7 total)
46
+
47
+ **Internal imports by file:**
48
+
49
+ - `input.ts`: 8 definitions (coarseBlockSize, coarseDimensions, fineBlockSize, fineDimensions, focusRing, staticDisabled, staticFocusRing, subduedFocus)
50
+ - `list.ts`: 3 definitions (densityBlockSize, focusRing, ghostHover)
51
+ - `menu.ts`: 2 definitions (dataDisabled, subduedFocus)
52
+ - `button.ts`, `link.ts`, `popover.ts`, `toast.ts`: 1 definition each (ghostHover, focusRing, focusRing, focusRing)
53
+
54
+ **Completely unused:** 7 fragments
55
+
56
+ - `subtleHover` from `hover.ts`
57
+ - `hoverableOpenControlItem`, `groupHoverControlItemWithTransition` from `hover.ts` (only 2-3 uses)
58
+ - `descriptionTextPrimary` from `text.ts` (only 1 use)
@@ -2,14 +2,9 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- // TODO(burdon): Replace fragments with utility and component classes.
5
+ // TODO(burdon): Remove export of fragments.
6
6
 
7
7
  export * from './density';
8
8
  export * from './disabled';
9
- export * from './elevation';
10
- export * from './focus';
11
9
  export * from './hover';
12
- export * from './selected';
13
- export * from './size';
14
10
  export * from './text';
15
- export * from './valence';
@@ -2,10 +2,5 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- /**
6
- * Content areas that contain the text editor.
7
- */
8
- export const textBlockWidth = 'w-full max-w-text-content mx-auto';
9
-
10
5
  export const descriptionTextPrimary = 'text-sm font-normal text-base-surface-text';
11
6
  export const descriptionMessage = 'text-description border border-dashed border-separator rounded-sm p-4';
package/src/index.ts CHANGED
@@ -4,5 +4,5 @@
4
4
 
5
5
  export * from './defs';
6
6
  export * from './fragments';
7
- export * from './theme/index';
7
+ export * from './theme';
8
8
  export * from './util';
@@ -30,10 +30,12 @@
30
30
  @import './css/components/button.css';
31
31
  @import './css/components/checkbox.css';
32
32
  @import './css/components/dialog.css';
33
- @import './css/components/focus-ring.css';
33
+ @import './css/components/focus.css';
34
+ @import './css/components/icon.css';
34
35
  @import './css/components/panel.css';
35
36
  @import './css/components/link.css';
36
37
  @import './css/components/scrollbar.css';
38
+ @import './css/components/selected.css';
37
39
  @import './css/components/surface.css';
38
40
  @import './css/components/tag.css';
39
41
  @import './css/components/text.css';
@@ -75,9 +77,11 @@
75
77
  */
76
78
  @variant dark (&:where(.dark, .dark *));
77
79
 
78
- /**
79
- * Custom variants.
80
- */
81
- @custom-variant is-current (&[aria-current]:not([aria-current="false"]));
82
- @custom-variant hover-hover (@media (hover: hover));
80
+ /** Mobile */
81
+ @custom-variant pointer-coarse (@media (pointer: coarse));
82
+ /** Web */
83
83
  @custom-variant pointer-fine (@media (pointer: fine));
84
+ /** Supports mouse/trackpad (Web) */
85
+ @custom-variant hover-hover (@media (hover: hover));
86
+ /** Active navigation */
87
+ @custom-variant is-current (&[aria-current]:not([aria-current="false"]));