From 72c79deeea323590e46c57fd676490de3a09fdc2 Mon Sep 17 00:00:00 2001 From: Patrick Wehbe Date: Fri, 19 Jun 2026 15:19:40 +0300 Subject: [PATCH] fix: export DayOfWeek type from @internationalized/date The `DayOfWeek` union type (`'sun' | 'mon' | ... | 'sat'`) is used in the public signatures of the exported `getDayOfWeek`, `startOfWeek`, `endOfWeek`, and `getWeeksInMonth` functions (as the optional `firstDayOfWeek` parameter), but the type itself was declared without `export` in `queries.ts` and was not re-exported from `index.ts`. After the package moved to the `exports` field in package.json, the declaration file it lived in was no longer reachable, so consumers could no longer import it to type their own `firstDayOfWeek` props. Export the type formally so it can be imported alongside the functions that use it. Closes #9971 --- packages/@internationalized/date/src/index.ts | 1 + packages/@internationalized/date/src/queries.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@internationalized/date/src/index.ts b/packages/@internationalized/date/src/index.ts index 9d74d8bd93b..06c27a0900a 100644 --- a/packages/@internationalized/date/src/index.ts +++ b/packages/@internationalized/date/src/index.ts @@ -28,6 +28,7 @@ export type { CycleTimeOptions } from './types'; export type {DateValue} from './CalendarDate'; +export type {DayOfWeek} from './queries'; export {CalendarDate, CalendarDateTime, Time, ZonedDateTime} from './CalendarDate'; export {GregorianCalendar} from './calendars/GregorianCalendar'; diff --git a/packages/@internationalized/date/src/queries.ts b/packages/@internationalized/date/src/queries.ts index c26cdcbed40..5c2876c0074 100644 --- a/packages/@internationalized/date/src/queries.ts +++ b/packages/@internationalized/date/src/queries.ts @@ -79,7 +79,7 @@ const DAY_MAP = { sat: 6 }; -type DayOfWeek = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'; +export type DayOfWeek = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'; /** * Returns the day of week for the given date and locale. Days are numbered from zero to six,