Skip to content

Commit f272e5d

Browse files
Avoid exporting internal constants
1 parent ddb1660 commit f272e5d

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
@@ -62,3 +62,5 @@ export * from '../models/z-axis';
6262
export * from '../models/axis';
6363

6464
export * from './plugins/models';
65+
66+
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
@@ -462,8 +462,6 @@
462462
{ "name": "yellowPalette", "kind": "Variable" },
463463
{ "name": "yellowPaletteDark", "kind": "Variable" },
464464
{ "name": "yellowPaletteLight", "kind": "Variable" },
465-
{ "name": "ZOOM_SLIDER_MARGIN", "kind": "Variable" },
466-
{ "name": "ZOOM_SLIDER_SIZE", "kind": "Variable" },
467465
{ "name": "ZoomData", "kind": "TypeAlias" },
468466
{ "name": "ZoomFilterMode", "kind": "TypeAlias" },
469467
{ "name": "ZoomOptions", "kind": "Interface" },

scripts/x-charts.exports.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,5 @@
420420
{ "name": "YAxis", "kind": "TypeAlias" },
421421
{ "name": "yellowPalette", "kind": "Variable" },
422422
{ "name": "yellowPaletteDark", "kind": "Variable" },
423-
{ "name": "yellowPaletteLight", "kind": "Variable" },
424-
{ "name": "ZOOM_SLIDER_MARGIN", "kind": "Variable" },
425-
{ "name": "ZOOM_SLIDER_SIZE", "kind": "Variable" }
423+
{ "name": "yellowPaletteLight", "kind": "Variable" }
426424
]

0 commit comments

Comments
 (0)