Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-infra] Use the @mui/docs/HighlightedCode #12848

Merged
merged 11 commits into from
Apr 26, 2024
Merged
2 changes: 1 addition & 1 deletion docs/data/charts/bars/BarClickNoSnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import UndoOutlinedIcon from '@mui/icons-material/UndoOutlined';

import { BarChart } from '@mui/x-charts/BarChart';

import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

const barChartsParams = {
series: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { BarChart } from '@mui/x-charts/BarChart';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
// @ts-ignore
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

const series = [{ data: [-2, -9, 12, 11, 6, -4] }];

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState('piecewise');
const [colorY, setColorY] = React.useState('None');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { BarChart } from '@mui/x-charts/BarChart';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
// @ts-ignore
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

const series = [{ data: [-2, -9, 12, 11, 6, -4] }];

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState<
'None' | 'piecewise' | 'continuous' | 'ordinal'
>('piecewise');
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/bars/bars.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The bar charts use by priority:

Learn more about the `colorMap` properties in the [Styling docs](/x/react-charts/styling/#values-color).

{{"demo": "ColorScaleNoSnap.js"}}
{{"demo": "ColorScale.js"}}

### Border Radius

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { LineChart } from '@mui/x-charts/LineChart';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
// @ts-ignore
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState('None');
const [colorY, setColorY] = React.useState('piecewise');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { LineChart } from '@mui/x-charts/LineChart';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
// @ts-ignore
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState<
'None' | 'piecewise' | 'continuous' | 'ordinal'
>('None');
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/lines/InterpolationDemoNoSnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
import { LineChart } from '@mui/x-charts/LineChart';

import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

const curveTypes = [
'catmullRom',
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/lines/LineClickNoSnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import UndoOutlinedIcon from '@mui/icons-material/UndoOutlined';

import { LineChart } from '@mui/x-charts/LineChart';

import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

const lineChartsParams = {
series: [
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/lines/lines.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ The line charts use by priority:

Learn more about the `colorMap` properties in the [Styling docs](/x/react-charts/styling/#values-color).

{{"demo": "ColorScaleNoSnap.js"}}
{{"demo": "ColorScale.js"}}

:::warning
For now, ordinal config is not supported for line chart.
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/pie/PieClickNoSnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import UndoOutlinedIcon from '@mui/icons-material/UndoOutlined';

import { PieChart } from '@mui/x-charts/PieChart';

import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

const data1 = [
{ label: 'Group A', value: 400 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import { ScatterChart } from '@mui/x-charts/ScatterChart';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
// @ts-ignore
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

import { Chance } from 'chance';

const POINTS_NUMBER = 50;
const chance = new Chance(42);

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState('piecewise');
const [colorY, setColorY] = React.useState('None');
const [colorZ, setColorZ] = React.useState('None');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import { ScatterValueType } from '@mui/x-charts';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
// @ts-ignore
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

import { Chance } from 'chance';

const POINTS_NUMBER = 50;
const chance = new Chance(42);

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState<'None' | 'piecewise' | 'continuous'>(
'piecewise',
);
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/scatter/ScatterClickNoSnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import UndoOutlinedIcon from '@mui/icons-material/UndoOutlined';

import { ScatterChart } from '@mui/x-charts/ScatterChart';

import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

const scatterChartsParams = {
series: [
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/scatter/scatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Here are three ways to set z value to 5.

Learn more about the `colorMap` properties in the [Styling docs](/x/react-charts/styling/#values-color).

{{"demo": "ColorScaleNoSnap.js"}}
{{"demo": "ColorScale.js"}}

### Grid

Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/events/CatalogOfEventsNoSnap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { styled } from '@mui/material/styles';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
// @ts-ignore
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
import { DemoContainer, DemoItem } from '@mui/x-date-pickers/internals/demo';
import Stack from '@mui/material/Stack';
import Box from '@mui/material/Box';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
// @ts-ignore
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
import { DemoContainer, DemoItem } from '@mui/x-date-pickers/internals/demo';
import Stack from '@mui/material/Stack';
import Box from '@mui/material/Box';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/ApiDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import AccordionDetails from '@mui/material/AccordionDetails';
import Typography from '@mui/material/Typography';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import PropTypes from 'prop-types';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

const PrimaryHeading = styled(Typography)(({ theme }) => ({
fontSize: theme.typography.pxToRem(15),
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/ChartsUsageDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import Box from '@mui/joy/Box';
import BrandingProvider from 'docs/src/BrandingProvider';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
import DemoPropsForm from './DemoPropsForm';

export default function ChartsUsageDemo({
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/CustomizationPlayground.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
// @ts-ignore
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
// @ts-ignore
import BrandingProvider from 'docs/src/BrandingProvider';
import { styled, Theme, alpha, useTheme } from '@mui/material/styles';
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/components/InterfaceApiPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Alert from '@mui/material/Alert';
import VerifiedRoundedIcon from '@mui/icons-material/VerifiedRounded';
import { alpha } from '@mui/material/styles';
import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import MarkdownElement from 'docs/src/modules/components/MarkdownElement';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
import { MarkdownElement } from '@mui/docs/MarkdownElement';
import AppLayoutDocs from 'docs/src/modules/components/AppLayoutDocs';
import PropertiesSection from 'docs/src/modules/components/ApiPage/sections/PropertiesSection';
import { DEFAULT_API_LAYOUT_STORAGE_KEYS } from 'docs/src/modules/components/ApiPage/sections/ToggleDisplayOption';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/LocalizationTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import clsx from 'clsx';
import { styled } from '@mui/material/styles';
import { Link } from '@mui/docs/Link';
import MarkdownElement from 'docs/src/modules/components/MarkdownElement';
import { MarkdownElement } from '@mui/docs/MarkdownElement';

const Root = styled('div')(({ theme }) => ({
position: 'relative',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
import Stack from '@mui/material/Stack';
import ToggleOptions from './ToggleOptions';

Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/components/SelectorsDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import AccordionDetails from '@mui/material/AccordionDetails';
import Typography from '@mui/material/Typography';
import Box from '@mui/material/Box';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import MarkdownElement from 'docs/src/modules/components/MarkdownElement';
import { HighlightedCode } from '@mui/docs/HighlightedCode';
import { MarkdownElement } from '@mui/docs/MarkdownElement';
import allSelectors from 'docsx/pages/x/api/data-grid/selectors.json';

const SelectorDetails = styled(AccordionDetails)({
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@
"@emotion/styled": "^11.11.0",
"@mnajdova/enzyme-adapter-react-18": "^0.2.0",
"@mui/icons-material": "^5.15.14",
"@mui/internal-markdown": "^1.0.0",
"@mui/internal-markdown": "^1.0.3",
"@mui/material": "^5.15.14",
"@mui/monorepo": "github:mui/material-ui#e1d94d5ce097815bcd738352e69bb43ce03bd266",
"@mui/monorepo": "github:mui/material-ui#afffc2ffc3db1e6abf48f3b3e13a41e8b758f874",
"@mui/utils": "^5.15.14",
"@next/eslint-plugin-next": "14.0.4",
"@octokit/plugin-retry": "^6.0.1",
Expand Down Expand Up @@ -197,8 +197,7 @@
"patchedDependencies": {
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"@mui/[email protected]": "patches/@[email protected]"
"[email protected]": "patches/[email protected]"
}
}
}
31 changes: 13 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"@mui/x-tree-view-pro/*": ["./packages/x-tree-view-pro/src/*"],
"@mui/x-license": ["./packages/x-license/src"],
"@mui/x-license/*": ["./packages/x-license/src/*"],
"@mui/docs": ["./node_modules/@mui/monorepo/packages/mui-docs/src"],
"@mui/docs/*": ["./node_modules/@mui/monorepo/packages/mui-docs/src/*"],
LukasTy marked this conversation as resolved.
Show resolved Hide resolved
"@mui-internal/test-utils": ["./node_modules/@mui/monorepo/packages/test-utils/src"],
"@mui-internal/test-utils/*": ["./node_modules/@mui/monorepo/packages/test-utils/src/*"],
"@mui-internal/api-docs-builder": ["./node_modules/@mui/monorepo/packages/api-docs-builder"],
Expand Down
Loading