@dreamtree-org/twreact-ui 1.3.1 → 1.3.3

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 (75) hide show
  1. package/DESIGN.md +2 -2
  2. package/README.md +90 -5
  3. package/ai-skills/dreamtree-ui.md +43 -4
  4. package/bin/cli.mjs +72 -4
  5. package/charts/package.json +5 -0
  6. package/dist/_shared/cn-DPPQUJu1.js +138 -0
  7. package/dist/ai-schema.json +639 -1
  8. package/dist/charts/index.d.ts +9 -0
  9. package/dist/charts/index.d.ts.map +1 -0
  10. package/dist/charts/index.js +797 -0
  11. package/dist/components/charts/AreaChart.d.ts +4 -0
  12. package/dist/components/charts/AreaChart.d.ts.map +1 -0
  13. package/dist/components/charts/BarChart.d.ts +4 -0
  14. package/dist/components/charts/BarChart.d.ts.map +1 -0
  15. package/dist/components/charts/CartesianChart.d.ts +5 -0
  16. package/dist/components/charts/CartesianChart.d.ts.map +1 -0
  17. package/dist/components/charts/ChartFrame.d.ts +18 -0
  18. package/dist/components/charts/ChartFrame.d.ts.map +1 -0
  19. package/dist/components/charts/DonutChart.d.ts +4 -0
  20. package/dist/components/charts/DonutChart.d.ts.map +1 -0
  21. package/dist/components/charts/LineChart.d.ts +4 -0
  22. package/dist/components/charts/LineChart.d.ts.map +1 -0
  23. package/dist/components/charts/Sparkline.d.ts +5 -0
  24. package/dist/components/charts/Sparkline.d.ts.map +1 -0
  25. package/dist/components/charts/chartTheme.d.ts +36 -0
  26. package/dist/components/charts/chartTheme.d.ts.map +1 -0
  27. package/dist/components/core/Table/MobileCard.d.ts.map +1 -1
  28. package/dist/components/core/Table/MobileFilters.d.ts.map +1 -1
  29. package/dist/components/core/Table/Table.d.ts.map +1 -1
  30. package/dist/components/rich-text/RichTextEditor.d.ts +4 -0
  31. package/dist/components/rich-text/RichTextEditor.d.ts.map +1 -0
  32. package/dist/components/rich-text/RichTextToolbar.d.ts +219 -0
  33. package/dist/components/rich-text/RichTextToolbar.d.ts.map +1 -0
  34. package/dist/components/utility/Stepper.d.ts.map +1 -1
  35. package/dist/esm/charts/index.js +5 -0
  36. package/dist/esm/components/blocks/StatCard.js +1 -1
  37. package/dist/esm/components/charts/AreaChart.js +16 -0
  38. package/dist/esm/components/charts/BarChart.js +16 -0
  39. package/dist/esm/components/charts/CartesianChart.js +255 -0
  40. package/dist/esm/components/charts/ChartFrame.js +170 -0
  41. package/dist/esm/components/charts/DonutChart.js +122 -0
  42. package/dist/esm/components/charts/LineChart.js +16 -0
  43. package/dist/esm/components/charts/Sparkline.js +113 -0
  44. package/dist/esm/components/charts/chartTheme.js +126 -0
  45. package/dist/esm/components/core/Select.js +2 -2
  46. package/dist/esm/components/core/Table/MobileCard.js +5 -2
  47. package/dist/esm/components/core/Table/MobileFilters.js +10 -3
  48. package/dist/esm/components/core/Table/Table.js +10 -7
  49. package/dist/esm/components/rich-text/RichTextEditor.js +244 -0
  50. package/dist/esm/components/rich-text/RichTextToolbar.js +397 -0
  51. package/dist/esm/components/utility/Stepper.js +6 -4
  52. package/dist/esm/rich-text/index.js +1 -0
  53. package/dist/index.css +1 -1
  54. package/dist/index.esm.css +1 -1
  55. package/dist/index.esm.js +50 -22
  56. package/dist/index.js +50 -22
  57. package/dist/rich-text/index.d.ts +5 -0
  58. package/dist/rich-text/index.d.ts.map +1 -0
  59. package/dist/rich-text/index.js +654 -0
  60. package/dist/tokens/brands/practicepro.json +1 -0
  61. package/dist/tokens/brands/studio.css +14 -0
  62. package/dist/tokens/brands/studio.json +21 -0
  63. package/dist/types/charts.d.ts +97 -0
  64. package/dist/types/charts.d.ts.map +1 -0
  65. package/dist/types/rich-text.d.ts +50 -0
  66. package/dist/types/rich-text.d.ts.map +1 -0
  67. package/doc/README.md +13 -0
  68. package/mcp/catalog.snapshot.json +1016 -10
  69. package/mcp/server-core.mjs +30 -1
  70. package/package.json +39 -2
  71. package/rich-text/package.json +5 -0
  72. package/tokens/brand.schema.json +612 -0
  73. package/tokens/brands/practicepro.json +1 -0
  74. package/tokens/brands/studio.json +21 -0
  75. package/tokens/lib.cjs +131 -7
@@ -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 "${PKG}";`,
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.1",
3
+ "version": "1.3.3",
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",
@@ -35,6 +47,7 @@
35
47
  "mcp/catalog.snapshot.json",
36
48
  "tokens/tokens.json",
37
49
  "tokens/lib.cjs",
50
+ "tokens/brand.schema.json",
38
51
  "tokens/brands",
39
52
  "DESIGN.md",
40
53
  "ai-skills",
@@ -112,7 +125,25 @@
112
125
  },
113
126
  "peerDependencies": {
114
127
  "react": "^18.3.1 || ^19.0.0",
115
- "react-dom": "^18.3.1 || ^19.0.0"
128
+ "react-dom": "^18.3.1 || ^19.0.0",
129
+ "@tiptap/pm": "^3.0.0",
130
+ "@tiptap/react": "^3.0.0",
131
+ "@tiptap/starter-kit": "^3.0.0",
132
+ "recharts": "^2.15.0 || ^3.0.0"
133
+ },
134
+ "peerDependenciesMeta": {
135
+ "@tiptap/pm": {
136
+ "optional": true
137
+ },
138
+ "@tiptap/react": {
139
+ "optional": true
140
+ },
141
+ "@tiptap/starter-kit": {
142
+ "optional": true
143
+ },
144
+ "recharts": {
145
+ "optional": true
146
+ }
116
147
  },
117
148
  "dependencies": {
118
149
  "@hookform/resolvers": "^3.10.0",
@@ -144,6 +175,10 @@
144
175
  "@storybook/react-vite": "8.6.15",
145
176
  "@testing-library/jest-dom": "^6.9.1",
146
177
  "@testing-library/react": "^13.4.0",
178
+ "@tiptap/core": "^3.32.0",
179
+ "@tiptap/pm": "^3.32.0",
180
+ "@tiptap/react": "^3.32.0",
181
+ "@tiptap/starter-kit": "^3.32.0",
147
182
  "@types/jest": "^29.5.14",
148
183
  "@types/node": "^22.10.2",
149
184
  "@types/react": "^18.3.18",
@@ -163,6 +198,8 @@
163
198
  "postcss": "^8.5.6",
164
199
  "react": "^18.3.1",
165
200
  "react-dom": "^18.3.1",
201
+ "react-is": "^18.3.1",
202
+ "recharts": "^3.10.1",
166
203
  "rollup": "^4.57.1",
167
204
  "rollup-plugin-peer-deps-external": "^2.2.4",
168
205
  "rollup-plugin-postcss": "^4.0.2",
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "../dist/rich-text/index.js",
3
+ "module": "../dist/esm/rich-text/index.js",
4
+ "types": "../dist/rich-text/index.d.ts"
5
+ }