@matteoaliano/forest-ui 0.2.8 → 0.2.10

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/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Theme } from '@mui/material/styles';
3
- export { D as DesignTokens, P as PresetVariantConfig, T as ThemePreset, a as alkemyPlusPreset, b as alpha, c as avatarColors, d as bg, e as border, f as breadcrumbColors, g as buildTheme, h as buildThemeOptions, i as buttonColors, j as chartColors, k as colors, l as container, m as display, n as fg, o as focusRings, p as fontFamily, q as fontSize, r as fontWeight, s as forestPreset, t as forestTheme, u as forestThemeOptions, v as getAvailablePresets, w as getPreset, x as iconColors, y as lineHeight, z as navColors, A as radius, B as registerPreset, C as sliderColors, E as spacing, F as text, G as toggleColors, H as tokenShadows, I as widths } from './index-C7JP9vAZ.mjs';
3
+ export { D as DesignTokens, P as PresetVariantConfig, T as ThemePreset, a as alkemyPlusPreset, b as alpha, c as avatarColors, d as bg, e as border, f as breadcrumbColors, g as buildTheme, h as buildThemeOptions, i as buttonColors, j as chartColors, k as colors, l as container, m as display, n as fg, o as focusRings, p as fontFamily, q as fontSize, r as fontWeight, s as forestPreset, t as forestTheme, u as forestThemeOptions, v as getAvailablePresets, w as getPreset, x as iconColors, y as lineHeight, z as navColors, A as radius, B as registerPreset, C as sliderColors, E as spacing, F as text, G as toggleColors, H as tokenShadows, I as widths } from './index-DiI9xbOM.mjs';
4
4
  import { AutocompleteProps } from '@mui/material/Autocomplete';
5
5
  export { AutocompleteProps } from '@mui/material/Autocomplete';
6
6
  import { ButtonProps as ButtonProps$1 } from '@mui/material/Button';
@@ -112,6 +112,13 @@ import { SkeletonProps } from '@mui/material/Skeleton';
112
112
  export { SkeletonProps } from '@mui/material/Skeleton';
113
113
  import { SnackbarProps } from '@mui/material/Snackbar';
114
114
  export { SnackbarProps } from '@mui/material/Snackbar';
115
+ import React$1 from 'react';
116
+ import { DrawerProps } from '@mui/material/Drawer';
117
+ import { LineChartProps as LineChartProps$1 } from '@mui/x-charts/LineChart';
118
+ import { BarChartProps as BarChartProps$1 } from '@mui/x-charts/BarChart';
119
+ import { MakeOptional } from '@mui/x-charts/models/helpers';
120
+ import { BarSeriesType } from '@mui/x-charts/models/seriesType/bar';
121
+ import { PieChartProps as PieChartProps$1 } from '@mui/x-charts/PieChart';
115
122
  import '@mui/material';
116
123
 
117
124
  interface ForestProviderProps {
@@ -140,6 +147,19 @@ declare function Radio(props: RadioProps): react_jsx_runtime.JSX.Element;
140
147
  declare function Select<Value = unknown>(props: SelectProps<Value>): react_jsx_runtime.JSX.Element;
141
148
  declare function MenuItem(props: MenuItemProps): react_jsx_runtime.JSX.Element;
142
149
 
150
+ interface MultiSelectOption {
151
+ label: string;
152
+ value: string;
153
+ }
154
+ interface MultiSelectProps extends Omit<SelectProps<string[]>, "multiple" | "value" | "onChange" | "renderValue"> {
155
+ options: MultiSelectOption[];
156
+ value: string[];
157
+ onChange: (values: string[]) => void;
158
+ selectAll?: boolean;
159
+ selectAllLabel?: string;
160
+ }
161
+ declare function MultiSelect({ options, value, onChange, selectAll, selectAllLabel, label, ...rest }: MultiSelectProps): react_jsx_runtime.JSX.Element;
162
+
143
163
  declare function Switch(props: SwitchProps): react_jsx_runtime.JSX.Element;
144
164
 
145
165
  declare function TextField(props: TextFieldProps): react_jsx_runtime.JSX.Element;
@@ -208,4 +228,71 @@ declare function Skeleton(props: SkeletonProps): react_jsx_runtime.JSX.Element;
208
228
 
209
229
  declare function Snackbar(props: SnackbarProps): react_jsx_runtime.JSX.Element;
210
230
 
211
- export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Alert, AlertTitle, AppBar, Autocomplete, Backdrop, Badge, Button, ButtonGroup, type ButtonProps, Card, CardActions, CardContent, CardHeader, CardMedia, Checkbox, Chip, CircularProgress, DataGrid, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Fab, ForestProvider, type ForestProviderProps, LinearProgress, List, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemText, ListSubheader, MenuItem, Paper, Radio, RadioGroup, Select, Skeleton, Snackbar, Switch, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TextField, ToggleButton, ToggleButtonGroup, Toolbar, Tooltip, Typography };
231
+ interface SidebarContextValue {
232
+ open: boolean;
233
+ collapsedWidth: number;
234
+ expandedWidth: number;
235
+ }
236
+ declare function useSidebar(): SidebarContextValue;
237
+ interface SidebarNavProps extends Omit<DrawerProps, "open" | "variant" | "onClose"> {
238
+ /** Whether the sidebar is expanded */
239
+ open: boolean;
240
+ /** Callback when open state changes */
241
+ onOpenChange: (open: boolean) => void;
242
+ /** Width when expanded (default: 240) */
243
+ expandedWidth?: number;
244
+ /** Width when collapsed — icon-only (default: 64) */
245
+ collapsedWidth?: number;
246
+ /** Expand behavior:
247
+ * - "permanent": click to toggle, stays open/closed
248
+ * - "hover": collapsed by default, expands on mouse enter, collapses on mouse leave
249
+ */
250
+ behavior?: "permanent" | "hover";
251
+ /** Whether to show the edge toggle button (default: true for "permanent", false for "hover") */
252
+ showToggle?: boolean;
253
+ /** Content rendered inside the sidebar */
254
+ children: React$1.ReactNode;
255
+ /** Optional header slot — rendered above children */
256
+ header?: React$1.ReactNode;
257
+ /** Optional footer slot — rendered at bottom */
258
+ footer?: React$1.ReactNode;
259
+ }
260
+ declare function SidebarNav({ open, onOpenChange, expandedWidth, collapsedWidth, behavior, showToggle, children, header, footer, sx, ...rest }: SidebarNavProps): react_jsx_runtime.JSX.Element;
261
+ interface SidebarItemProps extends Omit<ListItemButtonProps, "children"> {
262
+ /** Icon element (required — visible in both expanded and collapsed states) */
263
+ icon: React$1.ReactNode;
264
+ /** Label text */
265
+ label: string;
266
+ /** Optional content rendered on the right side when expanded (badge, count, etc.) */
267
+ endAdornment?: React$1.ReactNode;
268
+ }
269
+ declare function SidebarItem({ icon, label, endAdornment, sx, ...rest }: SidebarItemProps): react_jsx_runtime.JSX.Element;
270
+
271
+ interface LineChartProps extends Omit<LineChartProps$1, "series"> {
272
+ series?: LineChartProps$1["series"];
273
+ /** Which color palette variant to use (categorical=12 pastel, vibrant=5 bright) */
274
+ palette?: "categorical" | "vibrant";
275
+ }
276
+ declare function LineChart({ series, colors, palette, ...props }: LineChartProps): react_jsx_runtime.JSX.Element;
277
+
278
+ type ForestBarSeriesType = MakeOptional<BarSeriesType, "type"> & {
279
+ /** Enables diagonal striped fill for comparative data representation */
280
+ variant?: "solid" | "striped";
281
+ };
282
+ interface BarChartProps extends Omit<BarChartProps$1, "series"> {
283
+ series?: ForestBarSeriesType[];
284
+ /** Which color palette variant to use (categorical=12 pastel, vibrant=5 bright) */
285
+ palette?: "categorical" | "vibrant";
286
+ }
287
+ declare function BarChart({ series, colors, palette, ...props }: BarChartProps): react_jsx_runtime.JSX.Element;
288
+
289
+ interface PieChartProps extends Omit<PieChartProps$1, "series"> {
290
+ series?: PieChartProps$1["series"];
291
+ /** Which color palette variant to use (categorical=12 pastel, vibrant=5 bright) */
292
+ palette?: "categorical" | "vibrant";
293
+ }
294
+ declare function PieChart({ series, colors, palette, ...props }: PieChartProps): react_jsx_runtime.JSX.Element;
295
+
296
+ declare function useChartColors(count: number, palette?: "categorical" | "vibrant"): string[];
297
+
298
+ export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Alert, AlertTitle, AppBar, Autocomplete, Backdrop, Badge, BarChart, type BarChartProps, Button, ButtonGroup, type ButtonProps, Card, CardActions, CardContent, CardHeader, CardMedia, Checkbox, Chip, CircularProgress, DataGrid, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Fab, ForestProvider, type ForestProviderProps, LineChart, type LineChartProps, LinearProgress, List, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemText, ListSubheader, MenuItem, MultiSelect, type MultiSelectOption, type MultiSelectProps, Paper, PieChart, type PieChartProps, Radio, RadioGroup, Select, SidebarItem, type SidebarItemProps, SidebarNav, type SidebarNavProps, Skeleton, Snackbar, Switch, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TextField, ToggleButton, ToggleButtonGroup, Toolbar, Tooltip, Typography, useChartColors, useSidebar };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Theme } from '@mui/material/styles';
3
- export { D as DesignTokens, P as PresetVariantConfig, T as ThemePreset, a as alkemyPlusPreset, b as alpha, c as avatarColors, d as bg, e as border, f as breadcrumbColors, g as buildTheme, h as buildThemeOptions, i as buttonColors, j as chartColors, k as colors, l as container, m as display, n as fg, o as focusRings, p as fontFamily, q as fontSize, r as fontWeight, s as forestPreset, t as forestTheme, u as forestThemeOptions, v as getAvailablePresets, w as getPreset, x as iconColors, y as lineHeight, z as navColors, A as radius, B as registerPreset, C as sliderColors, E as spacing, F as text, G as toggleColors, H as tokenShadows, I as widths } from './index-C7JP9vAZ.js';
3
+ export { D as DesignTokens, P as PresetVariantConfig, T as ThemePreset, a as alkemyPlusPreset, b as alpha, c as avatarColors, d as bg, e as border, f as breadcrumbColors, g as buildTheme, h as buildThemeOptions, i as buttonColors, j as chartColors, k as colors, l as container, m as display, n as fg, o as focusRings, p as fontFamily, q as fontSize, r as fontWeight, s as forestPreset, t as forestTheme, u as forestThemeOptions, v as getAvailablePresets, w as getPreset, x as iconColors, y as lineHeight, z as navColors, A as radius, B as registerPreset, C as sliderColors, E as spacing, F as text, G as toggleColors, H as tokenShadows, I as widths } from './index-DiI9xbOM.js';
4
4
  import { AutocompleteProps } from '@mui/material/Autocomplete';
5
5
  export { AutocompleteProps } from '@mui/material/Autocomplete';
6
6
  import { ButtonProps as ButtonProps$1 } from '@mui/material/Button';
@@ -112,6 +112,13 @@ import { SkeletonProps } from '@mui/material/Skeleton';
112
112
  export { SkeletonProps } from '@mui/material/Skeleton';
113
113
  import { SnackbarProps } from '@mui/material/Snackbar';
114
114
  export { SnackbarProps } from '@mui/material/Snackbar';
115
+ import React$1 from 'react';
116
+ import { DrawerProps } from '@mui/material/Drawer';
117
+ import { LineChartProps as LineChartProps$1 } from '@mui/x-charts/LineChart';
118
+ import { BarChartProps as BarChartProps$1 } from '@mui/x-charts/BarChart';
119
+ import { MakeOptional } from '@mui/x-charts/models/helpers';
120
+ import { BarSeriesType } from '@mui/x-charts/models/seriesType/bar';
121
+ import { PieChartProps as PieChartProps$1 } from '@mui/x-charts/PieChart';
115
122
  import '@mui/material';
116
123
 
117
124
  interface ForestProviderProps {
@@ -140,6 +147,19 @@ declare function Radio(props: RadioProps): react_jsx_runtime.JSX.Element;
140
147
  declare function Select<Value = unknown>(props: SelectProps<Value>): react_jsx_runtime.JSX.Element;
141
148
  declare function MenuItem(props: MenuItemProps): react_jsx_runtime.JSX.Element;
142
149
 
150
+ interface MultiSelectOption {
151
+ label: string;
152
+ value: string;
153
+ }
154
+ interface MultiSelectProps extends Omit<SelectProps<string[]>, "multiple" | "value" | "onChange" | "renderValue"> {
155
+ options: MultiSelectOption[];
156
+ value: string[];
157
+ onChange: (values: string[]) => void;
158
+ selectAll?: boolean;
159
+ selectAllLabel?: string;
160
+ }
161
+ declare function MultiSelect({ options, value, onChange, selectAll, selectAllLabel, label, ...rest }: MultiSelectProps): react_jsx_runtime.JSX.Element;
162
+
143
163
  declare function Switch(props: SwitchProps): react_jsx_runtime.JSX.Element;
144
164
 
145
165
  declare function TextField(props: TextFieldProps): react_jsx_runtime.JSX.Element;
@@ -208,4 +228,71 @@ declare function Skeleton(props: SkeletonProps): react_jsx_runtime.JSX.Element;
208
228
 
209
229
  declare function Snackbar(props: SnackbarProps): react_jsx_runtime.JSX.Element;
210
230
 
211
- export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Alert, AlertTitle, AppBar, Autocomplete, Backdrop, Badge, Button, ButtonGroup, type ButtonProps, Card, CardActions, CardContent, CardHeader, CardMedia, Checkbox, Chip, CircularProgress, DataGrid, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Fab, ForestProvider, type ForestProviderProps, LinearProgress, List, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemText, ListSubheader, MenuItem, Paper, Radio, RadioGroup, Select, Skeleton, Snackbar, Switch, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TextField, ToggleButton, ToggleButtonGroup, Toolbar, Tooltip, Typography };
231
+ interface SidebarContextValue {
232
+ open: boolean;
233
+ collapsedWidth: number;
234
+ expandedWidth: number;
235
+ }
236
+ declare function useSidebar(): SidebarContextValue;
237
+ interface SidebarNavProps extends Omit<DrawerProps, "open" | "variant" | "onClose"> {
238
+ /** Whether the sidebar is expanded */
239
+ open: boolean;
240
+ /** Callback when open state changes */
241
+ onOpenChange: (open: boolean) => void;
242
+ /** Width when expanded (default: 240) */
243
+ expandedWidth?: number;
244
+ /** Width when collapsed — icon-only (default: 64) */
245
+ collapsedWidth?: number;
246
+ /** Expand behavior:
247
+ * - "permanent": click to toggle, stays open/closed
248
+ * - "hover": collapsed by default, expands on mouse enter, collapses on mouse leave
249
+ */
250
+ behavior?: "permanent" | "hover";
251
+ /** Whether to show the edge toggle button (default: true for "permanent", false for "hover") */
252
+ showToggle?: boolean;
253
+ /** Content rendered inside the sidebar */
254
+ children: React$1.ReactNode;
255
+ /** Optional header slot — rendered above children */
256
+ header?: React$1.ReactNode;
257
+ /** Optional footer slot — rendered at bottom */
258
+ footer?: React$1.ReactNode;
259
+ }
260
+ declare function SidebarNav({ open, onOpenChange, expandedWidth, collapsedWidth, behavior, showToggle, children, header, footer, sx, ...rest }: SidebarNavProps): react_jsx_runtime.JSX.Element;
261
+ interface SidebarItemProps extends Omit<ListItemButtonProps, "children"> {
262
+ /** Icon element (required — visible in both expanded and collapsed states) */
263
+ icon: React$1.ReactNode;
264
+ /** Label text */
265
+ label: string;
266
+ /** Optional content rendered on the right side when expanded (badge, count, etc.) */
267
+ endAdornment?: React$1.ReactNode;
268
+ }
269
+ declare function SidebarItem({ icon, label, endAdornment, sx, ...rest }: SidebarItemProps): react_jsx_runtime.JSX.Element;
270
+
271
+ interface LineChartProps extends Omit<LineChartProps$1, "series"> {
272
+ series?: LineChartProps$1["series"];
273
+ /** Which color palette variant to use (categorical=12 pastel, vibrant=5 bright) */
274
+ palette?: "categorical" | "vibrant";
275
+ }
276
+ declare function LineChart({ series, colors, palette, ...props }: LineChartProps): react_jsx_runtime.JSX.Element;
277
+
278
+ type ForestBarSeriesType = MakeOptional<BarSeriesType, "type"> & {
279
+ /** Enables diagonal striped fill for comparative data representation */
280
+ variant?: "solid" | "striped";
281
+ };
282
+ interface BarChartProps extends Omit<BarChartProps$1, "series"> {
283
+ series?: ForestBarSeriesType[];
284
+ /** Which color palette variant to use (categorical=12 pastel, vibrant=5 bright) */
285
+ palette?: "categorical" | "vibrant";
286
+ }
287
+ declare function BarChart({ series, colors, palette, ...props }: BarChartProps): react_jsx_runtime.JSX.Element;
288
+
289
+ interface PieChartProps extends Omit<PieChartProps$1, "series"> {
290
+ series?: PieChartProps$1["series"];
291
+ /** Which color palette variant to use (categorical=12 pastel, vibrant=5 bright) */
292
+ palette?: "categorical" | "vibrant";
293
+ }
294
+ declare function PieChart({ series, colors, palette, ...props }: PieChartProps): react_jsx_runtime.JSX.Element;
295
+
296
+ declare function useChartColors(count: number, palette?: "categorical" | "vibrant"): string[];
297
+
298
+ export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Alert, AlertTitle, AppBar, Autocomplete, Backdrop, Badge, BarChart, type BarChartProps, Button, ButtonGroup, type ButtonProps, Card, CardActions, CardContent, CardHeader, CardMedia, Checkbox, Chip, CircularProgress, DataGrid, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Fab, ForestProvider, type ForestProviderProps, LineChart, type LineChartProps, LinearProgress, List, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemText, ListSubheader, MenuItem, MultiSelect, type MultiSelectOption, type MultiSelectProps, Paper, PieChart, type PieChartProps, Radio, RadioGroup, Select, SidebarItem, type SidebarItemProps, SidebarNav, type SidebarNavProps, Skeleton, Snackbar, Switch, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TextField, ToggleButton, ToggleButtonGroup, Toolbar, Tooltip, Typography, useChartColors, useSidebar };