@dxos/ui-theme 0.8.4-staging.ac66bdf99f → 0.9.0
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.
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/index.mjs +89 -867
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +89 -867
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/plugin/node-cjs/main.css +252 -119
- package/dist/plugin/node-cjs/main.css.map +3 -3
- package/dist/plugin/node-cjs/meta.json +1 -1
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +82 -10
- package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +3 -3
- package/dist/plugin/node-esm/main.css +252 -119
- package/dist/plugin/node-esm/main.css.map +3 -3
- package/dist/plugin/node-esm/meta.json +1 -1
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +84 -12
- package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +3 -3
- package/dist/types/src/Theme.stories.d.ts.map +1 -1
- package/dist/types/src/defs.d.ts +1 -1
- package/dist/types/src/defs.d.ts.map +1 -1
- package/dist/types/src/fragments/density.d.ts +2 -2
- package/dist/types/src/fragments/density.d.ts.map +1 -1
- package/dist/types/src/fragments/hover.d.ts +0 -1
- package/dist/types/src/fragments/hover.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugins/ThemePlugin.d.ts +3 -2
- package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -1
- package/dist/types/src/util/hash-styles.d.ts +12 -2
- package/dist/types/src/util/hash-styles.d.ts.map +1 -1
- package/dist/types/src/util/mx.d.ts +0 -36
- package/dist/types/src/util/mx.d.ts.map +1 -1
- package/dist/types/src/util/size.d.ts.map +1 -1
- package/dist/types/src/util/valence.d.ts +8 -2
- package/dist/types/src/util/valence.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -21
- package/src/Theme.stories.tsx +94 -27
- package/src/css/DESIGN_SYSTEM.md +187 -0
- package/src/css/base/base.css +2 -2
- package/src/css/components/button.css +63 -13
- package/src/css/components/card.css +14 -0
- package/src/css/components/checkbox.css +3 -3
- package/src/css/components/focus.css +12 -12
- package/src/css/components/link.css +4 -1
- package/src/css/components/panel.css +45 -45
- package/src/css/components/state.css +99 -0
- package/src/css/components/state.md +101 -0
- package/src/css/components/surface.css +33 -11
- package/src/css/components/tag.css +25 -24
- package/src/css/integrations/codemirror.css +4 -3
- package/src/css/integrations/tldraw.css +1 -1
- package/src/css/layout/main.css +6 -0
- package/src/css/layout/size.css +16 -3
- package/src/css/theme/animation.css +31 -0
- package/src/css/theme/palette.css +34 -0
- package/src/css/theme/semantic.css +101 -60
- package/src/css/theme/spacing.css +29 -12
- package/src/css/theme/styles.css +172 -119
- package/src/css/utilities.css +42 -0
- package/src/defs.ts +3 -1
- package/src/fragments/AUDIT.md +0 -2
- package/src/fragments/density.ts +34 -7
- package/src/fragments/hover.ts +0 -2
- package/src/index.ts +1 -1
- package/src/main.css +68 -9
- package/src/plugins/ThemePlugin.ts +102 -14
- package/src/plugins/main.css +10 -7
- package/src/util/hash-styles.ts +54 -42
- package/src/util/mx.ts +1 -126
- package/src/util/valence.ts +15 -5
- package/dist/types/src/theme/components/avatar.d.ts +0 -21
- package/dist/types/src/theme/components/avatar.d.ts.map +0 -1
- package/dist/types/src/theme/components/breadcrumb.d.ts +0 -9
- package/dist/types/src/theme/components/breadcrumb.d.ts.map +0 -1
- package/dist/types/src/theme/components/button.d.ts +0 -15
- package/dist/types/src/theme/components/button.d.ts.map +0 -1
- package/dist/types/src/theme/components/card.d.ts +0 -12
- package/dist/types/src/theme/components/card.d.ts.map +0 -1
- package/dist/types/src/theme/components/dialog.d.ts +0 -17
- package/dist/types/src/theme/components/dialog.d.ts.map +0 -1
- package/dist/types/src/theme/components/focus.d.ts +0 -6
- package/dist/types/src/theme/components/focus.d.ts.map +0 -1
- package/dist/types/src/theme/components/icon-button.d.ts +0 -8
- package/dist/types/src/theme/components/icon-button.d.ts.map +0 -1
- package/dist/types/src/theme/components/icon.d.ts +0 -10
- package/dist/types/src/theme/components/icon.d.ts.map +0 -1
- package/dist/types/src/theme/components/index.d.ts +0 -27
- package/dist/types/src/theme/components/index.d.ts.map +0 -1
- package/dist/types/src/theme/components/input.d.ts +0 -115
- package/dist/types/src/theme/components/input.d.ts.map +0 -1
- package/dist/types/src/theme/components/link.d.ts +0 -7
- package/dist/types/src/theme/components/link.d.ts.map +0 -1
- package/dist/types/src/theme/components/list.d.ts +0 -14
- package/dist/types/src/theme/components/list.d.ts.map +0 -1
- package/dist/types/src/theme/components/main.d.ts +0 -28
- package/dist/types/src/theme/components/main.d.ts.map +0 -1
- package/dist/types/src/theme/components/menu.d.ts +0 -13
- package/dist/types/src/theme/components/menu.d.ts.map +0 -1
- package/dist/types/src/theme/components/message.d.ts +0 -12
- package/dist/types/src/theme/components/message.d.ts.map +0 -1
- package/dist/types/src/theme/components/popover.d.ts +0 -11
- package/dist/types/src/theme/components/popover.d.ts.map +0 -1
- package/dist/types/src/theme/components/scroll-area.d.ts +0 -32
- package/dist/types/src/theme/components/scroll-area.d.ts.map +0 -1
- package/dist/types/src/theme/components/select.d.ts +0 -13
- package/dist/types/src/theme/components/select.d.ts.map +0 -1
- package/dist/types/src/theme/components/separator.d.ts +0 -8
- package/dist/types/src/theme/components/separator.d.ts.map +0 -1
- package/dist/types/src/theme/components/skeleton.d.ts +0 -7
- package/dist/types/src/theme/components/skeleton.d.ts.map +0 -1
- package/dist/types/src/theme/components/splitter.d.ts +0 -4
- package/dist/types/src/theme/components/splitter.d.ts.map +0 -1
- package/dist/types/src/theme/components/status.d.ts +0 -9
- package/dist/types/src/theme/components/status.d.ts.map +0 -1
- package/dist/types/src/theme/components/tag.d.ts +0 -7
- package/dist/types/src/theme/components/tag.d.ts.map +0 -1
- package/dist/types/src/theme/components/toast.d.ts +0 -12
- package/dist/types/src/theme/components/toast.d.ts.map +0 -1
- package/dist/types/src/theme/components/toolbar.d.ts +0 -11
- package/dist/types/src/theme/components/toolbar.d.ts.map +0 -1
- package/dist/types/src/theme/components/tooltip.d.ts +0 -8
- package/dist/types/src/theme/components/tooltip.d.ts.map +0 -1
- package/dist/types/src/theme/components/treegrid.d.ts +0 -10
- package/dist/types/src/theme/components/treegrid.d.ts.map +0 -1
- package/dist/types/src/theme/index.d.ts +0 -4
- package/dist/types/src/theme/index.d.ts.map +0 -1
- package/dist/types/src/theme/primitives/column.d.ts +0 -29
- package/dist/types/src/theme/primitives/column.d.ts.map +0 -1
- package/dist/types/src/theme/primitives/index.d.ts +0 -3
- package/dist/types/src/theme/primitives/index.d.ts.map +0 -1
- package/dist/types/src/theme/primitives/panel.d.ts +0 -13
- package/dist/types/src/theme/primitives/panel.d.ts.map +0 -1
- package/dist/types/src/theme/theme.d.ts +0 -5
- package/dist/types/src/theme/theme.d.ts.map +0 -1
- package/src/css/components/selected.css +0 -30
- package/src/theme/components/avatar.ts +0 -95
- package/src/theme/components/breadcrumb.ts +0 -29
- package/src/theme/components/button.ts +0 -48
- package/src/theme/components/card.ts +0 -102
- package/src/theme/components/dialog.ts +0 -61
- package/src/theme/components/focus.ts +0 -33
- package/src/theme/components/icon-button.ts +0 -18
- package/src/theme/components/icon.ts +0 -28
- package/src/theme/components/index.ts +0 -30
- package/src/theme/components/input.ts +0 -171
- package/src/theme/components/link.ts +0 -25
- package/src/theme/components/list.ts +0 -46
- package/src/theme/components/main.ts +0 -34
- package/src/theme/components/menu.ts +0 -50
- package/src/theme/components/message.ts +0 -40
- package/src/theme/components/popover.ts +0 -41
- package/src/theme/components/scroll-area.ts +0 -115
- package/src/theme/components/select.ts +0 -52
- package/src/theme/components/separator.ts +0 -24
- package/src/theme/components/skeleton.ts +0 -23
- package/src/theme/components/splitter.ts +0 -20
- package/src/theme/components/status.ts +0 -32
- package/src/theme/components/tag.ts +0 -23
- package/src/theme/components/toast.ts +0 -53
- package/src/theme/components/toolbar.ts +0 -35
- package/src/theme/components/tooltip.ts +0 -27
- package/src/theme/components/treegrid.ts +0 -37
- package/src/theme/index.ts +0 -7
- package/src/theme/primitives/column.ts +0 -71
- package/src/theme/primitives/index.ts +0 -6
- package/src/theme/primitives/panel.ts +0 -43
- package/src/theme/theme.ts +0 -87
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/plugins/ThemePlugin.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/plugins/ThemePlugin.ts":{"bytes":28566,"imports":[{"path":"@tailwindcss/postcss","kind":"import-statement","external":true},{"path":"@tailwindcss/vite","kind":"import-statement","external":true},{"path":"autoprefixer","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"postcss-import","kind":"import-statement","external":true},{"path":"postcss-nesting","kind":"import-statement","external":true}],"format":"esm"},"src/css/theme/animation.css":{"bytes":4993,"imports":[]},"src/css/theme/border.css":{"bytes":623,"imports":[]},"src/css/theme/palette.css":{"bytes":3716,"imports":[]},"src/css/theme/semantic.css":{"bytes":7871,"imports":[]},"src/css/theme/spacing.css":{"bytes":4559,"imports":[]},"src/css/theme/styles.css":{"bytes":8508,"imports":[]},"src/css/theme/text.css":{"bytes":1008,"imports":[]},"src/css/base/base.css":{"bytes":828,"imports":[]},"src/css/base/typography.css":{"bytes":3219,"imports":[{"path":"@fontsource-variable/jetbrains-mono/wght-italic.css","kind":"import-rule","external":true},{"path":"@fontsource-variable/jetbrains-mono/wght.css","kind":"import-rule","external":true},{"path":"@fontsource/poiret-one","kind":"import-rule","external":true}]},"src/css/components/button.css":{"bytes":4188,"imports":[]},"src/css/components/card.css":{"bytes":663,"imports":[]},"src/css/components/checkbox.css":{"bytes":1622,"imports":[]},"src/css/components/dialog.css":{"bytes":1597,"imports":[]},"src/css/components/focus.css":{"bytes":5359,"imports":[]},"src/css/components/icon.css":{"bytes":109,"imports":[]},"src/css/components/panel.css":{"bytes":2965,"imports":[]},"src/css/components/link.css":{"bytes":230,"imports":[]},"src/css/components/scrollbar.css":{"bytes":524,"imports":[]},"src/css/components/state.css":{"bytes":4273,"imports":[]},"src/css/components/surface.css":{"bytes":1778,"imports":[]},"src/css/components/tag.css":{"bytes":2725,"imports":[]},"src/css/components/text.css":{"bytes":1996,"imports":[]},"src/css/layout/main.css":{"bytes":6819,"imports":[]},"src/css/layout/native.css":{"bytes":496,"imports":[]},"src/css/layout/positioning.css":{"bytes":322,"imports":[]},"src/css/layout/size.css":{"bytes":6881,"imports":[]},"src/css/utilities.css":{"bytes":3909,"imports":[]},"src/css/integrations/codemirror.css":{"bytes":1851,"imports":[]},"src/css/integrations/tldraw.css":{"bytes":326,"imports":[]},"src/main.css":{"bytes":6005,"imports":[{"path":"tailwindcss","kind":"import-rule","external":true},{"path":"src/css/theme/animation.css","kind":"import-rule","original":"./css/theme/animation.css"},{"path":"src/css/theme/border.css","kind":"import-rule","original":"./css/theme/border.css"},{"path":"src/css/theme/palette.css","kind":"import-rule","original":"./css/theme/palette.css"},{"path":"src/css/theme/semantic.css","kind":"import-rule","original":"./css/theme/semantic.css"},{"path":"src/css/theme/spacing.css","kind":"import-rule","original":"./css/theme/spacing.css"},{"path":"src/css/theme/styles.css","kind":"import-rule","original":"./css/theme/styles.css"},{"path":"src/css/theme/text.css","kind":"import-rule","original":"./css/theme/text.css"},{"path":"src/css/base/base.css","kind":"import-rule","original":"./css/base/base.css"},{"path":"src/css/base/typography.css","kind":"import-rule","original":"./css/base/typography.css"},{"path":"src/css/components/button.css","kind":"import-rule","original":"./css/components/button.css"},{"path":"src/css/components/card.css","kind":"import-rule","original":"./css/components/card.css"},{"path":"src/css/components/checkbox.css","kind":"import-rule","original":"./css/components/checkbox.css"},{"path":"src/css/components/dialog.css","kind":"import-rule","original":"./css/components/dialog.css"},{"path":"src/css/components/focus.css","kind":"import-rule","original":"./css/components/focus.css"},{"path":"src/css/components/icon.css","kind":"import-rule","original":"./css/components/icon.css"},{"path":"src/css/components/panel.css","kind":"import-rule","original":"./css/components/panel.css"},{"path":"src/css/components/link.css","kind":"import-rule","original":"./css/components/link.css"},{"path":"src/css/components/scrollbar.css","kind":"import-rule","original":"./css/components/scrollbar.css"},{"path":"src/css/components/state.css","kind":"import-rule","original":"./css/components/state.css"},{"path":"src/css/components/surface.css","kind":"import-rule","original":"./css/components/surface.css"},{"path":"src/css/components/tag.css","kind":"import-rule","original":"./css/components/tag.css"},{"path":"src/css/components/text.css","kind":"import-rule","original":"./css/components/text.css"},{"path":"src/css/layout/main.css","kind":"import-rule","original":"./css/layout/main.css"},{"path":"src/css/layout/native.css","kind":"import-rule","original":"./css/layout/native.css"},{"path":"src/css/layout/positioning.css","kind":"import-rule","original":"./css/layout/positioning.css"},{"path":"src/css/layout/size.css","kind":"import-rule","original":"./css/layout/size.css"},{"path":"src/css/utilities.css","kind":"import-rule","original":"./css/utilities.css"},{"path":"src/css/integrations/codemirror.css","kind":"import-rule","original":"./css/integrations/codemirror.css"},{"path":"src/css/integrations/tldraw.css","kind":"import-rule","original":"./css/integrations/tldraw.css"}]}},"outputs":{"dist/plugin/node-esm/plugins/ThemePlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":12590},"dist/plugin/node-esm/plugins/ThemePlugin.mjs":{"imports":[{"path":"@tailwindcss/postcss","kind":"import-statement","external":true},{"path":"@tailwindcss/vite","kind":"import-statement","external":true},{"path":"autoprefixer","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"postcss-import","kind":"import-statement","external":true},{"path":"postcss-nesting","kind":"import-statement","external":true}],"exports":["LAYER_ORDER","ThemePlugin"],"entryPoint":"src/plugins/ThemePlugin.ts","inputs":{"src/plugins/ThemePlugin.ts":{"bytesInOutput":6683}},"bytes":6888},"dist/plugin/node-esm/main.css.map":{"imports":[],"exports":[],"inputs":{},"bytes":136387},"dist/plugin/node-esm/main.css":{"imports":[{"path":"tailwindcss","kind":"import-rule","external":true},{"path":"@fontsource-variable/jetbrains-mono/wght-italic.css","kind":"import-rule","external":true},{"path":"@fontsource-variable/jetbrains-mono/wght.css","kind":"import-rule","external":true},{"path":"@fontsource/poiret-one","kind":"import-rule","external":true}],"entryPoint":"src/main.css","inputs":{"src/css/theme/animation.css":{"bytesInOutput":3508},"src/css/theme/border.css":{"bytesInOutput":450},"src/css/theme/palette.css":{"bytesInOutput":2713},"src/css/theme/semantic.css":{"bytesInOutput":5845},"src/css/theme/spacing.css":{"bytesInOutput":3635},"src/css/theme/styles.css":{"bytesInOutput":7242},"src/css/theme/text.css":{"bytesInOutput":841},"src/css/base/base.css":{"bytesInOutput":784},"src/css/base/typography.css":{"bytesInOutput":2742},"src/css/components/button.css":{"bytesInOutput":2995},"src/css/components/card.css":{"bytesInOutput":116},"src/css/components/checkbox.css":{"bytesInOutput":1296},"src/css/components/dialog.css":{"bytesInOutput":1550},"src/css/components/focus.css":{"bytesInOutput":5252},"src/css/components/icon.css":{"bytesInOutput":91},"src/css/components/panel.css":{"bytesInOutput":2641},"src/css/components/link.css":{"bytesInOutput":195},"src/css/components/scrollbar.css":{"bytesInOutput":451},"src/css/components/state.css":{"bytesInOutput":2057},"src/css/components/surface.css":{"bytesInOutput":1151},"src/css/components/tag.css":{"bytesInOutput":2456},"src/css/components/text.css":{"bytesInOutput":1794},"src/css/layout/main.css":{"bytesInOutput":6525},"src/css/layout/native.css":{"bytesInOutput":215},"src/css/layout/positioning.css":{"bytesInOutput":297},"src/css/layout/size.css":{"bytesInOutput":5804},"src/css/utilities.css":{"bytesInOutput":1154},"src/css/integrations/codemirror.css":{"bytesInOutput":1382},"src/css/integrations/tldraw.css":{"bytesInOutput":271},"src/main.css":{"bytesInOutput":1522}},"bytes":68358}}}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// src/plugins/ThemePlugin.ts
|
|
4
|
-
import
|
|
4
|
+
import tailwindcssPostcss from "@tailwindcss/postcss";
|
|
5
|
+
import tailwindcssVite from "@tailwindcss/vite";
|
|
5
6
|
import autoprefixer from "autoprefixer";
|
|
6
7
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
|
-
import {
|
|
8
|
+
import { resolve } from "node:path";
|
|
8
9
|
import postcssImport from "postcss-import";
|
|
9
10
|
import postcssNesting from "postcss-nesting";
|
|
10
11
|
var LAYER_ORDER = [
|
|
@@ -29,18 +30,65 @@ var ThemePlugin = (options) => {
|
|
|
29
30
|
const darkModeScriptPath = resolve(pluginsDir, "dark-mode.ts");
|
|
30
31
|
const mainCssPath = resolve(pluginsDir, "main.css");
|
|
31
32
|
const config = {
|
|
32
|
-
srcCssPath: isMonorepo ? srcThemePath : distThemePath,
|
|
33
|
-
virtualFileId: "@dxos-theme",
|
|
34
|
-
|
|
33
|
+
srcCssPath: options.srcCssPath ?? (isMonorepo ? srcThemePath : distThemePath),
|
|
34
|
+
virtualFileId: options.virtualFileId ?? "@dxos-theme",
|
|
35
|
+
verbose: options.verbose
|
|
35
36
|
};
|
|
36
|
-
const base = isMonorepo ? resolve(dirname(srcThemePath), ROOT) : void 0;
|
|
37
37
|
if (process.env.DEBUG || options.verbose) {
|
|
38
38
|
console.log("ThemePlugin:\n", JSON.stringify(config, null, 2));
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
let themeReloadTimer;
|
|
41
|
+
const themePlugin = {
|
|
41
42
|
name: "vite-plugin-dxos-ui-theme",
|
|
42
43
|
config: () => {
|
|
43
44
|
return {
|
|
45
|
+
server: {
|
|
46
|
+
watch: {
|
|
47
|
+
// Stop build outputs from driving HMR — they are the root of the
|
|
48
|
+
// `main.css` HMR storm.
|
|
49
|
+
//
|
|
50
|
+
// Tailwind's `@source` scanning (see `src/main.css`) registers its
|
|
51
|
+
// scanned source files as Vite watch dependencies of the compiled
|
|
52
|
+
// theme CSS. Tailwind's own scanner respects `.gitignore` (and the
|
|
53
|
+
// `@source not` directives), so it never *scans* `dist/`. BUT the
|
|
54
|
+
// scanner hands Vite a coarse `dir-dependency` glob — e.g.
|
|
55
|
+
// `{**/*.html,**/*.ts,**/*.tsx}` — and Vite re-expands that glob
|
|
56
|
+
// itself, ignoring only `node_modules` (not `.gitignore`, not the
|
|
57
|
+
// `@source not` negations). The re-expansion therefore sweeps in
|
|
58
|
+
// every `packages/*/dist/**/*.d.ts` (`.d.ts` matches `**/*.ts`),
|
|
59
|
+
// making each emitted declaration file a watch-dependency of
|
|
60
|
+
// `main.css`. A single package rebuild emits dozens of `.d.ts` in a
|
|
61
|
+
// tight burst, and each write re-invalidates the theme — 40+ HMR
|
|
62
|
+
// pings for `main.css` in one second, repeating on every rebuild.
|
|
63
|
+
//
|
|
64
|
+
// Ignoring build outputs in the watcher is also semantically
|
|
65
|
+
// correct: in dev the workspace resolves `@dxos/*` via the `source`
|
|
66
|
+
// export condition (see `vite-plugin-import-source`), so `dist/`
|
|
67
|
+
// is never consumed at runtime and its churn should never trigger
|
|
68
|
+
// HMR. Vite concatenates these patterns with its built-in ignores
|
|
69
|
+
// (`**/node_modules/**`, `**/.git/**`, …), so this is purely
|
|
70
|
+
// additive.
|
|
71
|
+
//
|
|
72
|
+
// `<root>/.claude/**` covers agent worktrees checked out under the
|
|
73
|
+
// repo root (`.claude/worktrees/<name>/packages/**`): they are full
|
|
74
|
+
// source copies, so the glob re-expansion above sweeps them in and
|
|
75
|
+
// every agent-side edit burst or checkout invalidates the theme in
|
|
76
|
+
// the user's dev server. The pattern is anchored at the resolved
|
|
77
|
+
// repo root (not `**/.claude/**`) because chokidar matches against
|
|
78
|
+
// absolute paths — a bare pattern would match *everything* when the
|
|
79
|
+
// dev server itself runs from inside a worktree whose path contains
|
|
80
|
+
// a `.claude` segment. `*.log` covers runtime log sinks (e.g.
|
|
81
|
+
// vite-plugin-log's `app.log` in the app root), which are appended
|
|
82
|
+
// continuously at runtime and must never feed back into the
|
|
83
|
+
// watcher.
|
|
84
|
+
ignored: [
|
|
85
|
+
"**/dist/**",
|
|
86
|
+
"**/out/**",
|
|
87
|
+
"**/*.log",
|
|
88
|
+
`${resolve(import.meta.dirname, ROOT, ".claude")}/**`
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
},
|
|
44
92
|
css: {
|
|
45
93
|
postcss: {
|
|
46
94
|
plugins: [
|
|
@@ -48,11 +96,11 @@ var ThemePlugin = (options) => {
|
|
|
48
96
|
postcssImport(),
|
|
49
97
|
// Processes CSS nesting syntax.
|
|
50
98
|
postcssNesting(),
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
99
|
+
// Resolves @reference/@apply in `.pcss` files (e.g. lit-grid, lit-ui), which the
|
|
100
|
+
// @tailwindcss/vite plugin skips — its transform filter only matches `.css`.
|
|
101
|
+
// Theme `.css` files are compiled by @tailwindcss/vite first (enforce: 'pre'),
|
|
102
|
+
// so this plugin's quick-bail check passes them through untouched.
|
|
103
|
+
tailwindcssPostcss(),
|
|
56
104
|
// Adds vendor prefixes.
|
|
57
105
|
autoprefixer
|
|
58
106
|
]
|
|
@@ -65,6 +113,26 @@ var ThemePlugin = (options) => {
|
|
|
65
113
|
return config.srcCssPath;
|
|
66
114
|
}
|
|
67
115
|
},
|
|
116
|
+
hotUpdate({ type, file, modules }) {
|
|
117
|
+
if (this.environment.name !== "client" || type !== "update" || file.endsWith(".css")) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const isThemeDep = (mod) => mod.file === config.srcCssPath || mod.id === null && mod.importers.size > 0 && [
|
|
121
|
+
...mod.importers
|
|
122
|
+
].every((importer) => importer.file === config.srcCssPath);
|
|
123
|
+
if (!modules.some(isThemeDep)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const environment = this.environment;
|
|
127
|
+
clearTimeout(themeReloadTimer);
|
|
128
|
+
themeReloadTimer = setTimeout(() => {
|
|
129
|
+
for (const mod of environment.moduleGraph.getModulesByFile(config.srcCssPath) ?? []) {
|
|
130
|
+
environment.reloadModule(mod).catch(() => {
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}, 300);
|
|
134
|
+
return modules.filter((mod) => !isThemeDep(mod));
|
|
135
|
+
},
|
|
68
136
|
transformIndexHtml: () => {
|
|
69
137
|
const darkModeTag = {
|
|
70
138
|
tag: "script",
|
|
@@ -97,6 +165,10 @@ var ThemePlugin = (options) => {
|
|
|
97
165
|
];
|
|
98
166
|
}
|
|
99
167
|
};
|
|
168
|
+
return [
|
|
169
|
+
...tailwindcssVite(),
|
|
170
|
+
themePlugin
|
|
171
|
+
];
|
|
100
172
|
};
|
|
101
173
|
export {
|
|
102
174
|
LAYER_ORDER,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/plugins/ThemePlugin.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport
|
|
5
|
-
"mappings": ";;;AAMA,OAAOA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\n/* eslint-disable no-console */\n\nimport tailwindcssPostcss from '@tailwindcss/postcss';\nimport tailwindcssVite from '@tailwindcss/vite';\nimport autoprefixer from 'autoprefixer';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport postcssImport from 'postcss-import';\nimport postcssNesting from 'postcss-nesting';\nimport { type HtmlTagDescriptor, type Plugin, type UserConfig } from 'vite';\n\n/**\n * CSS cascade layer order.\n * Must be established before any stylesheets load so that Tailwind's own @layer declarations don't override our ordering. Exported so consuming\n */\nexport const LAYER_ORDER = [\n 'properties',\n 'theme',\n 'dx-tokens',\n 'user-tokens',\n 'base',\n 'tw-base',\n 'dx-base',\n 'components',\n 'tw-components',\n 'dx-components',\n 'utilities',\n] as const;\n\nconst ROOT = '../../../../';\n\nexport type ThemePluginOptions = {\n srcCssPath?: string;\n virtualFileId?: string;\n verbose?: boolean;\n};\n\n/**\n * Vite plugin to configure theme.\n * Returns the official Tailwind Vite plugin (persistent incremental scanner) alongside the theme plugin.\n */\nexport const ThemePlugin = (options: ThemePluginOptions): Plugin[] => {\n // Prefer source CSS if available (monorepo dev), fall back to dist for installed package.\n const srcThemePath = resolve(import.meta.dirname, ROOT, 'src/main.css');\n const distThemePath = resolve(import.meta.dirname, '../main.css');\n const isMonorepo = existsSync(srcThemePath);\n\n // Static assets shipped via \"files\": [\"src\"] in package.json.\n // Both monorepo and installed package resolve to the same src/plugins/ directory.\n const pluginsDir = resolve(import.meta.dirname, ROOT, 'src/plugins');\n const darkModeScriptPath = resolve(pluginsDir, 'dark-mode.ts');\n const mainCssPath = resolve(pluginsDir, 'main.css');\n\n const config = {\n srcCssPath: options.srcCssPath ?? (isMonorepo ? srcThemePath : distThemePath),\n virtualFileId: options.virtualFileId ?? '@dxos-theme',\n verbose: options.verbose,\n };\n\n if (process.env.DEBUG || options.verbose) {\n console.log('ThemePlugin:\\n', JSON.stringify(config, null, 2));\n }\n\n // Trailing-edge debounce handle for theme CSS reloads (see `handleHotUpdate`).\n let themeReloadTimer: ReturnType<typeof setTimeout> | undefined;\n\n const themePlugin: Plugin = {\n name: 'vite-plugin-dxos-ui-theme',\n config: (): UserConfig => {\n return {\n server: {\n watch: {\n // Stop build outputs from driving HMR — they are the root of the\n // `main.css` HMR storm.\n //\n // Tailwind's `@source` scanning (see `src/main.css`) registers its\n // scanned source files as Vite watch dependencies of the compiled\n // theme CSS. Tailwind's own scanner respects `.gitignore` (and the\n // `@source not` directives), so it never *scans* `dist/`. BUT the\n // scanner hands Vite a coarse `dir-dependency` glob — e.g.\n // `{**/*.html,**/*.ts,**/*.tsx}` — and Vite re-expands that glob\n // itself, ignoring only `node_modules` (not `.gitignore`, not the\n // `@source not` negations). The re-expansion therefore sweeps in\n // every `packages/*/dist/**/*.d.ts` (`.d.ts` matches `**/*.ts`),\n // making each emitted declaration file a watch-dependency of\n // `main.css`. A single package rebuild emits dozens of `.d.ts` in a\n // tight burst, and each write re-invalidates the theme — 40+ HMR\n // pings for `main.css` in one second, repeating on every rebuild.\n //\n // Ignoring build outputs in the watcher is also semantically\n // correct: in dev the workspace resolves `@dxos/*` via the `source`\n // export condition (see `vite-plugin-import-source`), so `dist/`\n // is never consumed at runtime and its churn should never trigger\n // HMR. Vite concatenates these patterns with its built-in ignores\n // (`**/node_modules/**`, `**/.git/**`, …), so this is purely\n // additive.\n //\n // `<root>/.claude/**` covers agent worktrees checked out under the\n // repo root (`.claude/worktrees/<name>/packages/**`): they are full\n // source copies, so the glob re-expansion above sweeps them in and\n // every agent-side edit burst or checkout invalidates the theme in\n // the user's dev server. The pattern is anchored at the resolved\n // repo root (not `**/.claude/**`) because chokidar matches against\n // absolute paths — a bare pattern would match *everything* when the\n // dev server itself runs from inside a worktree whose path contains\n // a `.claude` segment. `*.log` covers runtime log sinks (e.g.\n // vite-plugin-log's `app.log` in the app root), which are appended\n // continuously at runtime and must never feed back into the\n // watcher.\n ignored: ['**/dist/**', '**/out/**', '**/*.log', `${resolve(import.meta.dirname, ROOT, '.claude')}/**`],\n },\n },\n css: {\n postcss: {\n plugins: [\n // Handles @import statements in CSS.\n postcssImport(),\n // Processes CSS nesting syntax.\n postcssNesting(),\n // Resolves @reference/@apply in `.pcss` files (e.g. lit-grid, lit-ui), which the\n // @tailwindcss/vite plugin skips — its transform filter only matches `.css`.\n // Theme `.css` files are compiled by @tailwindcss/vite first (enforce: 'pre'),\n // so this plugin's quick-bail check passes them through untouched.\n tailwindcssPostcss(),\n // Adds vendor prefixes.\n autoprefixer,\n ],\n },\n },\n };\n },\n resolveId: (id) => {\n if (id === config.virtualFileId) {\n return config.srcCssPath;\n }\n },\n hotUpdate({ type, file, modules }) {\n // Direct edits to CSS (the theme source or its imports) keep Vite's\n // default immediate update for instant feedback while authoring styles.\n if (this.environment.name !== 'client' || type !== 'update' || file.endsWith('.css')) {\n return;\n }\n\n // Every content file Tailwind scans is registered as a dependency of the\n // theme CSS — Vite models it as a file-only entry node whose importer is\n // `main.css` — so each source-file save invalidates `main.css` and\n // re-runs the monorepo-wide Tailwind scan. During an edit wave that\n // serializes one full scan per save. Drop the theme-dep entries from the\n // update (the changed module itself still hot-updates immediately) and\n // reload the theme CSS once on the trailing edge of a quiet window, so a\n // wave costs at most one scan.\n const isThemeDep = (mod: (typeof modules)[number]): boolean =>\n mod.file === config.srcCssPath ||\n (mod.id === null &&\n mod.importers.size > 0 &&\n [...mod.importers].every((importer) => importer.file === config.srcCssPath));\n if (!modules.some(isThemeDep)) {\n return;\n }\n\n const environment = this.environment;\n clearTimeout(themeReloadTimer);\n themeReloadTimer = setTimeout(() => {\n for (const mod of environment.moduleGraph.getModulesByFile(config.srcCssPath) ?? []) {\n environment.reloadModule(mod).catch(() => {\n // Server may be mid-restart; the next edit reschedules the reload.\n });\n }\n }, 300);\n\n return modules.filter((mod) => !isThemeDep(mod));\n },\n transformIndexHtml: () => {\n // Apply .dark class to <html> synchronously before any scripts run, so that\n // the critical CSS html.dark rules apply on the very first paint.\n const darkModeTag: HtmlTagDescriptor = {\n tag: 'script',\n attrs: { 'data-dxos-theme': '' },\n injectTo: 'head-prepend',\n children: readFileSync(darkModeScriptPath, 'utf-8'),\n };\n\n // Establish cascade layer order before any stylesheet loads.\n const layersTag: HtmlTagDescriptor = {\n tag: 'style',\n attrs: { 'data-dxos-layers': '' },\n children: `@layer ${LAYER_ORDER.join(', ')};`,\n injectTo: 'head-prepend',\n };\n\n // Critical styles: font sizing, overscroll, color fallbacks.\n // Loaded from critical.css to keep styles maintainable and out of index.html.\n const criticalTag: HtmlTagDescriptor = {\n tag: 'style',\n attrs: { 'data-dxos-critical': '' },\n injectTo: 'head-prepend',\n children: readFileSync(mainCssPath, 'utf-8'),\n };\n\n return [darkModeTag, layersTag, criticalTag];\n },\n };\n\n // The Tailwind Vite plugins are `enforce: 'pre'`, so they compile theme CSS (resolving\n // `@import 'tailwindcss'`, @source, @plugin, @theme) before the postcss chain runs —\n // postcss-import never sees the raw Tailwind directives. Scan roots come from the @source\n // directives in main.css (relative to that file); no project-root base is needed.\n return [...tailwindcssVite(), themePlugin];\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["tailwindcssPostcss", "tailwindcssVite", "autoprefixer", "existsSync", "readFileSync", "resolve", "postcssImport", "postcssNesting", "LAYER_ORDER", "ROOT", "ThemePlugin", "options", "srcThemePath", "dirname", "distThemePath", "isMonorepo", "pluginsDir", "darkModeScriptPath", "mainCssPath", "config", "srcCssPath", "virtualFileId", "verbose", "process", "env", "DEBUG", "console", "log", "JSON", "stringify", "themeReloadTimer", "themePlugin", "name", "server", "watch", "ignored", "css", "postcss", "plugins", "resolveId", "id", "hotUpdate", "type", "file", "modules", "environment", "endsWith", "isThemeDep", "mod", "importers", "size", "every", "importer", "some", "clearTimeout", "setTimeout", "moduleGraph", "getModulesByFile", "reloadModule", "catch", "filter", "transformIndexHtml", "darkModeTag", "tag", "attrs", "injectTo", "children", "layersTag", "join", "criticalTag"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.stories.d.ts","sourceRoot":"","sources":["../../../src/Theme.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"Theme.stories.d.ts","sourceRoot":"","sources":["../../../src/Theme.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA4C,MAAM,OAAO,CAAC;AA4FjE,QAAA,MAAM,IAAI;;;QAGN,MAAM;;CAEM,CAAC;eAEF,IAAI;AAEnB,eAAO,MAAM,MAAM;IACjB,MAAM;CAWP,CAAC;AAEF,eAAO,MAAM,MAAM;IACjB,MAAM;CAWP,CAAC;AAEF,eAAO,MAAM,OAAO;IAClB,MAAM;CAoBP,CAAC;AAyCF,eAAO,MAAM,QAAQ;IACnB,MAAM;CA+CP,CAAC;AAEF,eAAO,MAAM,IAAI;IACf,MAAM;CAsBP,CAAC;AAEF,eAAO,MAAM,SAAS;IACpB,MAAM;CAkBP,CAAC"}
|
package/dist/types/src/defs.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const osTranslations = "org.dxos.i18n.os";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const hues: ChromaticPalette[];
|
|
10
10
|
export declare const hueShades: readonly [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
11
|
-
export declare const roles: readonly [
|
|
11
|
+
export declare const roles: readonly ['fill', 'surface', 'foreground', 'text', 'border'];
|
|
12
12
|
/**
|
|
13
13
|
* Card size constants (Tailwind spacing units).
|
|
14
14
|
* Cards should be no larger than 320px per WCAG 2.1 SC 1.4.10.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../src/defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,IAAI,EAAE,gBAAgB,EAkBzB,CAAC;AAEX,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../src/defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,IAAI,EAAE,gBAAgB,EAkBzB,CAAC;AAEX,eAAO,MAAM,SAAS,YAAI,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAIzF,eAAO,MAAM,KAAK,YAAI,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAElF;;;GAGG;AAEH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,gBAAgB,KAAK,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Density } from '@dxos/ui-types';
|
|
2
|
-
export declare const densityDimensions: (density?: Density) => "min-h-[2.5rem] pointer-fine:min-h-[2rem] px-2" | "min-h-[2.5rem] px-3";
|
|
3
|
-
export declare const densityBlockSize: (density?: Density) => "min-h-[
|
|
2
|
+
export declare const densityDimensions: (density?: Density) => "min-h-[1.5rem] px-1" | "min-h-[1.75rem] px-1.5" | "min-h-[2.5rem] pointer-fine:min-h-[2rem] px-2" | "min-h-[2.5rem] px-3";
|
|
3
|
+
export declare const densityBlockSize: (density?: Density) => "min-h-[1.5rem]" | "min-h-[1.75rem]" | "min-h-[2.5rem]" | "min-h-[2.5rem] pointer-fine:min-h-[2rem]";
|
|
4
4
|
//# sourceMappingURL=density.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"density.d.ts","sourceRoot":"","sources":["../../../../src/fragments/density.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"density.d.ts","sourceRoot":"","sources":["../../../../src/fragments/density.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAY9C,eAAO,MAAM,iBAAiB,aAAa,OAAO,+HAYjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAa,OAAO,yGAYhD,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const subtleHover = "hover:bg-hover-overlay";
|
|
2
1
|
export declare const ghostHover = "hover:bg-hover-surface";
|
|
3
2
|
export declare const ghostFocusWithin = "focus-within:bg-hover-surface";
|
|
4
3
|
export declare const hoverableControls = "[--controls-opacity:1] hover-hover:[--controls-opacity:0] hover-hover:hover:[--controls-opacity:1]";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../../src/fragments/hover.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../../src/fragments/hover.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,2BAA2B,CAAC;AACnD,eAAO,MAAM,gBAAgB,kCAAkC,CAAC;AAEhE,eAAO,MAAM,iBAAiB,uGACwE,CAAC;AAEvG,eAAO,MAAM,mCAAmC,sEAAsE,CAAC;AAEvH,eAAO,MAAM,gCAAgC,yCAAyC,CAAC;AACvF,eAAO,MAAM,8BAA8B,wCAAwC,CAAC;AACpF,eAAO,MAAM,wBAAwB,4DAA4D,CAAC;AAClG,eAAO,MAAM,oBAAoB,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAE5B,cAAc,QAAQ,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { type Plugin } from 'vite';
|
|
|
3
3
|
* CSS cascade layer order.
|
|
4
4
|
* Must be established before any stylesheets load so that Tailwind's own @layer declarations don't override our ordering. Exported so consuming
|
|
5
5
|
*/
|
|
6
|
-
export declare const LAYER_ORDER: readonly [
|
|
6
|
+
export declare const LAYER_ORDER: readonly ['properties', 'theme', 'dx-tokens', 'user-tokens', 'base', 'tw-base', 'dx-base', 'components', 'tw-components', 'dx-components', 'utilities'];
|
|
7
7
|
export type ThemePluginOptions = {
|
|
8
8
|
srcCssPath?: string;
|
|
9
9
|
virtualFileId?: string;
|
|
@@ -11,6 +11,7 @@ export type ThemePluginOptions = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Vite plugin to configure theme.
|
|
14
|
+
* Returns the official Tailwind Vite plugin (persistent incremental scanner) alongside the theme plugin.
|
|
14
15
|
*/
|
|
15
|
-
export declare const ThemePlugin: (options: ThemePluginOptions) => Plugin;
|
|
16
|
+
export declare const ThemePlugin: (options: ThemePluginOptions) => Plugin[];
|
|
16
17
|
//# sourceMappingURL=ThemePlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemePlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ThemePlugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemePlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/ThemePlugin.ts"],"names":[],"mappings":"AAaA,OAAO,EAA0B,KAAK,MAAM,EAAmB,MAAM,MAAM,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,WAAW,YACtB,YAAY,EACZ,OAAO,EACP,WAAW,EACX,aAAa,EACb,MAAM,EACN,SAAS,EACT,SAAS,EACT,YAAY,EACZ,eAAe,EACf,eAAe,EACf,WAAW,CACH,CAAC;AAIX,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAa,kBAAkB,KAAG,MAAM,EAuK/D,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type ChromaticPalette } from '@dxos/ui-types';
|
|
2
2
|
export type Hue = ChromaticPalette | 'neutral';
|
|
3
|
+
/**
|
|
4
|
+
* See theme.css
|
|
5
|
+
*/
|
|
3
6
|
export type ColorStyles = {
|
|
4
7
|
hue: Hue;
|
|
5
|
-
|
|
8
|
+
bg: string;
|
|
6
9
|
surface: string;
|
|
7
|
-
|
|
10
|
+
fg: string;
|
|
8
11
|
text: string;
|
|
9
12
|
border: string;
|
|
10
13
|
};
|
|
@@ -12,6 +15,13 @@ export declare const palette: {
|
|
|
12
15
|
neutral: ColorStyles;
|
|
13
16
|
hues: ColorStyles[];
|
|
14
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Normalise an arbitrary string into a known `Hue`, falling back to `'neutral'` when the
|
|
20
|
+
* input doesn't match one of the catalogued palette entries. Useful when accepting hue
|
|
21
|
+
* values from user-authored data (e.g. ECHO objects, plugin settings) that need to be
|
|
22
|
+
* forwarded to a hue-keyed prop like `Tag`'s `palette`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const toHue: (hue: string | undefined) => Hue;
|
|
15
25
|
export declare const getStyles: (hue: string) => ColorStyles;
|
|
16
26
|
export declare const getHashStyles: (id: string | undefined) => ColorStyles;
|
|
17
27
|
export declare const getHashHue: (id: string | undefined) => Hue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash-styles.d.ts","sourceRoot":"","sources":["../../../../src/util/hash-styles.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,MAAM,GAAG,GAAG,gBAAgB,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"hash-styles.d.ts","sourceRoot":"","sources":["../../../../src/util/hash-styles.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,MAAM,GAAG,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,GAAG,CAAC;IACT,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwJF,eAAO,MAAM,OAAO;;;CAGnB,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,QAAS,MAAM,GAAG,SAAS,KAAG,GAAoE,CAAC;AAGrH,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,WAEvC,CAAC;AAGF,eAAO,MAAM,aAAa,OAAQ,MAAM,GAAG,SAAS,KAAG,WAEtD,CAAC;AAEF,eAAO,MAAM,UAAU,OAAQ,MAAM,GAAG,SAAS,KAAG,GAEnD,CAAC"}
|
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
import { type ForwardRefExoticComponent, type ForwardedRef, type HTMLAttributes, type ReactNode, type RefAttributes, CSSProperties } from 'react';
|
|
2
|
-
import { ThemedClassName, type ComposableProps, type SlottableProps } from '@dxos/ui-types';
|
|
3
1
|
export declare const mx: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
|
|
4
|
-
/**
|
|
5
|
-
* Reconciles className properties from a parent slot.
|
|
6
|
-
* - `className` is set by the Slot merge mechanism.
|
|
7
|
-
* - `classNames` is the consumer-facing prop for theming overrides.
|
|
8
|
-
* Use `composableProps` to reconcile both into a single `className`.
|
|
9
|
-
*/
|
|
10
|
-
export declare const composableProps: <P extends HTMLElement = HTMLElement>({ className, classNames, role, style, ...props }: ComposableProps, { classNames: defaultClassNames, ...defaults }?: ThemedClassName<Partial<HTMLAttributes<P>>> | undefined) => {
|
|
11
|
-
role: import("react").AriaRole;
|
|
12
|
-
style: CSSProperties;
|
|
13
|
-
className: string;
|
|
14
|
-
children?: ReactNode;
|
|
15
|
-
};
|
|
16
|
-
export declare function slottable<E extends HTMLElement, P extends object = {}>(render: (props: SlottableProps<P> & HTMLAttributes<E>, forwardedRef: ForwardedRef<E>) => ReactNode): ForwardRefExoticComponent<SlottableProps<P> & RefAttributes<E>>;
|
|
17
|
-
/**
|
|
18
|
-
* Factory for composable (leaf) components.
|
|
19
|
-
* The implementation receives full `HTMLAttributes<E>` so it can destructure `role`, `style`, etc.
|
|
20
|
-
* Consumers see only `ComposableProps<P>` — a narrow type exposing `classNames`, `className`,
|
|
21
|
-
* `children`, and the custom props `P`.
|
|
22
|
-
*
|
|
23
|
-
* For generic components, use `any` for the type parameter inside `composable` and
|
|
24
|
-
* cast the result to restore the generic signature for consumers.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```tsx
|
|
28
|
-
* const Leaf = composable<HTMLButtonElement>(({ children, ...props }, forwardedRef) => {
|
|
29
|
-
* return (
|
|
30
|
-
* <button {...composableProps(props, { classNames: 'btn' })} ref={forwardedRef}>
|
|
31
|
-
* {children}
|
|
32
|
-
* </button>
|
|
33
|
-
* );
|
|
34
|
-
* });
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export declare function composable<E extends HTMLElement, P extends object = {}>(render: (props: ComposableProps<P> & HTMLAttributes<E>, forwardedRef: ForwardedRef<E>) => ReactNode): ForwardRefExoticComponent<ComposableProps<P> & RefAttributes<E>>;
|
|
38
2
|
//# sourceMappingURL=mx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mx.d.ts","sourceRoot":"","sources":["../../../../src/util/mx.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mx.d.ts","sourceRoot":"","sources":["../../../../src/util/mx.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,EAAE,sEAuCb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../../../src/util/size.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AA6C3C,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../../../src/util/size.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AA6C3C,eAAO,MAAM,SAAS,SAAU,IAAI,WAAqB,CAAC;AAC1D,eAAO,MAAM,QAAQ,SAAU,IAAI,WAAqB,CAAC;AACzD,eAAO,MAAM,OAAO,SAAU,IAAI,WAAwC,CAAC;AAE3E,eAAO,MAAM,SAAS,SAAU,IAAI,KAAG,MAAoC,CAAC;AAC5E,eAAO,MAAM,SAAS,SAAU,IAAI,KAAG,MAAmE,CAAC;AAE3G,eAAO,MAAM,QAAQ,SAAU,IAAI,GAAG,IAAI,KAAG,aAC6B,CAAC;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,UAAW,MAAM,eAAe,IAAI,KAAG,IAwB3D,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type MessageValence } from '@dxos/ui-types';
|
|
2
|
-
export declare const textValence: (valence?: MessageValence) => "font-medium text-
|
|
3
|
-
export declare const messageValence: (valence?: MessageValence) => "font-medium
|
|
2
|
+
export declare const textValence: (valence?: MessageValence) => "font-medium" | "font-medium text-error-text" | "font-medium text-info-text" | "font-medium text-success-text" | "font-medium text-warning-text";
|
|
3
|
+
export declare const messageValence: (valence?: MessageValence) => "font-medium border-error-text text-error-fg bg-error-surface" | "font-medium border-info-text text-info-fg bg-info-surface" | "font-medium border-neutral-text text-neutral-fg bg-neutral-surface" | "font-medium border-success-text text-success-fg bg-success-surface" | "font-medium border-warning-text text-warning-fg bg-warning-surface";
|
|
4
|
+
/**
|
|
5
|
+
* Classes for a Button rendered inside a Message.Root that should inherit the message's valence color.
|
|
6
|
+
* Message.Root sets --dx-valence-bg / --dx-valence-bg-hover / --dx-valence-text on its DOM node.
|
|
7
|
+
* Pass variant='valence' to the Button so button.css reads those variables.
|
|
8
|
+
*/
|
|
9
|
+
export declare const buttonValence: (_valence?: MessageValence) => string;
|
|
4
10
|
//# sourceMappingURL=valence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valence.d.ts","sourceRoot":"","sources":["../../../../src/util/valence.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"valence.d.ts","sourceRoot":"","sources":["../../../../src/util/valence.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,eAAO,MAAM,WAAW,aAAc,cAAc,qJAanD,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,cAAc,sVAatD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,cAAe,cAAc,KAAG,MACwB,CAAC"}
|