@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
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@dxos/ui-theme",
3
- "version": "0.0.0",
3
+ "version": "0.8.4-main.16b68245aa",
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",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": [
@@ -16,24 +20,11 @@
16
20
  "types": "./dist/types/src/index.d.ts",
17
21
  "default": "./dist/lib/browser/index.mjs"
18
22
  },
19
- "./esbuild-plugin": {
20
- "source": "./src/plugins/esbuild-plugin.ts",
21
- "types": "./dist/types/src/plugins/esbuild-plugin.d.ts",
22
- "import": "./dist/plugin/node-esm/plugins/esbuild-plugin.mjs",
23
- "require": "./dist/plugin/node-cjs/plugins/esbuild-plugin.cjs"
24
- },
25
23
  "./plugin": {
26
- "source": "./src/plugins/plugin.ts",
27
- "types": "./dist/types/src/plugins/plugin.d.ts",
28
- "import": "./dist/plugin/node-esm/plugins/plugin.mjs",
29
- "require": "./dist/plugin/node-cjs/plugins/plugin.cjs"
30
- }
31
- },
32
- "typesVersions": {
33
- "*": {
34
- "plugin": [
35
- "dist/types/src/plugins/plugin.d.ts"
36
- ]
24
+ "source": "./src/plugins/ThemePlugin.ts",
25
+ "types": "./dist/types/src/plugins/ThemePlugin.d.ts",
26
+ "import": "./dist/plugin/node-esm/plugins/ThemePlugin.mjs",
27
+ "require": "./dist/plugin/node-cjs/plugins/ThemePlugin.cjs"
37
28
  }
38
29
  },
39
30
  "files": [
@@ -41,40 +32,43 @@
41
32
  "src"
42
33
  ],
43
34
  "dependencies": {
44
- "@ch-ui/tailwind-tokens": "2.8.1",
45
- "@ch-ui/tokens": "3.0.1",
46
- "@fontsource-variable/inter": "5.0.16",
35
+ "@fontsource-variable/inter": "5.2.8",
47
36
  "@fontsource-variable/jetbrains-mono": "5.0.21",
48
37
  "@fontsource/poiret-one": "^5.0.20",
49
- "@tailwindcss/container-queries": "^0.1.1",
50
- "@tailwindcss/forms": "^0.5.3",
51
- "autoprefixer": "^10.4.12",
38
+ "@radix-ui/react-slot": "1.1.2",
39
+ "@tailwindcss/forms": "^0.5.9",
40
+ "@tailwindcss/postcss": "^4.2.0",
41
+ "autoprefixer": "^10.5.0",
52
42
  "esbuild-style-plugin": "^1.6.1",
53
43
  "glob": "^7.2.3",
54
44
  "globby": "14.1.0",
55
45
  "lodash.merge": "^4.6.2",
56
- "postcss": "^8.4.41",
46
+ "postcss": "^8.5.12",
57
47
  "postcss-import": "^16.1.0",
58
- "tailwind-merge": "^2.2.1",
59
- "tailwind-scrollbar": "^3.1.0",
60
- "tailwindcss": "~3.4.1",
61
- "tailwindcss-logical": "^3.0.0",
62
- "tailwindcss-radix": "^2.8.0",
63
- "@dxos/node-std": "0.8.3",
64
- "@dxos/util": "0.8.3"
48
+ "postcss-nesting": "^13.0.1",
49
+ "tailwind-merge": "^3.5.0",
50
+ "tailwind-scrollbar": "^4.0.0",
51
+ "tailwindcss": "^4.2.0",
52
+ "tailwindcss-radix": "^4.0.2",
53
+ "@dxos/log": "0.8.4-main.16b68245aa",
54
+ "@dxos/node-std": "0.8.4-main.16b68245aa",
55
+ "@dxos/util": "0.8.4-main.16b68245aa"
65
56
  },
66
57
  "devDependencies": {
67
- "@ch-ui/colors": "1.2.1",
68
58
  "@types/lodash.merge": "^4.6.6",
69
59
  "@types/postcss-import": "^14.0.3",
70
- "esbuild": "0.25.10",
71
- "vite": "7.1.9",
72
- "@dxos/ui-types": "0.0.0"
60
+ "esbuild": "0.28.0",
61
+ "vite": "^8.0.10",
62
+ "@dxos/ui-types": "0.8.4-main.16b68245aa"
63
+ },
64
+ "peerDependencies": {
65
+ "react": "~19.2.3"
73
66
  },
74
67
  "publishConfig": {
75
68
  "access": "public"
76
69
  },
77
70
  "scripts": {
71
+ "audit-classes": "npx tsx bin/audit-classes.mts",
78
72
  "tailwind-check": "tailwindcss -i ./dist/plugin/node-esm/theme.css --config ./src/tailwind.ts --content \"./src/**/*.{js,ts,jsx,tsx,vue}\" --check"
79
73
  }
80
74
  }
@@ -0,0 +1,224 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Meta } from '@storybook/react-vite';
6
+ import React from 'react';
7
+
8
+ import { hueShades, hues } from './defs';
9
+ import { mx } from './util';
10
+
11
+ // prettier-ignore
12
+ const neutralShades: [number, string][] = [
13
+ [50, 'bg-neutral-50'],
14
+ [75, 'bg-neutral-75'],
15
+ [100, 'bg-neutral-100'],
16
+ [200, 'bg-neutral-200'],
17
+ [250, 'bg-neutral-250'],
18
+ [300, 'bg-neutral-300'],
19
+ [400, 'bg-neutral-400'],
20
+ [500, 'bg-neutral-500'],
21
+ [600, 'bg-neutral-600'],
22
+ [700, 'bg-neutral-700'],
23
+ [750, 'bg-neutral-750'],
24
+ [800, 'bg-neutral-800'],
25
+ [900, 'bg-neutral-900'],
26
+ [925, 'bg-neutral-925'],
27
+ [950, 'bg-neutral-950'],
28
+ ];
29
+
30
+ const ColorSwatch = ({ hue }: { hue: string }) => {
31
+ return (
32
+ <div
33
+ style={{
34
+ borderColor: `var(--color-${hue}-border)`,
35
+ }}
36
+ className={mx('shrink-0 aspect-square w-36 grid grid-rows-3 border-2 overflow-hidden rounded-md')}
37
+ >
38
+ <div
39
+ style={{
40
+ color: `var(--color-${hue}-text)`,
41
+ backgroundColor: `var(--color-base-surface)`,
42
+ }}
43
+ className='p-2 text-sm'
44
+ >
45
+ {hue}
46
+ </div>
47
+ <div
48
+ style={{
49
+ color: `var(--color-${hue}-text)`,
50
+ backgroundColor: `var(--color-${hue}-fill)`,
51
+ }}
52
+ className='px-1 text-sm flex items-center'
53
+ >
54
+ <svg className='h-6 w-6'>
55
+ <use href='/icons.svg#ph--aperture--regular' />
56
+ </svg>
57
+ </div>
58
+ <div
59
+ style={{
60
+ color: `var(--color-${hue}-surface-text)`,
61
+ backgroundColor: `var(--color-${hue}-surface)`,
62
+ }}
63
+ className='p-2 text-sm'
64
+ >
65
+ {hue}
66
+ </div>
67
+ </div>
68
+ );
69
+ };
70
+
71
+ const HueSwatch = ({ hue, shades }: { hue: string; shades: readonly number[] }) => (
72
+ <div className='flex gap-1'>
73
+ {shades.map((shade) => (
74
+ <div
75
+ key={shade}
76
+ className='shrink-0 aspect-square w-24 flex flex-col rounded-sm'
77
+ style={{ backgroundColor: `var(--color-${hue}-${shade})` }}
78
+ >
79
+ <span
80
+ className='flex flex-col h-full justify-between text-sm p-2'
81
+ style={{ color: shade <= 500 ? 'black' : 'white' }}
82
+ >
83
+ <span className='text-xs'>{shade}</span>
84
+ {shade === 500 && <span className='text-xs'>{hue}</span>}
85
+ </span>
86
+ </div>
87
+ ))}
88
+ </div>
89
+ );
90
+
91
+ const meta = {
92
+ title: 'ui/ui-theme/Theme',
93
+ parameters: {
94
+ layout: 'fullscreen',
95
+ },
96
+ } satisfies Meta;
97
+
98
+ export default meta;
99
+
100
+ export const Styles = {
101
+ render: () => {
102
+ return (
103
+ <div className='p-4'>
104
+ <div className='flex flex-wrap gap-2'>
105
+ {['neutral', ...hues].map((hue) => (
106
+ <ColorSwatch key={hue} hue={hue} />
107
+ ))}
108
+ </div>
109
+ </div>
110
+ );
111
+ },
112
+ };
113
+
114
+ export const Colors = {
115
+ render: () => {
116
+ return (
117
+ <div className='p-4'>
118
+ <div className='flex flex-col gap-1'>
119
+ {['neutral', ...hues].map((hue) => (
120
+ <HueSwatch key={hue} hue={hue} shades={hueShades} />
121
+ ))}
122
+ </div>
123
+ </div>
124
+ );
125
+ },
126
+ };
127
+
128
+ export const Neutral = {
129
+ render: () => {
130
+ return (
131
+ <div className='p-4'>
132
+ <div className='flex flex-col items-center'>
133
+ {neutralShades.map(([value, className]) => (
134
+ <div
135
+ key={value}
136
+ className={mx(
137
+ 'h-12 w-48 p-2 text-right text-sm',
138
+ className,
139
+ value <= 500 ? 'text-neutral-950' : 'text-neutral-50',
140
+ )}
141
+ >
142
+ {value}
143
+ </div>
144
+ ))}
145
+ </div>
146
+ </div>
147
+ );
148
+ },
149
+ };
150
+
151
+ export const Surfaces = {
152
+ render: () => {
153
+ return (
154
+ <div className='absolute inset-0 h-full p-4 bg-white dark:bg-black'>
155
+ <div className='flex flex-wrap gap-2'>
156
+ {[
157
+ { className: 'bg-scrim-surface', label: 'scrim' },
158
+ { className: 'bg-base-surface', label: 'base' },
159
+ { className: 'bg-deck-surface', label: 'deck' },
160
+ { className: 'bg-group-surface', label: 'group' },
161
+ { className: 'bg-sidebar-surface', label: 'sidebar' },
162
+ { className: 'bg-header-surface', label: 'header' },
163
+ { className: 'bg-card-surface', label: 'card' },
164
+ { className: 'bg-modal-surface', label: 'modal' },
165
+ { className: 'bg-input-surface', label: 'input' },
166
+ { className: 'bg-active-surface', label: 'active' },
167
+ { className: 'bg-hover-surface', label: 'hover' },
168
+ { className: 'bg-inverse-surface text-inverse-surface-text', label: 'inverse' },
169
+ ].map(({ className, label }) => (
170
+ <div key={className} className={mx('shrink-0 p-2 aspect-square w-48 rounded-md', className)}>
171
+ {label}
172
+ </div>
173
+ ))}
174
+ </div>
175
+ </div>
176
+ );
177
+ },
178
+ };
179
+
180
+ export const Tags = {
181
+ render: () => {
182
+ return (
183
+ <div className='p-4'>
184
+ <div className='flex flex-col gap-1'>
185
+ {['neutral', ...hues].map((hue) => (
186
+ <div key={hue} className='grid grid-cols-[8rem_8rem]'>
187
+ <div>
188
+ <span className='dx-tag' data-hue={hue}>
189
+ {hue}
190
+ </span>
191
+ </div>
192
+ <div>
193
+ <span className='dx-text text-sm' data-hue={hue}>
194
+ {hue}
195
+ </span>
196
+ </div>
197
+ </div>
198
+ ))}
199
+ </div>
200
+ </div>
201
+ );
202
+ },
203
+ };
204
+
205
+ export const Animation = {
206
+ render: () => {
207
+ return (
208
+ <div className='absolute inset-0 grid place-items-center'>
209
+ <div className='dx-density-coarse border border-separator rounded-md'>
210
+ <div
211
+ className={mx(
212
+ 'flex items-center font-mono text-2xl text-test-experimental',
213
+ 'p-form-padding w-card-min-width grid grid-cols-[min-content_1fr_min-content]',
214
+ )}
215
+ >
216
+ <span className='animate-blink text-error-text'>*</span>
217
+ <span className='text-center'>experimental</span>
218
+ <span className='animate-blink text-error-text'>*</span>
219
+ </div>
220
+ </div>
221
+ </div>
222
+ );
223
+ },
224
+ };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Base utilities.
3
+ */
4
+
5
+ @layer dx-base {
6
+ :root {
7
+ color-scheme: light;
8
+ touch-action: pan-x pan-y;
9
+ font-synthesis: none;
10
+ font-variation-settings:
11
+ 'wght' 400,
12
+ 'slnt' 0;
13
+ scroll-padding-block-start: var(--spacing-14);
14
+ scroll-padding-block-end: var(--spacing-2);
15
+ @apply font-body;
16
+ }
17
+
18
+ .dark {
19
+ color-scheme: dark;
20
+ }
21
+
22
+ button {
23
+ @apply cursor-pointer;
24
+ -webkit-tap-highlight-color: transparent;
25
+ }
26
+ }
27
+
28
+ @layer dx-tokens {
29
+ :root {
30
+ --dx-tag-padding-block: var(--spacing-tag-padding-block);
31
+ }
32
+
33
+ html,
34
+ html.dark,
35
+ html .dark,
36
+ .sb-show-main {
37
+ background-color: var(--color-base-surface);
38
+ color: var(--color-base-surface-text);
39
+ --surface-bg: var(--color-base-surface);
40
+ --surface-text: var(--color-base-surface-text);
41
+ --description-text: var(--color-description);
42
+ }
43
+ }
@@ -1,19 +1,19 @@
1
1
  /**
2
- * Typography configuration.
2
+ * Typography
3
3
  */
4
4
 
5
5
  @import '@fontsource-variable/jetbrains-mono/wght-italic.css';
6
6
  @import '@fontsource-variable/jetbrains-mono/wght.css';
7
- @import '@fontsource-variable/inter/slnt.css';
8
7
  @import '@fontsource/poiret-one';
9
8
 
10
- @layer utilities {
9
+ @layer dx-components {
11
10
  /* Font weights & `italic` handling */
12
11
  .not-italic {
13
12
  font-variation-settings:
14
13
  'wght' 400,
15
14
  'slnt' 0;
16
15
  }
16
+
17
17
  .font-thin,
18
18
  .not-italic.font-thin,
19
19
  .not-italic .font-thin,
@@ -22,6 +22,7 @@
22
22
  'wght' 100,
23
23
  'slnt' 0;
24
24
  }
25
+
25
26
  .font-extralight,
26
27
  .not-italic.font-extralight,
27
28
  .not-italic .font-extralight,
@@ -30,6 +31,7 @@
30
31
  'wght' 200,
31
32
  'slnt' 0;
32
33
  }
34
+
33
35
  .font-light,
34
36
  .not-italic.font-light,
35
37
  .not-italic .font-light,
@@ -38,6 +40,7 @@
38
40
  'wght' 300,
39
41
  'slnt' 0;
40
42
  }
43
+
41
44
  .font-normal,
42
45
  .not-italic.font-normal,
43
46
  .not-italic .font-normal,
@@ -46,6 +49,7 @@
46
49
  'wght' 400,
47
50
  'slnt' 0;
48
51
  }
52
+
49
53
  .font-medium,
50
54
  .not-italic.font-medium,
51
55
  .not-italic .font-medium,
@@ -54,6 +58,7 @@
54
58
  'wght' 500,
55
59
  'slnt' 0;
56
60
  }
61
+
57
62
  .font-semibold,
58
63
  .not-italic.font-semibold,
59
64
  .not-italic .font-semibold,
@@ -62,6 +67,7 @@
62
67
  'wght' 600,
63
68
  'slnt' 0;
64
69
  }
70
+
65
71
  .font-bold,
66
72
  .not-italic.font-bold,
67
73
  .not-italic .font-bold,
@@ -70,6 +76,7 @@
70
76
  'wght' 700,
71
77
  'slnt' 0;
72
78
  }
79
+
73
80
  .font-extrabold,
74
81
  .not-italic.font-extrabold,
75
82
  .not-italic .font-extrabold,
@@ -78,6 +85,7 @@
78
85
  'wght' 800,
79
86
  'slnt' 0;
80
87
  }
88
+
81
89
  .font-black,
82
90
  .not-italic.font-black,
83
91
  .not-italic .font-black,
@@ -86,11 +94,13 @@
86
94
  'wght' 900,
87
95
  'slnt' 0;
88
96
  }
97
+
89
98
  .italic {
90
99
  font-variation-settings:
91
100
  'wght' 400,
92
101
  'slnt' -10;
93
102
  }
103
+
94
104
  .italic.font-thin,
95
105
  .italic .font-thin,
96
106
  .font-thin .italic {
@@ -98,6 +108,7 @@
98
108
  'wght' 100,
99
109
  'slnt' -10;
100
110
  }
111
+
101
112
  .italic.font-extralight,
102
113
  .italic .font-extralight,
103
114
  .font-extralight .italic {
@@ -105,6 +116,7 @@
105
116
  'wght' 200,
106
117
  'slnt' -10;
107
118
  }
119
+
108
120
  .italic.font-light,
109
121
  .italic .font-light,
110
122
  .font-light .italic {
@@ -112,6 +124,7 @@
112
124
  'wght' 300,
113
125
  'slnt' -10;
114
126
  }
127
+
115
128
  .italic.font-normal,
116
129
  .italic .font-normal,
117
130
  .font-normal .italic {
@@ -119,6 +132,7 @@
119
132
  'wght' 400,
120
133
  'slnt' -10;
121
134
  }
135
+
122
136
  .italic.font-medium,
123
137
  .italic .font-medium,
124
138
  .font-medium .italic {
@@ -126,6 +140,7 @@
126
140
  'wght' 500,
127
141
  'slnt' -10;
128
142
  }
143
+
129
144
  .italic.font-semibold,
130
145
  .italic .font-semibold,
131
146
  .font-semibold .italic {
@@ -133,6 +148,7 @@
133
148
  'wght' 600,
134
149
  'slnt' -10;
135
150
  }
151
+
136
152
  .italic.font-bold,
137
153
  .italic .font-bold,
138
154
  .font-bold .italic {
@@ -140,6 +156,7 @@
140
156
  'wght' 700,
141
157
  'slnt' -10;
142
158
  }
159
+
143
160
  .italic.font-extrabold,
144
161
  .italic .font-extrabold,
145
162
  .font-extrabold .italic {
@@ -147,6 +164,7 @@
147
164
  'wght' 800,
148
165
  'slnt' -10;
149
166
  }
167
+
150
168
  .italic.font-black,
151
169
  .italic .font-black,
152
170
  .font-black .italic {
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Button
3
+ */
4
+
1
5
  /* TODO(thure): Focus is handled by .dx-focus-ring, but should ideally be applied as part of this component. */
2
6
  @layer dx-components {
3
7
  /**
@@ -6,71 +10,76 @@
6
10
 
7
11
  /* Base styles */
8
12
  .dx-button {
9
- @apply font-medium shrink-0 inline-flex select-none items-center justify-center overflow-hidden transition-colors duration-100 ease-linear bg-inputSurface min-bs-[2.5rem] pli-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;
10
15
  &[aria-pressed='true'],
11
16
  &[aria-checked='true'] {
12
- @apply text-accentText bg-attention;
17
+ @apply text-accent-text bg-attention-surface;
13
18
  }
19
+
14
20
  /* Disabled styles */
15
21
  &[disabled]:not([disabled='false']) {
16
22
  @apply opacity-40 cursor-not-allowed shadow-none;
17
23
  }
24
+
18
25
  /* Variants consistent between enabled & disabled */
19
26
  &[data-variant='ghost'] {
20
27
  @apply bg-transparent;
21
28
  &:hover {
22
- @apply bg-hoverSurface text-inherit;
29
+ @apply bg-hover-surface text-inherit;
23
30
  }
24
31
  &[data-state='open'] {
25
- @apply bg-inputSurface;
32
+ @apply bg-input-surface;
26
33
  }
27
34
  &[aria-pressed='true'],
28
35
  &[aria-checked='true'] {
29
- @apply bg-baseSurface text-accentText;
36
+ @apply bg-base-surface text-accent-text;
30
37
  }
31
38
  }
32
39
  &[data-variant='outline'] {
33
- @apply border border-baseSurface bg-transparent;
40
+ @apply border border-base-surface bg-transparent;
34
41
  &:hover {
35
- @apply bg-hoverSurface;
42
+ @apply bg-hover-surface;
36
43
  }
37
44
  }
45
+
38
46
  /* Enabled styles */
39
47
  &:not([disabled]),
40
48
  &[disabled='false'] {
41
49
  /* Hover */
42
50
  &:hover {
43
- @apply bg-hoverSurface;
51
+ @apply bg-hover-surface;
44
52
  }
53
+
45
54
  /* Variants */
46
55
  &[data-variant='primary'] {
47
- @apply text-accentSurfaceText bg-accentSurface;
56
+ @apply text-accent-surface-text bg-accent-surface;
48
57
  &:hover,
49
58
  &[aria-pressed='true'],
50
59
  &[aria-checked='true'] &[data-state='open'] {
51
- @apply bg-accentSurfaceHover;
60
+ @apply bg-accent-surface-hover;
52
61
  }
53
62
  }
54
63
  &[data-variant='destructive'] {
55
- @apply text-accentSurfaceText bg-roseFill;
64
+ @apply text-accent-surface-text bg-rose-fill;
56
65
  &:hover,
57
66
  &[aria-pressed='true'],
58
67
  &[aria-checked='true'] &[data-state='open'] {
59
- @apply bg-roseFill;
68
+ @apply bg-rose-fill;
60
69
  }
61
70
  }
62
71
  }
63
72
  }
64
73
  /* Props */
65
74
  .dx-button:not([data-props~='grouped']) {
66
- @apply rounded-sm;
75
+ @apply rounded-xs;
67
76
  }
68
77
  .dx-button:not([data-props~='wrap']) {
69
78
  @apply truncate;
70
79
  }
71
80
  @media (pointer: fine) {
72
81
  .dx-button[data-density='fine'] {
73
- @apply min-bs-[2rem] pli-2.5;
82
+ @apply min-h-[2rem] px-2.5;
74
83
  }
75
84
  }
76
85
  }
@@ -1,40 +1,44 @@
1
+ /**
2
+ * Checkbox
3
+ */
4
+
1
5
  /* TODO(thure): Focus is handled by .dx-focus-ring, but should ideally be applied as part of this component.*/
2
6
  @layer dx-components {
3
7
  .dx-checkbox--switch,
4
8
  .dx-checkbox {
5
- @apply border border-unAccent;
9
+ @apply border border-un-accent;
6
10
  &[aria-checked='true'],
7
11
  &[aria-checked='mixed'],
8
12
  &:checked {
9
- @apply bg-accentSurface accent-accentSurface border-accentSurface;
13
+ @apply bg-accent-surface accent-accent-surface border-accent-surface;
10
14
  }
11
15
 
12
16
  &:not([disabled]),
13
17
  &[disabled='false'] {
14
18
  &:hover {
15
- @apply bg-unAccentHover accent-unAccentHover;
19
+ @apply bg-un-accent-hover accent-un-accent-hover;
16
20
  &[aria-checked='true'],
17
21
  &[aria-checked='mixed'],
18
22
  &:checked {
19
- @apply bg-accentSurfaceHover accent-accentSurfaceHover border-accentSurfaceHover;
23
+ @apply bg-accent-surface-hover accent-accent-surface-hover border-accent-surface-hover;
20
24
  }
21
25
  }
22
26
  }
23
27
  }
24
28
 
25
29
  .dx-checkbox {
26
- @apply is-4 bs-4 overflow-hidden shadow-inner transition-colors bg-unAccent accent-unAccent text-accentSurfaceText shrink-0 inline-grid place-items-center rounded-sm;
30
+ @apply w-4 h-4 overflow-hidden shadow-inner transition-colors bg-un-accent accent-un-accent text-accent-surface-text shrink-0 inline-grid place-items-center rounded-xs;
27
31
  }
28
32
 
29
33
  /* TODO(ZaymonFC): Focus is handled by .dx-focus-ring, but should ideally be applied as part of this component.*/
30
34
  /* NOTE: This isn't compatible with the Radix switch. */
31
35
  .dx-checkbox--switch {
32
- @apply inline-block appearance-none relative shrink-0 bs-5 is-8;
33
- @apply shadow-inner transition-colors bg-unAccent;
36
+ @apply inline-block appearance-none relative shrink-0 h-5 w-8;
37
+ @apply shadow-inner transition-colors bg-un-accent;
34
38
  @apply cursor-pointer rounded-full;
35
39
 
36
40
  &::before {
37
- @apply is-3 bs-3 mli-[0.1875rem] mlb-[0.1875rem] absolute block bg-white rounded-full border-separator transition-transform duration-100 will-change-transform;
41
+ @apply w-3 h-3 mx-[0.1875rem] my-[0.1875rem] absolute block bg-white rounded-full border-separator transition-transform duration-100 will-change-transform;
38
42
  content: '';
39
43
  }
40
44