@matteoaliano/forest-ui 0.2.10 → 0.3.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/README.md ADDED
@@ -0,0 +1,123 @@
1
+ # Forest UI
2
+
3
+ Forest Design System — A multi-tenant MUI v7 + Emotion component library.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @matteoaliano/forest-ui
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```tsx
14
+ import { ForestProvider, Button, Typography } from '@matteoaliano/forest-ui';
15
+ import '@fontsource/poppins'; // or load Aeonik font
16
+
17
+ function App() {
18
+ return (
19
+ <ForestProvider>
20
+ <Typography variant="h1">Hello Forest</Typography>
21
+ <Button variant="contained">Click me</Button>
22
+ </ForestProvider>
23
+ );
24
+ }
25
+ ```
26
+
27
+ ## Theme Presets
28
+
29
+ Three presets are available:
30
+
31
+ | Preset | Use Case |
32
+ |--------|----------|
33
+ | `forest-agency` | Internal tools + partner agencies (default) |
34
+ | `forest-external` | Client-facing products |
35
+ | `forest-internal` | Internal tools |
36
+
37
+ ### Using a Preset
38
+
39
+ ```tsx
40
+ import { ForestProvider } from '@matteoaliano/forest-ui';
41
+
42
+ <ForestProvider preset="forest-external">
43
+ {/* Your app */}
44
+ </ForestProvider>
45
+ ```
46
+
47
+ ### Using a Custom Theme
48
+
49
+ ```tsx
50
+ import { ForestProvider, buildTheme } from '@matteoaliano/forest-ui';
51
+ import { getPreset } from '@matteoaliano/forest-ui';
52
+
53
+ const preset = getPreset('forest-agency');
54
+ const theme = buildTheme(preset.variants.light.tokens);
55
+
56
+ <ForestProvider theme={theme}>
57
+ {/* Your app */}
58
+ </ForestProvider>
59
+ ```
60
+
61
+ ## Components
62
+
63
+ 40+ wrapped MUI components with Forest defaults. See [Storybook](https://storybook.url) for all components.
64
+
65
+ ### Inputs
66
+ - Button, ButtonGroup
67
+ - TextField, Select, MultiSelect
68
+ - Checkbox, RadioGroup, Switch
69
+ - ToggleButton
70
+ - DatePicker
71
+ - Autocomplete
72
+ - Search
73
+
74
+ ### Data Display
75
+ - Typography
76
+ - Table, DataGrid
77
+ - Chip, Badge
78
+ - Tooltip
79
+ - List
80
+ - Divider
81
+ - Skeleton
82
+
83
+ ### Surfaces
84
+ - Card, Paper
85
+ - AppBar
86
+ - Accordion
87
+
88
+ ### Feedback
89
+ - Alert, Snackbar
90
+ - Dialog, Modal, Popover
91
+ - Progress (Linear, Circular)
92
+ - Backdrop
93
+
94
+ ### Navigation
95
+ - Tabs, Stepper
96
+ - Pagination
97
+ - Breadcrumbs
98
+ - Link
99
+ - Menu
100
+ - SidebarNav
101
+
102
+ ### Charts
103
+ - LineChart, BarChart, PieChart
104
+
105
+ ## Development
106
+
107
+ ```bash
108
+ # Install dependencies
109
+ npm install
110
+
111
+ # Build
112
+ npm run build
113
+
114
+ # Run tests
115
+ npm test
116
+
117
+ # Storybook
118
+ npm run storybook
119
+ ```
120
+
121
+ ## License
122
+
123
+ MIT
package/bin/sync.mjs CHANGED
@@ -14,12 +14,12 @@
14
14
  * .antigravity/rules.md — Antigravity
15
15
  *
16
16
  * Guideline categories:
17
- * - FOREST_AI_GUIDELINES.md — Design system components, tokens, patterns
18
- * - FOREST_DEV_GUIDELINES.md Development best practices
19
- * - themes/FOREST_THEME_<NAME>.md Theme-specific guidelines (auto-discovered)
17
+ * - FOREST_UI_GUIDELINES.md — Design system components, tokens, patterns
18
+ * - FOREST_FE_GUIDELINES.md Next.js frontend best practices
19
+ * - FOREST_BE_GUIDELINES.md FastAPI backend best practices
20
20
  */
21
21
 
22
- import { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync } from "node:fs";
22
+ import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
23
23
  import { resolve, dirname, basename } from "node:path";
24
24
  import { fileURLToPath } from "node:url";
25
25
 
@@ -30,48 +30,32 @@ const pkgPath = resolve(__dirname, "..", "package.json");
30
30
  const pkgVersion = JSON.parse(readFileSync(pkgPath, "utf-8")).version;
31
31
 
32
32
  const guidelinesDir = resolve(__dirname, "..", "guidelines");
33
- const themesDir = resolve(guidelinesDir, "themes");
34
33
 
35
34
  // Static guideline entries
36
35
  const staticEntries = [
37
36
  {
38
- source: resolve(guidelinesDir, "FOREST_AI_GUIDELINES.md"),
37
+ source: resolve(guidelinesDir, "FOREST_UI_GUIDELINES.md"),
39
38
  claudeName: "forest-ui.md",
40
39
  geminiName: "forest-ui.md",
41
40
  cursorName: "forest-ui.mdc",
42
41
  cursorDescription: "Forest UI Design System guidelines — components, tokens, and patterns",
43
42
  },
44
43
  {
45
- source: resolve(guidelinesDir, "FOREST_DEV_GUIDELINES.md"),
46
- claudeName: "forest-dev.md",
47
- geminiName: "forest-dev.md",
48
- cursorName: "forest-dev.mdc",
49
- cursorDescription: "Forest UI development best practices",
44
+ source: resolve(guidelinesDir, "FOREST_FE_GUIDELINES.md"),
45
+ claudeName: "forest-fe.md",
46
+ geminiName: "forest-fe.md",
47
+ cursorName: "forest-fe.mdc",
48
+ cursorDescription: "Next.js frontend best practices",
49
+ },
50
+ {
51
+ source: resolve(guidelinesDir, "FOREST_BE_GUIDELINES.md"),
52
+ claudeName: "forest-be.md",
53
+ geminiName: "forest-be.md",
54
+ cursorName: "forest-be.mdc",
55
+ cursorDescription: "FastAPI backend requirements and best practices",
50
56
  },
51
57
  ];
52
58
 
53
- // Auto-discover theme files from guidelines/themes/
54
- function discoverThemeEntries() {
55
- if (!existsSync(themesDir)) return [];
56
-
57
- return readdirSync(themesDir)
58
- .filter((f) => /^FOREST_THEME_\w+\.md$/.test(f))
59
- .map((f) => {
60
- const themeName = f
61
- .replace(/^FOREST_THEME_/, "")
62
- .replace(/\.md$/, "")
63
- .toLowerCase();
64
-
65
- return {
66
- source: resolve(themesDir, f),
67
- claudeName: `forest-theme-${themeName}.md`,
68
- geminiName: `forest-theme-${themeName}.md`,
69
- cursorName: `forest-theme-${themeName}.mdc`,
70
- cursorDescription: `Forest UI theme guidelines — ${themeName}`,
71
- };
72
- });
73
- }
74
-
75
59
  // Find the consuming project root (walk up until we find package.json)
76
60
  function findProjectRoot(startDir) {
77
61
  let dir = startDir;
@@ -90,7 +74,7 @@ function findProjectRoot(startDir) {
90
74
  }
91
75
 
92
76
  const projectRoot = findProjectRoot(process.cwd());
93
- const entries = [...staticEntries, ...discoverThemeEntries()];
77
+ const entries = [...staticEntries];
94
78
 
95
79
  console.log(`\n🌲 Forest UI — Syncing AI guidelines\n`);
96
80
  console.log(` Project root: ${projectRoot}`);