@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.js CHANGED
@@ -13,6 +13,9 @@ var MuiRadioGroup = require('@mui/material/RadioGroup');
13
13
  var MuiRadio = require('@mui/material/Radio');
14
14
  var MuiSelect = require('@mui/material/Select');
15
15
  var MuiMenuItem = require('@mui/material/MenuItem');
16
+ var MuiListItemText = require('@mui/material/ListItemText');
17
+ var MuiFormControl = require('@mui/material/FormControl');
18
+ var MuiInputLabel = require('@mui/material/InputLabel');
16
19
  var MuiSwitch = require('@mui/material/Switch');
17
20
  var MuiTextField = require('@mui/material/TextField');
18
21
  var MuiToggleButton = require('@mui/material/ToggleButton');
@@ -23,9 +26,8 @@ var utils = require('@mui/material/utils');
23
26
  var MuiDivider = require('@mui/material/Divider');
24
27
  var MuiList = require('@mui/material/List');
25
28
  var MuiListItem = require('@mui/material/ListItem');
26
- var MuiListItemButton = require('@mui/material/ListItemButton');
27
- var MuiListItemIcon = require('@mui/material/ListItemIcon');
28
- var MuiListItemText = require('@mui/material/ListItemText');
29
+ var MuiListItemButton2 = require('@mui/material/ListItemButton');
30
+ var ListItemIcon2 = require('@mui/material/ListItemIcon');
29
31
  var MuiListItemAvatar = require('@mui/material/ListItemAvatar');
30
32
  var MuiListSubheader = require('@mui/material/ListSubheader');
31
33
  var MuiTable = require('@mui/material/Table');
@@ -61,6 +63,13 @@ var MuiLinearProgress = require('@mui/material/LinearProgress');
61
63
  var MuiCircularProgress = require('@mui/material/CircularProgress');
62
64
  var MuiSkeleton = require('@mui/material/Skeleton');
63
65
  var MuiSnackbar = require('@mui/material/Snackbar');
66
+ var MuiDrawer = require('@mui/material/Drawer');
67
+ var Box = require('@mui/material/Box');
68
+ var IconButton = require('@mui/material/IconButton');
69
+ var LineChart$1 = require('@mui/x-charts/LineChart');
70
+ var material = require('@mui/material');
71
+ var BarChart$1 = require('@mui/x-charts/BarChart');
72
+ var PieChart$1 = require('@mui/x-charts/PieChart');
64
73
 
65
74
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
66
75
 
@@ -74,6 +83,9 @@ var MuiRadioGroup__default = /*#__PURE__*/_interopDefault(MuiRadioGroup);
74
83
  var MuiRadio__default = /*#__PURE__*/_interopDefault(MuiRadio);
75
84
  var MuiSelect__default = /*#__PURE__*/_interopDefault(MuiSelect);
76
85
  var MuiMenuItem__default = /*#__PURE__*/_interopDefault(MuiMenuItem);
86
+ var MuiListItemText__default = /*#__PURE__*/_interopDefault(MuiListItemText);
87
+ var MuiFormControl__default = /*#__PURE__*/_interopDefault(MuiFormControl);
88
+ var MuiInputLabel__default = /*#__PURE__*/_interopDefault(MuiInputLabel);
77
89
  var MuiSwitch__default = /*#__PURE__*/_interopDefault(MuiSwitch);
78
90
  var MuiTextField__default = /*#__PURE__*/_interopDefault(MuiTextField);
79
91
  var MuiToggleButton__default = /*#__PURE__*/_interopDefault(MuiToggleButton);
@@ -83,9 +95,8 @@ var MuiChip__default = /*#__PURE__*/_interopDefault(MuiChip);
83
95
  var MuiDivider__default = /*#__PURE__*/_interopDefault(MuiDivider);
84
96
  var MuiList__default = /*#__PURE__*/_interopDefault(MuiList);
85
97
  var MuiListItem__default = /*#__PURE__*/_interopDefault(MuiListItem);
86
- var MuiListItemButton__default = /*#__PURE__*/_interopDefault(MuiListItemButton);
87
- var MuiListItemIcon__default = /*#__PURE__*/_interopDefault(MuiListItemIcon);
88
- var MuiListItemText__default = /*#__PURE__*/_interopDefault(MuiListItemText);
98
+ var MuiListItemButton2__default = /*#__PURE__*/_interopDefault(MuiListItemButton2);
99
+ var ListItemIcon2__default = /*#__PURE__*/_interopDefault(ListItemIcon2);
89
100
  var MuiListItemAvatar__default = /*#__PURE__*/_interopDefault(MuiListItemAvatar);
90
101
  var MuiListSubheader__default = /*#__PURE__*/_interopDefault(MuiListSubheader);
91
102
  var MuiTable__default = /*#__PURE__*/_interopDefault(MuiTable);
@@ -120,6 +131,9 @@ var MuiLinearProgress__default = /*#__PURE__*/_interopDefault(MuiLinearProgress)
120
131
  var MuiCircularProgress__default = /*#__PURE__*/_interopDefault(MuiCircularProgress);
121
132
  var MuiSkeleton__default = /*#__PURE__*/_interopDefault(MuiSkeleton);
122
133
  var MuiSnackbar__default = /*#__PURE__*/_interopDefault(MuiSnackbar);
134
+ var MuiDrawer__default = /*#__PURE__*/_interopDefault(MuiDrawer);
135
+ var Box__default = /*#__PURE__*/_interopDefault(Box);
136
+ var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
123
137
 
124
138
  // src/provider/ForestProvider.tsx
125
139
 
@@ -213,6 +227,54 @@ var colors = {
213
227
  800: "#1849a9",
214
228
  900: "#194185",
215
229
  950: "#102a56"
230
+ },
231
+ teal: {
232
+ 100: "#ccfbef",
233
+ 200: "#99f6e0",
234
+ 600: "#0e9384",
235
+ 700: "#107569"
236
+ },
237
+ orange: {
238
+ 100: "#fdead7",
239
+ 200: "#f9dbaf",
240
+ 600: "#e04f16",
241
+ 700: "#b93815"
242
+ },
243
+ purple: {
244
+ 100: "#ebe9fe",
245
+ 200: "#d9d6fe",
246
+ 600: "#6938ef",
247
+ 700: "#5925dc"
248
+ },
249
+ pink: {
250
+ 100: "#fce7f6",
251
+ 200: "#fcceee",
252
+ 600: "#dd2590",
253
+ 700: "#c11574"
254
+ },
255
+ fuchsia: {
256
+ 100: "#fbe8ff",
257
+ 200: "#f6d0fe",
258
+ 600: "#ba24d5",
259
+ 700: "#9f1ab1"
260
+ },
261
+ orangeDark: {
262
+ 100: "#ffe6d5",
263
+ 200: "#ffd6ae",
264
+ 600: "#e62e05",
265
+ 700: "#bc1b06"
266
+ },
267
+ green: {
268
+ 100: "#d3f8df",
269
+ 200: "#aaf0c4",
270
+ 600: "#099250",
271
+ 700: "#087443"
272
+ },
273
+ indigo: {
274
+ 100: "#e0eaff",
275
+ 200: "#c7d7fe",
276
+ 600: "#444ce7",
277
+ 700: "#3538cd"
216
278
  }
217
279
  };
218
280
  var spacing = {
@@ -350,7 +412,7 @@ var bg = {
350
412
  secondarySolid: colors.gray[600],
351
413
  tertiary: colors.gray[100],
352
414
  quaternary: colors.gray[200],
353
- active: colors.gray[50],
415
+ active: colors.gray[200],
354
416
  disabled: colors.gray[100],
355
417
  disabledSubtle: colors.gray[50],
356
418
  overlay: colors.gray[950],
@@ -497,7 +559,7 @@ var iconColors = {
497
559
  };
498
560
  var navColors = {
499
561
  itemIconFg: colors.gray[500],
500
- itemIconFgActive: colors.gray[500],
562
+ itemIconFgActive: colors.gray[700],
501
563
  itemButtonIconFg: colors.gray[500],
502
564
  itemButtonIconFgActive: colors.gray[700]
503
565
  };
@@ -518,15 +580,33 @@ var chartColors = {
518
580
  tooltipBg: colors.gray[950],
519
581
  tooltipFg: colors.base.white,
520
582
  crosshairFg: colors.gray[500],
521
- legendFg: colors.gray[700],
522
- series1Fg: colors.blue[600],
523
- series1FgHover: colors.blue[700],
524
- series1Bg: colors.blue[100],
525
- series1BgHover: colors.blue[200],
526
- series2Fg: colors.brand[600],
527
- series2FgHover: colors.brand[700],
528
- series2Bg: colors.brand[100],
529
- series2BgHover: colors.brand[200]
583
+ legendFg: text.tertiary,
584
+ categorical: [
585
+ "#7B61FF",
586
+ "#FF7E67",
587
+ "#76DFD5",
588
+ "#F6C343",
589
+ "#B36A6F",
590
+ "#71BCF6",
591
+ "#FFB076",
592
+ "#11819D",
593
+ "#3CB371",
594
+ "#FFBCAE",
595
+ "#C87EED",
596
+ "#76C5AF"
597
+ ],
598
+ vibrant: [
599
+ "#6B38FB",
600
+ // 1. Deep Purple
601
+ "#E85B22",
602
+ // 2. Deep Orange
603
+ "#4AABFF",
604
+ // 3. Bright Blue
605
+ "#E83B1A",
606
+ // 4. True Red
607
+ "#E02088"
608
+ // 5. Magenta
609
+ ]
530
610
  };
531
611
  var alpha = {
532
612
  white: {
@@ -557,6 +637,7 @@ var alpha = {
557
637
 
558
638
  // src/theme/palette.ts
559
639
  function buildPalette(tokens) {
640
+ var _a;
560
641
  const { colors: colors3, text: text3, bg: bg3, fg: fg3, border: border3 } = tokens;
561
642
  return {
562
643
  primary: {
@@ -611,7 +692,8 @@ function buildPalette(tokens) {
611
692
  selected: bg3.brandPrimary,
612
693
  disabled: fg3.disabled,
613
694
  disabledBackground: bg3.disabled
614
- }
695
+ },
696
+ chart: (_a = tokens.chartColors) != null ? _a : chartColors
615
697
  };
616
698
  }
617
699
  var palette = buildPalette({
@@ -619,7 +701,8 @@ var palette = buildPalette({
619
701
  text,
620
702
  bg,
621
703
  fg,
622
- border
704
+ border,
705
+ chartColors
623
706
  });
624
707
 
625
708
  // src/theme/typography.ts
@@ -1140,6 +1223,15 @@ function buildComponents(tokens) {
1140
1223
  }
1141
1224
  }
1142
1225
  },
1226
+ // ─── Drawer (used by Sidebar) ─────────────────────────────────
1227
+ MuiDrawer: {
1228
+ styleOverrides: {
1229
+ paper: {
1230
+ backgroundColor: bg3.primary,
1231
+ borderRight: `1px solid ${border3.secondary}`
1232
+ }
1233
+ }
1234
+ },
1143
1235
  // ─── Card ───────────────────────────────────────────────────────
1144
1236
  MuiCard: {
1145
1237
  defaultProps: {
@@ -1930,7 +2022,6 @@ var forestPreset = {
1930
2022
  // src/theme/presets/alkemy-plus.ts
1931
2023
  var red = {
1932
2024
  50: "#fef2f2",
1933
- 100: "#fee2e2",
1934
2025
  200: "#fecaca",
1935
2026
  600: "#dc2626",
1936
2027
  700: "#b91c1c",
@@ -1992,7 +2083,15 @@ var colors2 = {
1992
2083
  /** Success — forest defaults (standard UX green) */
1993
2084
  success: colors.success,
1994
2085
  /** Blue (info) — forest defaults (standard UX) */
1995
- blue: colors.blue
2086
+ blue: colors.blue,
2087
+ teal: colors.teal,
2088
+ orange: colors.orange,
2089
+ purple: colors.purple,
2090
+ pink: colors.pink,
2091
+ fuchsia: colors.fuchsia,
2092
+ orangeDark: colors.orangeDark,
2093
+ green: colors.green,
2094
+ indigo: colors.indigo
1996
2095
  };
1997
2096
  var radius2 = {
1998
2097
  ...radius,
@@ -2212,15 +2311,48 @@ var chartColors2 = {
2212
2311
  tooltipBg: colors2.gray[950],
2213
2312
  tooltipFg: colors2.base.white,
2214
2313
  crosshairFg: colors2.gray[500],
2215
- legendFg: colors2.gray[700],
2216
- series1Fg: colors2.brand[600],
2217
- series1FgHover: colors2.brand[700],
2218
- series1Bg: colors2.brand[100],
2219
- series1BgHover: colors2.brand[200],
2220
- series2Fg: red[600],
2221
- series2FgHover: red[700],
2222
- series2Bg: red[100],
2223
- series2BgHover: red[200]
2314
+ legendFg: text2.tertiary,
2315
+ categorical: [
2316
+ "#7B61FF",
2317
+ "#FF7E67",
2318
+ "#76DFD5",
2319
+ "#F6C343",
2320
+ "#B36A6F",
2321
+ "#71BCF6",
2322
+ "#FFB076",
2323
+ "#11819D",
2324
+ "#3CB371",
2325
+ "#FFBCAE",
2326
+ "#C87EED",
2327
+ "#76C5AF"
2328
+ ],
2329
+ vibrant: [
2330
+ "#6B38FB",
2331
+ "#E85B22",
2332
+ "#4AABFF",
2333
+ "#E83B1A",
2334
+ "#E02088"
2335
+ ],
2336
+ series6Fg: colors2.brand[400],
2337
+ series6FgHover: colors2.brand[500],
2338
+ series6Bg: colors2.brand[100],
2339
+ series6BgHover: colors2.brand[200],
2340
+ series7Fg: colors2.fuchsia[600],
2341
+ series7FgHover: colors2.fuchsia[700],
2342
+ series7Bg: colors2.fuchsia[100],
2343
+ series7BgHover: colors2.fuchsia[200],
2344
+ series8Fg: colors2.teal[600],
2345
+ series8FgHover: colors2.teal[700],
2346
+ series8Bg: colors2.teal[100],
2347
+ series8BgHover: colors2.teal[200],
2348
+ series9Fg: colors2.indigo[600],
2349
+ series9FgHover: colors2.indigo[700],
2350
+ series9Bg: colors2.indigo[100],
2351
+ series9BgHover: colors2.indigo[200],
2352
+ series10Fg: colors2.green[600],
2353
+ series10FgHover: colors2.green[700],
2354
+ series10Bg: colors2.green[100],
2355
+ series10BgHover: colors2.green[200]
2224
2356
  };
2225
2357
  var focusRings2 = {
2226
2358
  brand: "0px 0px 0px 4px #f040403d",
@@ -2350,6 +2482,64 @@ function Select(props) {
2350
2482
  function MenuItem(props) {
2351
2483
  return /* @__PURE__ */ jsxRuntime.jsx(MuiMenuItem__default.default, { ...props });
2352
2484
  }
2485
+ function MultiSelect({
2486
+ options,
2487
+ value,
2488
+ onChange,
2489
+ selectAll = true,
2490
+ selectAllLabel = "Select All",
2491
+ label,
2492
+ ...rest
2493
+ }) {
2494
+ const allSelected = options.length > 0 && value.length === options.length;
2495
+ const handleChange = (event) => {
2496
+ const selected = event.target.value;
2497
+ const arr = typeof selected === "string" ? selected.split(",") : selected;
2498
+ onChange(arr);
2499
+ };
2500
+ const handleSelectAll = (e) => {
2501
+ e.stopPropagation();
2502
+ onChange(allSelected ? [] : options.map((o) => o.value));
2503
+ };
2504
+ const labelMap = new Map(options.map((o) => [o.value, o.label]));
2505
+ const renderValue2 = (selected) => selected.map((v) => {
2506
+ var _a;
2507
+ return (_a = labelMap.get(v)) != null ? _a : v;
2508
+ }).join(", ");
2509
+ const labelId = label ? `forest-multiselect-${String(label).replace(/\s+/g, "-").toLowerCase()}` : void 0;
2510
+ return /* @__PURE__ */ jsxRuntime.jsxs(MuiFormControl__default.default, { fullWidth: true, children: [
2511
+ label && /* @__PURE__ */ jsxRuntime.jsx(MuiInputLabel__default.default, { id: labelId, shrink: value.length > 0, children: label }),
2512
+ /* @__PURE__ */ jsxRuntime.jsxs(
2513
+ MuiSelect__default.default,
2514
+ {
2515
+ labelId,
2516
+ label,
2517
+ multiple: true,
2518
+ notched: value.length > 0,
2519
+ value,
2520
+ onChange: handleChange,
2521
+ displayEmpty: true,
2522
+ renderValue: renderValue2,
2523
+ ...rest,
2524
+ children: [
2525
+ selectAll && /* @__PURE__ */ jsxRuntime.jsx(
2526
+ MuiButton__default.default,
2527
+ {
2528
+ size: "small",
2529
+ variant: "text",
2530
+ onMouseDown: handleSelectAll,
2531
+ children: allSelected ? "Deselect All" : selectAllLabel
2532
+ }
2533
+ ),
2534
+ options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(MuiMenuItem__default.default, { value: option.value, children: [
2535
+ /* @__PURE__ */ jsxRuntime.jsx(MuiCheckbox__default.default, { checked: value.includes(option.value) }),
2536
+ /* @__PURE__ */ jsxRuntime.jsx(MuiListItemText__default.default, { primary: option.label })
2537
+ ] }, option.value))
2538
+ ]
2539
+ }
2540
+ )
2541
+ ] });
2542
+ }
2353
2543
  function Switch(props) {
2354
2544
  return /* @__PURE__ */ jsxRuntime.jsx(MuiSwitch__default.default, { ...props });
2355
2545
  }
@@ -2387,10 +2577,10 @@ function ListItem(props) {
2387
2577
  return /* @__PURE__ */ jsxRuntime.jsx(MuiListItem__default.default, { ...props });
2388
2578
  }
2389
2579
  function ListItemButton(props) {
2390
- return /* @__PURE__ */ jsxRuntime.jsx(MuiListItemButton__default.default, { ...props });
2580
+ return /* @__PURE__ */ jsxRuntime.jsx(MuiListItemButton2__default.default, { ...props });
2391
2581
  }
2392
2582
  function ListItemIcon(props) {
2393
- return /* @__PURE__ */ jsxRuntime.jsx(MuiListItemIcon__default.default, { ...props });
2583
+ return /* @__PURE__ */ jsxRuntime.jsx(ListItemIcon2__default.default, { ...props });
2394
2584
  }
2395
2585
  function ListItemText(props) {
2396
2586
  return /* @__PURE__ */ jsxRuntime.jsx(MuiListItemText__default.default, { ...props });
@@ -2500,6 +2690,518 @@ function Skeleton(props) {
2500
2690
  function Snackbar(props) {
2501
2691
  return /* @__PURE__ */ jsxRuntime.jsx(MuiSnackbar__default.default, { ...props });
2502
2692
  }
2693
+ var ChevronLeftOutlined_default = utils.createSvgIcon(/* @__PURE__ */ jsxRuntime.jsx("path", {
2694
+ d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"
2695
+ }), "ChevronLeftOutlined");
2696
+ var ChevronRightOutlined_default = utils.createSvgIcon(/* @__PURE__ */ jsxRuntime.jsx("path", {
2697
+ d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
2698
+ }), "ChevronRightOutlined");
2699
+ var SidebarContext = react.createContext({
2700
+ open: true,
2701
+ collapsedWidth: 48,
2702
+ expandedWidth: 240
2703
+ });
2704
+ function useSidebar() {
2705
+ return react.useContext(SidebarContext);
2706
+ }
2707
+ function SidebarNav({
2708
+ open,
2709
+ onOpenChange,
2710
+ expandedWidth = 240,
2711
+ collapsedWidth = 48,
2712
+ behavior = "permanent",
2713
+ showToggle,
2714
+ children,
2715
+ header,
2716
+ footer,
2717
+ sx,
2718
+ ...rest
2719
+ }) {
2720
+ const isHover = behavior === "hover";
2721
+ const drawerWidth = open ? expandedWidth : collapsedWidth;
2722
+ const layoutWidth = isHover ? collapsedWidth : drawerWidth;
2723
+ const shouldShowToggle = showToggle != null ? showToggle : !isHover;
2724
+ const hoverHandlers = isHover ? {
2725
+ onMouseEnter: () => onOpenChange(true),
2726
+ onMouseLeave: () => onOpenChange(false)
2727
+ } : {};
2728
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: { open, collapsedWidth, expandedWidth }, children: /* @__PURE__ */ jsxRuntime.jsxs(Box__default.default, { sx: { position: "relative", width: layoutWidth, flexShrink: 0 }, children: [
2729
+ /* @__PURE__ */ jsxRuntime.jsx(
2730
+ MuiDrawer__default.default,
2731
+ {
2732
+ variant: "permanent",
2733
+ ...rest,
2734
+ ...hoverHandlers,
2735
+ sx: {
2736
+ width: drawerWidth,
2737
+ flexShrink: 0,
2738
+ "& .MuiDrawer-paper": {
2739
+ width: drawerWidth,
2740
+ transition: "width 200ms ease-in-out",
2741
+ overflowX: "hidden",
2742
+ boxSizing: "border-box",
2743
+ ...isHover && { zIndex: (theme) => theme.zIndex.drawer + 2 }
2744
+ },
2745
+ ...sx
2746
+ },
2747
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2748
+ Box__default.default,
2749
+ {
2750
+ sx: {
2751
+ display: "flex",
2752
+ flexDirection: "column",
2753
+ height: "100%",
2754
+ overflow: "hidden"
2755
+ },
2756
+ children: [
2757
+ header && /* @__PURE__ */ jsxRuntime.jsx(Box__default.default, { sx: { flexShrink: 0 }, children: header }),
2758
+ /* @__PURE__ */ jsxRuntime.jsx(Box__default.default, { sx: { flexGrow: 1, overflowY: "auto", overflowX: "hidden" }, children }),
2759
+ footer && /* @__PURE__ */ jsxRuntime.jsx(Box__default.default, { sx: { flexShrink: 0 }, children: footer })
2760
+ ]
2761
+ }
2762
+ )
2763
+ }
2764
+ ),
2765
+ shouldShowToggle && /* @__PURE__ */ jsxRuntime.jsx(
2766
+ IconButton__default.default,
2767
+ {
2768
+ size: "small",
2769
+ onClick: () => onOpenChange(!open),
2770
+ sx: {
2771
+ position: "absolute",
2772
+ top: "50%",
2773
+ right: 0,
2774
+ transform: "translate(50%, -50%)",
2775
+ zIndex: (theme) => theme.zIndex.drawer + 1,
2776
+ width: 28,
2777
+ height: 28,
2778
+ border: 1,
2779
+ borderColor: "divider",
2780
+ backgroundColor: "background.paper",
2781
+ boxShadow: 1,
2782
+ "&:hover": {
2783
+ backgroundColor: "action.hover"
2784
+ },
2785
+ "& .MuiSvgIcon-root": {
2786
+ fontSize: 18
2787
+ }
2788
+ },
2789
+ children: open ? /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftOutlined_default, {}) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRightOutlined_default, {})
2790
+ }
2791
+ )
2792
+ ] }) });
2793
+ }
2794
+ var itemSx = {
2795
+ borderRadius: 1,
2796
+ backgroundColor: bg.primary,
2797
+ color: text.secondary,
2798
+ "& .MuiListItemIcon-root": {
2799
+ color: navColors.itemIconFg
2800
+ },
2801
+ "&:hover": {
2802
+ backgroundColor: bg.primaryHover
2803
+ },
2804
+ "&.Mui-selected": {
2805
+ backgroundColor: bg.active,
2806
+ color: text.primary,
2807
+ "& .MuiListItemIcon-root": {
2808
+ color: navColors.itemIconFgActive
2809
+ },
2810
+ "& .MuiListItemText-primary": {
2811
+ fontWeight: 600
2812
+ },
2813
+ "&:hover": {
2814
+ backgroundColor: bg.primaryHover
2815
+ }
2816
+ }
2817
+ };
2818
+ function SidebarItem({
2819
+ icon,
2820
+ label,
2821
+ endAdornment,
2822
+ sx,
2823
+ ...rest
2824
+ }) {
2825
+ const { open } = useSidebar();
2826
+ if (!open) {
2827
+ return /* @__PURE__ */ jsxRuntime.jsx(MuiTooltip__default.default, { title: label, placement: "right", arrow: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2828
+ MuiListItemButton2__default.default,
2829
+ {
2830
+ ...rest,
2831
+ sx: {
2832
+ ...itemSx,
2833
+ display: "flex",
2834
+ justifyContent: "center",
2835
+ alignItems: "center",
2836
+ width: 40,
2837
+ height: 40,
2838
+ padding: 0,
2839
+ margin: "0 auto",
2840
+ ...sx
2841
+ },
2842
+ children: /* @__PURE__ */ jsxRuntime.jsx(ListItemIcon2__default.default, { sx: { minWidth: "unset", margin: 0, "& .MuiSvgIcon-root": { fontSize: 20 } }, children: icon })
2843
+ }
2844
+ ) });
2845
+ }
2846
+ return /* @__PURE__ */ jsxRuntime.jsxs(MuiListItemButton2__default.default, { ...rest, sx: { ...itemSx, height: 40, ...sx }, children: [
2847
+ /* @__PURE__ */ jsxRuntime.jsx(ListItemIcon2__default.default, { sx: { "& .MuiSvgIcon-root": { fontSize: 20 } }, children: icon }),
2848
+ /* @__PURE__ */ jsxRuntime.jsx(MuiListItemText__default.default, { primary: label }),
2849
+ endAdornment
2850
+ ] });
2851
+ }
2852
+ function useChartColors(count, palette2 = "categorical") {
2853
+ const theme = styles.useTheme();
2854
+ const chart = theme.palette.chart;
2855
+ const colors3 = chart[palette2] || chart.categorical || [
2856
+ "#7B61FF",
2857
+ "#FF7E67",
2858
+ "#76DFD5",
2859
+ "#F6C343",
2860
+ "#B36A6F"
2861
+ ];
2862
+ return colors3.slice(0, Math.min(count, colors3.length));
2863
+ }
2864
+ function formatDate(date) {
2865
+ if (!date) return "";
2866
+ const d = new Date(date);
2867
+ if (isNaN(d.getTime())) return String(date);
2868
+ return d.toLocaleDateString("en-US", {
2869
+ weekday: "short",
2870
+ month: "short",
2871
+ day: "numeric",
2872
+ year: "numeric"
2873
+ });
2874
+ }
2875
+ function renderValue(val) {
2876
+ if (val == null) return "0";
2877
+ if (typeof val === "object" && "y" in val) {
2878
+ return String(val.y);
2879
+ }
2880
+ return String(val);
2881
+ }
2882
+ function CustomTooltip(props) {
2883
+ const { series, axisValue, dataIndex } = props;
2884
+ const theme = styles.useTheme();
2885
+ if (dataIndex == null) {
2886
+ return null;
2887
+ }
2888
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2889
+ material.Box,
2890
+ {
2891
+ sx: {
2892
+ backgroundColor: theme.palette.common.white,
2893
+ borderRadius: "12px",
2894
+ boxShadow: "0px 12px 24px -4px #1018281a, 0px 4px 8px -2px #1018280f",
2895
+ // Very high elevation shadow per reference
2896
+ padding: "16px",
2897
+ minWidth: "200px",
2898
+ display: "flex",
2899
+ flexDirection: "column",
2900
+ gap: "12px",
2901
+ borderTop: `1px solid ${theme.palette.divider}`,
2902
+ borderRight: `1px solid ${theme.palette.divider}`,
2903
+ borderBottom: `1px solid ${theme.palette.divider}`,
2904
+ borderLeft: `4px solid ${theme.palette.chart.series1Fg}`
2905
+ // Primary Accent line
2906
+ },
2907
+ children: [
2908
+ /* @__PURE__ */ jsxRuntime.jsx(
2909
+ material.Typography,
2910
+ {
2911
+ variant: "body2",
2912
+ sx: {
2913
+ fontWeight: 600,
2914
+ color: theme.palette.text.primary,
2915
+ marginBottom: "4px"
2916
+ },
2917
+ children: formatDate(axisValue)
2918
+ }
2919
+ ),
2920
+ series.map((s) => {
2921
+ const color = typeof s.getColor === "function" ? s.getColor(dataIndex) : s.color;
2922
+ const value = s.data ? s.data[dataIndex] : null;
2923
+ if (value == null) return null;
2924
+ return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { display: "flex", flexDirection: "column", gap: "6px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2925
+ /* @__PURE__ */ jsxRuntime.jsx(
2926
+ material.Box,
2927
+ {
2928
+ sx: {
2929
+ width: 16,
2930
+ height: 16,
2931
+ borderRadius: "4px",
2932
+ backgroundColor: color,
2933
+ flexShrink: 0
2934
+ }
2935
+ }
2936
+ ),
2937
+ /* @__PURE__ */ jsxRuntime.jsxs(
2938
+ material.Typography,
2939
+ {
2940
+ variant: "body2",
2941
+ sx: {
2942
+ color: theme.palette.text.secondary,
2943
+ display: "flex",
2944
+ alignItems: "center",
2945
+ gap: "6px"
2946
+ },
2947
+ children: [
2948
+ /* @__PURE__ */ jsxRuntime.jsx(
2949
+ material.Box,
2950
+ {
2951
+ component: "span",
2952
+ sx: {
2953
+ backgroundColor: theme.palette.grey[50] || "#f9fafb",
2954
+ padding: "2px 6px",
2955
+ borderRadius: "4px",
2956
+ fontWeight: 500,
2957
+ color: theme.palette.text.primary,
2958
+ border: `1px solid ${theme.palette.divider}`
2959
+ },
2960
+ children: renderValue(value)
2961
+ }
2962
+ ),
2963
+ " ",
2964
+ "events"
2965
+ ]
2966
+ }
2967
+ )
2968
+ ] }) }, s.id);
2969
+ })
2970
+ ]
2971
+ }
2972
+ );
2973
+ }
2974
+ function LineChart({ series, colors: colors3, palette: palette2 = "categorical", ...props }) {
2975
+ var _a, _b;
2976
+ const theme = styles.useTheme();
2977
+ const chart = theme.palette.chart;
2978
+ const seriesColors = useChartColors((_a = series == null ? void 0 : series.length) != null ? _a : 0, palette2);
2979
+ const modifiedSeries = series == null ? void 0 : series.map((s) => {
2980
+ var _a2, _b2;
2981
+ return {
2982
+ ...s,
2983
+ curve: (_a2 = s.curve) != null ? _a2 : "monotoneX",
2984
+ highlightScope: (_b2 = s.highlightScope) != null ? _b2 : { highlighted: "item", faded: "global" }
2985
+ };
2986
+ });
2987
+ return /* @__PURE__ */ jsxRuntime.jsx(
2988
+ LineChart$1.LineChart,
2989
+ {
2990
+ series: modifiedSeries != null ? modifiedSeries : [],
2991
+ colors: colors3 != null ? colors3 : seriesColors,
2992
+ grid: { horizontal: true },
2993
+ slots: {
2994
+ axisContent: CustomTooltip
2995
+ },
2996
+ slotProps: {
2997
+ legend: {
2998
+ itemMarkWidth: 12,
2999
+ itemMarkHeight: 12,
3000
+ padding: { bottom: 20 }
3001
+ }
3002
+ },
3003
+ sx: {
3004
+ "& .MuiChartsAxis-line": { stroke: chart.axisFg },
3005
+ "& .MuiChartsAxis-tick": { stroke: chart.axisFg },
3006
+ "& .MuiChartsAxis-tickLabel": {
3007
+ fill: chart.labelFg,
3008
+ fontFamily: theme.typography.fontFamily,
3009
+ fontSize: typeof theme.typography.body2.fontSize === "number" ? theme.typography.body2.fontSize : 12
3010
+ },
3011
+ "& .MuiChartsAxis-label": {
3012
+ fill: chart.labelFgEmphasis,
3013
+ fontFamily: theme.typography.fontFamily,
3014
+ fontSize: typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14,
3015
+ fontWeight: theme.typography.fontWeightMedium
3016
+ },
3017
+ "& .MuiChartsGrid-line": {
3018
+ stroke: chart.gridlineFg,
3019
+ strokeDasharray: "4 4"
3020
+ },
3021
+ "& .MuiChartsLegend-series text": {
3022
+ fill: chart.legendFg,
3023
+ fontFamily: theme.typography.fontFamily,
3024
+ fontSize: "14px !important"
3025
+ },
3026
+ "& .MuiChartsLegend-mark": {
3027
+ ry: 4,
3028
+ rx: 4,
3029
+ width: 12,
3030
+ height: 12
3031
+ },
3032
+ "& .MuiChartsTooltip-root": {
3033
+ fontFamily: theme.typography.fontFamily,
3034
+ fontSize: typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14
3035
+ },
3036
+ "& .MuiChartsTooltip-table": {
3037
+ backgroundColor: chart.tooltipBg,
3038
+ color: chart.tooltipFg,
3039
+ borderRadius: theme.shape.borderRadius,
3040
+ boxShadow: theme.shadows[4]
3041
+ },
3042
+ "& .MuiLineElement-root": {
3043
+ strokeWidth: 3
3044
+ // Thicker lines for line charts
3045
+ },
3046
+ ...(_b = props.sx) != null ? _b : {}
3047
+ },
3048
+ ...props
3049
+ }
3050
+ );
3051
+ }
3052
+ function BarChart({ series, colors: colors3, palette: palette2 = "categorical", ...props }) {
3053
+ var _a, _b;
3054
+ const theme = styles.useTheme();
3055
+ const chart = theme.palette.chart;
3056
+ const seriesColors = useChartColors((_a = series == null ? void 0 : series.length) != null ? _a : 0, palette2);
3057
+ const resolvedColors = colors3 != null ? colors3 : seriesColors;
3058
+ const modifiedSeries = series == null ? void 0 : series.map((s, idx) => {
3059
+ var _a2;
3060
+ const baseColor = s.color || resolvedColors[idx % resolvedColors.length];
3061
+ const actualColor = s.variant === "striped" ? `url(#striped-pattern-${idx})` : baseColor;
3062
+ const { variant, ...rest } = s;
3063
+ return {
3064
+ ...rest,
3065
+ color: actualColor,
3066
+ highlightScope: (_a2 = s.highlightScope) != null ? _a2 : { highlighted: "item", faded: "global" }
3067
+ };
3068
+ });
3069
+ return /* @__PURE__ */ jsxRuntime.jsx(
3070
+ BarChart$1.BarChart,
3071
+ {
3072
+ series: modifiedSeries != null ? modifiedSeries : [],
3073
+ colors: colors3 != null ? colors3 : seriesColors,
3074
+ grid: { horizontal: true },
3075
+ borderRadius: 4,
3076
+ slots: {
3077
+ axisContent: CustomTooltip
3078
+ },
3079
+ slotProps: {
3080
+ legend: {
3081
+ itemMarkWidth: 12,
3082
+ itemMarkHeight: 12,
3083
+ padding: { bottom: 20 }
3084
+ }
3085
+ },
3086
+ sx: {
3087
+ "& .MuiChartsAxis-line": { stroke: chart.axisFg },
3088
+ "& .MuiChartsAxis-tick": { stroke: chart.axisFg },
3089
+ "& .MuiChartsAxis-tickLabel": {
3090
+ fill: chart.labelFg,
3091
+ fontFamily: theme.typography.fontFamily,
3092
+ fontSize: typeof theme.typography.body2.fontSize === "number" ? theme.typography.body2.fontSize : 12
3093
+ // fallback to xs value conceptually if needed
3094
+ },
3095
+ "& .MuiChartsAxis-label": {
3096
+ fill: chart.labelFgEmphasis,
3097
+ fontFamily: theme.typography.fontFamily,
3098
+ fontSize: typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14,
3099
+ fontWeight: theme.typography.fontWeightMedium
3100
+ },
3101
+ "& .MuiChartsGrid-line": {
3102
+ stroke: chart.gridlineFg,
3103
+ strokeDasharray: "4 4"
3104
+ },
3105
+ "& .MuiChartsLegend-series text": {
3106
+ fill: chart.legendFg,
3107
+ fontFamily: theme.typography.fontFamily,
3108
+ fontSize: "14px !important"
3109
+ },
3110
+ "& .MuiChartsLegend-mark": {
3111
+ ry: 4,
3112
+ rx: 4,
3113
+ width: 12,
3114
+ height: 12
3115
+ },
3116
+ "& .MuiChartsTooltip-root": {
3117
+ fontFamily: theme.typography.fontFamily,
3118
+ fontSize: typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14
3119
+ },
3120
+ "& .MuiChartsTooltip-table": {
3121
+ backgroundColor: chart.tooltipBg,
3122
+ color: chart.tooltipFg,
3123
+ borderRadius: theme.shape.borderRadius,
3124
+ boxShadow: theme.shadows[4]
3125
+ // md equivalent in MUI default array length
3126
+ },
3127
+ ...(_b = props.sx) != null ? _b : {}
3128
+ },
3129
+ ...props,
3130
+ children: /* @__PURE__ */ jsxRuntime.jsx("defs", { children: series == null ? void 0 : series.map((s, idx) => {
3131
+ if (s.variant !== "striped") return null;
3132
+ const baseColor = s.color || resolvedColors[idx % resolvedColors.length];
3133
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3134
+ "pattern",
3135
+ {
3136
+ id: `striped-pattern-${idx}`,
3137
+ patternUnits: "userSpaceOnUse",
3138
+ width: "8",
3139
+ height: "8",
3140
+ patternTransform: "rotate(45)",
3141
+ children: [
3142
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "8", height: "8", fill: theme.palette.background.paper }),
3143
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "0", y: "0", x2: "0", y2: "8", stroke: baseColor, strokeWidth: "4" })
3144
+ ]
3145
+ },
3146
+ `striped-${idx}`
3147
+ );
3148
+ }) })
3149
+ }
3150
+ );
3151
+ }
3152
+ function PieChart({ series, colors: colors3, palette: palette2 = "categorical", ...props }) {
3153
+ var _a, _b, _c, _d;
3154
+ const theme = styles.useTheme();
3155
+ const chart = theme.palette.chart;
3156
+ const sliceCount = (_c = (_b = (_a = series == null ? void 0 : series[0]) == null ? void 0 : _a.data) == null ? void 0 : _b.length) != null ? _c : 0;
3157
+ const seriesColors = useChartColors(sliceCount, palette2);
3158
+ const modifiedSeries = series == null ? void 0 : series.map((s) => {
3159
+ var _a2;
3160
+ return {
3161
+ ...s,
3162
+ highlightScope: (_a2 = s.highlightScope) != null ? _a2 : { highlighted: "item", faded: "global" }
3163
+ };
3164
+ });
3165
+ return /* @__PURE__ */ jsxRuntime.jsx(
3166
+ PieChart$1.PieChart,
3167
+ {
3168
+ series: modifiedSeries != null ? modifiedSeries : [],
3169
+ colors: colors3 != null ? colors3 : seriesColors,
3170
+ slotProps: {
3171
+ legend: {
3172
+ itemMarkWidth: 12,
3173
+ itemMarkHeight: 12,
3174
+ padding: { bottom: 20 }
3175
+ }
3176
+ },
3177
+ sx: {
3178
+ "& .MuiChartsLegend-series text": {
3179
+ fill: chart.legendFg,
3180
+ fontFamily: theme.typography.fontFamily,
3181
+ fontSize: "14px !important"
3182
+ },
3183
+ "& .MuiChartsLegend-mark": {
3184
+ ry: 4,
3185
+ rx: 4,
3186
+ width: 12,
3187
+ height: 12
3188
+ },
3189
+ "& .MuiChartsTooltip-root": {
3190
+ fontFamily: theme.typography.fontFamily,
3191
+ fontSize: typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14
3192
+ },
3193
+ "& .MuiChartsTooltip-table": {
3194
+ backgroundColor: chart.tooltipBg,
3195
+ color: chart.tooltipFg,
3196
+ borderRadius: theme.shape.borderRadius,
3197
+ boxShadow: theme.shadows[4]
3198
+ },
3199
+ ...(_d = props.sx) != null ? _d : {}
3200
+ },
3201
+ ...props
3202
+ }
3203
+ );
3204
+ }
2503
3205
 
2504
3206
  exports.Accordion = Accordion;
2505
3207
  exports.AccordionActions = AccordionActions;
@@ -2511,6 +3213,7 @@ exports.AppBar = AppBar;
2511
3213
  exports.Autocomplete = Autocomplete;
2512
3214
  exports.Backdrop = Backdrop;
2513
3215
  exports.Badge = Badge;
3216
+ exports.BarChart = BarChart;
2514
3217
  exports.Button = Button;
2515
3218
  exports.ButtonGroup = ButtonGroup;
2516
3219
  exports.Card = Card;
@@ -2530,6 +3233,7 @@ exports.DialogTitle = DialogTitle;
2530
3233
  exports.Divider = Divider;
2531
3234
  exports.Fab = Fab;
2532
3235
  exports.ForestProvider = ForestProvider;
3236
+ exports.LineChart = LineChart;
2533
3237
  exports.LinearProgress = LinearProgress;
2534
3238
  exports.List = List;
2535
3239
  exports.ListItem = ListItem;
@@ -2539,10 +3243,14 @@ exports.ListItemIcon = ListItemIcon;
2539
3243
  exports.ListItemText = ListItemText;
2540
3244
  exports.ListSubheader = ListSubheader;
2541
3245
  exports.MenuItem = MenuItem;
3246
+ exports.MultiSelect = MultiSelect;
2542
3247
  exports.Paper = Paper;
3248
+ exports.PieChart = PieChart;
2543
3249
  exports.Radio = Radio;
2544
3250
  exports.RadioGroup = RadioGroup;
2545
3251
  exports.Select = Select;
3252
+ exports.SidebarItem = SidebarItem;
3253
+ exports.SidebarNav = SidebarNav;
2546
3254
  exports.Skeleton = Skeleton;
2547
3255
  exports.Snackbar = Snackbar;
2548
3256
  exports.Switch = Switch;
@@ -2591,6 +3299,8 @@ exports.spacing = spacing;
2591
3299
  exports.text = text;
2592
3300
  exports.toggleColors = toggleColors;
2593
3301
  exports.tokenShadows = shadows;
3302
+ exports.useChartColors = useChartColors;
3303
+ exports.useSidebar = useSidebar;
2594
3304
  exports.widths = widths;
2595
3305
  //# sourceMappingURL=index.js.map
2596
3306
  //# sourceMappingURL=index.js.map