@matteoaliano/forest-ui 1.1.1 → 1.2.1
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/bin/sync.mjs +15 -1
- package/dist/{chunk-BCOHH5MJ.mjs → chunk-4PNVZETQ.mjs} +63 -18
- package/dist/chunk-4PNVZETQ.mjs.map +1 -0
- package/dist/index.d.mts +155 -32
- package/dist/index.d.ts +155 -32
- package/dist/index.js +163 -129
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +306 -317
- package/dist/index.mjs.map +1 -1
- package/dist/theme.js +62 -17
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +1 -1
- package/package.json +2 -2
- package/skills/forest-alkemy-plus/SKILL.md +3 -2
- package/skills/forest-alkemy-plus/references/components.md +4 -4
- package/skills/forest-alkemy-plus/references/patterns.md +3 -3
- package/dist/chunk-BCOHH5MJ.mjs.map +0 -1
package/dist/theme.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matteoaliano/forest-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Forest Design System — themed MUI components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"sync": "node bin/sync.mjs --internal",
|
|
34
34
|
"lint": "eslint src --ext .ts,.tsx",
|
|
35
35
|
"build": "tsup",
|
|
36
|
-
"prepublishOnly": "tsup && node bin/sync.mjs",
|
|
36
|
+
"prepublishOnly": "tsup && node bin/sync.mjs --internal",
|
|
37
37
|
"dev": "tsup --watch",
|
|
38
38
|
"test": "vitest",
|
|
39
39
|
"test:coverage": "vitest --coverage",
|
|
@@ -3,7 +3,7 @@ name: forest-alkemy-plus
|
|
|
3
3
|
description: Forest UI Design System rules for the Alkemy+ (charcoal/red) preset. Enforces correct imports, component usage, and theming with @matteoaliano/forest-ui. Use when the project uses forest-ui, forest-alkemy-plus preset, or when user builds UI components in a forest-ui project. Triggers on "forest", "forest-ui", "forest alkemy", "forest alkemy+", "@matteoaliano/forest-ui".
|
|
4
4
|
metadata:
|
|
5
5
|
author: Forest Design System
|
|
6
|
-
version: 1.
|
|
6
|
+
version: 1.2.1
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Forest UI — Alkemy+ Preset
|
|
@@ -16,6 +16,7 @@ metadata:
|
|
|
16
16
|
4. **Every widget, chart, or table inside a `<Page>` lives in a `<Card>`.** A clickable card wraps its content in `<CardActionArea>`.
|
|
17
17
|
5. **No raw colors or spacing** (`#hex`, `rgb()`, `"16px"`) — use theme tokens via `sx` (`p: 4`, `color: "text.secondary"`, `backgroundColor: "primary.main"`). Never override a component's internals.
|
|
18
18
|
6. **Dark mode is built in** — `defaultMode` on ForestProvider + `useColorScheme`. Never `createTheme`, a second `ThemeProvider`, or `.dark` CSS.
|
|
19
|
+
7. **Never invent props, variants, or color names.** If you're not certain a prop/value exists, look it up in `references/components.md` or the component's exported type — don't guess. Before calling UI work done, run the project's typecheck (`tsc --noEmit` or the build) and fix every error; an unknown prop or variant value failing to compile means it doesn't exist.
|
|
19
20
|
|
|
20
21
|
## Setup (once per app)
|
|
21
22
|
|
|
@@ -49,6 +50,6 @@ Full APIs (nav router escape, logoVariant, brand/search/actions slots, Page acti
|
|
|
49
50
|
|
|
50
51
|
## Components
|
|
51
52
|
|
|
52
|
-
Inputs: Button, ButtonGroup, TextField, Select+MenuItem, MultiSelect, Checkbox, RadioGroup, Switch, ToggleButton, Fab, IconButton (variant:
|
|
53
|
+
Inputs: Button, ButtonGroup, TextField, Select+MenuItem, MultiSelect, Checkbox, RadioGroup, Switch, ToggleButton, Fab, IconButton (variant: contained (default)|outlined|icon), Autocomplete, Search, DatePicker, Input · Data: Badge, Chip, Divider, Typography, Tooltip (plain text only; rich content → Popover), Logo, Table family, DataGrid, List family, Avatar, ImageList, Rating · Surfaces: Accordion, AppBar+Toolbar, Card family, Paper, Drawer · Feedback: Alert, Dialog, Backdrop, Progress, Skeleton, Modal, Popover, Snackbar, Slider · Navigation: Breadcrumbs, Link, Menu, Pagination, Stepper, Tabs, SidebarNav+SidebarItem, BottomNavigation, SpeedDial · Layout: **AppShell, Page**, Box, Stack, Grid, Container · Charts: BarChart, LineChart, PieChart, ScatterChart, Gauge, SparkLineChart · plus form helpers, transitions, utilities, hooks (useMediaQuery, useTheme, useColorScheme).
|
|
53
54
|
|
|
54
55
|
**Full prop tables:** `references/components.md` · **Copy-paste patterns** (forms, tables, dialogs, app shell, detail drawer, charts): `references/patterns.md` · **Upgrading:** `references/upgrading.md`.
|
|
@@ -54,7 +54,7 @@ import Button from "@mui/material/Button";
|
|
|
54
54
|
| `Switch` | `import { Switch } from "@matteoaliano/forest-ui"` | `color: "default" \| "primary" \| "secondary" \| "error" \| "info" \| "success" \| "warning"`, `size: "small" \| "medium"`, `checked`, `disabled` | — |
|
|
55
55
|
| `ToggleButton` + `ToggleButtonGroup` | `import { ToggleButton, ToggleButtonGroup } from "@matteoaliano/forest-ui"` | `value`, `exclusive`, `onChange`, `orientation: "horizontal" \| "vertical"`, `size: "small" \| "medium" \| "large"`, `color`, `fullWidth` | — |
|
|
56
56
|
| `Fab` | `import { Fab } from "@matteoaliano/forest-ui"` | `variant: "circular" \| "extended"`, `size: "small" \| "medium" \| "large"`, `color`, `disabled`, `href` | `color="primary"` |
|
|
57
|
-
| `IconButton` | `import { IconButton } from "@matteoaliano/forest-ui"` | `variant: "
|
|
57
|
+
| `IconButton` | `import { IconButton } from "@matteoaliano/forest-ui"` | `variant: "contained" \| "outlined" \| "icon"` (contained/outlined get the faux-3D button affordance and a 32×32 square; **icon** is the bare icon — use it for quiet chrome like input adornments and app-bar toggles), `color: "inherit" \| "primary" \| "secondary" \| "error" \| "info" \| "success" \| "warning" \| "default"`, `size: "small" \| "medium" \| "large"`, `disabled`, `disableRipple` | `variant="contained"` |
|
|
58
58
|
| `Autocomplete` | `import { Autocomplete } from "@matteoaliano/forest-ui"` | `options`, `renderInput` (required), `multiple`, `freeSolo`, `disableClearable`, `loading`, `groupBy`, `limitTags`, `filterOptions` | — |
|
|
59
59
|
| `Search` | `import { Search } from "@matteoaliano/forest-ui"` | `onClear`, `placeholder`, all TextField props (except `variant`) | `variant="outlined"`, `placeholder="Search..."`, built-in search icon and clear button |
|
|
60
60
|
| `Input` | `import { Input } from "@matteoaliano/forest-ui"` | `value`, `onChange`, `placeholder`, `multiline`, `rows`, `startAdornment`, `endAdornment`, `disabled`, `error` — all InputBase props | — |
|
|
@@ -65,7 +65,7 @@ import Button from "@mui/material/Button";
|
|
|
65
65
|
| Component | Import | Variants / Key Props | Default Props |
|
|
66
66
|
|-----------|--------|----------------------|---------------|
|
|
67
67
|
| `Badge` | `import { Badge } from "@matteoaliano/forest-ui"` | `variant: "standard" \| "dot"`, `color`, `badgeContent`, `max`, `invisible`, `showZero`, `overlap: "rectangular" \| "circular"`, `anchorOrigin` | — |
|
|
68
|
-
| `Chip` | `import { Chip } from "@matteoaliano/forest-ui"` | `variant: "filled" \| "outlined"`, `color
|
|
68
|
+
| `Chip` | `import { Chip } from "@matteoaliano/forest-ui"` | `variant: "filled" \| "outlined"`, `color: "default" \| "primary" \| "secondary" \| "error" \| "info" \| "success" \| "warning" \| "teal" \| "orange" \| "purple" \| "pink" \| "fuchsia" \| "orangeDark" \| "green" \| "indigo" \| "rose" \| "blueLight"` (closed union — no other values exist), `size: "small" \| "medium"`, `label`, `onDelete`, `clickable`, `avatar`, `icon` | `deleteIcon={<CloseOutlined />}` |
|
|
69
69
|
| `Divider` | `import { Divider } from "@matteoaliano/forest-ui"` | `orientation: "horizontal" \| "vertical"`, `variant: "fullWidth" \| "inset" \| "middle"`, `textAlign`, `flexItem` | — |
|
|
70
70
|
| `Typography` | `import { Typography } from "@matteoaliano/forest-ui"` | `variant: "h1"-"h6" \| "subtitle1" \| "subtitle2" \| "body1" \| "body2" \| "caption" \| "overline" \| "button"`, `align`, `gutterBottom`, `noWrap` | — |
|
|
71
71
|
| `Tooltip` | `import { Tooltip } from "@matteoaliano/forest-ui"` | `title` (required), `placement` (12 positions), `arrow`, `followCursor`, `enterDelay`, `leaveDelay` | `arrow={true}` |
|
|
@@ -74,7 +74,7 @@ import Button from "@mui/material/Button";
|
|
|
74
74
|
| `ImageList` | `import { ImageList } from "@matteoaliano/forest-ui"` | `variant: "masonry" \| "quilted" \| "standard" \| "woven"`, `cols`, `gap`, `rowHeight` |
|
|
75
75
|
| `ImageListItem` | `import { ImageListItem } from "@matteoaliano/forest-ui"` | `cols`, `rows` |
|
|
76
76
|
| `ImageListItemBar` | `import { ImageListItemBar } from "@matteoaliano/forest-ui"` | `title`, `subtitle`, `position`, `actionIcon` |
|
|
77
|
-
| `Logo` | `import { Logo } from "@matteoaliano/forest-ui"` | `product: "
|
|
77
|
+
| `Logo` | `import { Logo } from "@matteoaliano/forest-ui"` | `product: "studio" \| "ai-hub" \| "contix" \| "sentimenthub" \| "adgenie" \| "revenue-pulse" \| "contixdb" \| "feedati"`, `variant: "logo" \| "logomark"`, `color: "default" \| "positive" \| "negative" \| "negative-payoff"`, `sx` | `product="studio"`, `variant="logo"`. Logomarks only support `default`/`negative` (others fall back to `default`). `logo` variants include the payoff caption — pass `sx={{ height: 64 }}` or larger to render legibly. |
|
|
78
78
|
| `Rating` | `import { Rating } from "@matteoaliano/forest-ui"` | `value`, `onChange`, `precision`, `max`, `size`, `readOnly`, `disabled` |
|
|
79
79
|
| `Table` family | `import { Table, TableHead, TableBody, TableRow, TableCell, TableContainer } from "@matteoaliano/forest-ui"` | Table: `size: "small" \| "medium"`, `stickyHeader`; TableCell: `align`, `padding`, `sortDirection`, `variant`; TableRow: `hover`, `selected` | — |
|
|
80
80
|
| `DataGrid` | `import { DataGrid, type GridColDef, type GridRenderCellParams, type GridRowSelectionModel } from "@matteoaliano/forest-ui"` | `rows`, `columns`, `paginationModel`, `sortModel`, `filterModel`, `checkboxSelection`, `loading`, `density`. Types: `GridColDef`, `GridRowsProp`, `GridRowParams`, `GridCellParams`, `GridRenderCellParams`, `GridRowSelectionModel`, `GridSortModel`, `GridFilterModel`, `GridPaginationModel` | — |
|
|
@@ -92,7 +92,7 @@ import Button from "@mui/material/Button";
|
|
|
92
92
|
| `Accordion` family | `import { Accordion, AccordionSummary, AccordionDetails, AccordionActions } from "@matteoaliano/forest-ui"` | `expanded`, `defaultExpanded`, `onChange`, `disabled`, `disableGutters`, `square` | — |
|
|
93
93
|
| `AppBar` + `Toolbar` | `import { AppBar, Toolbar } from "@matteoaliano/forest-ui"` | `position`, `color`, `elevation`; Toolbar: `variant: "dense" \| "regular"` | — |
|
|
94
94
|
| `AppBarNavItem` | `import { AppBarNavItem } from "@matteoaliano/forest-ui"` | `label` (required), `icon`, `selected`, `href`, `sx` — navigation button for AppBar | — |
|
|
95
|
-
| `Card` family | `import { Card, CardContent, CardHeader, CardActions, CardMedia } from "@matteoaliano/forest-ui"` | `variant: "elevation" \| "outlined"`, `elevation`, `raised`; CardHeader: `title`, `subheader`, `avatar`, `action`. **If the card is clickable, wrap its content in `CardActionArea`** (see below) |
|
|
95
|
+
| `Card` family | `import { Card, CardContent, CardHeader, CardActions, CardMedia } from "@matteoaliano/forest-ui"` | `color: "primary" \| "secondary"` (secondary = `background.paper` face), `variant: "elevation" \| "outlined"`, `elevation`, `raised`; CardHeader: `title`, `subheader`, `avatar`, `action`. **If the card is clickable, wrap its content in `CardActionArea`** (see below) | `color="primary"` |
|
|
96
96
|
| `Paper` | `import { Paper } from "@matteoaliano/forest-ui"` | `variant: "elevation" \| "outlined"`, `elevation` (0-24), `square` | — |
|
|
97
97
|
| `CardActionArea` | `import { CardActionArea } from "@matteoaliano/forest-ui"` | `onClick`, `href`, `disabled`. **REQUIRED for any clickable card** — carries the faux-3D bevel + glaze + press affordance (same interaction language as Button) that signals a card is interactive. Never put `onClick` on a bare `Card`. | `<Card><CardActionArea onClick={…}><CardContent>…</CardContent></CardActionArea></Card>` |
|
|
98
98
|
| `Drawer` | `import { Drawer } from "@matteoaliano/forest-ui"` | `open`, `onClose`, `anchor: "left" \| "right" \| "top" \| "bottom"`, `variant: "permanent" \| "persistent" \| "temporary"`, `hideBackdrop` | `anchor="right"`, `hideBackdrop={true}` |
|
|
@@ -163,7 +163,7 @@ function ConfirmDialog({ open, onClose, onConfirm }) {
|
|
|
163
163
|
|
|
164
164
|
**Every authenticated surface renders inside `<AppShell>`, and every routed page inside `<Page>`.** Both are real components — do not hand-roll app chrome or page scaffolds.
|
|
165
165
|
|
|
166
|
-
- `<AppShell>` owns the sticky AppBar (brand / centered search / actions), the SidebarNav, responsive mobile drawer, and the **color-mode toggle (built in — never add your own)**. The brand auto-flips to negative artwork in dark mode.
|
|
166
|
+
- `<AppShell>` owns the sticky AppBar (brand / centered search / actions), the SidebarNav, responsive mobile drawer, and the **color-mode toggle (built in — never add your own)**. The logomark brand always uses the default full-color artwork; the full wordmark (`logoVariant="full"`) auto-flips to negative artwork in dark mode.
|
|
167
167
|
- `<Page>` owns the flat `background.paper` surface, the 24px gutters, breadcrumbs, the page title, and header actions.
|
|
168
168
|
- **Every widget, chart, or table inside a `<Page>` must live in a `<Card>`.**
|
|
169
169
|
|
|
@@ -190,7 +190,7 @@ export function Layout() {
|
|
|
190
190
|
search // true = default centered Search; or pass a node
|
|
191
191
|
actions={
|
|
192
192
|
<>
|
|
193
|
-
<IconButton size="small" color="inherit">
|
|
193
|
+
<IconButton variant="icon" size="small" color="inherit">
|
|
194
194
|
<Badge badgeContent={3} color="error" variant="dot">
|
|
195
195
|
<NotificationsOutlined fontSize="small" />
|
|
196
196
|
</Badge>
|
|
@@ -246,7 +246,7 @@ function KeywordTable({ rows, columns }: { rows: any[]; columns: GridColDef[] })
|
|
|
246
246
|
{/* Header */}
|
|
247
247
|
<Box sx={{ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }}>
|
|
248
248
|
<Typography variant="h6">{selected.name}</Typography>
|
|
249
|
-
<IconButton size="small" onClick={() => setSelected(null)}>
|
|
249
|
+
<IconButton variant="icon" size="small" onClick={() => setSelected(null)}>
|
|
250
250
|
<CloseOutlined />
|
|
251
251
|
</IconButton>
|
|
252
252
|
</Box>
|