Skip to content

Commit

Permalink
Try fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Aug 5, 2024
1 parent 6134015 commit b14ce33
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 379 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ jobs:
name: Tests TypeScript definitions
command: pnpm typescript:ci
environment:
NODE_OPTIONS: --max-old-space-size=1536
NODE_OPTIONS: --max-old-space-size=3584
test_e2e:
<<: *default-job
docker:
Expand Down
22 changes: 5 additions & 17 deletions docs/data/data-grid/localization/DataGridRTL.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import * as React from 'react';
import { prefixer } from 'stylis';
import rtlPlugin from 'stylis-plugin-rtl';
import { DataGrid } from '@mui/x-data-grid';
import { arSD } from '@mui/x-data-grid/locales';
import createCache from '@emotion/cache';
import { CacheProvider } from '@emotion/react';
import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';

// Create rtl cache
const cacheRtl = createCache({
key: 'data-grid-rtl-demo',
stylisPlugins: [prefixer, rtlPlugin],
});

const columns = [
{
field: 'id',
Expand Down Expand Up @@ -62,12 +52,10 @@ export default function DataGridRTL() {
[existingTheme],
);
return (
<CacheProvider value={cacheRtl}>
<ThemeProvider theme={theme}>
<div dir="rtl" style={{ height: 400, width: '100%' }}>
<DataGrid rows={rows} columns={columns} />
</div>
</ThemeProvider>
</CacheProvider>
<ThemeProvider theme={theme}>
<div dir="rtl" style={{ height: 400, width: '100%' }}>
<DataGrid rows={rows} columns={columns} />
</div>
</ThemeProvider>
);
}
22 changes: 5 additions & 17 deletions docs/data/data-grid/localization/DataGridRTL.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import * as React from 'react';
import { prefixer } from 'stylis';
import rtlPlugin from 'stylis-plugin-rtl';
import { DataGrid, GridColDef } from '@mui/x-data-grid';
import { arSD } from '@mui/x-data-grid/locales';
import createCache from '@emotion/cache';
import { CacheProvider } from '@emotion/react';
import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';

// Create rtl cache
const cacheRtl = createCache({
key: 'data-grid-rtl-demo',
stylisPlugins: [prefixer, rtlPlugin],
});

const columns: GridColDef[] = [
{
field: 'id',
Expand Down Expand Up @@ -62,12 +52,10 @@ export default function DataGridRTL() {
[existingTheme],
);
return (
<CacheProvider value={cacheRtl}>
<ThemeProvider theme={theme}>
<div dir="rtl" style={{ height: 400, width: '100%' }}>
<DataGrid rows={rows} columns={columns} />
</div>
</ThemeProvider>
</CacheProvider>
<ThemeProvider theme={theme}>
<div dir="rtl" style={{ height: 400, width: '100%' }}>
<DataGrid rows={rows} columns={columns} />
</div>
</ThemeProvider>
);
}
12 changes: 5 additions & 7 deletions docs/data/data-grid/localization/DataGridRTL.tsx.preview
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<CacheProvider value={cacheRtl}>
<ThemeProvider theme={theme}>
<div dir="rtl" style={{ height: 400, width: '100%' }}>
<DataGrid rows={rows} columns={columns} />
</div>
</ThemeProvider>
</CacheProvider>
<ThemeProvider theme={theme}>
<div dir="rtl" style={{ height: 400, width: '100%' }}>
<DataGrid rows={rows} columns={columns} />
</div>
</ThemeProvider>
68 changes: 2 additions & 66 deletions docs/data/date-pickers/adapters-locale/PickersRTL.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,3 @@
import * as React from 'react';
import { prefixer } from 'stylis';
import rtlPlugin from 'stylis-plugin-rtl';
import createCache from '@emotion/cache';
import { CacheProvider } from '@emotion/react';
import Box from '@mui/material/Box';
import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';
import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { DateRangeCalendar } from '@mui/x-date-pickers-pro/DateRangeCalendar';
import { MultiSectionDigitalClock } from '@mui/x-date-pickers/MultiSectionDigitalClock';

// Create rtl cache
const cacheRtl = createCache({
key: 'pickers-rtl-demo',
stylisPlugins: [prefixer, rtlPlugin],
});

export default function PickersRTL() {
// Inherit the theme from the docs site (dark/light mode)
const existingTheme = useTheme();

const theme = React.useMemo(
() =>
createTheme({}, existingTheme, {
direction: 'rtl',
}),
[existingTheme],
);

return (
<CacheProvider value={cacheRtl}>
<ThemeProvider theme={theme}>
<div dir="rtl">
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DemoContainer
components={[
'DatePicker',
'DateRangeCalendar',
'MultiSectionDigitalClock',
]}
>
<DatePicker
// Setting `dir="rtl"` on the paper is needed if the `<div dir="rtl />` does not contain the portaled element.
// If you set `dir="rtl"` on the `<body />`, you can skip it.
slotProps={{
desktopPaper: {
dir: 'rtl',
},
mobilePaper: {
dir: 'rtl',
},
}}
/>
<DateRangeCalendar />
<Box sx={{ width: 56 * 3 }}>
<MultiSectionDigitalClock />
</Box>
</DemoContainer>
</LocalizationProvider>
</div>
</ThemeProvider>
</CacheProvider>
);
export function PickersRTL() {
return null;
}
68 changes: 2 additions & 66 deletions docs/data/date-pickers/adapters-locale/PickersRTL.tsx
Original file line number Diff line number Diff line change
@@ -1,67 +1,3 @@
import * as React from 'react';
import { prefixer } from 'stylis';
import rtlPlugin from 'stylis-plugin-rtl';
import createCache from '@emotion/cache';
import { CacheProvider } from '@emotion/react';
import Box from '@mui/material/Box';
import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';
import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { DateRangeCalendar } from '@mui/x-date-pickers-pro/DateRangeCalendar';
import { MultiSectionDigitalClock } from '@mui/x-date-pickers/MultiSectionDigitalClock';

// Create rtl cache
const cacheRtl = createCache({
key: 'pickers-rtl-demo',
stylisPlugins: [prefixer, rtlPlugin],
});

export default function PickersRTL() {
// Inherit the theme from the docs site (dark/light mode)
const existingTheme = useTheme();

const theme = React.useMemo(
() =>
createTheme({}, existingTheme, {
direction: 'rtl',
}),
[existingTheme],
);

return (
<CacheProvider value={cacheRtl}>
<ThemeProvider theme={theme}>
<div dir="rtl">
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DemoContainer
components={[
'DatePicker',
'DateRangeCalendar',
'MultiSectionDigitalClock',
]}
>
<DatePicker
// Setting `dir="rtl"` on the paper is needed if the `<div dir="rtl />` does not contain the portaled element.
// If you set `dir="rtl"` on the `<body />`, you can skip it.
slotProps={{
desktopPaper: {
dir: 'rtl',
},
mobilePaper: {
dir: 'rtl',
},
}}
/>
<DateRangeCalendar />
<Box sx={{ width: 56 * 3 }}>
<MultiSectionDigitalClock />
</Box>
</DemoContainer>
</LocalizationProvider>
</div>
</ThemeProvider>
</CacheProvider>
);
export function PickersRTL() {
return null;
}
2 changes: 1 addition & 1 deletion docs/data/date-pickers/calendar-systems/AdapterHijri.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';

// Create rtl cache
const cacheRtl = createCache({
key: 'adapter-hijri-demo',
key: 'mui-x-demo',
stylisPlugins: [prefixer, rtlPlugin],
});

Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/calendar-systems/AdapterHijri.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';

// Create rtl cache
const cacheRtl = createCache({
key: 'adapter-hijri-demo',
key: 'mui-x-demo',
stylisPlugins: [prefixer, rtlPlugin],
});

Expand Down
51 changes: 2 additions & 49 deletions docs/data/date-pickers/calendar-systems/AdapterJalali.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,3 @@
import * as React from 'react';
import { prefixer } from 'stylis';
import rtlPlugin from 'stylis-plugin-rtl';
import createCache from '@emotion/cache';
import { CacheProvider } from '@emotion/react';
import { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalali';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';

// Create rtl cache
const cacheRtl = createCache({
key: 'adapter-jalali-demo',
stylisPlugins: [prefixer, rtlPlugin],
});

export default function AdapterJalali() {
// Inherit the theme from the docs site (dark/light mode)
const existingTheme = useTheme();

const theme = React.useMemo(
() => createTheme(existingTheme, { direction: 'rtl' }),
[existingTheme],
);

return (
<CacheProvider value={cacheRtl}>
<ThemeProvider theme={theme}>
<div dir="rtl">
<LocalizationProvider dateAdapter={AdapterDateFnsJalali}>
<DateTimePicker
label="AdapterDateFnsJalali"
defaultValue={new Date(2022, 1, 1, 12)}
// Setting `dir="rtl"` on the paper is needed if the `<div dir="rtl />` does not contain the portaled element.
// If you set `dir="rtl"` on the `<body />`, you can skip it.
slotProps={{
desktopPaper: {
dir: 'rtl',
},
mobilePaper: {
dir: 'rtl',
},
}}
/>
</LocalizationProvider>
</div>
</ThemeProvider>
</CacheProvider>
);
export function PickersRTL() {
return null;
}
51 changes: 2 additions & 49 deletions docs/data/date-pickers/calendar-systems/AdapterJalali.tsx
Original file line number Diff line number Diff line change
@@ -1,50 +1,3 @@
import * as React from 'react';
import { prefixer } from 'stylis';
import rtlPlugin from 'stylis-plugin-rtl';
import createCache from '@emotion/cache';
import { CacheProvider } from '@emotion/react';
import { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalali';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
import { createTheme, ThemeProvider, useTheme } from '@mui/material/styles';

// Create rtl cache
const cacheRtl = createCache({
key: 'adapter-jalali-demo',
stylisPlugins: [prefixer, rtlPlugin],
});

export default function AdapterJalali() {
// Inherit the theme from the docs site (dark/light mode)
const existingTheme = useTheme();

const theme = React.useMemo(
() => createTheme(existingTheme, { direction: 'rtl' }),
[existingTheme],
);

return (
<CacheProvider value={cacheRtl}>
<ThemeProvider theme={theme}>
<div dir="rtl">
<LocalizationProvider dateAdapter={AdapterDateFnsJalali}>
<DateTimePicker
label="AdapterDateFnsJalali"
defaultValue={new Date(2022, 1, 1, 12)}
// Setting `dir="rtl"` on the paper is needed if the `<div dir="rtl />` does not contain the portaled element.
// If you set `dir="rtl"` on the `<body />`, you can skip it.
slotProps={{
desktopPaper: {
dir: 'rtl',
},
mobilePaper: {
dir: 'rtl',
},
}}
/>
</LocalizationProvider>
</div>
</ThemeProvider>
</CacheProvider>
);
export function PickersRTL() {
return null;
}
Loading

0 comments on commit b14ce33

Please sign in to comment.