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] Make overview demo work in codesandbox #10661

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions docs/data/date-pickers/base-concepts/ComponentFamilies.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Link from 'next/link';
import dayjs from 'dayjs';
import { styled } from '@mui/material/styles';
import { DemoContainer, DemoItem } from '@mui/x-date-pickers/internals/demo';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
Expand All @@ -13,13 +13,25 @@ import { MultiInputDateTimeRangeField } from '@mui/x-date-pickers-pro/MultiInput
import Stack from '@mui/material/Stack';
import Tooltip from '@mui/material/Tooltip';

const ProSpan = styled('span')({
display: 'inline-block',
height: '1em',
width: '1em',
verticalAlign: 'middle',
marginLeft: '0.3em',
marginBottom: '0.08em',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundImage: 'url(https://mui.com/static/x/pro.svg)',
});

function ProLabel({ children }) {
return (
<Stack direction="row" spacing={0.5} component="span">
<Tooltip title="Included in Pro package">
<Link href="/x/introduction/licensing/#pro-plan">
<span className="plan-pro" />
</Link>
<a href="https://mui.com/x/introduction/licensing/#pro-plan">
<ProSpan />
</a>
</Tooltip>
<span>{children}</span>
</Stack>
Expand Down
20 changes: 16 additions & 4 deletions docs/data/date-pickers/base-concepts/ComponentFamilies.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Link from 'next/link';
import dayjs from 'dayjs';
import { styled } from '@mui/material/styles';
import { DemoContainer, DemoItem } from '@mui/x-date-pickers/internals/demo';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
Expand All @@ -13,13 +13,25 @@ import { MultiInputDateTimeRangeField } from '@mui/x-date-pickers-pro/MultiInput
import Stack from '@mui/material/Stack';
import Tooltip from '@mui/material/Tooltip';

const ProSpan = styled('span')({
display: 'inline-block',
height: '1em',
width: '1em',
verticalAlign: 'middle',
marginLeft: '0.3em',
marginBottom: '0.08em',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundImage: 'url(https://mui.com/static/x/pro.svg)',
});

function ProLabel({ children }: { children: React.ReactNode }) {
return (
<Stack direction="row" spacing={0.5} component="span">
<Tooltip title="Included in Pro package">
<Link href="/x/introduction/licensing/#pro-plan">
<span className="plan-pro" />
</Link>
<a href="https://mui.com/x/introduction/licensing/#pro-plan">
<ProSpan />
</a>
</Tooltip>
<span>{children}</span>
</Stack>
Expand Down
20 changes: 16 additions & 4 deletions docs/data/date-pickers/overview/CommonlyUsedComponents.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Link from 'next/link';
import { styled } from '@mui/material/styles';
import Tooltip from '@mui/material/Tooltip';
import Stack from '@mui/material/Stack';
import { DemoContainer, DemoItem } from '@mui/x-date-pickers/internals/demo';
Expand All @@ -10,6 +10,18 @@ import { TimePicker } from '@mui/x-date-pickers/TimePicker';
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';

const ProSpan = styled('span')({
display: 'inline-block',
height: '1em',
width: '1em',
verticalAlign: 'middle',
marginLeft: '0.3em',
marginBottom: '0.08em',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundImage: 'url(https://mui.com/static/x/pro.svg)',
});

function Label({ componentName, valueType, isProOnly }) {
const content = (
<span>
Expand All @@ -21,9 +33,9 @@ function Label({ componentName, valueType, isProOnly }) {
return (
<Stack direction="row" spacing={0.5} component="span">
<Tooltip title="Included on Pro package">
<Link href="/x/introduction/licensing/#pro-plan">
<span className="plan-pro" />
</Link>
<a href="https://mui.com/x/introduction/licensing/#pro-plan">
<ProSpan />
</a>
</Tooltip>
{content}
</Stack>
Expand Down
20 changes: 16 additions & 4 deletions docs/data/date-pickers/overview/CommonlyUsedComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Link from 'next/link';
import { styled } from '@mui/material/styles';
import Tooltip from '@mui/material/Tooltip';
import Stack from '@mui/material/Stack';
import { DemoContainer, DemoItem } from '@mui/x-date-pickers/internals/demo';
Expand All @@ -10,6 +10,18 @@ import { TimePicker } from '@mui/x-date-pickers/TimePicker';
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';

const ProSpan = styled('span')({
display: 'inline-block',
height: '1em',
width: '1em',
verticalAlign: 'middle',
marginLeft: '0.3em',
marginBottom: '0.08em',
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundImage: 'url(https://mui.com/static/x/pro.svg)',
});

function Label({
componentName,
valueType,
Expand All @@ -29,9 +41,9 @@ function Label({
return (
<Stack direction="row" spacing={0.5} component="span">
<Tooltip title="Included on Pro package">
<Link href="/x/introduction/licensing/#pro-plan">
<span className="plan-pro" />
</Link>
<a href="https://mui.com/x/introduction/licensing/#pro-plan">
<ProSpan />
</a>
</Tooltip>
{content}
</Stack>
Expand Down