Skip to content

Commit

Permalink
fix(date-range-picker): calendar-content width as per visible-months (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
awesome-pro committed Jul 18, 2024
1 parent 5591138 commit 1fdbf2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/short-garlics-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nextui-org/calendar": patch
"@nextui-org/theme": patch
---

Fixed the calendarContent width as per visible month
2 changes: 1 addition & 1 deletion packages/components/calendar/src/use-calendar-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export function useCalendarBase(originalProps: UseCalendarBasePropsComplete) {
"data-has-multiple-months": dataAttr(hasMultipleMonths),
style: {
// @ts-ignore
"--visible-months": visibleMonths,
"--visible-months": typeof visibleMonths === "number" ? `${visibleMonths}` : visibleMonths,
"--calendar-width": typeof calendarWidth === "number" ? `${calendarWidth}px` : calendarWidth,
} as React.CSSProperties,
};
Expand Down
4 changes: 2 additions & 2 deletions packages/core/theme/src/components/date-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const datePicker = tv({
selectorButton: "-mr-2 text-inherit",
selectorIcon: "text-lg text-inherit pointer-events-none flex-shrink-0",
popoverContent: "p-0 w-full",
calendar: "w-[var(--calendar-width)] shadow-none",
calendarContent: "w-[var(--calendar-width)]",
calendar: "w-[calc(var(--visible-months)_*_var(--calendar-width))] shadow-none",
calendarContent: "w-[calc(var(--visible-months)_*_var(--calendar-width))]",
timeInputLabel: "font-medium",
timeInput: "px-5 pb-4 flex-wrap gap-x-6",
},
Expand Down

0 comments on commit 1fdbf2a

Please sign in to comment.