@mui/x-charts 8.0.0-alpha.3 → 8.0.0-alpha.4

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.
Files changed (84) hide show
  1. package/CHANGELOG.md +274 -0
  2. package/ChartsAxis/ChartsAxis.js +0 -4
  3. package/ChartsLabel/ChartsLabel.d.ts +19 -0
  4. package/ChartsLabel/ChartsLabel.js +58 -0
  5. package/ChartsLabel/ChartsLabelGradient.d.ts +40 -0
  6. package/ChartsLabel/ChartsLabelGradient.js +133 -0
  7. package/ChartsLabel/ChartsLabelMark.d.ts +27 -0
  8. package/ChartsLabel/ChartsLabelMark.js +108 -0
  9. package/ChartsLabel/labelClasses.d.ts +9 -0
  10. package/ChartsLabel/labelClasses.js +13 -0
  11. package/ChartsLabel/labelGradientClasses.d.ts +15 -0
  12. package/ChartsLabel/labelGradientClasses.js +17 -0
  13. package/ChartsLabel/labelMarkClasses.d.ts +17 -0
  14. package/ChartsLabel/labelMarkClasses.js +17 -0
  15. package/ChartsLegend/useAxis.js +3 -3
  16. package/ChartsTooltip/ChartsAxisTooltipContent.js +5 -3
  17. package/ChartsTooltip/ChartsTooltipTable.js +15 -13
  18. package/ChartsTooltip/chartsTooltipClasses.d.ts +3 -1
  19. package/ChartsTooltip/chartsTooltipClasses.js +3 -2
  20. package/ChartsTooltip/useAxisTooltip.js +2 -3
  21. package/ChartsTooltip/useItemTooltip.js +2 -3
  22. package/PieChart/PiePlot.js +2 -2
  23. package/README.md +1 -1
  24. package/ScatterChart/ScatterPlot.js +2 -2
  25. package/ScatterChart/extremums.js +1 -3
  26. package/ScatterChart/formatter.js +2 -2
  27. package/hooks/useChartId.d.ts +1 -1
  28. package/hooks/useColorScale.js +2 -3
  29. package/hooks/useZAxis.d.ts +6 -0
  30. package/hooks/useZAxis.js +8 -0
  31. package/index.js +1 -1
  32. package/internals/consumeThemeProps.d.ts +54 -0
  33. package/internals/consumeThemeProps.js +79 -0
  34. package/internals/plugins/corePlugins/useChartId/useChartId.js +1 -1
  35. package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +6 -6
  36. package/internals/plugins/corePlugins/useChartId/useChartId.types.d.ts +3 -3
  37. package/internals/store/useCharts.js +8 -2
  38. package/modern/ChartsAxis/ChartsAxis.js +0 -4
  39. package/modern/ChartsLabel/ChartsLabel.js +58 -0
  40. package/modern/ChartsLabel/ChartsLabelGradient.js +133 -0
  41. package/modern/ChartsLabel/ChartsLabelMark.js +108 -0
  42. package/modern/ChartsLabel/labelClasses.js +13 -0
  43. package/modern/ChartsLabel/labelGradientClasses.js +17 -0
  44. package/modern/ChartsLabel/labelMarkClasses.js +17 -0
  45. package/modern/ChartsLegend/useAxis.js +3 -3
  46. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +5 -3
  47. package/modern/ChartsTooltip/ChartsTooltipTable.js +15 -13
  48. package/modern/ChartsTooltip/chartsTooltipClasses.js +3 -2
  49. package/modern/ChartsTooltip/useAxisTooltip.js +2 -3
  50. package/modern/ChartsTooltip/useItemTooltip.js +2 -3
  51. package/modern/PieChart/PiePlot.js +2 -2
  52. package/modern/ScatterChart/ScatterPlot.js +2 -2
  53. package/modern/ScatterChart/extremums.js +1 -3
  54. package/modern/ScatterChart/formatter.js +2 -2
  55. package/modern/hooks/useColorScale.js +2 -3
  56. package/modern/hooks/useZAxis.js +8 -0
  57. package/modern/index.js +1 -1
  58. package/modern/internals/consumeThemeProps.js +79 -0
  59. package/modern/internals/plugins/corePlugins/useChartId/useChartId.js +1 -1
  60. package/modern/internals/store/useCharts.js +8 -2
  61. package/node/ChartsAxis/ChartsAxis.js +0 -4
  62. package/node/ChartsLabel/ChartsLabel.js +64 -0
  63. package/node/ChartsLabel/ChartsLabelGradient.js +139 -0
  64. package/node/ChartsLabel/ChartsLabelMark.js +114 -0
  65. package/node/ChartsLabel/labelClasses.js +22 -0
  66. package/node/ChartsLabel/labelGradientClasses.js +26 -0
  67. package/node/ChartsLabel/labelMarkClasses.js +26 -0
  68. package/node/ChartsLegend/useAxis.js +2 -4
  69. package/node/ChartsTooltip/ChartsAxisTooltipContent.js +5 -3
  70. package/node/ChartsTooltip/ChartsTooltipTable.js +15 -13
  71. package/node/ChartsTooltip/chartsTooltipClasses.js +3 -2
  72. package/node/ChartsTooltip/useAxisTooltip.js +2 -4
  73. package/node/ChartsTooltip/useItemTooltip.js +2 -4
  74. package/node/PieChart/PiePlot.js +2 -2
  75. package/node/ScatterChart/ScatterPlot.js +2 -2
  76. package/node/ScatterChart/extremums.js +1 -3
  77. package/node/ScatterChart/formatter.js +2 -2
  78. package/node/hooks/useColorScale.js +2 -4
  79. package/node/hooks/useZAxis.js +15 -0
  80. package/node/index.js +1 -1
  81. package/node/internals/consumeThemeProps.js +87 -0
  82. package/node/internals/plugins/corePlugins/useChartId/useChartId.js +1 -1
  83. package/node/internals/store/useCharts.js +9 -2
  84. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -5,6 +5,133 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.0.0-alpha.4
9
+
10
+ _Dec 13, 2024_
11
+
12
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🌍 Improve Romanian locale on the Data Grid and Pickers
15
+ - 📚 Documentation improvements
16
+ - 🐞 Bugfixes
17
+
18
+ Special thanks go out to the community contributors who have helped make this release possible:
19
+ @k-rajat19, @nusr, @rares985, @zivl.
20
+ Following are all team members who have contributed to this release:
21
+ @alexfauquette, @arminmeh, @flaviendelangle, @JCQuintas, @KenanYusuf, @LukasTy, @MBilalShafi.
22
+
23
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
24
+
25
+ ### Data Grid
26
+
27
+ #### Breaking changes
28
+
29
+ - The selectors signature has been updated due to the support of arguments in the selectors. Pass `undefined` as `arguments` if the selector doesn't use any arguments.
30
+
31
+ ```diff
32
+ -mySelector(state, instanceId)
33
+ +mySelector(state, arguments, instanceId)
34
+ ```
35
+
36
+ - The `useGridSelector` signature has been updated due to the introduction of arguments parameter in the selectors. Pass `undefined` as `arguments` if the selector doesn't use any arguments.
37
+
38
+ ```diff
39
+ -const output = useGridSelector(apiRef, selector, equals)
40
+ +const output = useGridSelector(apiRef, selector, arguments, equals)
41
+ ```
42
+ - The default variant for text fields and selects in the filter panel has been changed to `outlined`.
43
+ - The "row spanning" feature is now stable.
44
+ ```diff
45
+ <DataGrid
46
+ - unstable_rowSpanning
47
+ + rowSpanning
48
+ />
49
+ ```
50
+ - Selected row is now deselected when clicked again.
51
+
52
+ #### `@mui/x-data-grid@8.0.0-alpha.4`
53
+
54
+ - [DataGrid] Deselect selected row on click (#15509) @k-rajat19
55
+ - [DataGrid] Fix "No rows" displaying when all rows are pinned (#15335) @nusr
56
+ - [DataGrid] Make row spanning feature stable (#15742) @MBilalShafi
57
+ - [DataGrid] Round dimensions to avoid subpixel rendering error (#15850) @KenanYusuf
58
+ - [DataGrid] Toggle menu on click in `<GridActionsCell />` (#15867) @k-rajat19
59
+ - [DataGrid] Trigger row spanning computation on rows update (#15858) @MBilalShafi
60
+ - [DataGrid] Update filter panel input variant (#15807) @KenanYusuf
61
+ - [DataGrid] Use `columnsManagement` slot (#15817) @k-rajat19
62
+ - [DataGrid] Use new selector signature (#15200) @MBilalShafi
63
+ - [l10n] Improve Romanian (ro-RO) locale (#15745) @rares985
64
+
65
+ #### `@mui/x-data-grid-pro@8.0.0-alpha.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
66
+
67
+ Same changes as in `@mui/x-data-grid@8.0.0-alpha.4`, plus:
68
+
69
+ - [DataGridPro] Make row reordering work with pagination (#15355) @k-rajat19
70
+
71
+ #### `@mui/x-data-grid-premium@8.0.0-alpha.4` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
72
+
73
+ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.4`, plus:
74
+
75
+ - [DataGridPremium] Fix group column ignoring `valueOptions` for `singleSelect` column type (#15739) @arminmeh
76
+
77
+ ### Date and Time Pickers
78
+
79
+ #### `@mui/x-date-pickers@8.0.0-alpha.4`
80
+
81
+ - [l10n] Improve Romanian (ro-RO) locale (#15745) @rares985
82
+ - [pickers] Clean `usePicker` logic (#15763) @flaviendelangle
83
+ - [pickers] Rename layout `ownerState` property from `isRtl` to `layoutDirection` (#15803) @flaviendelangle
84
+ - [pickers] Use the new `ownerState` in `useClearableField` (#15776) @flaviendelangle
85
+ - [pickers] Use the new `ownerState` in the toolbar components (#15777) @flaviendelangle
86
+ - [pickers] Use the new `ownerState` object for the clock components and the desktop / mobile wrappers (#15669) @flaviendelangle
87
+
88
+ #### `@mui/x-date-pickers-pro@8.0.0-alpha.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
89
+
90
+ Same changes as in `@mui/x-date-pickers@8.0.0-alpha.4`.
91
+
92
+ ### Charts
93
+
94
+ #### Breaking changes
95
+
96
+ - The default styling of the charts tooltip has been updated.
97
+
98
+ #### `@mui/x-charts@8.0.0-alpha.4`
99
+
100
+ - [charts] Fix hydration missmatch (#15647) @alexfauquette
101
+ - [charts] Fix internal spelling typo (#15805) @zivl
102
+ - [charts] Fix scatter dataset with missing data (#15802) @alexfauquette
103
+ - [charts] HTML Labels (#15813) @JCQuintas
104
+ - [charts] Only access store values by using hooks (#15764) @alexfauquette
105
+ - [charts] Update Tooltip style (#15630) @alexfauquette
106
+
107
+ #### `@mui/x-charts-pro@8.0.0-alpha.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
108
+
109
+ Same changes as in `@mui/x-charts@8.0.0-alpha.4`.
110
+
111
+ ### Tree View
112
+
113
+ #### `@mui/x-tree-view@8.0.0-alpha.4`
114
+
115
+ No changes, releasing to keep the versions in sync.
116
+
117
+ #### `@mui/x-tree-view-pro@8.0.0-alpha.4` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
118
+
119
+ Releasing to benefit from license package fix (#15814).
120
+
121
+ ### Docs
122
+
123
+ - [docs] Clean Joy and Browser custom field demos (#15707) @flaviendelangle
124
+ - [docs] Fix outdated link to handbook (#15855) @oliviertassinari
125
+ - [docs] Improve Pickers accessible DOM migration section description (#15596) @LukasTy
126
+ - [docs] Use `updateRows` method for list view demos (#15732) @KenanYusuf
127
+ - [docs] Use date library version from package dev dependencies for sandboxes (#15762) @LukasTy
128
+
129
+ ### Core
130
+
131
+ - [code-infra] Add Charts sandbox generation (#15830) @JCQuintas
132
+ - [code-infra] Remove redundant `@type/react-test-renderer` dep (#15766) @LukasTy
133
+ - [license] Use `console.log` for the error message on Codesandbox to avoid rendering error (#15814) @arminmeh
134
+
8
135
  ## 8.0.0-alpha.3
9
136
 
10
137
  _Dec 5, 2024_
@@ -567,6 +694,153 @@ Same changes as in `@mui/x-charts@8.0.0-alpha.0`.
567
694
  - [release] v8 preparation (#15054) @michelengelen
568
695
  - [test] Fix advanced list view regression test snapshot (#15260) @KenanYusuf
569
696
 
697
+ ## 7.23.2
698
+
699
+ _Dec 12, 2024_
700
+
701
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
702
+
703
+ - 🌍 Improve Romanian and Turkish locales on the Data Grid
704
+ - 🌍 Improve Romanian locale on the Pickers
705
+ - 📚 Documentation improvements
706
+ - 🐞 Bugfixes
707
+
708
+ Special thanks go out to the community contributors who have helped make this release possible:
709
+ @ihsanberkozcan, @k-rajat19, @lhilgert9, @nusr, @rares985.
710
+
711
+ Following are all team members who have contributed to this release:
712
+ @alexfauquette, @arminmeh, @flaviendelangle, @JCQuintas, @KenanYusuf, @LukasTy.
713
+
714
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
715
+
716
+ ### Data Grid
717
+
718
+ #### `@mui/x-data-grid@7.23.2`
719
+
720
+ - [DataGrid] Fix "No rows" displaying when all rows are pinned (#15851) @nusr
721
+ - [DataGrid] Use `columnsManagement` slot (#15821) @k-rajat19
722
+ - [l10n] Improve Romanian (ro-RO) locale (#15751) @rares985
723
+ - [l10n] Improve Turkish (tr-TR) locale (#15748) @ihsanberkozcan
724
+
725
+ #### `@mui/x-data-grid-pro@7.23.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
726
+
727
+ Same changes as in `@mui/x-data-grid@7.23.2`, plus:
728
+
729
+ - [DataGridPro] Make Row reordering work with pagination (#15782) @k-rajat19
730
+
731
+ #### `@mui/x-data-grid-premium@7.23.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
732
+
733
+ Same changes as in `@mui/x-data-grid-pro@7.23.2`, plus:
734
+
735
+ - [DataGridPremium] Fix group column ignoring `valueOptions` for `singleSelect` column type (#15754) @arminmeh
736
+
737
+ ### Date and Time Pickers
738
+
739
+ #### `@mui/x-date-pickers@7.23.2`
740
+
741
+ - [l10n] Improve Romanian (ro-RO) locale (#15751) @rares985
742
+
743
+ #### `@mui/x-date-pickers-pro@7.23.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
744
+
745
+ Same changes as in `@mui/x-date-pickers@7.23.2`.
746
+
747
+ ### Charts
748
+
749
+ #### `@mui/x-charts@7.23.2`
750
+
751
+ - [charts] Fix key generation for the ChartsGrid (#15864) @alexfauquette
752
+ - [charts] Fix scatter dataset with missing data (#15804) @alexfauquette
753
+
754
+ #### `@mui/x-charts-pro@7.23.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
755
+
756
+ Same changes as in `@mui/x-charts@7.23.2`.
757
+
758
+ #### `@mui/x-tree-view@v7.23.2`
759
+
760
+ No changes, releasing to keep the versions in sync.
761
+
762
+ #### `@mui/x-tree-view-pro@7.23.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
763
+
764
+ Releasing to benefit from license package fix (#15818).
765
+
766
+ ### Docs
767
+
768
+ - [docs] Fix typo in charts axis documentation (#15746) @JCQuintas
769
+ - [docs] Improve Pickers accessible DOM structure description (#15752) @LukasTy
770
+ - [docs] Use `updateRows` method for list view demos (#15824) @KenanYusuf
771
+ - [docs] Use date library version from package dev dependencies for sandboxes (#15767) @LukasTy
772
+
773
+ ### Core
774
+
775
+ - [core] Add `@mui/x-tree-view-pro` to `releaseChangelog` (#15747) @flaviendelangle
776
+ - [license] Use `console.log` for the error message on Codesandbox to avoid rendering error (#15818) @arminmeh
777
+
778
+ ## 7.23.1
779
+
780
+ _Dec 5, 2024_
781
+
782
+ We'd like to offer a big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
783
+
784
+ - 🌍 Improve German locale on the Data Grid component
785
+ - 🐞 Bugfixes
786
+
787
+ Special thanks go out to the community contributors who have helped make this release possible:
788
+ @lhilgert9.
789
+
790
+ Following are all team members who have contributed to this release:
791
+ @arthurbalduini, @cherniavskii, @flaviendelangle, @JCQuintas, @LukasTy and @MBilalShafi.
792
+
793
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
794
+
795
+ ### Data Grid
796
+
797
+ #### `@mui/x-data-grid@7.23.1`
798
+
799
+ - [DataGrid] Make column autosizing work with flex columns (#15712) @cherniavskii
800
+ - [l10n] Improve German (de-DE) locale (#15641) @lhilgert9
801
+
802
+ #### `@mui/x-data-grid-pro@7.23.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
803
+
804
+ Same changes as in `@mui/x-data-grid@7.23.1`, plus:
805
+
806
+ - [DataGridPro] Cleanup pinned rows on removal (#15702) @cherniavskii
807
+
808
+ #### `@mui/x-data-grid-premium@7.23.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
809
+
810
+ Same changes as in `@mui/x-data-grid-pro@7.23.1`.
811
+
812
+ ### Date and Time Pickers
813
+
814
+ #### `@mui/x-date-pickers@7.23.1`
815
+
816
+ - [TimePicker] Prevent mouse events after `touchend` event (#15430) @arthurbalduini
817
+
818
+ #### `@mui/x-date-pickers-pro@7.23.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
819
+
820
+ Same changes as in `@mui/x-date-pickers@7.23.1`.
821
+
822
+ ### Charts
823
+
824
+ #### `@mui/x-charts@7.23.1`
825
+
826
+ - [charts] Improve SVG `pattern` and `gradient` support (#15724) @JCQuintas
827
+
828
+ #### `@mui/x-charts-pro@7.23.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
829
+
830
+ Same changes as in `@mui/x-charts@7.23.1`.
831
+
832
+ ### Docs
833
+
834
+ - [docs] Fix Pickers theme augmentation example (#15675) @LukasTy
835
+ - [docs] Remove duplicated warning (#15715) @cherniavskii
836
+ - [test] Force hover in headless Chrome (#15711) @cherniavskii
837
+ - [docs-infra] Bump `@mui/internal-markdown` to support nested demo imports (#15738) @alexfauquette
838
+ - [docs] Improve SEO titles for the Data Grid (#15695) @MBilalShafi
839
+
840
+ ### Core
841
+
842
+ - [core] Add `@mui/x-tree-view-pro` to `releaseChangelog` (#15747) @flaviendelangle
843
+
570
844
  ## 7.23.0
571
845
 
572
846
  _Nov 29, 2024_
@@ -50,10 +50,6 @@ function ChartsAxis(props) {
50
50
  yAxis,
51
51
  yAxisIds
52
52
  } = useCartesianContext();
53
-
54
- // TODO: use for plotting line without ticks or any thing
55
- // const drawingArea = React.useContext(DrawingContext);
56
-
57
53
  const leftId = getAxisId(leftAxis === undefined ? yAxisIds[0] : leftAxis, yAxisIds[0]);
58
54
  const bottomId = getAxisId(bottomAxis === undefined ? xAxisIds[0] : bottomAxis, xAxisIds[0]);
59
55
  const topId = getAxisId(topAxis, xAxisIds[0]);
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ import { ChartsLabelClasses } from './labelClasses';
4
+ export interface ChartsLabelProps {
5
+ /**
6
+ * Override or extend the styles applied to the component.
7
+ */
8
+ classes?: Partial<ChartsLabelClasses>;
9
+ children?: React.ReactNode;
10
+ className?: string;
11
+ sx?: SxProps<Theme>;
12
+ }
13
+ /**
14
+ * @ignore - internal component.
15
+ *
16
+ * Generates the label mark for the tooltip and legend.
17
+ */
18
+ declare const ChartsLabel: React.ForwardRefExoticComponent<ChartsLabelProps & React.RefAttributes<any>>;
19
+ export { ChartsLabel };
@@ -0,0 +1,58 @@
1
+ 'use client';
2
+
3
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
+ import _extends from "@babel/runtime/helpers/esm/extends";
5
+ const _excluded = ["children", "className", "classes"];
6
+ import * as React from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import { styled } from '@mui/material/styles';
9
+ import clsx from 'clsx';
10
+ import { useUtilityClasses } from "./labelClasses.js";
11
+ import { consumeThemeProps } from "../internals/consumeThemeProps.js";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const Root = styled('span', {
14
+ name: 'MuiChartsLabel',
15
+ slot: 'Root',
16
+ overridesResolver: (props, styles) => styles.root
17
+ })(({
18
+ theme
19
+ }) => _extends({}, theme.typography.caption, {
20
+ color: (theme.vars || theme).palette.text.primary,
21
+ lineHeight: undefined,
22
+ display: 'flex'
23
+ }));
24
+
25
+ /**
26
+ * @ignore - internal component.
27
+ *
28
+ * Generates the label mark for the tooltip and legend.
29
+ */
30
+ const ChartsLabel = consumeThemeProps('MuiChartsLabel', {
31
+ classesResolver: useUtilityClasses
32
+ }, function ChartsLabel(props, ref) {
33
+ const {
34
+ children,
35
+ className,
36
+ classes
37
+ } = props,
38
+ other = _objectWithoutPropertiesLoose(props, _excluded);
39
+ return /*#__PURE__*/_jsx(Root, _extends({
40
+ className: clsx(classes?.root, className),
41
+ ownerState: props,
42
+ ref: ref
43
+ }, other, {
44
+ children: children
45
+ }));
46
+ });
47
+ process.env.NODE_ENV !== "production" ? ChartsLabel.propTypes = {
48
+ // ----------------------------- Warning --------------------------------
49
+ // | These PropTypes are generated from the TypeScript type definitions |
50
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
51
+ // ----------------------------------------------------------------------
52
+ children: PropTypes.node,
53
+ /**
54
+ * Override or extend the styles applied to the component.
55
+ */
56
+ classes: PropTypes.object
57
+ } : void 0;
58
+ export { ChartsLabel };
@@ -0,0 +1,40 @@
1
+ import * as React from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ import { ChartsLabelGradientClasses } from './labelGradientClasses';
4
+ export interface ChartsLabelGradientProps {
5
+ /**
6
+ * A unique identifier for the gradient.
7
+ *
8
+ * The `gradientId` will be used as `fill="url(#gradientId)"`.
9
+ */
10
+ gradientId: string;
11
+ /**
12
+ * The direction of the gradient.
13
+ *
14
+ * @default 'row'
15
+ */
16
+ direction?: 'column' | 'row';
17
+ /**
18
+ * If `true`, the gradient will be reversed.
19
+ */
20
+ reverse?: boolean;
21
+ /**
22
+ * If provided, the gradient will be rotated by 90deg.
23
+ *
24
+ * Useful for linear gradients that are not in the correct orientation.
25
+ */
26
+ rotate?: boolean;
27
+ /**
28
+ * Override or extend the styles applied to the component.
29
+ */
30
+ classes?: Partial<ChartsLabelGradientClasses>;
31
+ className?: string;
32
+ sx?: SxProps<Theme>;
33
+ }
34
+ /**
35
+ * @ignore - internal component.
36
+ *
37
+ * Generates the label Gradient for the tooltip and legend.
38
+ */
39
+ declare const ChartsLabelGradient: React.ForwardRefExoticComponent<ChartsLabelGradientProps & React.RefAttributes<any>>;
40
+ export { ChartsLabelGradient };
@@ -0,0 +1,133 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
+ const _excluded = ["gradientId", "direction", "classes", "className"];
6
+ import * as React from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import { styled } from '@mui/material/styles';
9
+ import clsx from 'clsx';
10
+ import { useUtilityClasses, labelGradientClasses } from "./labelGradientClasses.js";
11
+ import { consumeThemeProps } from "../internals/consumeThemeProps.js";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const getRotation = (direction, reverse, rotate) => {
14
+ if (!rotate && reverse) {
15
+ return direction === 'column' ? 90 : 180;
16
+ }
17
+ if (rotate && !reverse) {
18
+ return direction === 'column' ? 0 : 90;
19
+ }
20
+ if (rotate && reverse) {
21
+ return direction === 'column' ? 180 : -90;
22
+ }
23
+ return direction === 'column' ? -90 : 0;
24
+ };
25
+ const Root = styled('div', {
26
+ name: 'MuiChartsLabelGradient',
27
+ slot: 'Root',
28
+ overridesResolver: (props, styles) => styles.root
29
+ })(({
30
+ ownerState
31
+ }) => {
32
+ const rotation = getRotation(ownerState.direction, ownerState.reverse, ownerState.rotate);
33
+ return {
34
+ display: 'flex',
35
+ alignItems: 'center',
36
+ justifyContent: 'center',
37
+ [`.${labelGradientClasses.mask}`]: {
38
+ borderRadius: 2,
39
+ overflow: 'hidden'
40
+ },
41
+ [`&.${labelGradientClasses.row}`]: {
42
+ width: '100%',
43
+ [`.${labelGradientClasses.mask}`]: {
44
+ height: 12,
45
+ width: '100%'
46
+ }
47
+ },
48
+ [`&.${labelGradientClasses.column}`]: {
49
+ height: '100%',
50
+ [`.${labelGradientClasses.mask}`]: {
51
+ width: 12,
52
+ height: '100%',
53
+ '> svg': {
54
+ height: '100%'
55
+ }
56
+ }
57
+ },
58
+ svg: {
59
+ transform: `rotate(${rotation}deg)`,
60
+ display: 'block'
61
+ }
62
+ };
63
+ });
64
+
65
+ /**
66
+ * @ignore - internal component.
67
+ *
68
+ * Generates the label Gradient for the tooltip and legend.
69
+ */
70
+ const ChartsLabelGradient = consumeThemeProps('MuiChartsLabelGradient', {
71
+ defaultProps: {
72
+ direction: 'row'
73
+ },
74
+ classesResolver: useUtilityClasses
75
+ }, function ChartsLabelGradient(props, ref) {
76
+ const {
77
+ gradientId,
78
+ classes,
79
+ className
80
+ } = props,
81
+ other = _objectWithoutPropertiesLoose(props, _excluded);
82
+ return /*#__PURE__*/_jsx(Root, _extends({
83
+ className: clsx(classes?.root, className),
84
+ ownerState: props,
85
+ "aria-hidden": "true",
86
+ ref: ref
87
+ }, other, {
88
+ children: /*#__PURE__*/_jsx("div", {
89
+ className: classes?.mask,
90
+ children: /*#__PURE__*/_jsx("svg", {
91
+ viewBox: "0 0 24 24",
92
+ children: /*#__PURE__*/_jsx("rect", {
93
+ width: "24",
94
+ height: "24",
95
+ fill: `url(#${gradientId})`
96
+ })
97
+ })
98
+ })
99
+ }));
100
+ });
101
+ process.env.NODE_ENV !== "production" ? ChartsLabelGradient.propTypes = {
102
+ // ----------------------------- Warning --------------------------------
103
+ // | These PropTypes are generated from the TypeScript type definitions |
104
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
105
+ // ----------------------------------------------------------------------
106
+ /**
107
+ * Override or extend the styles applied to the component.
108
+ */
109
+ classes: PropTypes.object,
110
+ /**
111
+ * The direction of the gradient.
112
+ *
113
+ * @default 'row'
114
+ */
115
+ direction: PropTypes.oneOf(['column', 'row']),
116
+ /**
117
+ * A unique identifier for the gradient.
118
+ *
119
+ * The `gradientId` will be used as `fill="url(#gradientId)"`.
120
+ */
121
+ gradientId: PropTypes.string.isRequired,
122
+ /**
123
+ * If `true`, the gradient will be reversed.
124
+ */
125
+ reverse: PropTypes.bool,
126
+ /**
127
+ * If provided, the gradient will be rotated by 90deg.
128
+ *
129
+ * Useful for linear gradients that are not in the correct orientation.
130
+ */
131
+ rotate: PropTypes.bool
132
+ } : void 0;
133
+ export { ChartsLabelGradient };
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ import { ChartsLabelMarkClasses } from './labelMarkClasses';
4
+ export interface ChartsLabelMarkProps {
5
+ /**
6
+ * The type of the mark.
7
+ * @default 'square'
8
+ */
9
+ type?: 'square' | 'circle' | 'line';
10
+ /**
11
+ * The color of the mark.
12
+ */
13
+ color?: string;
14
+ /**
15
+ * Override or extend the styles applied to the component.
16
+ */
17
+ classes?: Partial<ChartsLabelMarkClasses>;
18
+ className?: string;
19
+ sx?: SxProps<Theme>;
20
+ }
21
+ /**
22
+ * @ignore - internal component.
23
+ *
24
+ * Generates the label mark for the tooltip and legend.
25
+ */
26
+ declare const ChartsLabelMark: React.ForwardRefExoticComponent<ChartsLabelMarkProps & React.RefAttributes<any>>;
27
+ export { ChartsLabelMark };
@@ -0,0 +1,108 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
+ const _excluded = ["type", "color", "className", "classes"];
6
+ import * as React from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import { styled } from '@mui/material/styles';
9
+ import clsx from 'clsx';
10
+ import { labelMarkClasses, useUtilityClasses } from "./labelMarkClasses.js";
11
+ import { consumeThemeProps } from "../internals/consumeThemeProps.js";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const Root = styled('div', {
14
+ name: 'MuiChartsLabelMark',
15
+ slot: 'Root',
16
+ overridesResolver: (props, styles) => styles.root
17
+ })(() => {
18
+ return {
19
+ display: 'flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ flexShrink: 0,
23
+ [`&.${labelMarkClasses.line}`]: {
24
+ width: 16,
25
+ display: 'flex',
26
+ alignItems: 'center',
27
+ [`.${labelMarkClasses.mask}`]: {
28
+ height: 4,
29
+ width: '100%',
30
+ borderRadius: 1,
31
+ overflow: 'hidden'
32
+ }
33
+ },
34
+ [`&.${labelMarkClasses.square}`]: {
35
+ height: 13,
36
+ width: 13,
37
+ borderRadius: 2,
38
+ overflow: 'hidden'
39
+ },
40
+ [`&.${labelMarkClasses.circle}`]: {
41
+ height: 15,
42
+ width: 15,
43
+ borderRadius: '50%',
44
+ overflow: 'hidden'
45
+ },
46
+ svg: {
47
+ display: 'block',
48
+ height: '100%',
49
+ width: '100%'
50
+ }
51
+ };
52
+ });
53
+
54
+ /**
55
+ * @ignore - internal component.
56
+ *
57
+ * Generates the label mark for the tooltip and legend.
58
+ */
59
+ const ChartsLabelMark = consumeThemeProps('MuiChartsLabelMark', {
60
+ classesResolver: useUtilityClasses
61
+ }, function ChartsLabelMark(props, ref) {
62
+ const {
63
+ type,
64
+ color,
65
+ className,
66
+ classes
67
+ } = props,
68
+ other = _objectWithoutPropertiesLoose(props, _excluded);
69
+ return /*#__PURE__*/_jsx(Root, _extends({
70
+ className: clsx(classes?.root, className),
71
+ ownerState: props,
72
+ "aria-hidden": "true",
73
+ ref: ref
74
+ }, other, {
75
+ children: /*#__PURE__*/_jsx("div", {
76
+ className: classes?.mask,
77
+ children: /*#__PURE__*/_jsx("svg", {
78
+ viewBox: "0 0 24 24",
79
+ preserveAspectRatio: type === 'line' ? 'none' : undefined,
80
+ children: /*#__PURE__*/_jsx("rect", {
81
+ width: "24",
82
+ height: "24",
83
+ fill: color
84
+ })
85
+ })
86
+ })
87
+ }));
88
+ });
89
+ process.env.NODE_ENV !== "production" ? ChartsLabelMark.propTypes = {
90
+ // ----------------------------- Warning --------------------------------
91
+ // | These PropTypes are generated from the TypeScript type definitions |
92
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
93
+ // ----------------------------------------------------------------------
94
+ /**
95
+ * Override or extend the styles applied to the component.
96
+ */
97
+ classes: PropTypes.object,
98
+ /**
99
+ * The color of the mark.
100
+ */
101
+ color: PropTypes.string,
102
+ /**
103
+ * The type of the mark.
104
+ * @default 'square'
105
+ */
106
+ type: PropTypes.oneOf(['circle', 'line', 'square'])
107
+ } : void 0;
108
+ export { ChartsLabelMark };