@dreamtree-org/twreact-ui 1.3.1 → 1.3.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/DESIGN.md +2 -2
- package/README.md +80 -1
- package/ai-skills/dreamtree-ui.md +40 -3
- package/charts/package.json +5 -0
- package/dist/_shared/cn-DPPQUJu1.js +138 -0
- package/dist/ai-schema.json +638 -0
- package/dist/charts/index.d.ts +9 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +769 -0
- package/dist/components/charts/AreaChart.d.ts +4 -0
- package/dist/components/charts/AreaChart.d.ts.map +1 -0
- package/dist/components/charts/BarChart.d.ts +4 -0
- package/dist/components/charts/BarChart.d.ts.map +1 -0
- package/dist/components/charts/CartesianChart.d.ts +5 -0
- package/dist/components/charts/CartesianChart.d.ts.map +1 -0
- package/dist/components/charts/ChartFrame.d.ts +18 -0
- package/dist/components/charts/ChartFrame.d.ts.map +1 -0
- package/dist/components/charts/DonutChart.d.ts +4 -0
- package/dist/components/charts/DonutChart.d.ts.map +1 -0
- package/dist/components/charts/LineChart.d.ts +4 -0
- package/dist/components/charts/LineChart.d.ts.map +1 -0
- package/dist/components/charts/Sparkline.d.ts +5 -0
- package/dist/components/charts/Sparkline.d.ts.map +1 -0
- package/dist/components/charts/chartTheme.d.ts +26 -0
- package/dist/components/charts/chartTheme.d.ts.map +1 -0
- package/dist/components/rich-text/RichTextEditor.d.ts +4 -0
- package/dist/components/rich-text/RichTextEditor.d.ts.map +1 -0
- package/dist/components/rich-text/RichTextToolbar.d.ts +219 -0
- package/dist/components/rich-text/RichTextToolbar.d.ts.map +1 -0
- package/dist/esm/charts/index.js +5 -0
- package/dist/esm/components/charts/AreaChart.js +16 -0
- package/dist/esm/components/charts/BarChart.js +16 -0
- package/dist/esm/components/charts/CartesianChart.js +250 -0
- package/dist/esm/components/charts/ChartFrame.js +170 -0
- package/dist/esm/components/charts/DonutChart.js +119 -0
- package/dist/esm/components/charts/LineChart.js +16 -0
- package/dist/esm/components/charts/Sparkline.js +110 -0
- package/dist/esm/components/charts/chartTheme.js +109 -0
- package/dist/esm/components/rich-text/RichTextEditor.js +244 -0
- package/dist/esm/components/rich-text/RichTextToolbar.js +397 -0
- package/dist/esm/rich-text/index.js +1 -0
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +17 -4
- package/dist/index.js +17 -4
- package/dist/rich-text/index.d.ts +5 -0
- package/dist/rich-text/index.d.ts.map +1 -0
- package/dist/rich-text/index.js +654 -0
- package/dist/tokens/brands/studio.css +14 -0
- package/dist/tokens/brands/studio.json +20 -0
- package/dist/types/charts.d.ts +97 -0
- package/dist/types/charts.d.ts.map +1 -0
- package/dist/types/rich-text.d.ts +50 -0
- package/dist/types/rich-text.d.ts.map +1 -0
- package/doc/README.md +13 -0
- package/mcp/catalog.snapshot.json +1009 -3
- package/mcp/server-core.mjs +30 -1
- package/package.json +38 -2
- package/rich-text/package.json +5 -0
- package/tokens/brands/studio.json +20 -0
package/mcp/server-core.mjs
CHANGED
|
@@ -38,10 +38,15 @@ function asText(obj) {
|
|
|
38
38
|
return { content: [{ type: "text", text: typeof obj === "string" ? obj : JSON.stringify(obj, null, 2) }] };
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// The module a catalog entry is imported from: the root package, or an
|
|
42
|
+
// optional-peer subpath such as "@dreamtree-org/twreact-ui/charts".
|
|
43
|
+
const importFrom = (c) => c.importFrom || PKG;
|
|
44
|
+
|
|
41
45
|
function componentSummary(c) {
|
|
42
46
|
return {
|
|
43
47
|
name: c.name,
|
|
44
48
|
group: c.group,
|
|
49
|
+
importFrom: importFrom(c),
|
|
45
50
|
familyExports: c.familyExports,
|
|
46
51
|
hasDoc: c.hasDoc,
|
|
47
52
|
description: c.description,
|
|
@@ -53,7 +58,13 @@ function fullComponent(c) {
|
|
|
53
58
|
name: c.name,
|
|
54
59
|
group: c.group,
|
|
55
60
|
familyExports: c.familyExports,
|
|
56
|
-
import: `import { ${[c.name, ...c.familyExports].join(", ")} } from "${
|
|
61
|
+
import: `import { ${[c.name, ...c.familyExports].join(", ")} } from "${importFrom(c)}";`,
|
|
62
|
+
...(c.peerDependencies && c.peerDependencies.length
|
|
63
|
+
? {
|
|
64
|
+
peerDependencies: c.peerDependencies,
|
|
65
|
+
install: `npm install ${c.peerDependencies.join(" ")}`,
|
|
66
|
+
}
|
|
67
|
+
: {}),
|
|
57
68
|
description: c.description,
|
|
58
69
|
props: c.props,
|
|
59
70
|
examples: c.examples,
|
|
@@ -106,6 +117,23 @@ const TOOLS = [
|
|
|
106
117
|
},
|
|
107
118
|
];
|
|
108
119
|
|
|
120
|
+
// One prompt line per optional-peer subpath, derived from the catalog so it
|
|
121
|
+
// cannot drift from the real entry points.
|
|
122
|
+
function subpathRules(c) {
|
|
123
|
+
const bySubpath = new Map();
|
|
124
|
+
for (const x of c.components) {
|
|
125
|
+
if (importFrom(x) === PKG) continue;
|
|
126
|
+
if (!bySubpath.has(x.importFrom)) bySubpath.set(x.importFrom, { names: [], peers: x.peerDependencies || [] });
|
|
127
|
+
bySubpath.get(x.importFrom).names.push(x.name);
|
|
128
|
+
}
|
|
129
|
+
return [...bySubpath]
|
|
130
|
+
.map(
|
|
131
|
+
([from, { names, peers }]) =>
|
|
132
|
+
`- ${names.join(", ")} must be imported from "${from}" (never the root); it needs the optional peer(s) ${peers.join(" ")}.\n`
|
|
133
|
+
)
|
|
134
|
+
.join("");
|
|
135
|
+
}
|
|
136
|
+
|
|
109
137
|
const SKILL_URI = "dreamtree://skill";
|
|
110
138
|
const docName = (name) => `dreamtree://docs/${name}`;
|
|
111
139
|
|
|
@@ -223,6 +251,7 @@ export function createServer({ version, catalog }) {
|
|
|
223
251
|
`- Use the shared vocabulary: variant = primary|secondary|outline|ghost|destructive|success|warning; size = xs|sm|md|lg|xl. Never pass a raw color prop.\n` +
|
|
224
252
|
`- Wrap the tree in <ThemeProvider> when using dark mode or useTheme; <StoreProvider> only if using useMixins.\n` +
|
|
225
253
|
`- The consumer's tailwind.config.js content[] must include ./node_modules/${PKG}/dist/**/*.{js,mjs}.\n` +
|
|
254
|
+
subpathRules(c) +
|
|
226
255
|
`- Read the dreamtree://skill resource for full wiring + examples.\n` +
|
|
227
256
|
(task ? `\nTask: ${task}\n` : "");
|
|
228
257
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamtree-org/twreact-ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "A comprehensive React + Tailwind components library for building modern web apps",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Partha Preetham Krishna",
|
|
@@ -17,6 +17,16 @@
|
|
|
17
17
|
"module": "./dist/esm/index.js",
|
|
18
18
|
"default": "./dist/index.js"
|
|
19
19
|
},
|
|
20
|
+
"./charts": {
|
|
21
|
+
"types": "./dist/charts/index.d.ts",
|
|
22
|
+
"module": "./dist/esm/charts/index.js",
|
|
23
|
+
"default": "./dist/charts/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./rich-text": {
|
|
26
|
+
"types": "./dist/rich-text/index.d.ts",
|
|
27
|
+
"module": "./dist/esm/rich-text/index.js",
|
|
28
|
+
"default": "./dist/rich-text/index.js"
|
|
29
|
+
},
|
|
20
30
|
"./package.json": "./package.json",
|
|
21
31
|
"./*": "./*"
|
|
22
32
|
},
|
|
@@ -28,6 +38,8 @@
|
|
|
28
38
|
},
|
|
29
39
|
"files": [
|
|
30
40
|
"dist",
|
|
41
|
+
"charts/package.json",
|
|
42
|
+
"rich-text/package.json",
|
|
31
43
|
"bin/cli.mjs",
|
|
32
44
|
"mcp/server-core.mjs",
|
|
33
45
|
"mcp/catalog-core.mjs",
|
|
@@ -112,7 +124,25 @@
|
|
|
112
124
|
},
|
|
113
125
|
"peerDependencies": {
|
|
114
126
|
"react": "^18.3.1 || ^19.0.0",
|
|
115
|
-
"react-dom": "^18.3.1 || ^19.0.0"
|
|
127
|
+
"react-dom": "^18.3.1 || ^19.0.0",
|
|
128
|
+
"@tiptap/pm": "^3.0.0",
|
|
129
|
+
"@tiptap/react": "^3.0.0",
|
|
130
|
+
"@tiptap/starter-kit": "^3.0.0",
|
|
131
|
+
"recharts": "^2.15.0 || ^3.0.0"
|
|
132
|
+
},
|
|
133
|
+
"peerDependenciesMeta": {
|
|
134
|
+
"@tiptap/pm": {
|
|
135
|
+
"optional": true
|
|
136
|
+
},
|
|
137
|
+
"@tiptap/react": {
|
|
138
|
+
"optional": true
|
|
139
|
+
},
|
|
140
|
+
"@tiptap/starter-kit": {
|
|
141
|
+
"optional": true
|
|
142
|
+
},
|
|
143
|
+
"recharts": {
|
|
144
|
+
"optional": true
|
|
145
|
+
}
|
|
116
146
|
},
|
|
117
147
|
"dependencies": {
|
|
118
148
|
"@hookform/resolvers": "^3.10.0",
|
|
@@ -144,6 +174,10 @@
|
|
|
144
174
|
"@storybook/react-vite": "8.6.15",
|
|
145
175
|
"@testing-library/jest-dom": "^6.9.1",
|
|
146
176
|
"@testing-library/react": "^13.4.0",
|
|
177
|
+
"@tiptap/core": "^3.32.0",
|
|
178
|
+
"@tiptap/pm": "^3.32.0",
|
|
179
|
+
"@tiptap/react": "^3.32.0",
|
|
180
|
+
"@tiptap/starter-kit": "^3.32.0",
|
|
147
181
|
"@types/jest": "^29.5.14",
|
|
148
182
|
"@types/node": "^22.10.2",
|
|
149
183
|
"@types/react": "^18.3.18",
|
|
@@ -163,6 +197,8 @@
|
|
|
163
197
|
"postcss": "^8.5.6",
|
|
164
198
|
"react": "^18.3.1",
|
|
165
199
|
"react-dom": "^18.3.1",
|
|
200
|
+
"react-is": "^18.3.1",
|
|
201
|
+
"recharts": "^3.10.1",
|
|
166
202
|
"rollup": "^4.57.1",
|
|
167
203
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
168
204
|
"rollup-plugin-postcss": "^4.0.2",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "studio",
|
|
3
|
+
"label": "Dreamtree Studio",
|
|
4
|
+
"$description": "Indigo primary for Dreamtree Studio, the MCP prototyping harness (its own app pages, not the prototypes it renders). The shell, background and text roles are the shared slate defaults, so only the primary scale changes. Indigo 600 (#4f46e5) is 6.3:1 on white and 600/700 pass WCAG AA for text on white.",
|
|
5
|
+
"color": {
|
|
6
|
+
"primary": {
|
|
7
|
+
"50": "#eef2ff",
|
|
8
|
+
"100": "#e0e7ff",
|
|
9
|
+
"200": "#c7d2fe",
|
|
10
|
+
"300": "#a5b4fc",
|
|
11
|
+
"400": "#818cf8",
|
|
12
|
+
"500": "#6366f1",
|
|
13
|
+
"600": "#4f46e5",
|
|
14
|
+
"700": "#4338ca",
|
|
15
|
+
"800": "#3730a3",
|
|
16
|
+
"900": "#312e81",
|
|
17
|
+
"950": "#1e1b4b"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|