@dbx-tools/ui-appkit 0.1.2

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/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # @dbx-tools/ui-appkit
2
+
3
+ Shared React/Vite/Tailwind foundation for AppKit-oriented UI packages.
4
+
5
+ Import this package when a React client or feature UI package needs the same
6
+ Vite plugin setup and base stylesheet used by dbx-tools AppKit UI components.
7
+ It centralizes React refresh, Tailwind v4, Streamdown base styles, and a shiki
8
+ token paint shim for streamed markdown/code output.
9
+
10
+ Key features:
11
+
12
+ - Shared Vite plugin factory for React and Tailwind v4.
13
+ - Stable `@dbx-tools/ui-appkit/react` re-export of AppKit's React component
14
+ primitives for feature packages.
15
+ - AppKit UI stylesheet import path for host applications and feature packages.
16
+ - Streamdown/code-block styling used by streaming chat and Markdown surfaces.
17
+ - One place to evolve UI build assumptions for feature packages such as
18
+ [`@dbx-tools/ui-email`](../email) and [`@dbx-tools/ui-mastra`](../mastra).
19
+
20
+ ## Why Not Just AppKit UI?
21
+
22
+ Use `@databricks/appkit-ui` directly in app code when you only need AppKit's
23
+ components and hooks. This package exists for dbx-tools feature packages and
24
+ hosts that want one stable import path for AppKit primitives, React/Tailwind Vite
25
+ setup, Streamdown/shiki styling, and Tailwind source registration.
26
+
27
+ ## Configure Vite
28
+
29
+ ```ts
30
+ import { appkitUiVitePlugins } from "@dbx-tools/ui-appkit/vite";
31
+ import { defineConfig } from "vite";
32
+
33
+ export default defineConfig({
34
+ plugins: appkitUiVitePlugins(),
35
+ });
36
+ ```
37
+
38
+ `vite.appkitUiVitePlugins()` returns the React plugin and Tailwind v4 plugin.
39
+ Using it keeps host applications and feature packages on the same Vite/Tailwind
40
+ integration.
41
+
42
+ ## Import Styles
43
+
44
+ ```css
45
+ @import "@databricks/appkit-ui/styles.css";
46
+ @import "@dbx-tools/ui-appkit/styles.css";
47
+ ```
48
+
49
+ The stylesheet imports Tailwind and Streamdown styles, then adds the shiki CSS
50
+ variable shim used by Streamdown code-block spans. Feature UI packages should
51
+ import this once and add their own `@source` directives for local class names.
52
+
53
+ ## Build Feature UI Packages
54
+
55
+ Feature packages should depend on this package instead of each owning their own
56
+ Tailwind and Streamdown base setup. That gives downstream host apps one place to
57
+ look for:
58
+
59
+ - Vite plugin defaults;
60
+ - shared markdown/code styling;
61
+ - AppKit UI peer assumptions;
62
+ - future shared React utilities.
63
+
64
+ ## Module
65
+
66
+ - `./vite` - `appkitUiVitePlugins()` for React + Tailwind v4 Vite projects.
67
+ - `./react` - AppKit React UI kit re-export for feature packages and hosts.
68
+ - `./styles.css` - Tailwind/Streamdown/shiki base stylesheet.
69
+
70
+ App-specific React components should live in feature UI packages that import this
71
+ foundation.
package/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ // GENERATED by projen watch - DO NOT EDIT.
2
+ // Regenerated from the exporting modules in ./src.
3
+ // Hand edits are overwritten on the next watch; this file is read-only.
4
+
5
+ export * as vite from "./src/vite";
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@dbx-tools/ui-appkit",
3
+ "devDependencies": {
4
+ "@types/node": "^24.6.0",
5
+ "@types/react": "^19.2.2",
6
+ "@types/react-dom": "^19.2.2",
7
+ "tsx": "^4.23.0",
8
+ "typescript": "^5.9.3",
9
+ "vite": "^7.1.14"
10
+ },
11
+ "dependencies": {
12
+ "@databricks/appkit-ui": "^0.43.1",
13
+ "@tailwindcss/vite": "^4.3.1",
14
+ "@vitejs/plugin-react": "^5.0.4",
15
+ "react": "^19.2.4",
16
+ "react-dom": "^19.2.4",
17
+ "streamdown": "^2.5.0",
18
+ "tailwindcss": "^4.3.2",
19
+ "@dbx-tools/shared-core": "0.1.2"
20
+ },
21
+ "main": "index.ts",
22
+ "license": "UNLICENSED",
23
+ "version": "0.1.2",
24
+ "types": "index.ts",
25
+ "type": "module",
26
+ "exports": {
27
+ "./react": "./src/react/index.ts",
28
+ "./vite": "./src/vite.ts",
29
+ "./styles.css": "./src/styles.css",
30
+ "./package.json": "./package.json"
31
+ },
32
+ "dbxToolsConfig": {
33
+ "tags": [
34
+ "ui"
35
+ ]
36
+ },
37
+ "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\".",
38
+ "scripts": {
39
+ "build": "projen build",
40
+ "compile": "projen compile",
41
+ "default": "projen default",
42
+ "package": "projen package",
43
+ "post-compile": "projen post-compile",
44
+ "pre-compile": "projen pre-compile",
45
+ "test": "projen test",
46
+ "watch": "projen watch",
47
+ "projen": "projen"
48
+ }
49
+ }
@@ -0,0 +1,6 @@
1
+ // Re-export of AppKit's React UI kit so the `@dbx-tools/*` UI packages import
2
+ // their primitives (Button, Input, cn, etc.) through one stable specifier -
3
+ // `@dbx-tools/ui-appkit/react` - and resolve AppKit + React from this package's
4
+ // dependencies rather than each consumer's.
5
+
6
+ export * from "@databricks/appkit-ui/react";
package/src/styles.css ADDED
@@ -0,0 +1,19 @@
1
+ /*
2
+ * @dbx-tools/ui-appkit shared stylesheet.
3
+ *
4
+ * Feature UI packages (`ui-email`, `ui-mastra`, ...) import
5
+ * this once and add their own `@source` for local class strings.
6
+ *
7
+ * Provides:
8
+ * 1. Streamdown's base stylesheet (markdown / code-block layout).
9
+ * 2. The shiki token-paint shim used by Streamdown renderers.
10
+ */
11
+
12
+ @import "tailwindcss";
13
+ @import "streamdown/styles.css";
14
+
15
+ @source "./react";
16
+
17
+ [data-streamdown="code-block-body"] code span {
18
+ color: var(--sdm-c, inherit);
19
+ }
package/src/vite.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Default Vite plugins for host apps building `@dbx-tools/*` UI packages.
3
+ * Import from `@dbx-tools/ui-appkit/vite` so Tailwind and React refresh resolve
4
+ * from this package's dependencies, not the host's.
5
+ */
6
+ import tailwindcss from "@tailwindcss/vite";
7
+ import react from "@vitejs/plugin-react";
8
+ import type { PluginOption } from "vite";
9
+
10
+ /** React + Tailwind v4 plugins for a standard AppKit UI Vite app. */
11
+ export function appkitUiVitePlugins(): PluginOption[] {
12
+ return [react(), tailwindcss()];
13
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,43 @@
1
+ // ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen".
2
+ {
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "lib",
6
+ "alwaysStrict": true,
7
+ "declaration": true,
8
+ "esModuleInterop": true,
9
+ "experimentalDecorators": true,
10
+ "inlineSourceMap": true,
11
+ "inlineSources": true,
12
+ "lib": [
13
+ "ES2022",
14
+ "DOM",
15
+ "DOM.Iterable"
16
+ ],
17
+ "module": "ESNext",
18
+ "noEmitOnError": false,
19
+ "noFallthroughCasesInSwitch": true,
20
+ "noImplicitAny": true,
21
+ "noImplicitReturns": true,
22
+ "noImplicitThis": true,
23
+ "noUnusedLocals": true,
24
+ "noUnusedParameters": true,
25
+ "resolveJsonModule": true,
26
+ "strict": true,
27
+ "strictNullChecks": true,
28
+ "strictPropertyInitialization": true,
29
+ "stripInternal": true,
30
+ "target": "ES2022",
31
+ "types": [],
32
+ "moduleResolution": "bundler",
33
+ "skipLibCheck": true,
34
+ "jsx": "react-jsx"
35
+ },
36
+ "include": [
37
+ "src/**/*.ts",
38
+ "src/**/*.tsx"
39
+ ],
40
+ "exclude": [
41
+ "node_modules"
42
+ ]
43
+ }