Skip to content

Commit 47aab94

Browse files
Avoid exporting internal constants
1 parent df62fa7 commit 47aab94

File tree

8 files changed

+11
-14
lines changed

8 files changed

+11
-14
lines changed

packages/x-charts-pro/src/ChartZoomSlider/internals/ChartAxisZoomSlider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import {
1111
useSelector,
1212
useStore,
1313
ZoomData,
14+
ZOOM_SLIDER_MARGIN,
1415
} from '@mui/x-charts/internals';
1516
import { styled } from '@mui/material/styles';
1617
import { useXAxes, useYAxes } from '@mui/x-charts/hooks';
1718
import { rafThrottle } from '@mui/x-internals/rafThrottle';
18-
import { ZOOM_SLIDER_MARGIN } from '@mui/x-charts/constants';
1919
import {
2020
selectorChartAxisZoomData,
2121
UseChartProZoomSignature,

packages/x-charts/src/constants/index.ts

-6
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,5 @@ export const DEFAULT_MARGINS = {
1111
export const DEFAULT_AXIS_SIZE_WIDTH = 45;
1212
export const DEFAULT_AXIS_SIZE_HEIGHT = 25;
1313

14-
/** Margin in the opposite direction of the axis, i.e., horizontal if the axis is vertical and vice versa. */
15-
export const ZOOM_SLIDER_MARGIN = 4;
16-
17-
/** Size reserved for the zoom slider. The actual size of the slider might be smaller. */
18-
export const ZOOM_SLIDER_SIZE = 20 + 2 * ZOOM_SLIDER_MARGIN;
19-
2014
// How many pixels to add to the default axis size if that axis has a label
2115
export const AXIS_LABEL_DEFAULT_HEIGHT = 20;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** Margin in the opposite direction of the axis, i.e., horizontal if the axis is vertical and vice versa. */
2+
export const ZOOM_SLIDER_MARGIN = 4;
3+
4+
/** Size reserved for the zoom slider. The actual size of the slider might be smaller. */
5+
export const ZOOM_SLIDER_SIZE = 20 + 2 * ZOOM_SLIDER_MARGIN;

packages/x-charts/src/internals/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ export * from '../models/axis';
6464
export * from './plugins/models';
6565
export * from './material';
6666
export * from './createSvgIcon';
67+
68+
export * from './constants';

packages/x-charts/src/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ZOOM_SLIDER_SIZE } from '../../../constants';
12
import { defaultizeZoom } from './defaultizeZoom';
23
import { ZoomOptions } from './zoom.types';
34
import {
@@ -6,7 +7,6 @@ import {
67
DEFAULT_AXIS_SIZE_HEIGHT,
78
DEFAULT_AXIS_SIZE_WIDTH,
89
AXIS_LABEL_DEFAULT_HEIGHT,
9-
ZOOM_SLIDER_SIZE,
1010
} from '../../../../constants';
1111
import { XAxis, YAxis } from '../../../../models';
1212
import { DefaultedXAxis, DefaultedYAxis } from '../../../../models/axis';

packages/x-charts/src/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ZOOM_SLIDER_SIZE } from '../../../../constants';
1+
import { ZOOM_SLIDER_SIZE } from '../../../constants';
22
import {
33
selectorChartRawXAxis,
44
selectorChartRawYAxis,

scripts/x-charts-pro.exports.json

-2
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,6 @@
467467
{ "name": "yellowPalette", "kind": "Variable" },
468468
{ "name": "yellowPaletteDark", "kind": "Variable" },
469469
{ "name": "yellowPaletteLight", "kind": "Variable" },
470-
{ "name": "ZOOM_SLIDER_MARGIN", "kind": "Variable" },
471-
{ "name": "ZOOM_SLIDER_SIZE", "kind": "Variable" },
472470
{ "name": "ZoomData", "kind": "TypeAlias" },
473471
{ "name": "ZoomFilterMode", "kind": "TypeAlias" },
474472
{ "name": "ZoomOptions", "kind": "Interface" },

scripts/x-charts.exports.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,5 @@
428428
{ "name": "YAxis", "kind": "TypeAlias" },
429429
{ "name": "yellowPalette", "kind": "Variable" },
430430
{ "name": "yellowPaletteDark", "kind": "Variable" },
431-
{ "name": "yellowPaletteLight", "kind": "Variable" },
432-
{ "name": "ZOOM_SLIDER_MARGIN", "kind": "Variable" },
433-
{ "name": "ZOOM_SLIDER_SIZE", "kind": "Variable" }
431+
{ "name": "yellowPaletteLight", "kind": "Variable" }
434432
]

0 commit comments

Comments
 (0)