@matteoaliano/forest-ui 0.2.9 → 0.2.11

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { bg, navColors, text, forestTheme, getPreset, buildTheme } from './chunk-QF5T6J4D.mjs';
2
- export { alkemyPlusPreset, alpha, avatarColors, bg, border, breadcrumbColors, buildTheme, buildThemeOptions, buttonColors, chartColors, colors, container, display, fg, focusRings, fontFamily, fontSize, fontWeight, forestPreset, forestTheme, forestThemeOptions, getAvailablePresets, getPreset, iconColors, lineHeight, navColors, radius, registerPreset, sliderColors, spacing, text, toggleColors, shadows as tokenShadows, widths } from './chunk-QF5T6J4D.mjs';
3
- import { createContext, useMemo, useContext } from 'react';
4
- import { ThemeProvider } from '@mui/material/styles';
1
+ import { bg, navColors, text, forestTheme, getPreset, buildTheme, lineHeight, fontSize } from './chunk-6W3RIXXY.mjs';
2
+ export { alkemyPlusPreset, alpha, avatarColors, bg, border, breadcrumbColors, buildTheme, buildThemeOptions, buttonColors, chartColors, colors, container, display, fg, focusRings, fontFamily, fontSize, fontWeight, forestPreset, forestTheme, forestThemeOptions, getAvailablePresets, getPreset, iconColors, lineHeight, navColors, radius, registerPreset, sliderColors, spacing, text, toggleColors, shadows as tokenShadows, widths } from './chunk-6W3RIXXY.mjs';
3
+ import React2, { createContext, useMemo, useState, useCallback, useContext } from 'react';
4
+ import { ThemeProvider, useTheme } from '@mui/material/styles';
5
5
  import CssBaseline from '@mui/material/CssBaseline';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
7
  import MuiAutocomplete from '@mui/material/Autocomplete';
@@ -13,19 +13,26 @@ import MuiRadioGroup from '@mui/material/RadioGroup';
13
13
  import MuiRadio from '@mui/material/Radio';
14
14
  import MuiSelect from '@mui/material/Select';
15
15
  import MuiMenuItem from '@mui/material/MenuItem';
16
+ import MuiListItemText from '@mui/material/ListItemText';
17
+ import MuiFormControl from '@mui/material/FormControl';
18
+ import MuiInputLabel from '@mui/material/InputLabel';
16
19
  import MuiSwitch from '@mui/material/Switch';
17
20
  import MuiTextField from '@mui/material/TextField';
21
+ import InputAdornment from '@mui/material/InputAdornment';
22
+ import IconButton from '@mui/material/IconButton';
23
+ import { createSvgIcon } from '@mui/material/utils';
18
24
  import MuiToggleButton from '@mui/material/ToggleButton';
19
25
  import MuiToggleButtonGroup from '@mui/material/ToggleButtonGroup';
26
+ import { DatePicker as DatePicker$1 } from '@mui/x-date-pickers/DatePicker';
27
+ import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
28
+ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
20
29
  import MuiBadge from '@mui/material/Badge';
21
30
  import MuiChip from '@mui/material/Chip';
22
- import { createSvgIcon } from '@mui/material/utils';
23
31
  import MuiDivider from '@mui/material/Divider';
24
32
  import MuiList from '@mui/material/List';
25
33
  import MuiListItem from '@mui/material/ListItem';
26
34
  import MuiListItemButton2 from '@mui/material/ListItemButton';
27
35
  import ListItemIcon2 from '@mui/material/ListItemIcon';
28
- import MuiListItemText from '@mui/material/ListItemText';
29
36
  import MuiListItemAvatar from '@mui/material/ListItemAvatar';
30
37
  import MuiListSubheader from '@mui/material/ListSubheader';
31
38
  import MuiTable from '@mui/material/Table';
@@ -60,10 +67,25 @@ import MuiDialogContentText from '@mui/material/DialogContentText';
60
67
  import MuiLinearProgress from '@mui/material/LinearProgress';
61
68
  import MuiCircularProgress from '@mui/material/CircularProgress';
62
69
  import MuiSkeleton from '@mui/material/Skeleton';
70
+ import MuiModal from '@mui/material/Modal';
71
+ import MuiPopover from '@mui/material/Popover';
63
72
  import MuiSnackbar from '@mui/material/Snackbar';
73
+ import MuiBreadcrumbs from '@mui/material/Breadcrumbs';
74
+ import MuiLink from '@mui/material/Link';
75
+ import MuiMenu from '@mui/material/Menu';
76
+ import MuiMenuList from '@mui/material/MenuList';
77
+ import MuiPagination from '@mui/material/Pagination';
78
+ import MuiStepper from '@mui/material/Stepper';
79
+ import MuiStep from '@mui/material/Step';
80
+ import MuiStepLabel from '@mui/material/StepLabel';
81
+ import MuiTabs from '@mui/material/Tabs';
82
+ import MuiTab from '@mui/material/Tab';
64
83
  import MuiDrawer from '@mui/material/Drawer';
65
84
  import Box from '@mui/material/Box';
66
- import IconButton from '@mui/material/IconButton';
85
+ import { LineChart as LineChart$1 } from '@mui/x-charts/LineChart';
86
+ import { Box as Box$1, Typography as Typography$1 } from '@mui/material';
87
+ import { BarChart as BarChart$1 } from '@mui/x-charts/BarChart';
88
+ import { PieChart as PieChart$1 } from '@mui/x-charts/PieChart';
67
89
 
68
90
  function ForestProvider({
69
91
  children,
@@ -122,18 +144,137 @@ function Select(props) {
122
144
  function MenuItem(props) {
123
145
  return /* @__PURE__ */ jsx(MuiMenuItem, { ...props });
124
146
  }
147
+ function MultiSelect({
148
+ options,
149
+ value,
150
+ onChange,
151
+ selectAll = true,
152
+ selectAllLabel = "Select All",
153
+ label,
154
+ ...rest
155
+ }) {
156
+ const allSelected = options.length > 0 && value.length === options.length;
157
+ const handleChange = (event) => {
158
+ const selected = event.target.value;
159
+ const arr = typeof selected === "string" ? selected.split(",") : selected;
160
+ onChange(arr);
161
+ };
162
+ const handleSelectAll = () => {
163
+ onChange(allSelected ? [] : options.map((o) => o.value));
164
+ };
165
+ const labelMap = new Map(options.map((o) => [o.value, o.label]));
166
+ const renderValue2 = (selected) => selected.map((v) => {
167
+ var _a;
168
+ return (_a = labelMap.get(v)) != null ? _a : v;
169
+ }).join(", ");
170
+ const labelId = label ? `forest-multiselect-${String(label).replace(/\s+/g, "-").toLowerCase()}` : void 0;
171
+ return /* @__PURE__ */ jsxs(MuiFormControl, { fullWidth: true, children: [
172
+ label && /* @__PURE__ */ jsx(MuiInputLabel, { id: labelId, shrink: value.length > 0, children: label }),
173
+ /* @__PURE__ */ jsxs(
174
+ MuiSelect,
175
+ {
176
+ labelId,
177
+ label,
178
+ multiple: true,
179
+ notched: value.length > 0,
180
+ value,
181
+ onChange: handleChange,
182
+ displayEmpty: true,
183
+ renderValue: renderValue2,
184
+ ...rest,
185
+ children: [
186
+ selectAll && /* @__PURE__ */ jsx(
187
+ "li",
188
+ {
189
+ onMouseDown: (e) => e.preventDefault(),
190
+ onClick: (e) => {
191
+ e.stopPropagation();
192
+ handleSelectAll();
193
+ },
194
+ children: /* @__PURE__ */ jsx(MuiButton, { size: "small", variant: "text", children: allSelected ? "Deselect All" : selectAllLabel })
195
+ }
196
+ ),
197
+ options.map((option) => /* @__PURE__ */ jsxs(MuiMenuItem, { value: option.value, children: [
198
+ /* @__PURE__ */ jsx(MuiCheckbox, { checked: value.includes(option.value) }),
199
+ /* @__PURE__ */ jsx(MuiListItemText, { primary: option.label })
200
+ ] }, option.value))
201
+ ]
202
+ }
203
+ )
204
+ ] });
205
+ }
125
206
  function Switch(props) {
126
207
  return /* @__PURE__ */ jsx(MuiSwitch, { ...props });
127
208
  }
128
209
  function TextField(props) {
129
210
  return /* @__PURE__ */ jsx(MuiTextField, { ...props });
130
211
  }
212
+ var Search_default = createSvgIcon(/* @__PURE__ */ jsx("path", {
213
+ d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"
214
+ }), "Search");
215
+ var Clear_default = createSvgIcon(/* @__PURE__ */ jsx("path", {
216
+ d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
217
+ }), "Clear");
218
+ function Search({
219
+ value: controlledValue,
220
+ onChange,
221
+ onClear,
222
+ placeholder = "Search\u2026",
223
+ slotProps,
224
+ ...props
225
+ }) {
226
+ const [internalValue, setInternalValue] = useState("");
227
+ const isControlled = controlledValue !== void 0;
228
+ const currentValue = isControlled ? controlledValue : internalValue;
229
+ const handleChange = useCallback(
230
+ (e) => {
231
+ if (!isControlled) setInternalValue(e.target.value);
232
+ onChange == null ? void 0 : onChange(e);
233
+ },
234
+ [isControlled, onChange]
235
+ );
236
+ const handleClear = useCallback(() => {
237
+ if (!isControlled) setInternalValue("");
238
+ onClear == null ? void 0 : onClear();
239
+ }, [isControlled, onClear]);
240
+ return /* @__PURE__ */ jsx(
241
+ MuiTextField,
242
+ {
243
+ variant: "outlined",
244
+ placeholder,
245
+ value: currentValue,
246
+ onChange: handleChange,
247
+ slotProps: {
248
+ ...slotProps,
249
+ input: {
250
+ sx: { pl: "12px", gap: 0 },
251
+ startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", sx: { mr: 0 }, children: /* @__PURE__ */ jsx(Search_default, { sx: { fontSize: 20 } }) }),
252
+ endAdornment: currentValue ? /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(
253
+ IconButton,
254
+ {
255
+ "aria-label": "clear search",
256
+ onClick: handleClear,
257
+ edge: "end",
258
+ size: "small",
259
+ children: /* @__PURE__ */ jsx(Clear_default, { fontSize: "small" })
260
+ }
261
+ ) }) : null,
262
+ ...typeof (slotProps == null ? void 0 : slotProps.input) === "object" ? slotProps.input : {}
263
+ }
264
+ },
265
+ ...props
266
+ }
267
+ );
268
+ }
131
269
  function ToggleButton(props) {
132
270
  return /* @__PURE__ */ jsx(MuiToggleButton, { ...props });
133
271
  }
134
272
  function ToggleButtonGroup(props) {
135
273
  return /* @__PURE__ */ jsx(MuiToggleButtonGroup, { ...props });
136
274
  }
275
+ function DatePicker(props) {
276
+ return /* @__PURE__ */ jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, children: /* @__PURE__ */ jsx(DatePicker$1, { ...props }) });
277
+ }
137
278
  function Badge(props) {
138
279
  return /* @__PURE__ */ jsx(MuiBadge, { ...props });
139
280
  }
@@ -236,9 +377,9 @@ function CardMedia(props) {
236
377
  function Paper(props) {
237
378
  return /* @__PURE__ */ jsx(MuiPaper, { ...props });
238
379
  }
239
- function Alert(props) {
240
- return /* @__PURE__ */ jsx(MuiAlert, { ...props });
241
- }
380
+ var Alert = React2.forwardRef(function Alert2(props, ref) {
381
+ return /* @__PURE__ */ jsx(MuiAlert, { ref, ...props });
382
+ });
242
383
  function AlertTitle(props) {
243
384
  return /* @__PURE__ */ jsx(MuiAlertTitle, { ...props });
244
385
  }
@@ -269,9 +410,45 @@ function CircularProgress(props) {
269
410
  function Skeleton(props) {
270
411
  return /* @__PURE__ */ jsx(MuiSkeleton, { ...props });
271
412
  }
413
+ function Modal(props) {
414
+ return /* @__PURE__ */ jsx(MuiModal, { ...props });
415
+ }
416
+ function Popover(props) {
417
+ return /* @__PURE__ */ jsx(MuiPopover, { ...props });
418
+ }
272
419
  function Snackbar(props) {
273
420
  return /* @__PURE__ */ jsx(MuiSnackbar, { ...props });
274
421
  }
422
+ function Breadcrumbs(props) {
423
+ return /* @__PURE__ */ jsx(MuiBreadcrumbs, { ...props });
424
+ }
425
+ function Link(props) {
426
+ return /* @__PURE__ */ jsx(MuiLink, { ...props });
427
+ }
428
+ function Menu(props) {
429
+ return /* @__PURE__ */ jsx(MuiMenu, { ...props });
430
+ }
431
+ function MenuList(props) {
432
+ return /* @__PURE__ */ jsx(MuiMenuList, { ...props });
433
+ }
434
+ function Pagination(props) {
435
+ return /* @__PURE__ */ jsx(MuiPagination, { ...props });
436
+ }
437
+ function Stepper(props) {
438
+ return /* @__PURE__ */ jsx(MuiStepper, { ...props });
439
+ }
440
+ function Step(props) {
441
+ return /* @__PURE__ */ jsx(MuiStep, { ...props });
442
+ }
443
+ function StepLabel(props) {
444
+ return /* @__PURE__ */ jsx(MuiStepLabel, { ...props });
445
+ }
446
+ function Tabs(props) {
447
+ return /* @__PURE__ */ jsx(MuiTabs, { ...props });
448
+ }
449
+ function Tab(props) {
450
+ return /* @__PURE__ */ jsx(MuiTab, { ...props });
451
+ }
275
452
  var ChevronLeftOutlined_default = createSvgIcon(/* @__PURE__ */ jsx("path", {
276
453
  d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"
277
454
  }), "ChevronLeftOutlined");
@@ -431,7 +608,355 @@ function SidebarItem({
431
608
  endAdornment
432
609
  ] });
433
610
  }
611
+ function useChartColors(count) {
612
+ const theme = useTheme();
613
+ const chart = theme.palette.chart;
614
+ const colors2 = chart.series.map((s) => s.fg);
615
+ return colors2.slice(0, Math.min(count, colors2.length));
616
+ }
617
+ function formatDate(date) {
618
+ if (!date) return "";
619
+ const d = new Date(date);
620
+ if (isNaN(d.getTime())) return String(date);
621
+ return d.toLocaleDateString("en-US", {
622
+ weekday: "short",
623
+ month: "short",
624
+ day: "numeric",
625
+ year: "numeric"
626
+ });
627
+ }
628
+ function renderValue(val) {
629
+ if (val == null) return "0";
630
+ if (typeof val === "object" && "y" in val) {
631
+ return String(val.y);
632
+ }
633
+ return String(val);
634
+ }
635
+ function CustomTooltip(props) {
636
+ const { series, axisValue, dataIndex } = props;
637
+ const theme = useTheme();
638
+ if (dataIndex == null) {
639
+ return null;
640
+ }
641
+ return /* @__PURE__ */ jsxs(
642
+ Box$1,
643
+ {
644
+ sx: {
645
+ backgroundColor: theme.palette.common.white,
646
+ borderRadius: "12px",
647
+ boxShadow: "0px 12px 24px -4px #1018281a, 0px 4px 8px -2px #1018280f",
648
+ // Very high elevation shadow per reference
649
+ padding: "16px",
650
+ minWidth: "200px",
651
+ display: "flex",
652
+ flexDirection: "column",
653
+ gap: "12px",
654
+ borderTop: `1px solid ${theme.palette.divider}`,
655
+ borderRight: `1px solid ${theme.palette.divider}`,
656
+ borderBottom: `1px solid ${theme.palette.divider}`,
657
+ borderLeft: `4px solid ${theme.palette.chart.series[0].fg}`
658
+ },
659
+ children: [
660
+ /* @__PURE__ */ jsx(
661
+ Typography$1,
662
+ {
663
+ variant: "body2",
664
+ sx: {
665
+ fontWeight: 600,
666
+ color: theme.palette.text.primary,
667
+ marginBottom: "4px"
668
+ },
669
+ children: formatDate(axisValue)
670
+ }
671
+ ),
672
+ series.map((s) => {
673
+ const color = typeof s.getColor === "function" ? s.getColor(dataIndex) : s.color;
674
+ const value = s.data ? s.data[dataIndex] : null;
675
+ if (value == null) return null;
676
+ return /* @__PURE__ */ jsx(Box$1, { sx: { display: "flex", flexDirection: "column", gap: "6px" }, children: /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
677
+ /* @__PURE__ */ jsx(
678
+ Box$1,
679
+ {
680
+ sx: {
681
+ width: 16,
682
+ height: 16,
683
+ borderRadius: "4px",
684
+ backgroundColor: color,
685
+ flexShrink: 0
686
+ }
687
+ }
688
+ ),
689
+ /* @__PURE__ */ jsxs(
690
+ Typography$1,
691
+ {
692
+ variant: "body2",
693
+ sx: {
694
+ color: theme.palette.text.secondary,
695
+ display: "flex",
696
+ alignItems: "center",
697
+ gap: "6px"
698
+ },
699
+ children: [
700
+ /* @__PURE__ */ jsx(
701
+ Box$1,
702
+ {
703
+ component: "span",
704
+ sx: {
705
+ backgroundColor: theme.palette.grey[50] || "#f9fafb",
706
+ padding: "2px 6px",
707
+ borderRadius: "4px",
708
+ fontWeight: 500,
709
+ color: theme.palette.text.primary,
710
+ border: `1px solid ${theme.palette.divider}`
711
+ },
712
+ children: renderValue(value)
713
+ }
714
+ ),
715
+ " ",
716
+ "events"
717
+ ]
718
+ }
719
+ )
720
+ ] }) }, s.id);
721
+ })
722
+ ]
723
+ }
724
+ );
725
+ }
726
+ function LineChart({ series, colors: colors2, ...props }) {
727
+ var _a, _b;
728
+ const theme = useTheme();
729
+ const chart = theme.palette.chart;
730
+ const seriesColors = useChartColors((_a = series == null ? void 0 : series.length) != null ? _a : 0);
731
+ const modifiedSeries = series == null ? void 0 : series.map((s) => {
732
+ var _a2, _b2;
733
+ return {
734
+ ...s,
735
+ curve: (_a2 = s.curve) != null ? _a2 : "linear",
736
+ highlightScope: (_b2 = s.highlightScope) != null ? _b2 : { highlighted: "item", faded: "global" }
737
+ };
738
+ });
739
+ return /* @__PURE__ */ jsx(
740
+ LineChart$1,
741
+ {
742
+ series: modifiedSeries != null ? modifiedSeries : [],
743
+ colors: colors2 != null ? colors2 : seriesColors,
744
+ grid: { horizontal: true },
745
+ slots: {
746
+ axisContent: CustomTooltip
747
+ },
748
+ slotProps: {
749
+ legend: {
750
+ itemMarkWidth: 12,
751
+ itemMarkHeight: 12,
752
+ padding: { bottom: 20 }
753
+ }
754
+ },
755
+ sx: {
756
+ "& .MuiChartsAxis-line": { stroke: `${chart.axisFg} !important` },
757
+ "& .MuiChartsAxis-tick": { stroke: `${chart.axisFg} !important` },
758
+ "& .MuiChartsAxis-tickLabel": {
759
+ fill: `${chart.labelFg} !important`,
760
+ fontFamily: `${theme.typography.fontFamily} !important`,
761
+ fontSize: `${fontSize.xxs}px !important`,
762
+ lineHeight: lineHeight.xxs
763
+ },
764
+ "& .MuiChartsAxis-label": {
765
+ fill: `${chart.labelFgEmphasis} !important`,
766
+ fontFamily: `${theme.typography.fontFamily} !important`,
767
+ fontSize: `${typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14}px !important`,
768
+ fontWeight: theme.typography.fontWeightMedium
769
+ },
770
+ "& .MuiChartsGrid-line": {
771
+ stroke: chart.gridlineFg,
772
+ strokeDasharray: "4 4"
773
+ },
774
+ "& .MuiChartsLegend-series text": {
775
+ fill: `${chart.legendFg} !important`,
776
+ fontFamily: `${theme.typography.fontFamily} !important`,
777
+ fontSize: "14px !important"
778
+ },
779
+ "& .MuiChartsLegend-mark": {
780
+ ry: 4,
781
+ rx: 4,
782
+ width: 12,
783
+ height: 12
784
+ },
785
+ "& .MuiChartsTooltip-root": {
786
+ fontFamily: theme.typography.fontFamily,
787
+ fontSize: typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14
788
+ },
789
+ "& .MuiChartsTooltip-table": {
790
+ backgroundColor: chart.tooltipBg,
791
+ color: chart.tooltipFg,
792
+ borderRadius: theme.shape.borderRadius,
793
+ boxShadow: theme.shadows[4]
794
+ },
795
+ "& .MuiLineElement-root": {
796
+ strokeWidth: 3
797
+ },
798
+ "& .MuiMarkElement-root": {
799
+ display: "none"
800
+ },
801
+ ...(_b = props.sx) != null ? _b : {}
802
+ },
803
+ ...props
804
+ }
805
+ );
806
+ }
807
+ function BarChart({ series, colors: colors2, ...props }) {
808
+ var _a, _b;
809
+ const theme = useTheme();
810
+ const chart = theme.palette.chart;
811
+ const seriesColors = useChartColors((_a = series == null ? void 0 : series.length) != null ? _a : 0);
812
+ const resolvedColors = colors2 != null ? colors2 : seriesColors;
813
+ const modifiedSeries = series == null ? void 0 : series.map((s, idx) => {
814
+ var _a2;
815
+ const baseColor = s.color || resolvedColors[idx % resolvedColors.length];
816
+ const actualColor = s.variant === "striped" ? `url(#striped-pattern-${idx})` : baseColor;
817
+ const { variant, ...rest } = s;
818
+ return {
819
+ ...rest,
820
+ color: actualColor,
821
+ highlightScope: (_a2 = s.highlightScope) != null ? _a2 : { highlighted: "item", faded: "global" }
822
+ };
823
+ });
824
+ return /* @__PURE__ */ jsx(
825
+ BarChart$1,
826
+ {
827
+ series: modifiedSeries != null ? modifiedSeries : [],
828
+ colors: colors2 != null ? colors2 : seriesColors,
829
+ grid: { horizontal: true },
830
+ borderRadius: 4,
831
+ slots: {
832
+ axisContent: CustomTooltip
833
+ },
834
+ slotProps: {
835
+ legend: {
836
+ itemMarkWidth: 12,
837
+ itemMarkHeight: 12,
838
+ padding: { bottom: 20 }
839
+ }
840
+ },
841
+ sx: {
842
+ "& .MuiChartsAxis-line": { stroke: `${chart.axisFg} !important` },
843
+ "& .MuiChartsAxis-tick": { stroke: `${chart.axisFg} !important` },
844
+ "& .MuiChartsAxis-tickLabel": {
845
+ fill: `${chart.labelFg} !important`,
846
+ fontFamily: `${theme.typography.fontFamily} !important`,
847
+ fontSize: `${fontSize.xxs}px !important`,
848
+ lineHeight: lineHeight.xxs
849
+ },
850
+ "& .MuiChartsAxis-label": {
851
+ fill: `${chart.labelFgEmphasis} !important`,
852
+ fontFamily: `${theme.typography.fontFamily} !important`,
853
+ fontSize: `${typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14}px !important`,
854
+ fontWeight: theme.typography.fontWeightMedium
855
+ },
856
+ "& .MuiChartsGrid-line": {
857
+ stroke: chart.gridlineFg,
858
+ strokeDasharray: "4 4"
859
+ },
860
+ "& .MuiChartsLegend-series text": {
861
+ fill: `${chart.legendFg} !important`,
862
+ fontFamily: `${theme.typography.fontFamily} !important`,
863
+ fontSize: "14px !important"
864
+ },
865
+ "& .MuiChartsLegend-mark": {
866
+ ry: 4,
867
+ rx: 4,
868
+ width: 12,
869
+ height: 12
870
+ },
871
+ "& .MuiChartsTooltip-root": {
872
+ fontFamily: theme.typography.fontFamily,
873
+ fontSize: typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14
874
+ },
875
+ "& .MuiChartsTooltip-table": {
876
+ backgroundColor: chart.tooltipBg,
877
+ color: chart.tooltipFg,
878
+ borderRadius: theme.shape.borderRadius,
879
+ boxShadow: theme.shadows[4]
880
+ },
881
+ ...(_b = props.sx) != null ? _b : {}
882
+ },
883
+ ...props,
884
+ children: /* @__PURE__ */ jsx("defs", { children: series == null ? void 0 : series.map((s, idx) => {
885
+ if (s.variant !== "striped") return null;
886
+ const baseColor = s.color || resolvedColors[idx % resolvedColors.length];
887
+ return /* @__PURE__ */ jsxs(
888
+ "pattern",
889
+ {
890
+ id: `striped-pattern-${idx}`,
891
+ patternUnits: "userSpaceOnUse",
892
+ width: "8",
893
+ height: "8",
894
+ patternTransform: "rotate(45)",
895
+ children: [
896
+ /* @__PURE__ */ jsx("rect", { width: "8", height: "8", fill: theme.palette.background.paper }),
897
+ /* @__PURE__ */ jsx("line", { x1: "0", y: "0", x2: "0", y2: "8", stroke: baseColor, strokeWidth: "4" })
898
+ ]
899
+ },
900
+ `striped-${idx}`
901
+ );
902
+ }) })
903
+ }
904
+ );
905
+ }
906
+ function PieChart({ series, colors: colors2, ...props }) {
907
+ var _a, _b, _c, _d;
908
+ const theme = useTheme();
909
+ const chart = theme.palette.chart;
910
+ const sliceCount = (_c = (_b = (_a = series == null ? void 0 : series[0]) == null ? void 0 : _a.data) == null ? void 0 : _b.length) != null ? _c : 0;
911
+ const seriesColors = useChartColors(sliceCount);
912
+ const modifiedSeries = series == null ? void 0 : series.map((s) => {
913
+ var _a2;
914
+ return {
915
+ ...s,
916
+ highlightScope: (_a2 = s.highlightScope) != null ? _a2 : { highlighted: "item", faded: "global" }
917
+ };
918
+ });
919
+ return /* @__PURE__ */ jsx(
920
+ PieChart$1,
921
+ {
922
+ series: modifiedSeries != null ? modifiedSeries : [],
923
+ colors: colors2 != null ? colors2 : seriesColors,
924
+ slotProps: {
925
+ legend: {
926
+ itemMarkWidth: 12,
927
+ itemMarkHeight: 12,
928
+ padding: { bottom: 20 }
929
+ }
930
+ },
931
+ sx: {
932
+ "& .MuiChartsLegend-series text": {
933
+ fill: `${chart.legendFg} !important`,
934
+ fontFamily: `${theme.typography.fontFamily} !important`,
935
+ fontSize: "14px !important"
936
+ },
937
+ "& .MuiChartsLegend-mark": {
938
+ ry: 4,
939
+ rx: 4,
940
+ width: 12,
941
+ height: 12
942
+ },
943
+ "& .MuiChartsTooltip-root": {
944
+ fontFamily: theme.typography.fontFamily,
945
+ fontSize: typeof theme.typography.body1.fontSize === "number" ? theme.typography.body1.fontSize : 14
946
+ },
947
+ "& .MuiChartsTooltip-table": {
948
+ backgroundColor: chart.tooltipBg,
949
+ color: chart.tooltipFg,
950
+ borderRadius: theme.shape.borderRadius,
951
+ boxShadow: theme.shadows[4]
952
+ },
953
+ ...(_d = props.sx) != null ? _d : {}
954
+ },
955
+ ...props
956
+ }
957
+ );
958
+ }
434
959
 
435
- export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Alert, AlertTitle, AppBar, Autocomplete, Backdrop, Badge, Button, ButtonGroup, Card, CardActions, CardContent, CardHeader, CardMedia, Checkbox, Chip, CircularProgress, DataGrid, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Fab, ForestProvider, LinearProgress, List, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemText, ListSubheader, MenuItem, Paper, Radio, RadioGroup, Select, SidebarItem, SidebarNav, Skeleton, Snackbar, Switch, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, TextField, ToggleButton, ToggleButtonGroup, Toolbar, Tooltip, Typography, useSidebar };
960
+ export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Alert, AlertTitle, AppBar, Autocomplete, Backdrop, Badge, BarChart, Breadcrumbs, Button, ButtonGroup, Card, CardActions, CardContent, CardHeader, CardMedia, Checkbox, Chip, CircularProgress, DataGrid, DatePicker, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Fab, ForestProvider, LineChart, LinearProgress, Link, List, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemText, ListSubheader, Menu, MenuItem, MenuList, Modal, MultiSelect, Pagination, Paper, PieChart, Popover, Radio, RadioGroup, Search, Select, SidebarItem, SidebarNav, Skeleton, Snackbar, Step, StepLabel, Stepper, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tabs, TextField, ToggleButton, ToggleButtonGroup, Toolbar, Tooltip, Typography, useChartColors, useSidebar };
436
961
  //# sourceMappingURL=index.mjs.map
437
962
  //# sourceMappingURL=index.mjs.map