@at5/kairo 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +13 -0
- package/dist/index.cjs +6 -1428
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -297
- package/dist/index.d.ts +1 -297
- package/dist/index.js +1 -1427
- package/dist/index.js.map +1 -1
- package/package.json +11 -39
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/date-picker/index.ts","../src/date-picker/context.ts","../src/utils/locale.ts","../src/utils/calendar.ts","../src/utils/date.ts","../src/date-picker/reducer.ts","../src/date-picker/use-date-picker.ts","../src/date-picker/root.tsx","../src/date-picker/label.tsx","../src/date-picker/input.tsx","../src/date-picker/trigger.tsx","../src/date-picker/use-click-outside.ts","../src/utils/aria.ts","../src/date-picker/use-focus-trap.ts","../src/date-picker/use-floating.ts","../src/date-picker/content.tsx","../src/date-picker/view-control.tsx","../src/date-picker/prev-trigger.tsx","../src/date-picker/next-trigger.tsx","../src/date-picker/view-trigger.tsx","../src/date-picker/view.tsx","../src/date-picker/week-days.tsx","../src/date-picker/day.tsx","../src/date-picker/grid.tsx","../src/date-picker/month-grid.tsx","../src/date-picker/month-cell.tsx","../src/date-picker/year-grid.tsx","../src/date-picker/year-cell.tsx","../src/date-picker/calendar.tsx"],"names":["createContext","useContext","offset","_","useId","useMemo","useReducer","useRef","useEffect","jsx","useTimescape","useState","jsxs","React","useCallback","useFloating","autoUpdate","flip","shift","useLayoutEffect","createPortal"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,mBAAA,GAAA;AAAA,QAAA,CAAA,mBAAA,EAAA;AAAA,EAAA,QAAA,EAAA,MAAA,QAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,GAAA,EAAA,MAAA,GAAA;AAAA,EAAA,IAAA,EAAA,MAAA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AE,KAAA,EAAO,UAAU,CAAA,CAAE,UAAA,EACjD,YAAE,KAAA,EAAA,EADU,CAAA,CAAE,KAEjB,CACD,CAAA,EACH,GAEJ,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"index.cjs","sourcesContent":["export { Root } from \"./root\";\nexport { Label } from \"./label\";\nexport { Input } from \"./input\";\nexport { Trigger } from \"./trigger\";\nexport { Content } from \"./content\";\nexport type { ContentProps } from \"./content\";\nexport { Calendar } from \"./calendar\";\nexport { View } from \"./view\";\nexport { ViewControl } from \"./view-control\";\nexport { PrevTrigger } from \"./prev-trigger\";\nexport { NextTrigger } from \"./next-trigger\";\nexport { ViewTrigger } from \"./view-trigger\";\nexport { WeekDays } from \"./week-days\";\nexport { Grid } from \"./grid\";\nexport { Day } from \"./day\";\nexport { MonthGrid } from \"./month-grid\";\nexport { MonthCell } from \"./month-cell\";\nexport { YearGrid } from \"./year-grid\";\nexport { YearCell } from \"./year-cell\";\n","import { createContext, useContext } from \"react\";\nimport type { Dispatch } from \"react\";\nimport type { DatePickerState, DatePickerAction } from \"./reducer\";\nimport type { DatePickerConfig, ViewMode } from \"../types\";\n\nexport interface DatePickerContextValue {\n state: DatePickerState;\n dispatch: Dispatch<DatePickerAction>;\n config: DatePickerConfig;\n ids: {\n root: string;\n label: string;\n input: string;\n trigger: string;\n content: string;\n };\n}\n\nexport const DatePickerContext = createContext<DatePickerContextValue | null>(null);\n\nexport function useDatePickerContext(): DatePickerContextValue {\n const ctx = useContext(DatePickerContext);\n if (!ctx) {\n throw new Error(\"DatePicker compound components must be rendered inside <DatePicker.Root>.\");\n }\n return ctx;\n}\n\nexport interface DatePickerViewContextValue {\n view: ViewMode;\n}\n\nexport const DatePickerViewContext = createContext<DatePickerViewContextValue | null>(null);\n\nexport function useDatePickerViewContext(): DatePickerViewContextValue {\n const ctx = useContext(DatePickerViewContext);\n if (!ctx) {\n throw new Error(\"DatePicker.View sub-components must be rendered inside <DatePicker.View>.\");\n }\n return ctx;\n}\n\n// ── Month/Year grid focus contexts ──────────────────────────────────────────\n\nexport const MonthGridFocusContext = createContext<number>(-1);\nexport const YearGridFocusContext = createContext<number>(-1);\n","export function getWeekStartDay(locale: string, override?: 0 | 1 | 2 | 3 | 4 | 5 | 6): number {\n if (override !== undefined) return override;\n try {\n // weekInfo.firstDay: 1=Monday..7=Sunday (ISO) → JS: 0=Sunday..6=Saturday\n // weekInfo is a stage-4 proposal, not yet in TS lib types\n const weekInfo = (new Intl.Locale(locale) as unknown as { weekInfo: { firstDay: number } })\n .weekInfo;\n return weekInfo.firstDay === 7 ? 0 : weekInfo.firstDay;\n } catch {\n return 0;\n }\n}\n\nexport function formatDate(date: Date, locale: string): string {\n return new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n }).format(date);\n}\n\nexport function formatMonthYear(date: Date, locale: string): string {\n return new Intl.DateTimeFormat(locale, {\n month: \"long\",\n year: \"numeric\",\n }).format(date);\n}\n\nexport function formatYear(year: number, locale: string): string {\n return new Intl.DateTimeFormat(locale, { year: \"numeric\" }).format(new Date(year, 0, 1));\n}\n\nexport function getMonthNames(\n locale: string,\n format: \"long\" | \"short\" | \"narrow\" = \"long\",\n): string[] {\n const formatter = new Intl.DateTimeFormat(locale, { month: format });\n return Array.from({ length: 12 }, (_, i) => formatter.format(new Date(2024, i, 1)));\n}\n\nexport function getWeekDayNames(\n locale: string,\n weekStartDay: number,\n format: \"long\" | \"short\" | \"narrow\" = \"short\",\n): Array<{ label: string; ariaLabel: string }> {\n const formatter = new Intl.DateTimeFormat(locale, { weekday: format });\n const longFormatter = new Intl.DateTimeFormat(locale, { weekday: \"long\" });\n // Jan 5 2025 is a Sunday (getDay() === 0), use as anchor\n const anchor = new Date(2025, 0, 5);\n return Array.from({ length: 7 }, (_, i) => {\n const day = new Date(anchor);\n day.setDate(anchor.getDate() + ((weekStartDay + i) % 7));\n return { label: formatter.format(day), ariaLabel: longFormatter.format(day) };\n });\n}\n\ntype DateField = \"year\" | \"month\" | \"day\";\n\nfunction getDateFieldOrder(locale: string): DateField[] {\n const parts = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n }).formatToParts(new Date(2024, 0, 15));\n\n const order: DateField[] = [];\n for (const part of parts) {\n if (part.type === \"year\" || part.type === \"month\" || part.type === \"day\") {\n order.push(part.type as DateField);\n }\n }\n return order;\n}\n\nexport interface SegmentInfo {\n order: DateField[];\n separator: string;\n}\n\nexport function getSegmentInfo(locale: string): SegmentInfo {\n const parts = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n }).formatToParts(new Date(2024, 0, 15));\n\n const order: DateField[] = [];\n let separator = \"/\";\n for (const part of parts) {\n if (part.type === \"year\" || part.type === \"month\" || part.type === \"day\") {\n order.push(part.type);\n } else if (part.type === \"literal\" && part.value.trim()) {\n separator = part.value.trim();\n }\n }\n return { order, separator };\n}\n\nexport function parseDate(value: string, locale: string): Date | null {\n if (!value.trim()) return null;\n\n // Parse YYYY-MM-DD as local date (Date.parse treats it as UTC, causing timezone shift)\n const isoMatch = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value);\n if (isoMatch) {\n const d = new Date(Number(isoMatch[1]), Number(isoMatch[2]) - 1, Number(isoMatch[3]));\n return isNaN(d.getTime()) ? null : d;\n }\n\n // Locale-aware parsing: detect field order from Intl\n const order = getDateFieldOrder(locale);\n const parts = value.split(/[-/.\\s]+/).map(Number);\n\n if (parts.length < 3 || parts.some(isNaN)) return null;\n\n const fields: Record<DateField, number> = { year: 0, month: 0, day: 0 };\n order.forEach((field, i) => {\n fields[field] = parts[i] ?? 0;\n });\n\n const { year, month, day } = fields;\n if (!year || !month || !day) return null;\n\n const date = new Date(year, month - 1, day);\n if (isNaN(date.getTime())) return null;\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n return null; // overflow guard (e.g. Feb 30)\n }\n\n return date;\n}\n","import { getWeekDayNames, getMonthNames } from \"./locale\";\nimport type { MonthItem, WeekDayItem } from \"../types\";\n\nexport function buildCalendarGrid(year: number, month: number, weekStartDay: number): Date[][] {\n const firstOfMonth = new Date(year, month, 1);\n const offset = (firstOfMonth.getDay() - weekStartDay + 7) % 7;\n const totalDays = new Date(year, month + 1, 0).getDate();\n const rows = offset + totalDays <= 35 ? 5 : 6;\n\n return Array.from({ length: rows }, (_, row) =>\n Array.from({ length: 7 }, (_, col) => new Date(year, month, 1 - offset + row * 7 + col)),\n );\n}\n\nexport function buildWeekDays(\n locale: string,\n weekStartDay: number,\n format: \"long\" | \"short\" | \"narrow\" = \"short\",\n): WeekDayItem[] {\n return getWeekDayNames(locale, weekStartDay, format);\n}\n\nexport function buildMonthItems(\n year: number,\n locale: string,\n selectedMonth?: number,\n minDate?: Date,\n maxDate?: Date,\n): MonthItem[] {\n const names = getMonthNames(locale, \"long\");\n return names.map((label, i) => {\n const isDisabled =\n (minDate !== undefined && year < minDate.getFullYear()) ||\n (minDate !== undefined && year === minDate.getFullYear() && i < minDate.getMonth()) ||\n (maxDate !== undefined && year > maxDate.getFullYear()) ||\n (maxDate !== undefined && year === maxDate.getFullYear() && i > maxDate.getMonth());\n\n return {\n value: i,\n label,\n isSelected: selectedMonth === i,\n isDisabled,\n };\n });\n}\n\nexport function buildYearItems(\n pageStart: number,\n count = 12,\n selectedYear?: number,\n minDate?: Date,\n maxDate?: Date,\n): Array<{ value: number; isSelected: boolean; isDisabled: boolean }> {\n return Array.from({ length: count }, (_, i) => {\n const year = pageStart + i;\n const isDisabled =\n (minDate !== undefined && year < minDate.getFullYear()) ||\n (maxDate !== undefined && year > maxDate.getFullYear());\n return { value: year, isSelected: selectedYear === year, isDisabled };\n });\n}\n\nexport function yearPageStart(year: number): number {\n return Math.floor(year / 12) * 12;\n}\n","export function isSameDay(a: Date | null, b: Date | null): boolean {\n if (!a || !b) return false;\n return (\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate()\n );\n}\n\nexport function isSameMonth(a: Date, b: Date): boolean {\n return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();\n}\n\nexport function isSameYear(a: Date, b: Date): boolean {\n return a.getFullYear() === b.getFullYear();\n}\n\nexport function isAfter(date: Date, reference: Date): boolean {\n return date.getTime() > reference.getTime();\n}\n\nexport function isBefore(date: Date, reference: Date): boolean {\n return date.getTime() < reference.getTime();\n}\n\nexport function isInRange(date: Date, start: Date | null, end: Date | null): boolean {\n if (!start || !end) return false;\n const [from, to] = start.getTime() <= end.getTime() ? [start, end] : [end, start];\n return date.getTime() > from.getTime() && date.getTime() < to.getTime();\n}\n\nexport function startOfDay(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n}\n\nexport function today(): Date {\n return startOfDay(new Date());\n}\n\nexport function addDays(date: Date, days: number): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);\n}\n\nexport function addMonths(date: Date, months: number): Date {\n const d = new Date(date.getFullYear(), date.getMonth() + months, 1);\n const maxDay = new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate();\n d.setDate(Math.min(date.getDate(), maxDay));\n return d;\n}\n\nexport function addYears(date: Date, years: number): Date {\n return new Date(date.getFullYear() + years, date.getMonth(), date.getDate());\n}\n\nexport function daysInMonth(year: number, month: number): number {\n return new Date(year, month + 1, 0).getDate();\n}\n\nexport function clampDate(date: Date, min?: Date, max?: Date): Date {\n if (min && date.getTime() < min.getTime()) return min;\n if (max && date.getTime() > max.getTime()) return max;\n return date;\n}\n\nexport function isDateDisabled(\n date: Date,\n config: { minDate?: Date; maxDate?: Date; disabled?: boolean | ((d: Date) => boolean) },\n): boolean {\n if (config.disabled === true) return true;\n if (typeof config.disabled === \"function\" && config.disabled(date)) return true;\n if (config.minDate && date.getTime() < startOfDay(config.minDate).getTime()) return true;\n if (config.maxDate && date.getTime() > startOfDay(config.maxDate).getTime()) return true;\n return false;\n}\n","import type { DatePickerConfig, ViewMode } from \"../types\";\nimport { yearPageStart } from \"../utils/calendar\";\nimport { isDateDisabled, isSameDay, startOfDay } from \"../utils/date\";\nimport { formatDate, parseDate } from \"../utils/locale\";\n\nexport type OpenSource = \"trigger\" | \"input\" | null;\n\nexport interface DatePickerState {\n open: boolean;\n openSource: OpenSource;\n view: ViewMode;\n focusedMonth: number;\n focusedYear: number;\n focusedDate: Date | null;\n selectedDate: Date | null;\n rangeStart: Date | null;\n rangeEnd: Date | null;\n hoverDate: Date | null;\n selectedDates: Date[];\n inputValue: string;\n yearPageStart: number;\n}\n\nexport type DatePickerAction =\n | { type: \"OPEN\"; source?: Exclude<OpenSource, null> }\n | { type: \"CLOSE\" }\n | { type: \"TOGGLE\"; source?: Exclude<OpenSource, null> }\n | { type: \"SET_VIEW\"; view: ViewMode }\n | { type: \"NAV_PREV\" }\n | { type: \"NAV_NEXT\" }\n | { type: \"NAV_TO_DATE\"; date: Date }\n | { type: \"FOCUS_DATE\"; date: Date }\n | { type: \"SELECT_DATE\"; date: Date }\n | { type: \"ANCHOR_DATE\"; date: Date }\n | { type: \"EXTEND_RANGE\"; date: Date }\n | { type: \"TOGGLE_DATE\"; date: Date }\n | { type: \"HOVER_DATE\"; date: Date | null }\n | { type: \"SET_INPUT\"; value: string }\n | { type: \"COMMIT_INPUT\" }\n | { type: \"SELECT_MONTH\"; month: number }\n | { type: \"SELECT_YEAR\"; year: number }\n | { type: \"YEAR_PAGE_PREV\" }\n | { type: \"YEAR_PAGE_NEXT\" };\n\nfunction openState(\n state: DatePickerState,\n anchor: Date | null,\n source: Exclude<OpenSource, null> | null = null,\n): DatePickerState {\n const ref = anchor ?? startOfDay(new Date());\n return {\n ...state,\n open: true,\n openSource: source,\n view: \"day\",\n focusedDate: ref,\n focusedMonth: ref.getMonth(),\n focusedYear: ref.getFullYear(),\n yearPageStart: yearPageStart(ref.getFullYear()),\n };\n}\n\nfunction navMonth(state: DatePickerState, delta: number): DatePickerState {\n const d = new Date(state.focusedYear, state.focusedMonth + delta, 1);\n return { ...state, focusedMonth: d.getMonth(), focusedYear: d.getFullYear() };\n}\n\nexport function datePickerReducer(\n state: DatePickerState,\n action: DatePickerAction,\n config: DatePickerConfig,\n): DatePickerState {\n switch (action.type) {\n case \"OPEN\":\n if (state.open || config.readOnly) return state;\n return openState(state, state.selectedDate ?? state.rangeStart, action.source ?? null);\n\n case \"CLOSE\":\n return {\n ...state,\n open: false,\n openSource: null,\n view: \"day\",\n hoverDate: null,\n };\n\n case \"TOGGLE\":\n if (state.open)\n return {\n ...state,\n open: false,\n openSource: null,\n view: \"day\",\n hoverDate: null,\n };\n if (config.readOnly) return state;\n return openState(state, state.selectedDate ?? state.rangeStart, action.source ?? \"trigger\");\n\n case \"SET_VIEW\":\n return { ...state, view: action.view };\n\n case \"NAV_PREV\": {\n if (state.view === \"day\") return navMonth(state, -1);\n if (state.view === \"month\") return { ...state, focusedYear: state.focusedYear - 1 };\n return { ...state, yearPageStart: state.yearPageStart - 12 };\n }\n\n case \"NAV_NEXT\": {\n if (state.view === \"day\") return navMonth(state, 1);\n if (state.view === \"month\") return { ...state, focusedYear: state.focusedYear + 1 };\n return { ...state, yearPageStart: state.yearPageStart + 12 };\n }\n\n case \"NAV_TO_DATE\": {\n const d = action.date;\n return {\n ...state,\n focusedMonth: d.getMonth(),\n focusedYear: d.getFullYear(),\n };\n }\n\n case \"FOCUS_DATE\": {\n const d = action.date;\n return {\n ...state,\n focusedDate: d,\n focusedMonth: d.getMonth(),\n focusedYear: d.getFullYear(),\n };\n }\n\n case \"SELECT_DATE\": {\n const d = startOfDay(action.date);\n if (isDateDisabled(d, config)) return state;\n\n if (config.mode === \"single\") {\n return {\n ...state,\n selectedDate: d,\n inputValue: formatDate(d, config.locale),\n open: config.closeOnSelect ? false : state.open,\n hoverDate: null,\n };\n }\n\n if (config.mode === \"range\") {\n // First click: anchor. Second click: complete range.\n if (!state.rangeStart || state.rangeEnd) {\n return { ...state, rangeStart: d, rangeEnd: null, hoverDate: null };\n }\n const [start, end] =\n d.getTime() >= state.rangeStart.getTime() ? [state.rangeStart, d] : [d, state.rangeStart];\n return {\n ...state,\n rangeStart: start,\n rangeEnd: end,\n hoverDate: null,\n open: config.closeOnSelect ? false : state.open,\n };\n }\n\n if (config.mode === \"multiple\") {\n const already = state.selectedDates.findIndex((s) => isSameDay(s, d));\n const selectedDates =\n already >= 0\n ? state.selectedDates.filter((_, i) => i !== already)\n : [...state.selectedDates, d];\n return { ...state, selectedDates };\n }\n\n return state;\n }\n\n case \"ANCHOR_DATE\": {\n const d = startOfDay(action.date);\n if (isDateDisabled(d, config)) return state;\n return { ...state, rangeStart: d, rangeEnd: null, hoverDate: null };\n }\n\n case \"EXTEND_RANGE\": {\n const d = startOfDay(action.date);\n if (!state.rangeStart || isDateDisabled(d, config)) return state;\n const [start, end] =\n d.getTime() >= state.rangeStart.getTime() ? [state.rangeStart, d] : [d, state.rangeStart];\n return {\n ...state,\n rangeStart: start,\n rangeEnd: end,\n hoverDate: null,\n open: config.closeOnSelect ? false : state.open,\n };\n }\n\n case \"TOGGLE_DATE\": {\n const d = startOfDay(action.date);\n if (isDateDisabled(d, config)) return state;\n const already = state.selectedDates.findIndex((s) => isSameDay(s, d));\n const selectedDates =\n already >= 0\n ? state.selectedDates.filter((_, i) => i !== already)\n : [...state.selectedDates, d];\n return { ...state, selectedDates };\n }\n\n case \"HOVER_DATE\":\n return {\n ...state,\n hoverDate: action.date ? startOfDay(action.date) : null,\n };\n\n case \"SET_INPUT\":\n return { ...state, inputValue: action.value };\n\n case \"COMMIT_INPUT\": {\n const parsed = parseDate(state.inputValue, config.locale);\n if (!parsed || isDateDisabled(parsed, config)) return { ...state, inputValue: \"\" };\n const d = startOfDay(parsed);\n return {\n ...state,\n selectedDate: d,\n focusedDate: d,\n focusedMonth: d.getMonth(),\n focusedYear: d.getFullYear(),\n open: false,\n };\n }\n\n case \"SELECT_MONTH\":\n return { ...state, focusedMonth: action.month, view: \"day\" };\n\n case \"SELECT_YEAR\":\n return {\n ...state,\n focusedYear: action.year,\n yearPageStart: yearPageStart(action.year),\n view: \"month\",\n };\n\n case \"YEAR_PAGE_PREV\":\n return { ...state, yearPageStart: state.yearPageStart - 12 };\n\n case \"YEAR_PAGE_NEXT\":\n return { ...state, yearPageStart: state.yearPageStart + 12 };\n\n default:\n return state;\n }\n}\n\nexport function createInitialState(config: {\n selectedDate?: Date | null;\n rangeStart?: Date | null;\n rangeEnd?: Date | null;\n selectedDates?: Date[];\n open?: boolean;\n locale: string;\n}): DatePickerState {\n const ref = config.selectedDate ?? config.rangeStart ?? new Date();\n return {\n open: config.open ?? false,\n openSource: null,\n view: \"day\",\n focusedMonth: ref.getMonth(),\n focusedYear: ref.getFullYear(),\n focusedDate: config.open ? startOfDay(ref) : null,\n selectedDate: config.selectedDate ?? null,\n rangeStart: config.rangeStart ?? null,\n rangeEnd: config.rangeEnd ?? null,\n hoverDate: null,\n selectedDates: config.selectedDates ?? [],\n inputValue: config.selectedDate ? formatDate(config.selectedDate, config.locale) : \"\",\n yearPageStart: yearPageStart(ref.getFullYear()),\n };\n}\n","import { useReducer, useMemo, useEffect, useRef, useId } from \"react\";\nimport { datePickerReducer, createInitialState } from \"./reducer\";\nimport type { DatePickerState, DatePickerAction } from \"./reducer\";\nimport type { DatePickerConfig, DatePickerRootProps } from \"../types\";\nimport {\n buildCalendarGrid,\n buildWeekDays,\n buildMonthItems,\n buildYearItems,\n} from \"../utils/calendar\";\nimport { getWeekStartDay } from \"../utils/locale\";\nimport type { Dispatch } from \"react\";\n\nfunction resolveConfig(props: DatePickerRootProps): DatePickerConfig {\n const base: DatePickerConfig = {\n mode: props.mode ?? \"single\",\n locale: props.locale ?? (typeof navigator !== \"undefined\" ? navigator.language : \"en-US\"),\n readOnly: props.readOnly ?? false,\n closeOnSelect: props.closeOnSelect ?? (props.mode !== \"range\" && props.mode !== \"multiple\"),\n ...(props.weekStartsOn !== undefined && { weekStartsOn: props.weekStartsOn }),\n ...(props.minDate !== undefined && { minDate: props.minDate }),\n ...(props.maxDate !== undefined && { maxDate: props.maxDate }),\n ...(props.disabled !== undefined && { disabled: props.disabled }),\n };\n return base;\n}\n\nfunction resolveInitialValue(props: DatePickerRootProps) {\n if (!props.mode || props.mode === \"single\") {\n const v = \"defaultValue\" in props ? props.defaultValue : undefined;\n return { selectedDate: v ?? null };\n }\n if (props.mode === \"range\") {\n const v = \"defaultValue\" in props ? props.defaultValue : undefined;\n return { rangeStart: v?.start ?? null, rangeEnd: v?.end ?? null };\n }\n if (props.mode === \"multiple\") {\n const v = \"defaultValue\" in props ? props.defaultValue : undefined;\n return { selectedDates: v ?? [] };\n }\n return {};\n}\n\nexport function useDatePicker(props: DatePickerRootProps) {\n const uid = useId();\n const { mode, locale, weekStartsOn, minDate, maxDate, disabled, readOnly, closeOnSelect } = props;\n const config = useMemo(\n () =>\n resolveConfig({\n mode,\n locale,\n weekStartsOn,\n minDate,\n maxDate,\n disabled,\n readOnly,\n closeOnSelect,\n } as DatePickerRootProps),\n [mode, locale, weekStartsOn, minDate, maxDate, disabled, readOnly, closeOnSelect],\n );\n\n const initialValue = resolveInitialValue(props);\n const [state, dispatch] = useReducer(\n (s: DatePickerState, a: DatePickerAction) => datePickerReducer(s, a, config),\n createInitialState({\n locale: config.locale,\n ...(props.defaultOpen !== undefined && { open: props.defaultOpen }),\n ...initialValue,\n }),\n );\n\n // ── External callbacks ─────────────────────────────────────────────────────\n // Use refs for callbacks to avoid stale closure issues\n const onValueChangeRef = useRef(\n !props.mode || props.mode === \"single\"\n ? (props as { onValueChange?: (d: Date | null) => void }).onValueChange\n : undefined,\n );\n useEffect(() => {\n if (!props.mode || props.mode === \"single\") {\n onValueChangeRef.current = (\n props as { onValueChange?: (d: Date | null) => void }\n ).onValueChange;\n }\n });\n\n const prevSelectedRef = useRef<Date | null | undefined>(undefined);\n useEffect(() => {\n // Skip the initial render\n if (prevSelectedRef.current === undefined) {\n prevSelectedRef.current = state.selectedDate;\n return;\n }\n if (state.selectedDate !== prevSelectedRef.current) {\n onValueChangeRef.current?.(state.selectedDate);\n prevSelectedRef.current = state.selectedDate;\n }\n }, [state.selectedDate]);\n\n const prevRangeRef = useRef<{ start: Date | null; end: Date | null } | undefined>(undefined);\n useEffect(() => {\n if (props.mode !== \"range\") return;\n const p = props as { onValueChange?: (r: { start: Date | null; end: Date | null }) => void };\n if (prevRangeRef.current === undefined) {\n prevRangeRef.current = { start: state.rangeStart, end: state.rangeEnd };\n return;\n }\n if (\n state.rangeStart !== prevRangeRef.current.start ||\n state.rangeEnd !== prevRangeRef.current.end\n ) {\n p.onValueChange?.({ start: state.rangeStart, end: state.rangeEnd });\n prevRangeRef.current = { start: state.rangeStart, end: state.rangeEnd };\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- props is a new object each render; mode/onValueChange accessed via closure intentionally\n }, [state.rangeStart, state.rangeEnd]);\n\n const prevMultipleRef = useRef<Date[] | undefined>(undefined);\n useEffect(() => {\n if (props.mode !== \"multiple\") return;\n const p = props as { onValueChange?: (dates: Date[]) => void };\n if (prevMultipleRef.current === undefined) {\n prevMultipleRef.current = state.selectedDates;\n return;\n }\n if (state.selectedDates !== prevMultipleRef.current) {\n p.onValueChange?.(state.selectedDates);\n prevMultipleRef.current = state.selectedDates;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- props is a new object each render; mode/onValueChange accessed via closure intentionally\n }, [state.selectedDates]);\n\n // ── Controlled open ────────────────────────────────────────────────────────\n const isControlledOpen = props.open !== undefined;\n const effectiveOpen = isControlledOpen ? (props.open ?? false) : state.open;\n\n const prevOpenRef = useRef(effectiveOpen);\n useEffect(() => {\n if (prevOpenRef.current !== effectiveOpen) {\n props.onOpenChange?.(effectiveOpen);\n }\n prevOpenRef.current = effectiveOpen;\n // eslint-disable-next-line react-hooks/exhaustive-deps -- props.onOpenChange accessed via closure; adding props would cause infinite loops\n }, [effectiveOpen]);\n\n // ── Derived values ─────────────────────────────────────────────────────────\n const weekStartDay = useMemo(\n () => getWeekStartDay(config.locale, config.weekStartsOn),\n [config.locale, config.weekStartsOn],\n );\n\n const weeks = useMemo(\n () => buildCalendarGrid(state.focusedYear, state.focusedMonth, weekStartDay),\n [state.focusedYear, state.focusedMonth, weekStartDay],\n );\n\n const weekDays = useMemo(\n () => buildWeekDays(config.locale, weekStartDay),\n [config.locale, weekStartDay],\n );\n\n const monthItems = useMemo(\n () =>\n buildMonthItems(\n state.focusedYear,\n config.locale,\n state.focusedMonth,\n config.minDate,\n config.maxDate,\n ),\n [state.focusedYear, config.locale, state.focusedMonth, config.minDate, config.maxDate],\n );\n\n const yearItems = useMemo(\n () =>\n buildYearItems(state.yearPageStart, 12, state.focusedYear, config.minDate, config.maxDate),\n [state.yearPageStart, state.focusedYear, config.minDate, config.maxDate],\n );\n\n const ids = useMemo(\n () => ({\n root: `dp-${uid}`,\n label: `dp-label-${uid}`,\n input: `dp-input-${uid}`,\n trigger: `dp-trigger-${uid}`,\n content: `dp-content-${uid}`,\n }),\n [uid],\n );\n\n return {\n state: { ...state, open: effectiveOpen },\n dispatch: dispatch as Dispatch<DatePickerAction>,\n config,\n ids,\n derived: { weeks, weekDays, monthItems, yearItems, weekStartDay },\n };\n}\n","import React from \"react\";\nimport { DatePickerContext } from \"./context\";\nimport { useDatePicker } from \"./use-date-picker\";\nimport type { DatePickerRootProps } from \"../types\";\n\nexport type RootProps = DatePickerRootProps & { children: React.ReactNode };\n\nexport function Root(props: RootProps) {\n const { children, ...pickerProps } = props;\n const picker = useDatePicker(pickerProps as DatePickerRootProps);\n\n return (\n <DatePickerContext.Provider\n value={{\n state: picker.state,\n dispatch: picker.dispatch,\n config: picker.config,\n ids: picker.ids,\n }}\n >\n {children}\n </DatePickerContext.Provider>\n );\n}\n","import React from \"react\";\nimport { useDatePickerContext } from \"./context\";\n\nexport type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;\n\nexport function Label({ children, ...props }: LabelProps) {\n const { ids } = useDatePickerContext();\n return (\n <label id={ids.label} htmlFor={ids.input} {...props}>\n {children}\n </label>\n );\n}\n","import React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useTimescape } from \"timescape/react\";\nimport { isDateDisabled } from \"../utils/date\";\nimport { getSegmentInfo } from \"../utils/locale\";\nimport { useDatePickerContext } from \"./context\";\n\n// React 19 ref callbacks must return void, not null. timescape still uses the\n// older signature so we wrap every ref to discard the null return value.\nfunction wrapRef<T extends HTMLElement>(ref: (el: T | null) => void | null): React.RefCallback<T> {\n return (el) => {\n ref(el);\n };\n}\n\nconst DEFAULT_LABELS = { month: \"Month\", day: \"Day\", year: \"Year\" };\nconst FIELD_MAP = {\n year: \"years\" as const,\n month: \"months\" as const,\n day: \"days\" as const,\n};\n\nexport interface InputProps {\n index?: 0 | 1;\n segmentLabels?: { month?: string; day?: string; year?: string };\n className?: string;\n style?: React.CSSProperties;\n}\n\n// ─── Inner component ────────────────────────────────────────────────────────\n// Lives in a separate component so React can remount it (via `key`) whenever\n// an external update (e.g. calendar click) must reinitialise timescape with\n// a new date. If we updated timescape's internal state imperatively with\n// `update()`, it would silently no-op when timescape starts in placeholder\n// mode (no initial date), so remounting is the reliable path.\n\ninterface SegmentsProps {\n sourceDate: Date | null;\n segmentOrder: string[];\n separator: string;\n labels: Record<string, string>;\n onDateChange: (date: Date | undefined) => void;\n groupId?: string | undefined;\n className?: string | undefined;\n style?: React.CSSProperties | undefined;\n}\n\nfunction Segments({\n sourceDate,\n segmentOrder,\n separator,\n labels,\n onDateChange,\n groupId,\n className,\n style,\n}: SegmentsProps) {\n const { state, dispatch, ids, config } = useDatePickerContext();\n\n // Keep onDateChange stable inside timescape even when the prop reference changes.\n const onDateChangeRef = useRef(onDateChange);\n onDateChangeRef.current = onDateChange;\n\n const opts: Record<string, unknown> = {\n wrapAround: true,\n onChangeDate: (d: Date | undefined) => onDateChangeRef.current(d),\n };\n if (config.minDate) opts.minDate = config.minDate;\n if (config.maxDate) opts.maxDate = config.maxDate;\n if (sourceDate) opts.date = sourceDate;\n\n const { getRootProps, getInputProps } = useTimescape(opts as Parameters<typeof useTimescape>[0]);\n\n const [focused, setFocused] = useState<string | null>(null);\n\n function handleSegmentFocus(field: string) {\n setFocused(field);\n if (!state.open && !config.readOnly) dispatch({ type: \"OPEN\", source: \"input\" });\n }\n\n function handleSegmentBlur(field: string, e: React.FocusEvent<HTMLInputElement>) {\n const relatedTarget = e.relatedTarget as Node | null;\n const isMovingWithin = e.currentTarget.parentElement?.contains(relatedTarget);\n if (!isMovingWithin) setFocused(null);\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (config.readOnly) {\n e.preventDefault();\n return;\n }\n if (e.key === \"Escape\") {\n e.preventDefault();\n if (state.open) dispatch({ type: \"CLOSE\" });\n }\n }\n\n const { ref: rootRef, ...rootProps } = getRootProps();\n\n return (\n <div\n role=\"group\"\n id={groupId ?? ids.input}\n aria-labelledby={ids.label}\n tabIndex={-1}\n className={className}\n style={style}\n {...rootProps}\n ref={wrapRef(rootRef as (el: HTMLElement | null) => void | null)}\n {...(config.readOnly ? { \"data-readonly\": \"true\" } : {})}\n >\n {segmentOrder.map((field, i) => {\n const type = FIELD_MAP[field as keyof typeof FIELD_MAP];\n const isFocused = focused === field;\n const isTabStop = isFocused || (focused === null && i === 0);\n const { ref: inputRef, ...inputProps } = getInputProps(type);\n const wrappedInputRef = wrapRef(inputRef as (el: HTMLInputElement | null) => void | null);\n\n return (\n <React.Fragment key={field}>\n {i > 0 && (\n <span aria-hidden=\"true\" data-separator=\"true\">\n {separator}\n </span>\n )}\n <input\n {...inputProps}\n ref={wrappedInputRef}\n aria-label={labels[field]}\n data-segment={field}\n tabIndex={config.readOnly ? -1 : isTabStop ? 0 : -1}\n disabled={config.readOnly}\n onFocus={(e) => {\n inputRef(e.currentTarget);\n handleSegmentFocus(field);\n }}\n onBlur={(e) => handleSegmentBlur(field, e)}\n onKeyDown={handleKeyDown}\n className=\"timescape-input\"\n style={{\n width: field === \"year\" ? \"4ch\" : \"2ch\",\n border: \"none\",\n background: \"transparent\",\n padding: 0,\n margin: 0,\n textAlign: \"center\",\n font: \"inherit\",\n outline: \"none\",\n }}\n />\n </React.Fragment>\n );\n })}\n </div>\n );\n}\n\n// ─── Public component ────────────────────────────────────────────────────────\n\nexport function Input({ index, segmentLabels, className, style }: InputProps) {\n const { state, dispatch, config, ids } = useDatePickerContext();\n\n const { order: segmentOrder, separator } = useMemo(\n () => getSegmentInfo(config.locale),\n [config.locale],\n );\n\n const labels = {\n month: segmentLabels?.month ?? DEFAULT_LABELS.month,\n day: segmentLabels?.day ?? DEFAULT_LABELS.day,\n year: segmentLabels?.year ?? DEFAULT_LABELS.year,\n };\n\n const sourceDate =\n index === 1 ? state.rangeEnd : index === 0 ? state.rangeStart : state.selectedDate;\n\n // ── External-change detection ──────────────────────────────────────────\n // When the user picks a date from the calendar (external update), we\n // increment `timescapeKey` to remount <Segments> with the correct\n // initialDate. When the change came from this input's own onDateChange\n // (internal), we skip the remount to preserve focus.\n const isInternalChangeRef = useRef(false);\n const prevSourceDateRef = useRef(sourceDate);\n const [timescapeKey, setTimescapeKey] = useState(0);\n\n useEffect(() => {\n const prev = prevSourceDateRef.current;\n prevSourceDateRef.current = sourceDate;\n\n if (isInternalChangeRef.current) {\n isInternalChangeRef.current = false;\n return;\n }\n\n // Compare by value so same-day objects don't trigger a remount.\n const prevTime = prev?.getTime();\n const currTime = sourceDate?.getTime();\n if (prevTime !== currTime) {\n setTimescapeKey((k) => k + 1);\n }\n }, [sourceDate]);\n\n // ── Date-change handler ────────────────────────────────────────────────\n const onDateChange = useCallback(\n (nextDate: Date | undefined) => {\n if (!nextDate) return;\n if (isDateDisabled(nextDate, config)) return;\n\n const prevDate = prevSourceDateRef.current;\n if (prevDate && prevDate.getTime() === nextDate.getTime()) return;\n\n if (config.mode === \"multiple\") {\n // Clear the input after each toggle so the user can enter\n // the next date without a manual clear.\n dispatch({ type: \"FOCUS_DATE\", date: nextDate });\n dispatch({ type: \"TOGGLE_DATE\", date: nextDate });\n setTimescapeKey((k) => k + 1);\n return;\n }\n\n // For single / range: mark as internal so the useEffect above\n // does not remount timescape (we want to keep segment focus).\n isInternalChangeRef.current = true;\n dispatch({ type: \"FOCUS_DATE\", date: nextDate });\n\n if (config.mode === \"single\") {\n dispatch({ type: \"SELECT_DATE\", date: nextDate });\n } else if (config.mode === \"range\" && index === 0) {\n dispatch({ type: \"ANCHOR_DATE\", date: nextDate });\n } else if (config.mode === \"range\" && index === 1) {\n dispatch({ type: \"EXTEND_RANGE\", date: nextDate });\n }\n },\n [config, dispatch, index],\n );\n\n const groupId = index !== undefined ? `${ids.input}-${index}` : ids.input;\n\n return (\n <Segments\n key={timescapeKey}\n sourceDate={sourceDate}\n segmentOrder={segmentOrder}\n separator={separator}\n labels={labels}\n onDateChange={onDateChange}\n groupId={groupId}\n className={className}\n style={style}\n />\n );\n}\n","import type React from \"react\";\nimport { useDatePickerContext } from \"./context\";\n\nexport type TriggerProps = Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n \"aria-haspopup\" | \"aria-expanded\" | \"aria-controls\"\n>;\n\nexport function Trigger({ children, onClick, disabled, ...props }: TriggerProps) {\n const { state, dispatch, ids, config } = useDatePickerContext();\n\n const isDisabled = disabled ?? config.disabled === true;\n const isReadOnly = config.readOnly;\n\n return (\n <button\n type=\"button\"\n id={ids.trigger}\n aria-haspopup=\"dialog\"\n aria-expanded={state.open}\n aria-controls={state.open ? ids.content : undefined}\n aria-label={children ? undefined : \"Open date picker\"}\n disabled={isDisabled || isReadOnly}\n data-disabled={isDisabled || isReadOnly ? \"true\" : undefined}\n onClick={(e) => {\n if (isDisabled || isReadOnly) return;\n dispatch({ type: \"TOGGLE\", source: \"trigger\" });\n onClick?.(e);\n }}\n {...props}\n >\n {children}\n </button>\n );\n}\n","import { useEffect, useRef, type RefObject } from \"react\";\n\nexport function useClickOutside(\n refs: RefObject<HTMLElement | null>[],\n handler: () => void,\n enabled = true,\n): void {\n // Keep a stable ref to the latest refs array so the effect doesn't need to\n // spread it into deps (oxlint flags spreads as complex expressions).\n const refsRef = useRef(refs);\n refsRef.current = refs;\n\n useEffect(() => {\n if (!enabled) return;\n\n function onPointerDown(e: PointerEvent) {\n const target = e.target as Node;\n if (refsRef.current.every((r) => !r.current?.contains(target))) {\n handler();\n }\n }\n\n document.addEventListener(\"pointerdown\", onPointerDown, true);\n return () => document.removeEventListener(\"pointerdown\", onPointerDown, true);\n }, [enabled, handler]);\n}\n","import type { Ref, RefCallback, MutableRefObject } from \"react\";\n\nlet counter = 0;\n\nexport function generateId(prefix = \"dp\"): string {\n return `${prefix}-${++counter}`;\n}\n\nexport function mergeRefs<T>(...refs: Array<Ref<T> | undefined>): RefCallback<T> {\n return (node: T | null) => {\n for (const ref of refs) {\n if (!ref) continue;\n if (typeof ref === \"function\") {\n ref(node);\n } else {\n (ref as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n\ntype EventHandler<E extends Event> = ((e: E) => void) | undefined;\n\nexport function composeEventHandlers<E extends Event>(\n ...handlers: Array<EventHandler<E>>\n): (e: E) => void {\n return (e: E) => {\n for (const handler of handlers) {\n if (e.defaultPrevented) break;\n handler?.(e);\n }\n };\n}\n\nexport function getFocusableElements(container: HTMLElement): HTMLElement[] {\n const selector = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n '[tabindex]:not([tabindex=\"-1\"])',\n ].join(\", \");\n\n return Array.from(container.querySelectorAll<HTMLElement>(selector)).filter(\n (el) => !el.closest(\"[hidden]\") && el.offsetParent !== null,\n );\n}\n","import { useEffect, type RefObject } from \"react\";\nimport { getFocusableElements } from \"../utils/aria\";\n\nexport function useFocusTrap(containerRef: RefObject<HTMLElement | null>, enabled = true): void {\n useEffect(() => {\n if (!enabled || !containerRef.current) return;\n\n const container = containerRef.current;\n\n // Re-query focusable elements each keydown so view switches (day→month→year)\n // that change the DOM don't result in stale element lists.\n function onKeyDown(e: KeyboardEvent) {\n if (e.key !== \"Tab\") return;\n const focusable = getFocusableElements(container);\n if (!focusable.length) return;\n\n const first = focusable[0]!;\n const last = focusable[focusable.length - 1]!;\n\n if (e.shiftKey) {\n if (document.activeElement === first) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n }\n }\n\n // When the DOM inside the dialog changes (e.g. view switch mounts new buttons),\n // ensure focus hasn't escaped to the body.\n const observer = new MutationObserver(() => {\n const active = document.activeElement;\n // Don't recapture focus if the input segments (spinbuttons) are intentionally focused\n if (active?.getAttribute(\"role\") === \"spinbutton\") return;\n if (!container.contains(active)) {\n const firstFocusable = getFocusableElements(container)[0];\n firstFocusable?.focus();\n }\n });\n\n observer.observe(container, { childList: true, subtree: true });\n container.addEventListener(\"keydown\", onKeyDown);\n\n return () => {\n container.removeEventListener(\"keydown\", onKeyDown);\n observer.disconnect();\n };\n }, [enabled, containerRef]);\n}\n","import { useFloating, autoUpdate, offset, flip, shift } from \"@floating-ui/react-dom\";\nimport type { Placement } from \"@floating-ui/react-dom\";\nimport type { CSSProperties } from \"react\";\n\ntype Side = \"top\" | \"bottom\" | \"left\" | \"right\";\ntype Align = \"start\" | \"center\" | \"end\";\n\nexport interface FloatingOptions {\n referenceElement?: HTMLElement | null;\n open: boolean;\n side?: Side | undefined;\n align?: Align | undefined;\n sideOffset?: number | undefined;\n alignOffset?: number | undefined;\n avoidCollisions?: boolean | undefined;\n collisionPadding?: number | undefined;\n}\n\nfunction toPlacement(side: Side, align: Align): Placement {\n return (align === \"center\" ? side : `${side}-${align}`) as Placement;\n}\n\nexport function useDatePickerFloating({\n referenceElement,\n open,\n side = \"bottom\",\n align = \"start\",\n sideOffset = 4,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = 8,\n}: FloatingOptions): {\n setReference: (node: HTMLElement | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n floatingStyles: CSSProperties;\n isPositioned: boolean;\n} {\n const { refs, floatingStyles, isPositioned } = useFloating({\n placement: toPlacement(side, align),\n strategy: \"fixed\",\n open,\n whileElementsMounted: autoUpdate,\n middleware: [\n offset({ mainAxis: sideOffset, crossAxis: alignOffset }),\n ...(avoidCollisions ? [flip(), shift({ padding: collisionPadding })] : []),\n ],\n ...(referenceElement !== undefined ? { elements: { reference: referenceElement } } : {}),\n });\n\n return {\n setReference: refs.setReference,\n setFloating: refs.setFloating,\n floatingStyles,\n isPositioned,\n };\n}\n","import React, { useRef, useEffect, useState, useCallback, useLayoutEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useDatePickerContext } from \"./context\";\nimport { useClickOutside } from \"./use-click-outside\";\nimport { useFocusTrap } from \"./use-focus-trap\";\nimport { formatMonthYear, formatYear } from \"../utils/locale\";\nimport { useDatePickerFloating } from \"./use-floating\";\n\nexport interface ContentProps extends React.HTMLAttributes<HTMLDivElement> {\n forceMount?: boolean;\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n alignOffset?: number;\n avoidCollisions?: boolean;\n collisionPadding?: number;\n portal?: boolean;\n}\n\nexport function Content({\n children,\n forceMount,\n side,\n align,\n sideOffset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n portal = false,\n style,\n onKeyDown,\n ...props\n}: ContentProps) {\n const { state, dispatch, ids, config } = useDatePickerContext();\n const contentRef = useRef<HTMLDivElement>(null);\n const isOpen = state.open;\n const shouldRender = forceMount || isOpen;\n\n // Kept as refs (not state) so click-outside detection stays stable across renders.\n const triggerRef = useRef<HTMLElement | null>(null);\n const inputRef = useRef<HTMLElement | null>(null);\n const input0Ref = useRef<HTMLElement | null>(null);\n const input1Ref = useRef<HTMLElement | null>(null);\n useEffect(() => {\n triggerRef.current = document.getElementById(ids.trigger);\n inputRef.current = document.getElementById(ids.input);\n input0Ref.current = document.getElementById(`${ids.input}-0`);\n input1Ref.current = document.getElementById(`${ids.input}-1`);\n });\n\n const { setReference, setFloating, floatingStyles, isPositioned } = useDatePickerFloating({\n open: isOpen,\n ...(side !== undefined && { side }),\n ...(align !== undefined && { align }),\n ...(sideOffset !== undefined && { sideOffset }),\n ...(alignOffset !== undefined && { alignOffset }),\n ...(avoidCollisions !== undefined && { avoidCollisions }),\n ...(collisionPadding !== undefined && { collisionPadding }),\n });\n\n // Resolve and bind the Floating UI anchor while the popover is open.\n //\n // The segmented Input remounts its group element (via a `key`) whenever an\n // external date change occurs, which swaps out the DOM node we anchor to.\n // Because that remount is local state inside <Input>, it does NOT re-render\n // <Content>, so a one-shot effect would keep pointing Floating UI at the now\n // detached old node — a detached node measures as (0,0), parking the popover\n // in the top-left corner. We watch the DOM for that swap and re-bind the\n // reference to the current node so positioning always tracks the live anchor.\n useLayoutEffect(() => {\n if (!isOpen) return;\n\n const resolveAnchor = () =>\n document.getElementById(ids.input) ||\n document.getElementById(`${ids.input}-0`) ||\n document.getElementById(ids.trigger);\n\n let current = resolveAnchor();\n setReference(current);\n\n const observer = new MutationObserver(() => {\n const next = resolveAnchor();\n if (next && next !== current) {\n current = next;\n setReference(next);\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n\n return () => observer.disconnect();\n }, [isOpen, ids.input, ids.trigger, setReference]);\n\n // Memoized so the ref callback identity is stable across re-renders.\n // Without this, React would call it with null then element on every render,\n // causing setFloating null/element cycles that interfere with state updates.\n const mergedRef = useCallback(\n (node: HTMLDivElement | null) => {\n (contentRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n setFloating(node);\n },\n [setFloating],\n );\n\n useClickOutside(\n [contentRef, triggerRef, inputRef, input0Ref, input1Ref],\n () => dispatch({ type: \"CLOSE\" }),\n isOpen,\n );\n useFocusTrap(contentRef, isOpen);\n\n // Floating UI computes the position one frame after mount, so the element\n // briefly sits at (0,0) before jumping to the anchor. If the consumer applies\n // a CSS transition (e.g. `transition-all`), that jump animates as a visible\n // \"fly-in\" from the top-left corner. We suppress transitions until the frame\n // after the first successful positioning, then restore them so later moves\n // (scroll, resize, collision flips) still animate smoothly.\n const [transitionsReady, setTransitionsReady] = useState(false);\n useEffect(() => {\n if (!isOpen || !isPositioned) {\n setTransitionsReady(false);\n return;\n }\n const raf = requestAnimationFrame(() => setTransitionsReady(true));\n return () => cancelAnimationFrame(raf);\n }, [isOpen, isPositioned]);\n\n useEffect(() => {\n if (!isOpen || !contentRef.current) return;\n if (state.openSource === \"input\") return;\n const active = document.activeElement;\n const activeRole = active?.getAttribute(\"role\");\n if (activeRole === \"combobox\" || activeRole === \"spinbutton\") return;\n const firstFocusable = contentRef.current.querySelector<HTMLElement>(\n 'button:not([disabled]), [tabindex=\"0\"]',\n );\n firstFocusable?.focus();\n }, [isOpen, state.openSource]);\n\n const announcement =\n state.view === \"day\"\n ? formatMonthYear(new Date(state.focusedYear, state.focusedMonth, 1), config.locale)\n : state.view === \"month\"\n ? formatYear(state.focusedYear, config.locale)\n : `${state.yearPageStart}–${state.yearPageStart + 11}`;\n\n if (!shouldRender) return null;\n\n const content = (\n <div\n ref={mergedRef}\n id={ids.content}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={ids.label}\n data-state={isOpen ? \"open\" : \"closed\"}\n style={{\n ...floatingStyles,\n ...(!isOpen ? { display: \"none\" } : undefined),\n // Hide via opacity (not `visibility`/`display`) while Floating UI\n // resolves the first position: this keeps the popover at (0,0)\n // invisible to sighted users for one frame without removing it from\n // the accessibility tree, so assistive tech still sees the dialog.\n ...(isOpen && !isPositioned ? { opacity: 0, pointerEvents: \"none\" } : undefined),\n ...(isOpen && !transitionsReady ? { transition: \"none\" } : undefined),\n ...style,\n }}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n e.preventDefault();\n dispatch({ type: \"CLOSE\" });\n document.getElementById(ids.trigger)?.focus();\n }\n onKeyDown?.(e);\n }}\n {...props}\n >\n <span\n aria-live=\"polite\"\n aria-atomic=\"true\"\n style={{\n position: \"absolute\",\n width: 1,\n height: 1,\n overflow: \"hidden\",\n clip: \"rect(0,0,0,0)\",\n whiteSpace: \"nowrap\",\n }}\n >\n {isOpen ? announcement : \"\"}\n </span>\n {children}\n </div>\n );\n\n return portal ? createPortal(content, document.body) : content;\n}\n","import React from \"react\";\n\nexport type ViewControlProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport function ViewControl({ children, ...props }: ViewControlProps) {\n return (\n <div role=\"group\" {...props}>\n {children}\n </div>\n );\n}\n","import React from \"react\";\nimport { useDatePickerContext } from \"./context\";\n\nexport type PrevTriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"aria-label\">;\n\nexport function PrevTrigger({ children, onClick, ...props }: PrevTriggerProps) {\n const { state, dispatch } = useDatePickerContext();\n const labels: Record<string, string> = {\n day: \"Go to previous month\",\n month: \"Go to previous year\",\n year: \"Go to previous years\",\n };\n\n return (\n <button\n type=\"button\"\n aria-label={labels[state.view]}\n onClick={(e) => {\n dispatch({ type: \"NAV_PREV\" });\n onClick?.(e);\n }}\n {...props}\n >\n {children ?? \"‹\"}\n </button>\n );\n}\n","import React from \"react\";\nimport { useDatePickerContext } from \"./context\";\n\nexport type NextTriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"aria-label\">;\n\nexport function NextTrigger({ children, onClick, ...props }: NextTriggerProps) {\n const { state, dispatch } = useDatePickerContext();\n const labels: Record<string, string> = {\n day: \"Go to next month\",\n month: \"Go to next year\",\n year: \"Go to next years\",\n };\n\n return (\n <button\n type=\"button\"\n aria-label={labels[state.view]}\n onClick={(e) => {\n dispatch({ type: \"NAV_NEXT\" });\n onClick?.(e);\n }}\n {...props}\n >\n {children ?? \"›\"}\n </button>\n );\n}\n","import React from \"react\";\nimport { useDatePickerContext } from \"./context\";\nimport { formatMonthYear } from \"../utils/locale\";\nimport type { ViewMode } from \"../types\";\n\nexport type ViewTriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"aria-label\">;\n\nconst nextView: Record<ViewMode, ViewMode> = {\n day: \"month\",\n month: \"year\",\n year: \"day\",\n};\n\nconst ariaLabel: Record<ViewMode, string> = {\n day: \"Switch to month view\",\n month: \"Switch to year view\",\n year: \"Switch to day view\",\n};\n\nexport function ViewTrigger({ children, onClick, ...props }: ViewTriggerProps) {\n const { state, dispatch, config } = useDatePickerContext();\n const label = formatMonthYear(new Date(state.focusedYear, state.focusedMonth, 1), config.locale);\n const yearRange = `${state.yearPageStart}–${state.yearPageStart + 11}`;\n\n const displayLabel =\n state.view === \"year\" ? yearRange : state.view === \"month\" ? String(state.focusedYear) : label;\n\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel[state.view]}\n aria-live=\"polite\"\n onClick={(e) => {\n dispatch({ type: \"SET_VIEW\", view: nextView[state.view] });\n onClick?.(e);\n }}\n {...props}\n >\n {children ?? displayLabel}\n </button>\n );\n}\n","import React from \"react\";\nimport { useDatePickerContext } from \"./context\";\nimport { DatePickerViewContext } from \"./context\";\nimport type { ViewMode } from \"../types\";\n\nexport interface ViewProps {\n view: ViewMode;\n children: React.ReactNode;\n}\n\nexport function View({ view, children }: ViewProps) {\n const { state } = useDatePickerContext();\n if (state.view !== view) return null;\n return (\n <DatePickerViewContext.Provider value={{ view }}>{children}</DatePickerViewContext.Provider>\n );\n}\n","import React from \"react\";\nimport { useDatePickerContext } from \"./context\";\nimport { buildWeekDays } from \"../utils/calendar\";\nimport { getWeekStartDay } from \"../utils/locale\";\n\nexport interface WeekDaysProps {\n format?: \"long\" | \"short\" | \"narrow\";\n className?: string;\n}\n\nexport function WeekDays({ format = \"short\", className }: WeekDaysProps) {\n const { config } = useDatePickerContext();\n const weekStartDay = getWeekStartDay(config.locale, config.weekStartsOn);\n const days = buildWeekDays(config.locale, weekStartDay, format);\n\n return (\n <tr className={className}>\n {days.map((day) => (\n <th key={day.ariaLabel} scope=\"col\" abbr={day.ariaLabel}>\n {day.label}\n </th>\n ))}\n </tr>\n );\n}\n","import React from \"react\";\nimport { useDatePickerContext } from \"./context\";\nimport { isSameDay, isInRange, isDateDisabled, startOfDay } from \"../utils/date\";\nimport type { DayCellMeta } from \"../types\";\n\nexport interface DayProps {\n date: Date;\n children?: (meta: DayCellMeta) => React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function Day({ date, children, className, style }: DayProps) {\n const { state, dispatch, config } = useDatePickerContext();\n const today = startOfDay(new Date());\n\n const meta: DayCellMeta = {\n date,\n isCurrentMonth: date.getMonth() === state.focusedMonth,\n isToday: isSameDay(date, today),\n isSelected:\n config.mode === \"single\"\n ? isSameDay(date, state.selectedDate)\n : config.mode === \"multiple\"\n ? state.selectedDates.some((d) => isSameDay(d, date))\n : isSameDay(date, state.rangeStart) || isSameDay(date, state.rangeEnd),\n isDisabled: isDateDisabled(date, config),\n isRangeStart: isSameDay(date, state.rangeStart),\n isRangeEnd: isSameDay(date, state.rangeEnd ?? state.hoverDate),\n isInRange: isInRange(date, state.rangeStart, state.rangeEnd ?? state.hoverDate),\n isHovered: isSameDay(date, state.hoverDate),\n };\n\n const isFocused = isSameDay(date, state.focusedDate);\n\n return (\n <td\n role=\"gridcell\"\n aria-selected={meta.isSelected}\n aria-disabled={meta.isDisabled}\n aria-current={meta.isToday ? \"date\" : undefined}\n tabIndex={isFocused ? 0 : -1}\n className={className}\n style={style}\n data-selected={meta.isSelected || undefined}\n data-today={meta.isToday || undefined}\n data-disabled={meta.isDisabled || undefined}\n data-outside-month={!meta.isCurrentMonth || undefined}\n data-range-start={meta.isRangeStart || undefined}\n data-range-end={meta.isRangeEnd || undefined}\n data-in-range={meta.isInRange || undefined}\n onClick={() => {\n if (!meta.isDisabled && !config.readOnly) dispatch({ type: \"SELECT_DATE\", date });\n }}\n onMouseEnter={() => {\n if (config.mode === \"range\") dispatch({ type: \"HOVER_DATE\", date });\n }}\n onMouseLeave={() => {\n if (config.mode === \"range\") dispatch({ type: \"HOVER_DATE\", date: null });\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n if (!meta.isDisabled && !config.readOnly) dispatch({ type: \"SELECT_DATE\", date });\n }\n }}\n >\n {children ? children(meta) : date.getDate()}\n </td>\n );\n}\n","import React, { useRef, useEffect } from \"react\";\nimport { useDatePickerContext } from \"./context\";\nimport { buildCalendarGrid } from \"../utils/calendar\";\nimport { getWeekStartDay, formatMonthYear } from \"../utils/locale\";\nimport { addDays, addMonths } from \"../utils/date\";\nimport { Day } from \"./day\";\n\nexport interface GridProps {\n children?: (ctx: { weeks: Date[][] }) => React.ReactNode;\n header?: React.ReactNode;\n className?: string;\n}\n\nfunction defaultRender(ws: Date[][]) {\n return ws.map((week, wi) => (\n <tr key={wi}>\n {week.map((day, di) => (\n <Day key={di} date={day} />\n ))}\n </tr>\n ));\n}\n\nexport function Grid({ children, header, className }: GridProps) {\n const { state, dispatch, config } = useDatePickerContext();\n const gridRef = useRef<HTMLTableElement>(null);\n\n const weekStartDay = getWeekStartDay(config.locale, config.weekStartsOn);\n const weeks = buildCalendarGrid(state.focusedYear, state.focusedMonth, weekStartDay);\n const label = formatMonthYear(new Date(state.focusedYear, state.focusedMonth, 1), config.locale);\n\n // Move DOM focus to the focused cell after render\n const focusedDateStr = state.focusedDate?.toDateString();\n useEffect(() => {\n if (!gridRef.current || !focusedDateStr) return;\n // Don't steal focus while the user is typing in the segmented input\n if (document.activeElement?.getAttribute(\"role\") === \"spinbutton\") return;\n if (state.openSource === \"input\" && !gridRef.current.contains(document.activeElement)) {\n return;\n }\n const focused = gridRef.current.querySelector<HTMLElement>('[tabindex=\"0\"]');\n if (focused && document.activeElement !== focused) focused.focus();\n }, [focusedDateStr, state.openSource]);\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLTableElement>) {\n if (!state.focusedDate) return;\n let next: Date | null = null;\n\n switch (e.key) {\n case \"ArrowRight\":\n next = addDays(state.focusedDate, 1);\n break;\n case \"ArrowLeft\":\n next = addDays(state.focusedDate, -1);\n break;\n case \"ArrowDown\":\n next = addDays(state.focusedDate, 7);\n break;\n case \"ArrowUp\":\n next = addDays(state.focusedDate, -7);\n break;\n case \"PageDown\":\n next = e.ctrlKey\n ? new Date(state.focusedYear + 1, state.focusedMonth, state.focusedDate.getDate())\n : addMonths(state.focusedDate, 1);\n break;\n case \"PageUp\":\n next = e.ctrlKey\n ? new Date(state.focusedYear - 1, state.focusedMonth, state.focusedDate.getDate())\n : addMonths(state.focusedDate, -1);\n break;\n case \"Home\": {\n const d = new Date(state.focusedDate);\n const diff = (d.getDay() - weekStartDay + 7) % 7;\n next = addDays(d, -diff);\n break;\n }\n case \"End\": {\n const d = new Date(state.focusedDate);\n const diff = (weekStartDay + 6 - d.getDay() + 7) % 7;\n next = addDays(d, diff);\n break;\n }\n default:\n return;\n }\n\n e.preventDefault();\n dispatch({ type: \"FOCUS_DATE\", date: next });\n }\n\n return (\n <table\n ref={gridRef}\n role=\"grid\"\n aria-label={label}\n className={className}\n onKeyDown={handleKeyDown}\n >\n {header && <thead>{header}</thead>}\n <tbody>{children ? children({ weeks }) : defaultRender(weeks)}</tbody>\n </table>\n );\n}\n","import React, { useState, useRef, useEffect } from \"react\";\nimport { useDatePickerContext } from \"./context\";\nimport { MonthGridFocusContext } from \"./context\";\nimport { buildMonthItems } from \"../utils/calendar\";\nimport type { MonthItem } from \"../types\";\n\nexport interface MonthGridProps {\n children: (ctx: { months: MonthItem[] }) => React.ReactNode;\n className?: string;\n}\n\nexport function MonthGrid({ children, className }: MonthGridProps) {\n const { state, config, dispatch } = useDatePickerContext();\n const months = buildMonthItems(\n state.focusedYear,\n config.locale,\n state.focusedMonth,\n config.minDate,\n config.maxDate,\n );\n\n const [focusedIndex, setFocusedIndex] = useState(state.focusedMonth);\n const gridRef = useRef<HTMLDivElement>(null);\n\n // Always holds the latest focusedMonth so the year-change effect below can\n // read it without listing it as a dep (which would re-run on every month\n // keyboard navigation and interfere with arrow-key focus).\n const focusedMonthRef = useRef(state.focusedMonth);\n focusedMonthRef.current = state.focusedMonth;\n\n // Sync focused cell when the user navigates to a different year.\n useEffect(() => {\n setFocusedIndex(focusedMonthRef.current);\n }, [state.focusedYear]);\n\n // Move DOM focus to the focused cell after state change\n useEffect(() => {\n const focused = gridRef.current?.querySelector<HTMLElement>('[tabindex=\"0\"]');\n if (focused && gridRef.current?.contains(document.activeElement)) {\n focused.focus();\n }\n }, [focusedIndex, state.focusedYear]);\n\n function handleKeyDown(e: React.KeyboardEvent) {\n let next = focusedIndex;\n switch (e.key) {\n case \"ArrowRight\":\n next = Math.min(focusedIndex + 1, 11);\n break;\n case \"ArrowLeft\":\n next = Math.max(focusedIndex - 1, 0);\n break;\n case \"ArrowDown\":\n next = Math.min(focusedIndex + 3, 11);\n break;\n case \"ArrowUp\":\n next = Math.max(focusedIndex - 3, 0);\n break;\n case \"Home\":\n next = 0;\n break;\n case \"End\":\n next = 11;\n break;\n case \"PageDown\":\n dispatch({ type: \"NAV_NEXT\" });\n e.preventDefault();\n return;\n case \"PageUp\":\n dispatch({ type: \"NAV_PREV\" });\n e.preventDefault();\n return;\n case \"Escape\":\n dispatch({ type: \"SET_VIEW\", view: \"day\" });\n e.preventDefault();\n return;\n case \"Enter\":\n case \" \":\n dispatch({ type: \"SELECT_MONTH\", month: focusedIndex });\n e.preventDefault();\n return;\n default:\n return;\n }\n e.preventDefault();\n setFocusedIndex(next);\n }\n\n return (\n <MonthGridFocusContext.Provider value={focusedIndex}>\n <div\n ref={gridRef}\n role=\"grid\"\n aria-label={String(state.focusedYear)}\n className={className}\n onKeyDown={handleKeyDown}\n >\n {children({ months })}\n </div>\n </MonthGridFocusContext.Provider>\n );\n}\n","import React, { useContext } from \"react\";\nimport { useDatePickerContext } from \"./context\";\nimport { MonthGridFocusContext } from \"./context\";\n\nexport interface MonthCellProps extends Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n \"aria-selected\" | \"aria-disabled\"\n> {\n value: number;\n}\n\nexport function MonthCell({ value, children, onClick, ...props }: MonthCellProps) {\n const { dispatch } = useDatePickerContext();\n const focusedIndex = useContext(MonthGridFocusContext);\n const isFocused = focusedIndex === value;\n\n return (\n <button\n type=\"button\"\n role=\"gridcell\"\n aria-selected={isFocused}\n tabIndex={isFocused ? 0 : -1}\n data-selected={isFocused || undefined}\n onClick={(e) => {\n dispatch({ type: \"SELECT_MONTH\", month: value });\n onClick?.(e);\n }}\n {...props}\n >\n {children}\n </button>\n );\n}\n","import React, { useState, useRef, useEffect } from \"react\";\nimport { useDatePickerContext } from \"./context\";\nimport { YearGridFocusContext } from \"./context\";\nimport { buildYearItems } from \"../utils/calendar\";\n\nexport interface YearItem {\n value: number;\n isSelected: boolean;\n isDisabled: boolean;\n}\n\nexport interface YearGridProps {\n children: (ctx: { years: YearItem[] }) => React.ReactNode;\n className?: string;\n}\n\nexport function YearGrid({ children, className }: YearGridProps) {\n const { state, config, dispatch } = useDatePickerContext();\n const years = buildYearItems(\n state.yearPageStart,\n 12,\n state.focusedYear,\n config.minDate,\n config.maxDate,\n );\n\n const [focusedYear, setFocusedYear] = useState(state.focusedYear);\n const gridRef = useRef<HTMLDivElement>(null);\n\n // Keep focused year within the current page when page changes\n useEffect(() => {\n const inPage = focusedYear >= state.yearPageStart && focusedYear < state.yearPageStart + 12;\n if (!inPage) setFocusedYear(state.yearPageStart);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- intentional: only re-check when page changes, not on every focusedYear navigation\n }, [state.yearPageStart]);\n\n // Move DOM focus to the focused cell\n useEffect(() => {\n const focused = gridRef.current?.querySelector<HTMLElement>('[tabindex=\"0\"]');\n if (focused && gridRef.current?.contains(document.activeElement)) {\n focused.focus();\n }\n }, [focusedYear, state.yearPageStart]);\n\n function handleKeyDown(e: React.KeyboardEvent) {\n let next = focusedYear;\n const pageStart = state.yearPageStart;\n const pageEnd = pageStart + 11;\n\n switch (e.key) {\n case \"ArrowRight\":\n next = Math.min(focusedYear + 1, pageEnd);\n break;\n case \"ArrowLeft\":\n next = Math.max(focusedYear - 1, pageStart);\n break;\n // 4-column grid: ↓/↑ = ±4 years (next/prev row)\n case \"ArrowDown\":\n next = Math.min(focusedYear + 4, pageEnd);\n break;\n case \"ArrowUp\":\n next = Math.max(focusedYear - 4, pageStart);\n break;\n case \"Home\":\n next = pageStart;\n break;\n case \"End\":\n next = pageEnd;\n break;\n case \"PageDown\":\n dispatch({ type: \"YEAR_PAGE_NEXT\" });\n e.preventDefault();\n return;\n case \"PageUp\":\n dispatch({ type: \"YEAR_PAGE_PREV\" });\n e.preventDefault();\n return;\n case \"Escape\":\n dispatch({ type: \"SET_VIEW\", view: \"month\" });\n e.preventDefault();\n return;\n case \"Enter\":\n case \" \":\n dispatch({ type: \"SELECT_YEAR\", year: focusedYear });\n e.preventDefault();\n return;\n default:\n return;\n }\n e.preventDefault();\n setFocusedYear(next);\n }\n\n return (\n <YearGridFocusContext.Provider value={focusedYear}>\n <div\n ref={gridRef}\n role=\"grid\"\n aria-label={`${state.yearPageStart}–${state.yearPageStart + 11}`}\n className={className}\n onKeyDown={handleKeyDown}\n >\n {children({ years })}\n </div>\n </YearGridFocusContext.Provider>\n );\n}\n","import React, { useContext } from \"react\";\nimport { useDatePickerContext } from \"./context\";\nimport { YearGridFocusContext } from \"./context\";\n\nexport interface YearCellProps extends Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n \"aria-selected\" | \"aria-disabled\"\n> {\n value: number;\n}\n\nexport function YearCell({ value, children, onClick, ...props }: YearCellProps) {\n const { dispatch } = useDatePickerContext();\n const focusedYear = useContext(YearGridFocusContext);\n const isFocused = focusedYear === value;\n\n return (\n <button\n type=\"button\"\n role=\"gridcell\"\n aria-selected={isFocused}\n tabIndex={isFocused ? 0 : -1}\n data-selected={isFocused || undefined}\n onClick={(e) => {\n dispatch({ type: \"SELECT_YEAR\", year: value });\n onClick?.(e);\n }}\n {...props}\n >\n {children}\n </button>\n );\n}\n","import React from \"react\";\nimport { ViewControl } from \"./view-control\";\nimport { PrevTrigger } from \"./prev-trigger\";\nimport { NextTrigger } from \"./next-trigger\";\nimport { ViewTrigger } from \"./view-trigger\";\nimport { View } from \"./view\";\nimport { WeekDays } from \"./week-days\";\nimport { Grid } from \"./grid\";\nimport { MonthGrid } from \"./month-grid\";\nimport { MonthCell } from \"./month-cell\";\nimport { YearGrid } from \"./year-grid\";\nimport { YearCell } from \"./year-cell\";\n\nexport interface CalendarProps {\n className?: string;\n}\n\nexport function Calendar({ className }: CalendarProps) {\n return (\n <div className={className}>\n <ViewControl>\n <PrevTrigger />\n <ViewTrigger />\n <NextTrigger />\n </ViewControl>\n\n <View view=\"day\">\n <Grid header={<WeekDays />} />\n </View>\n\n <View view=\"month\">\n <MonthGrid>\n {({ months }) => (\n <div style={{ display: \"grid\", gridTemplateColumns: \"repeat(3, 1fr)\" }}>\n {months.map((m) => (\n <MonthCell key={m.value} value={m.value} disabled={m.isDisabled}>\n {m.label}\n </MonthCell>\n ))}\n </div>\n )}\n </MonthGrid>\n </View>\n\n <View view=\"year\">\n <YearGrid>\n {({ years }) => (\n <div style={{ display: \"grid\", gridTemplateColumns: \"repeat(4, 1fr)\" }}>\n {years.map((y) => (\n <YearCell key={y.value} value={y.value} disabled={y.isDisabled}>\n {y.value}\n </YearCell>\n ))}\n </div>\n )}\n </YearGrid>\n </View>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,297 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { Dispatch } from 'react';
|
|
3
|
-
|
|
4
|
-
type ViewMode = "day" | "month" | "year";
|
|
5
|
-
type SelectionMode = "single" | "range" | "multiple";
|
|
6
|
-
interface DateRange {
|
|
7
|
-
start: Date | null;
|
|
8
|
-
end: Date | null;
|
|
9
|
-
}
|
|
10
|
-
interface DayCellMeta {
|
|
11
|
-
date: Date;
|
|
12
|
-
isCurrentMonth: boolean;
|
|
13
|
-
isToday: boolean;
|
|
14
|
-
isSelected: boolean;
|
|
15
|
-
isDisabled: boolean;
|
|
16
|
-
isRangeStart: boolean;
|
|
17
|
-
isRangeEnd: boolean;
|
|
18
|
-
isInRange: boolean;
|
|
19
|
-
isHovered: boolean;
|
|
20
|
-
}
|
|
21
|
-
interface MonthItem {
|
|
22
|
-
value: number;
|
|
23
|
-
label: string;
|
|
24
|
-
isSelected: boolean;
|
|
25
|
-
isDisabled: boolean;
|
|
26
|
-
}
|
|
27
|
-
interface YearItem$1 {
|
|
28
|
-
value: number;
|
|
29
|
-
isSelected: boolean;
|
|
30
|
-
isDisabled: boolean;
|
|
31
|
-
}
|
|
32
|
-
interface WeekDayItem {
|
|
33
|
-
label: string;
|
|
34
|
-
ariaLabel: string;
|
|
35
|
-
}
|
|
36
|
-
interface DatePickerSharedProps {
|
|
37
|
-
locale?: string;
|
|
38
|
-
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
39
|
-
minDate?: Date;
|
|
40
|
-
maxDate?: Date;
|
|
41
|
-
disabled?: boolean | ((date: Date) => boolean);
|
|
42
|
-
readOnly?: boolean;
|
|
43
|
-
open?: boolean;
|
|
44
|
-
defaultOpen?: boolean;
|
|
45
|
-
onOpenChange?: (open: boolean) => void;
|
|
46
|
-
modal?: boolean;
|
|
47
|
-
closeOnSelect?: boolean;
|
|
48
|
-
}
|
|
49
|
-
interface DatePickerSingleProps extends DatePickerSharedProps {
|
|
50
|
-
mode?: "single";
|
|
51
|
-
value?: Date | null;
|
|
52
|
-
defaultValue?: Date | null;
|
|
53
|
-
onValueChange?: (date: Date | null) => void;
|
|
54
|
-
}
|
|
55
|
-
interface DatePickerRangeProps extends DatePickerSharedProps {
|
|
56
|
-
mode: "range";
|
|
57
|
-
value?: DateRange;
|
|
58
|
-
defaultValue?: DateRange;
|
|
59
|
-
onValueChange?: (range: DateRange) => void;
|
|
60
|
-
}
|
|
61
|
-
interface DatePickerMultipleProps extends DatePickerSharedProps {
|
|
62
|
-
mode: "multiple";
|
|
63
|
-
value?: Date[];
|
|
64
|
-
defaultValue?: Date[];
|
|
65
|
-
onValueChange?: (dates: Date[]) => void;
|
|
66
|
-
}
|
|
67
|
-
type DatePickerRootProps = DatePickerSingleProps | DatePickerRangeProps | DatePickerMultipleProps;
|
|
68
|
-
interface DatePickerConfig {
|
|
69
|
-
mode: SelectionMode;
|
|
70
|
-
locale: string;
|
|
71
|
-
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
72
|
-
minDate?: Date;
|
|
73
|
-
maxDate?: Date;
|
|
74
|
-
disabled?: boolean | ((date: Date) => boolean);
|
|
75
|
-
readOnly: boolean;
|
|
76
|
-
closeOnSelect: boolean;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
type RootProps = DatePickerRootProps & {
|
|
80
|
-
children: React.ReactNode;
|
|
81
|
-
};
|
|
82
|
-
declare function Root(props: RootProps): react_jsx_runtime.JSX.Element;
|
|
83
|
-
|
|
84
|
-
type LabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;
|
|
85
|
-
declare function Label({ children, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
86
|
-
|
|
87
|
-
interface InputProps {
|
|
88
|
-
index?: 0 | 1;
|
|
89
|
-
segmentLabels?: {
|
|
90
|
-
month?: string;
|
|
91
|
-
day?: string;
|
|
92
|
-
year?: string;
|
|
93
|
-
};
|
|
94
|
-
className?: string;
|
|
95
|
-
style?: React.CSSProperties;
|
|
96
|
-
}
|
|
97
|
-
declare function Input({ index, segmentLabels, className, style }: InputProps): react_jsx_runtime.JSX.Element;
|
|
98
|
-
|
|
99
|
-
type TriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-haspopup" | "aria-expanded" | "aria-controls">;
|
|
100
|
-
declare function Trigger({ children, onClick, disabled, ...props }: TriggerProps): react_jsx_runtime.JSX.Element;
|
|
101
|
-
|
|
102
|
-
interface ContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
103
|
-
forceMount?: boolean;
|
|
104
|
-
side?: "top" | "bottom" | "left" | "right";
|
|
105
|
-
align?: "start" | "center" | "end";
|
|
106
|
-
sideOffset?: number;
|
|
107
|
-
alignOffset?: number;
|
|
108
|
-
avoidCollisions?: boolean;
|
|
109
|
-
collisionPadding?: number;
|
|
110
|
-
portal?: boolean;
|
|
111
|
-
}
|
|
112
|
-
declare function Content({ children, forceMount, side, align, sideOffset, alignOffset, avoidCollisions, collisionPadding, portal, style, onKeyDown, ...props }: ContentProps): react_jsx_runtime.JSX.Element | null;
|
|
113
|
-
|
|
114
|
-
interface CalendarProps {
|
|
115
|
-
className?: string;
|
|
116
|
-
}
|
|
117
|
-
declare function Calendar({ className }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
118
|
-
|
|
119
|
-
interface ViewProps {
|
|
120
|
-
view: ViewMode;
|
|
121
|
-
children: React.ReactNode;
|
|
122
|
-
}
|
|
123
|
-
declare function View({ view, children }: ViewProps): react_jsx_runtime.JSX.Element | null;
|
|
124
|
-
|
|
125
|
-
type ViewControlProps = React.HTMLAttributes<HTMLDivElement>;
|
|
126
|
-
declare function ViewControl({ children, ...props }: ViewControlProps): react_jsx_runtime.JSX.Element;
|
|
127
|
-
|
|
128
|
-
type PrevTriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label">;
|
|
129
|
-
declare function PrevTrigger({ children, onClick, ...props }: PrevTriggerProps): react_jsx_runtime.JSX.Element;
|
|
130
|
-
|
|
131
|
-
type NextTriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label">;
|
|
132
|
-
declare function NextTrigger({ children, onClick, ...props }: NextTriggerProps): react_jsx_runtime.JSX.Element;
|
|
133
|
-
|
|
134
|
-
type ViewTriggerProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label">;
|
|
135
|
-
declare function ViewTrigger({ children, onClick, ...props }: ViewTriggerProps): react_jsx_runtime.JSX.Element;
|
|
136
|
-
|
|
137
|
-
interface WeekDaysProps {
|
|
138
|
-
format?: "long" | "short" | "narrow";
|
|
139
|
-
className?: string;
|
|
140
|
-
}
|
|
141
|
-
declare function WeekDays({ format, className }: WeekDaysProps): react_jsx_runtime.JSX.Element;
|
|
142
|
-
|
|
143
|
-
interface GridProps {
|
|
144
|
-
children?: (ctx: {
|
|
145
|
-
weeks: Date[][];
|
|
146
|
-
}) => React.ReactNode;
|
|
147
|
-
header?: React.ReactNode;
|
|
148
|
-
className?: string;
|
|
149
|
-
}
|
|
150
|
-
declare function Grid({ children, header, className }: GridProps): react_jsx_runtime.JSX.Element;
|
|
151
|
-
|
|
152
|
-
interface DayProps {
|
|
153
|
-
date: Date;
|
|
154
|
-
children?: (meta: DayCellMeta) => React.ReactNode;
|
|
155
|
-
className?: string;
|
|
156
|
-
style?: React.CSSProperties;
|
|
157
|
-
}
|
|
158
|
-
declare function Day({ date, children, className, style }: DayProps): react_jsx_runtime.JSX.Element;
|
|
159
|
-
|
|
160
|
-
interface MonthGridProps {
|
|
161
|
-
children: (ctx: {
|
|
162
|
-
months: MonthItem[];
|
|
163
|
-
}) => React.ReactNode;
|
|
164
|
-
className?: string;
|
|
165
|
-
}
|
|
166
|
-
declare function MonthGrid({ children, className }: MonthGridProps): react_jsx_runtime.JSX.Element;
|
|
167
|
-
|
|
168
|
-
interface MonthCellProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-selected" | "aria-disabled"> {
|
|
169
|
-
value: number;
|
|
170
|
-
}
|
|
171
|
-
declare function MonthCell({ value, children, onClick, ...props }: MonthCellProps): react_jsx_runtime.JSX.Element;
|
|
172
|
-
|
|
173
|
-
interface YearItem {
|
|
174
|
-
value: number;
|
|
175
|
-
isSelected: boolean;
|
|
176
|
-
isDisabled: boolean;
|
|
177
|
-
}
|
|
178
|
-
interface YearGridProps {
|
|
179
|
-
children: (ctx: {
|
|
180
|
-
years: YearItem[];
|
|
181
|
-
}) => React.ReactNode;
|
|
182
|
-
className?: string;
|
|
183
|
-
}
|
|
184
|
-
declare function YearGrid({ children, className }: YearGridProps): react_jsx_runtime.JSX.Element;
|
|
185
|
-
|
|
186
|
-
interface YearCellProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-selected" | "aria-disabled"> {
|
|
187
|
-
value: number;
|
|
188
|
-
}
|
|
189
|
-
declare function YearCell({ value, children, onClick, ...props }: YearCellProps): react_jsx_runtime.JSX.Element;
|
|
190
|
-
|
|
191
|
-
declare const index_Calendar: typeof Calendar;
|
|
192
|
-
declare const index_Content: typeof Content;
|
|
193
|
-
type index_ContentProps = ContentProps;
|
|
194
|
-
declare const index_Day: typeof Day;
|
|
195
|
-
declare const index_Grid: typeof Grid;
|
|
196
|
-
declare const index_Input: typeof Input;
|
|
197
|
-
declare const index_Label: typeof Label;
|
|
198
|
-
declare const index_MonthCell: typeof MonthCell;
|
|
199
|
-
declare const index_MonthGrid: typeof MonthGrid;
|
|
200
|
-
declare const index_NextTrigger: typeof NextTrigger;
|
|
201
|
-
declare const index_PrevTrigger: typeof PrevTrigger;
|
|
202
|
-
declare const index_Root: typeof Root;
|
|
203
|
-
declare const index_Trigger: typeof Trigger;
|
|
204
|
-
declare const index_View: typeof View;
|
|
205
|
-
declare const index_ViewControl: typeof ViewControl;
|
|
206
|
-
declare const index_ViewTrigger: typeof ViewTrigger;
|
|
207
|
-
declare const index_WeekDays: typeof WeekDays;
|
|
208
|
-
declare const index_YearCell: typeof YearCell;
|
|
209
|
-
declare const index_YearGrid: typeof YearGrid;
|
|
210
|
-
declare namespace index {
|
|
211
|
-
export { index_Calendar as Calendar, index_Content as Content, type index_ContentProps as ContentProps, index_Day as Day, index_Grid as Grid, index_Input as Input, index_Label as Label, index_MonthCell as MonthCell, index_MonthGrid as MonthGrid, index_NextTrigger as NextTrigger, index_PrevTrigger as PrevTrigger, index_Root as Root, index_Trigger as Trigger, index_View as View, index_ViewControl as ViewControl, index_ViewTrigger as ViewTrigger, index_WeekDays as WeekDays, index_YearCell as YearCell, index_YearGrid as YearGrid };
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
type OpenSource = "trigger" | "input" | null;
|
|
215
|
-
interface DatePickerState {
|
|
216
|
-
open: boolean;
|
|
217
|
-
openSource: OpenSource;
|
|
218
|
-
view: ViewMode;
|
|
219
|
-
focusedMonth: number;
|
|
220
|
-
focusedYear: number;
|
|
221
|
-
focusedDate: Date | null;
|
|
222
|
-
selectedDate: Date | null;
|
|
223
|
-
rangeStart: Date | null;
|
|
224
|
-
rangeEnd: Date | null;
|
|
225
|
-
hoverDate: Date | null;
|
|
226
|
-
selectedDates: Date[];
|
|
227
|
-
inputValue: string;
|
|
228
|
-
yearPageStart: number;
|
|
229
|
-
}
|
|
230
|
-
type DatePickerAction = {
|
|
231
|
-
type: "OPEN";
|
|
232
|
-
source?: Exclude<OpenSource, null>;
|
|
233
|
-
} | {
|
|
234
|
-
type: "CLOSE";
|
|
235
|
-
} | {
|
|
236
|
-
type: "TOGGLE";
|
|
237
|
-
source?: Exclude<OpenSource, null>;
|
|
238
|
-
} | {
|
|
239
|
-
type: "SET_VIEW";
|
|
240
|
-
view: ViewMode;
|
|
241
|
-
} | {
|
|
242
|
-
type: "NAV_PREV";
|
|
243
|
-
} | {
|
|
244
|
-
type: "NAV_NEXT";
|
|
245
|
-
} | {
|
|
246
|
-
type: "NAV_TO_DATE";
|
|
247
|
-
date: Date;
|
|
248
|
-
} | {
|
|
249
|
-
type: "FOCUS_DATE";
|
|
250
|
-
date: Date;
|
|
251
|
-
} | {
|
|
252
|
-
type: "SELECT_DATE";
|
|
253
|
-
date: Date;
|
|
254
|
-
} | {
|
|
255
|
-
type: "ANCHOR_DATE";
|
|
256
|
-
date: Date;
|
|
257
|
-
} | {
|
|
258
|
-
type: "EXTEND_RANGE";
|
|
259
|
-
date: Date;
|
|
260
|
-
} | {
|
|
261
|
-
type: "TOGGLE_DATE";
|
|
262
|
-
date: Date;
|
|
263
|
-
} | {
|
|
264
|
-
type: "HOVER_DATE";
|
|
265
|
-
date: Date | null;
|
|
266
|
-
} | {
|
|
267
|
-
type: "SET_INPUT";
|
|
268
|
-
value: string;
|
|
269
|
-
} | {
|
|
270
|
-
type: "COMMIT_INPUT";
|
|
271
|
-
} | {
|
|
272
|
-
type: "SELECT_MONTH";
|
|
273
|
-
month: number;
|
|
274
|
-
} | {
|
|
275
|
-
type: "SELECT_YEAR";
|
|
276
|
-
year: number;
|
|
277
|
-
} | {
|
|
278
|
-
type: "YEAR_PAGE_PREV";
|
|
279
|
-
} | {
|
|
280
|
-
type: "YEAR_PAGE_NEXT";
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
interface DatePickerContextValue {
|
|
284
|
-
state: DatePickerState;
|
|
285
|
-
dispatch: Dispatch<DatePickerAction>;
|
|
286
|
-
config: DatePickerConfig;
|
|
287
|
-
ids: {
|
|
288
|
-
root: string;
|
|
289
|
-
label: string;
|
|
290
|
-
input: string;
|
|
291
|
-
trigger: string;
|
|
292
|
-
content: string;
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
declare function useDatePickerContext(): DatePickerContextValue;
|
|
296
|
-
|
|
297
|
-
export { index as DatePicker, type DatePickerConfig, type DatePickerMultipleProps, type DatePickerRangeProps, type DatePickerRootProps, type DatePickerSingleProps, type DateRange, type DayCellMeta, type MonthItem, type SelectionMode, type ViewMode, type WeekDayItem, type YearItem$1 as YearItem, useDatePickerContext };
|
|
1
|
+
export * from '@at5/axis-datepicker';
|