Follow-up from #22308.
The EventCalendar/EventCalendarPremium and EventTimelinePremium duplicate EventSkeleton and ErrorContainer. Both pairs are flagged with cross-referenced TODO #22309 comments in the source.
Current state
ErrorContainer — structurally identical
packages/x-scheduler/src/internals/components/error-container/ErrorContainer.tsx
packages/x-scheduler-premium/src/event-timeline-premium/error-container/EventTimelinePremiumErrorContainer.tsx
Both versions are structurally identical. The only differences left are:
- The store context hook (
useEventCalendarStoreContext vs useEventTimelinePremiumStoreContext)
- The styled context hook (
useEventCalendarStyledContext vs useEventTimelinePremiumStyledContext)
- The
styled() name field (MuiEventCalendar vs MuiEventTimeline)
EventSkeleton — diverges in sizing
packages/x-scheduler/src/internals/components/event-skeleton/EventSkeleton.tsx
packages/x-scheduler-premium/src/event-timeline-premium/content/event-skeleton/EventTimelinePremiumSkeleton.tsx
The calendar version takes a required data-variant: 'time-column' | 'day-grid' | 'agenda' prop and applies different layout per variant (absolute positioning vs fixed heights). The timeline version has no variant — single theme-derived height + width: 100%.
Proposed approach
Create two shared components in packages/x-scheduler/src/internals/components/ with their own theme namespaces (following the MuiEventDialog precedent for shared scheduler components):
EventSkeleton
- New theme name:
MuiEventSkeleton.
- Add a fourth variant
'timeline-row' (theme-derived height + width: 100%) so the timeline can consume the same component.
- Both products use the shared component with the appropriate variant.
- Delete
EventTimelinePremiumSkeleton.tsx.
ErrorContainer
- New theme name:
MuiEventErrorContainer.
- Pass the store as a prop (or via a small product-agnostic hook) so the shared component is decoupled from a specific store context.
- Both products use it.
- Delete
EventTimelinePremiumErrorContainer.tsx.
Each product can keep a thin wrapper if it needs to inject the store/classes from its own styled context, but the styled root + JSX lives in the shared component.
What to clean up
- The four
TODO #22309 comments in the source files linked above.
- The duplicated component files in
packages/x-scheduler-premium/src/event-timeline-premium/.
- Any imports/exports referencing the removed components.
Notes for the implementer
- The scheduler is in alpha, so introducing new theme namespaces is acceptable.
- Existing consumers using
theme.components.MuiEventCalendar.styleOverrides.eventSkeleton (or the MuiEventTimeline equivalent) will lose their override after the rename — document this as a breaking change in the PR description.
Follow-up from #22308.
The EventCalendar/EventCalendarPremium and EventTimelinePremium duplicate
EventSkeletonandErrorContainer. Both pairs are flagged with cross-referencedTODO #22309comments in the source.Current state
ErrorContainer— structurally identicalpackages/x-scheduler/src/internals/components/error-container/ErrorContainer.tsxpackages/x-scheduler-premium/src/event-timeline-premium/error-container/EventTimelinePremiumErrorContainer.tsxBoth versions are structurally identical. The only differences left are:
useEventCalendarStoreContextvsuseEventTimelinePremiumStoreContext)useEventCalendarStyledContextvsuseEventTimelinePremiumStyledContext)styled()namefield (MuiEventCalendarvsMuiEventTimeline)EventSkeleton— diverges in sizingpackages/x-scheduler/src/internals/components/event-skeleton/EventSkeleton.tsxpackages/x-scheduler-premium/src/event-timeline-premium/content/event-skeleton/EventTimelinePremiumSkeleton.tsxThe calendar version takes a required
data-variant: 'time-column' | 'day-grid' | 'agenda'prop and applies different layout per variant (absolute positioning vs fixed heights). The timeline version has no variant — single theme-derivedheight+width: 100%.Proposed approach
Create two shared components in
packages/x-scheduler/src/internals/components/with their own theme namespaces (following theMuiEventDialogprecedent for shared scheduler components):EventSkeletonMuiEventSkeleton.'timeline-row'(theme-derived height +width: 100%) so the timeline can consume the same component.EventTimelinePremiumSkeleton.tsx.ErrorContainerMuiEventErrorContainer.EventTimelinePremiumErrorContainer.tsx.Each product can keep a thin wrapper if it needs to inject the store/classes from its own styled context, but the styled root + JSX lives in the shared component.
What to clean up
TODO #22309comments in the source files linked above.packages/x-scheduler-premium/src/event-timeline-premium/.Notes for the implementer
theme.components.MuiEventCalendar.styleOverrides.eventSkeleton(or theMuiEventTimelineequivalent) will lose their override after the rename — document this as a breaking change in the PR description.