Skip to content
32 changes: 15 additions & 17 deletions docs/src/components/productX/XDateRangeDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ import { HighlightedCode } from '@mui/internal-core-docs/HighlightedCode';
import dayjs, { Dayjs } from 'dayjs';
import Frame from 'docs/src/components/action/Frame';

const startDate = dayjs();
startDate.date(10);
const endDate = dayjs();
endDate.date(endDate.date() + 28);
const startDate = dayjs().date(10);
const endDate = dayjs().add(28, 'day');

function CustomRangeShortcuts(props: PickersShortcutsProps<DateRange<Dayjs>>) {
const { items, changeImportance = 'accept' } = props;
Expand Down Expand Up @@ -130,9 +128,13 @@ export default function XDateRangeDemo() {
'& .MuiTypography-subtitle1': {
fontSize: '0.875rem',
},
'& .MuiTypography-caption': {
width: 28,
'& .MuiDayCalendar-weekDayLabel': {
width: 32,
height: 32,
margin: 0,
},
'& .MuiDayCalendar-root': {
minWidth: 258,
},
'& .MuiPickersSlideTransition-root': {
minWidth: 258,
Expand All @@ -142,23 +144,19 @@ export default function XDateRangeDemo() {
margin: '4px 0',
},
'& .MuiDateRangePickerDay-root': {
lineHeight: 0,
margin: 0,
'--PickerDay-horizontalMargin': '0px',
'--PickerDay-size': '32px',
fontWeight: 'regular',
},
'& .MuiPickersArrowSwitcher-root': {
padding: 0,
paddingTop: 0.5,
},
'& .MuiPickerDay-root': {
width: 28,
height: 28,
fontWeight: 'regular',
},
'& .MuiDateRangePickerDay-day.Mui-selected': {
'& .MuiDateRangePickerDay-selected': {
fontWeight: 'semiBold',
},
'& .MuiDateRangePickerDay-day:not(.Mui-selected)': {
borderColor: 'primary.300',
'& .MuiDateRangePickerDay-today': {
outlineColor: 'primary.300',
},
'& .MuiPickersLayout-actionBar': {
borderTop: '1px solid',
Expand All @@ -170,7 +168,7 @@ export default function XDateRangeDemo() {
'& > div': {
bgcolor: 'primaryDark.900',
},
'& .MuiDateRangePickerDay-day.Mui-selected': {
'& .MuiDateRangePickerDay-selected': {
color: '#FFF',
},
}),
Expand Down
30 changes: 14 additions & 16 deletions docs/src/components/productX/XHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ import FolderTreeView from 'docs/src/components/showcase/FolderTreeView';
import ROUTES from 'docs/src/route';
import dayjs from 'dayjs';

const startDate = dayjs();
startDate.date(10);
const endDate = dayjs();
endDate.date(endDate.date() + 28);
const startDate = dayjs().date(10);
const endDate = dayjs().add(28, 'day');

const visibleFields = [
'commodity',
Expand Down Expand Up @@ -307,9 +305,13 @@ export default function XHero() {
'& .MuiTypography-subtitle1': {
fontSize: '0.875rem',
},
'& .MuiTypography-caption': {
width: { xs: 28, xl: 32 },
'& .MuiDayCalendar-weekDayLabel': {
width: { xs: 32, xl: 36 },
height: 32,
margin: 0,
},
'& .MuiDayCalendar-root': {
minWidth: { xs: 268, xl: 300 },
},
'& .MuiPickersSlideTransition-root': {
minWidth: { xs: 268, xl: 300 },
Expand All @@ -322,27 +324,23 @@ export default function XHero() {
padding: 1,
},
'& .MuiDateRangePickerDay-root': {
lineHeight: 0,
margin: 0,
},
'& .MuiPickerDay-root': {
width: { xs: 28, xl: 32 },
height: { xs: 28, xl: 32 },
'--PickerDay-horizontalMargin': '0px',
'--PickerDay-size': { xs: '32px', xl: '36px' },
fontWeight: 400,
},
'& .MuiDateRangePickerDay-day.Mui-selected': {
'& .MuiDateRangePickerDay-selected': {
fontWeight: 600,
},
'& .MuiDateRangePickerDay-day:not(.Mui-selected)': {
borderColor: 'primary.300',
'& .MuiDateRangePickerDay-today': {
outlineColor: 'primary.300',
},
},
(theme) =>
theme.applyDarkStyles({
borderColor: 'primaryDark.700',
boxShadow: '0px 4px 6px rgba(0, 0, 0, 0.2)',
backgroundColor: 'primaryDark.900',
'& .MuiDateRangePickerDay-day.Mui-selected': {
'& .MuiDateRangePickerDay-selected': {
color: '#FFF',
},
}),
Expand Down
Loading