diff --git a/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.js b/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.js index 5a150cfe0e2b0..e67c204c64a7b 100644 --- a/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.js +++ b/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.js @@ -1,7 +1,6 @@ import * as React from 'react'; import clsx from 'clsx'; -import { Separator } from '@base-ui-components/react/separator'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; // eslint-disable-next-line no-restricted-imports @@ -11,24 +10,21 @@ import { } from '@mui/x-date-pickers-pro/internals/base/RangeCalendar'; import styles from './calendar.module.css'; -function Header(props) { - const { offset } = props; +function Header() { const { visibleDate } = useRangeCalendarContext(); - const date = visibleDate.add(offset, 'month'); - return (
- {date.format('MMMM YYYY')} + {visibleDate.format('MMMM YYYY')} @@ -36,60 +32,45 @@ function Header(props) { ); } -function DaysGrid(props) { - const { offset } = props; - return ( -
-
- - - {({ days }) => - days.map((day) => ( - - )) - } - - - {({ weeks }) => - weeks.map((week) => ( - - {({ days }) => - days.map((day) => ( - - )) - } - - )) - } - - -
- ); -} - -function DayCalendar(props) { +function DayRangeCalendar(props) { return ( - - - - + +
+ + + {({ days }) => + days.map((day) => ( + + )) + } + + + {({ weeks }) => + weeks.map((week) => ( + + {({ days }) => + days.map((day) => ( + + )) + } + + )) + } + + ); @@ -104,7 +85,7 @@ export default function DayRangeCalendarDemo() { return ( - + ); } diff --git a/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.tsx b/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.tsx index 1d6728c438e1d..ec645716124b8 100644 --- a/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.tsx +++ b/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.tsx @@ -32,7 +32,7 @@ function Header() { ); } -function DayCalendar(props: Omit) { +function DayRangeCalendar(props: Omit) { return ( @@ -91,7 +91,7 @@ export default function DayRangeCalendarDemo() { return ( - + ); } diff --git a/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.tsx.preview b/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.tsx.preview index 72b23c81a5a56..16ef550120c15 100644 --- a/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.tsx.preview +++ b/docs/data/date-pickers/base-calendar/DayRangeCalendarDemo.tsx.preview @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.js b/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.js index 652ea8846a45f..5b3b5729ad3da 100644 --- a/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.js +++ b/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.js @@ -79,7 +79,7 @@ function DaysGrid(props) { ); } -function DayCalendar(props) { +function DayRangeCalendar(props) { return ( - + ); } diff --git a/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.tsx b/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.tsx index 37e34b001f5fd..f9db36a489510 100644 --- a/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.tsx +++ b/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.tsx @@ -79,7 +79,7 @@ function DaysGrid(props: { offset: 0 | 1 }) { ); } -function DayCalendar(props: Omit) { +function DayRangeCalendar(props: Omit) { return ( - + ); } diff --git a/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.tsx.preview b/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.tsx.preview index 72b23c81a5a56..16ef550120c15 100644 --- a/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.tsx.preview +++ b/docs/data/date-pickers/base-calendar/DayRangeCalendarWithTwoMonthsDemo.tsx.preview @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file