diff --git a/resources/js/components/ui/Calendar/Calendar.vue b/resources/js/components/ui/Calendar/Calendar.vue index 56785b58777..9f9bb5943be 100644 --- a/resources/js/components/ui/Calendar/Calendar.vue +++ b/resources/js/components/ui/Calendar/Calendar.vue @@ -16,6 +16,7 @@ import { } from 'reka-ui'; import { parseAbsolute } from '@internationalized/date'; import Icon from '../Icon/Icon.vue'; +import CalendarToday from './CalendarToday.vue'; defineOptions({ name: 'Calendar' }); @@ -39,6 +40,7 @@ const components = computed(() => ({ CalendarHeading: props.components.Heading || CalendarHeading, CalendarPrev: props.components.Prev || CalendarPrev, CalendarNext: props.components.Next || CalendarNext, + CalendarToday: props.components.Today || CalendarToday, CalendarGrid: props.components.Grid || CalendarGrid, CalendarGridHead: props.components.GridHead || CalendarGridHead, CalendarGridBody: props.components.GridBody || CalendarGridBody, @@ -74,6 +76,20 @@ const gridStyle = computed(() => { 'grid-template-rows': 'auto' }; }); + +/** Popover uses slight negative inset to align with card; inline skips that inside padded layouts. */ +const calendarHeaderClass = computed(() => + props.inline + ? 'flex items-center justify-between pb-3.5 ms-1 -me-1.5 -mt-1' + : 'flex items-center justify-between ps-3.5 pe-1 pb-3.5 -mt-1.5', +); + +/** Month grid wrapper: popover matches narrow card; inline allows shrink in tight form layouts. */ +const calendarGridClass = computed(() => + props.inline + ? 'w-full border-collapse space-y-1 select-none -ms-2' + : 'w-full border-collapse space-y-1 select-none', +);