react-day-picker 9.14.0 → 10.0.0-next.1

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.
Files changed (91) hide show
  1. package/dist/cjs/DayPicker.js +84 -82
  2. package/dist/cjs/UI.d.ts +2 -239
  3. package/dist/cjs/UI.js +2 -2
  4. package/dist/cjs/classes/DateLib.d.ts +0 -21
  5. package/dist/cjs/classes/DateLib.js +3 -13
  6. package/dist/cjs/components/Chevron.js +1 -3
  7. package/dist/cjs/components/Dropdown.d.ts +0 -11
  8. package/dist/cjs/components/Dropdown.js +3 -1
  9. package/dist/cjs/components/NextMonthButton.js +1 -3
  10. package/dist/cjs/components/PreviousMonthButton.js +1 -3
  11. package/dist/cjs/components/custom-components.d.ts +0 -1
  12. package/dist/cjs/components/custom-components.js +0 -1
  13. package/dist/cjs/formatters/formatCaption.d.ts +0 -6
  14. package/dist/cjs/formatters/formatCaption.js +0 -7
  15. package/dist/cjs/formatters/formatWeekNumber.d.ts +1 -1
  16. package/dist/cjs/formatters/formatYearDropdown.d.ts +0 -6
  17. package/dist/cjs/formatters/formatYearDropdown.js +0 -7
  18. package/dist/cjs/helpers/getFormatters.d.ts +0 -2
  19. package/dist/cjs/helpers/getFormatters.js +0 -7
  20. package/dist/cjs/helpers/getInitialMonth.d.ts +1 -1
  21. package/dist/cjs/helpers/getNavMonth.d.ts +1 -1
  22. package/dist/cjs/helpers/getNavMonth.js +1 -21
  23. package/dist/cjs/hijri/index.js +2 -8
  24. package/dist/cjs/labels/labelDayButton.d.ts +0 -5
  25. package/dist/cjs/labels/labelDayButton.js +0 -6
  26. package/dist/cjs/labels/labelGrid.d.ts +0 -5
  27. package/dist/cjs/labels/labelGrid.js +0 -6
  28. package/dist/cjs/types/index.d.ts +0 -1
  29. package/dist/cjs/types/index.js +0 -1
  30. package/dist/cjs/types/props.d.ts +3 -97
  31. package/dist/cjs/types/shared.d.ts +1 -45
  32. package/dist/cjs/useAnimation.js +1 -2
  33. package/dist/cjs/useCalendar.d.ts +1 -1
  34. package/dist/cjs/utils/dateMatchModifiers.d.ts +0 -5
  35. package/dist/cjs/utils/dateMatchModifiers.js +0 -6
  36. package/dist/cjs/utils/rangeIncludesDate.d.ts +1 -6
  37. package/dist/cjs/utils/rangeIncludesDate.js +0 -7
  38. package/dist/cjs/utils/rangeOverlaps.d.ts +1 -1
  39. package/dist/esm/DayPicker.js +84 -82
  40. package/dist/esm/UI.d.ts +2 -239
  41. package/dist/esm/UI.js +2 -2
  42. package/dist/esm/classes/DateLib.d.ts +0 -21
  43. package/dist/esm/classes/DateLib.js +2 -12
  44. package/dist/esm/components/Chevron.js +1 -3
  45. package/dist/esm/components/Dropdown.d.ts +0 -11
  46. package/dist/esm/components/Dropdown.js +3 -1
  47. package/dist/esm/components/NextMonthButton.js +1 -3
  48. package/dist/esm/components/PreviousMonthButton.js +1 -3
  49. package/dist/esm/components/custom-components.d.ts +0 -1
  50. package/dist/esm/components/custom-components.js +0 -1
  51. package/dist/esm/formatters/formatCaption.d.ts +0 -6
  52. package/dist/esm/formatters/formatCaption.js +0 -6
  53. package/dist/esm/formatters/formatWeekNumber.d.ts +1 -1
  54. package/dist/esm/formatters/formatYearDropdown.d.ts +0 -6
  55. package/dist/esm/formatters/formatYearDropdown.js +0 -6
  56. package/dist/esm/helpers/getFormatters.d.ts +0 -2
  57. package/dist/esm/helpers/getFormatters.js +0 -7
  58. package/dist/esm/helpers/getInitialMonth.d.ts +1 -1
  59. package/dist/esm/helpers/getNavMonth.d.ts +1 -1
  60. package/dist/esm/helpers/getNavMonth.js +1 -21
  61. package/dist/esm/hijri/index.js +2 -8
  62. package/dist/esm/labels/labelDayButton.d.ts +0 -5
  63. package/dist/esm/labels/labelDayButton.js +0 -5
  64. package/dist/esm/labels/labelGrid.d.ts +0 -5
  65. package/dist/esm/labels/labelGrid.js +0 -5
  66. package/dist/esm/types/index.d.ts +0 -1
  67. package/dist/esm/types/index.js +0 -1
  68. package/dist/esm/types/props.d.ts +3 -97
  69. package/dist/esm/types/shared.d.ts +1 -45
  70. package/dist/esm/useAnimation.js +1 -2
  71. package/dist/esm/useCalendar.d.ts +1 -1
  72. package/dist/esm/utils/dateMatchModifiers.d.ts +0 -5
  73. package/dist/esm/utils/dateMatchModifiers.js +0 -5
  74. package/dist/esm/utils/rangeIncludesDate.d.ts +1 -6
  75. package/dist/esm/utils/rangeIncludesDate.js +0 -5
  76. package/dist/esm/utils/rangeOverlaps.d.ts +1 -1
  77. package/package.json +13 -25
  78. package/dist/cjs/components/Button.d.ts +0 -9
  79. package/dist/cjs/components/Button.js +0 -16
  80. package/dist/cjs/jalali.d.ts +0 -2
  81. package/dist/cjs/jalali.js +0 -18
  82. package/dist/cjs/types/deprecated.d.ts +0 -180
  83. package/dist/cjs/types/deprecated.js +0 -26
  84. package/dist/esm/components/Button.d.ts +0 -9
  85. package/dist/esm/components/Button.js +0 -10
  86. package/dist/esm/jalali.d.ts +0 -2
  87. package/dist/esm/jalali.js +0 -2
  88. package/dist/esm/types/deprecated.d.ts +0 -180
  89. package/dist/esm/types/deprecated.js +0 -23
  90. package/jalali.d.ts +0 -1
  91. package/jalali.js +0 -3
@@ -1,4 +1,3 @@
1
- export * from "./Button.js";
2
1
  export * from "./CaptionLabel.js";
3
2
  export * from "./Chevron.js";
4
3
  export * from "./Day.js";
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./Button.js"), exports);
18
17
  __exportStar(require("./CaptionLabel.js"), exports);
19
18
  __exportStar(require("./Chevron.js"), exports);
20
19
  __exportStar(require("./Day.js"), exports);
@@ -12,9 +12,3 @@ import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
12
12
  * @see https://daypicker.dev/docs/translation#custom-formatters
13
13
  */
14
14
  export declare function formatCaption(month: Date, options?: DateLibOptions, dateLib?: DateLib): string;
15
- /**
16
- * @private
17
- * @deprecated Use {@link formatCaption} instead.
18
- * @group Formatters
19
- */
20
- export declare const formatMonthCaption: typeof formatCaption;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatMonthCaption = void 0;
4
3
  exports.formatCaption = formatCaption;
5
4
  const DateLib_js_1 = require("../classes/DateLib.js");
6
5
  /**
@@ -19,9 +18,3 @@ function formatCaption(month, options, dateLib) {
19
18
  const lib = dateLib ?? new DateLib_js_1.DateLib(options);
20
19
  return lib.formatMonthYear(month);
21
20
  }
22
- /**
23
- * @private
24
- * @deprecated Use {@link formatCaption} instead.
25
- * @group Formatters
26
- */
27
- exports.formatMonthCaption = formatCaption;
@@ -9,4 +9,4 @@
9
9
  * @group Formatters
10
10
  * @see https://daypicker.dev/docs/translation#custom-formatters
11
11
  */
12
- export declare function formatWeekNumber(weekNumber: number, dateLib?: import("../classes/DateLib.js").DateLib): string;
12
+ export declare function formatWeekNumber(weekNumber: number, dateLib?: import("../index.js").DateLib): string;
@@ -10,9 +10,3 @@ import { type DateLib } from "../classes/DateLib.js";
10
10
  * @see https://daypicker.dev/docs/translation#custom-formatters
11
11
  */
12
12
  export declare function formatYearDropdown(year: Date, dateLib?: DateLib): string;
13
- /**
14
- * @private
15
- * @deprecated Use `formatYearDropdown` instead.
16
- * @group Formatters
17
- */
18
- export declare const formatYearCaption: typeof formatYearDropdown;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatYearCaption = void 0;
4
3
  exports.formatYearDropdown = formatYearDropdown;
5
4
  const DateLib_js_1 = require("../classes/DateLib.js");
6
5
  /**
@@ -16,9 +15,3 @@ const DateLib_js_1 = require("../classes/DateLib.js");
16
15
  function formatYearDropdown(year, dateLib = DateLib_js_1.defaultDateLib) {
17
16
  return dateLib.format(year, "yyyy");
18
17
  }
19
- /**
20
- * @private
21
- * @deprecated Use `formatYearDropdown` instead.
22
- * @group Formatters
23
- */
24
- exports.formatYearCaption = formatYearDropdown;
@@ -11,10 +11,8 @@ export declare function getFormatters(customFormatters: DayPickerProps["formatte
11
11
  formatCaption: typeof defaultFormatters.formatCaption;
12
12
  formatDay: typeof defaultFormatters.formatDay;
13
13
  formatMonthDropdown: typeof defaultFormatters.formatMonthDropdown;
14
- formatMonthCaption: typeof defaultFormatters.formatMonthCaption;
15
14
  formatWeekNumber: typeof defaultFormatters.formatWeekNumber;
16
15
  formatWeekNumberHeader: typeof defaultFormatters.formatWeekNumberHeader;
17
16
  formatWeekdayName: typeof defaultFormatters.formatWeekdayName;
18
17
  formatYearDropdown: typeof defaultFormatters.formatYearDropdown;
19
- formatYearCaption: typeof defaultFormatters.formatYearCaption;
20
18
  };
@@ -43,13 +43,6 @@ const defaultFormatters = __importStar(require("../formatters/index.js"));
43
43
  * @returns The merged formatters object.
44
44
  */
45
45
  function getFormatters(customFormatters) {
46
- if (customFormatters?.formatMonthCaption && !customFormatters.formatCaption) {
47
- customFormatters.formatCaption = customFormatters.formatMonthCaption;
48
- }
49
- if (customFormatters?.formatYearCaption &&
50
- !customFormatters.formatYearDropdown) {
51
- customFormatters.formatYearDropdown = customFormatters.formatYearCaption;
52
- }
53
46
  return {
54
47
  ...defaultFormatters,
55
48
  ...customFormatters,
@@ -11,4 +11,4 @@ import type { DayPickerProps } from "../types/props.js";
11
11
  * @param dateLib The date library to use for date manipulation.
12
12
  * @returns The initial month to display.
13
13
  */
14
- export declare function getInitialMonth(props: Pick<DayPickerProps, "fromYear" | "toYear" | "month" | "defaultMonth" | "today" | "numberOfMonths" | "timeZone">, navStart: Date | undefined, navEnd: Date | undefined, dateLib: DateLib): Date;
14
+ export declare function getInitialMonth(props: Pick<DayPickerProps, "month" | "defaultMonth" | "today" | "numberOfMonths" | "timeZone">, navStart: Date | undefined, navEnd: Date | undefined, dateLib: DateLib): Date;
@@ -7,4 +7,4 @@ import type { DayPickerProps } from "../types/index.js";
7
7
  * @param dateLib The date library to use for date manipulation.
8
8
  * @returns A tuple containing the start and end months for navigation.
9
9
  */
10
- export declare function getNavMonths(props: Pick<DayPickerProps, "captionLayout" | "endMonth" | "startMonth" | "today" | "timeZone" | "fromMonth" | "fromYear" | "toMonth" | "toYear">, dateLib: DateLib): [start: Date | undefined, end: Date | undefined];
10
+ export declare function getNavMonths(props: Pick<DayPickerProps, "captionLayout" | "endMonth" | "startMonth" | "today" | "timeZone">, dateLib: DateLib): [start: Date | undefined, end: Date | undefined];
@@ -10,38 +10,18 @@ exports.getNavMonths = getNavMonths;
10
10
  */
11
11
  function getNavMonths(props, dateLib) {
12
12
  let { startMonth, endMonth } = props;
13
- const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today, } = dateLib;
14
- // Handle deprecated code
15
- const { fromYear, toYear, fromMonth, toMonth } = props;
16
- if (!startMonth && fromMonth) {
17
- startMonth = fromMonth;
18
- }
19
- if (!startMonth && fromYear) {
20
- startMonth = dateLib.newDate(fromYear, 0, 1);
21
- }
22
- if (!endMonth && toMonth) {
23
- endMonth = toMonth;
24
- }
25
- if (!endMonth && toYear) {
26
- endMonth = newDate(toYear, 11, 31);
27
- }
13
+ const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, today, } = dateLib;
28
14
  const hasYearDropdown = props.captionLayout === "dropdown" ||
29
15
  props.captionLayout === "dropdown-years";
30
16
  if (startMonth) {
31
17
  startMonth = startOfMonth(startMonth);
32
18
  }
33
- else if (fromYear) {
34
- startMonth = newDate(fromYear, 0, 1);
35
- }
36
19
  else if (!startMonth && hasYearDropdown) {
37
20
  startMonth = startOfYear(addYears(props.today ?? today(), -100));
38
21
  }
39
22
  if (endMonth) {
40
23
  endMonth = endOfMonth(endMonth);
41
24
  }
42
- else if (toYear) {
43
- endMonth = newDate(toYear, 11, 31);
44
- }
45
25
  else if (!endMonth && hasYearDropdown) {
46
26
  endMonth = endOfYear(props.today ?? today());
47
27
  }
@@ -65,12 +65,8 @@ function clampDateProp(date) {
65
65
  */
66
66
  function DayPicker(props) {
67
67
  const { dateLib: dateLibProp, ...dayPickerProps } = props;
68
- const hasStartBound = props.startMonth !== undefined ||
69
- props.fromMonth !== undefined ||
70
- props.fromYear !== undefined;
71
- const hasEndBound = props.endMonth !== undefined ||
72
- props.toMonth !== undefined ||
73
- props.toYear !== undefined;
68
+ const hasStartBound = props.startMonth !== undefined;
69
+ const hasEndBound = props.endMonth !== undefined;
74
70
  const clampedProps = {
75
71
  ...dayPickerProps,
76
72
  month: clampDateProp(props.month),
@@ -82,8 +78,6 @@ function DayPicker(props) {
82
78
  endMonth: hasEndBound
83
79
  ? clampDateProp(props.endMonth)
84
80
  : new Date(range_js_1.GREGORIAN_MAX_DATE),
85
- fromMonth: clampDateProp(props.fromMonth),
86
- toMonth: clampDateProp(props.toMonth),
87
81
  };
88
82
  return (react_1.default.createElement(index_js_1.DayPicker, { ...clampedProps, locale: props.locale ?? ar_SA_js_1.arSA, numerals: props.numerals ?? "arab", dir: props.dir ?? "rtl", dateLib: { ...hijriDateLib, ...dateLibProp } }));
89
83
  }
@@ -16,8 +16,3 @@ import type { Modifiers } from "../types/index.js";
16
16
  * @see https://daypicker.dev/docs/translation#aria-labels
17
17
  */
18
18
  export declare function labelDayButton(date: Date, modifiers: Modifiers, options?: DateLibOptions, dateLib?: DateLib): string;
19
- /**
20
- * @ignore
21
- * @deprecated Use `labelDayButton` instead.
22
- */
23
- export declare const labelDay: typeof labelDayButton;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.labelDay = void 0;
4
3
  exports.labelDayButton = labelDayButton;
5
4
  const DateLib_js_1 = require("../classes/DateLib.js");
6
5
  /**
@@ -26,8 +25,3 @@ function labelDayButton(date, modifiers, options, dateLib) {
26
25
  label = `${label}, selected`;
27
26
  return label;
28
27
  }
29
- /**
30
- * @ignore
31
- * @deprecated Use `labelDayButton` instead.
32
- */
33
- exports.labelDay = labelDayButton;
@@ -12,8 +12,3 @@ import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
12
12
  * @see https://daypicker.dev/docs/translation#aria-labels
13
13
  */
14
14
  export declare function labelGrid(date: Date, options?: DateLibOptions, dateLib?: DateLib): string;
15
- /**
16
- * @ignore
17
- * @deprecated Use {@link labelGrid} instead.
18
- */
19
- export declare const labelCaption: typeof labelGrid;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.labelCaption = void 0;
4
3
  exports.labelGrid = labelGrid;
5
4
  const DateLib_js_1 = require("../classes/DateLib.js");
6
5
  /**
@@ -19,8 +18,3 @@ function labelGrid(date, options, dateLib) {
19
18
  const lib = dateLib ?? new DateLib_js_1.DateLib(options);
20
19
  return lib.formatMonthYear(date);
21
20
  }
22
- /**
23
- * @ignore
24
- * @deprecated Use {@link labelGrid} instead.
25
- */
26
- exports.labelCaption = labelGrid;
@@ -1,4 +1,3 @@
1
- export * from "./deprecated.js";
2
1
  export * from "./props.js";
3
2
  export * from "./selection.js";
4
3
  export * from "./shared.js";
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./deprecated.js"), exports);
18
17
  __exportStar(require("./props.js"), exports);
19
18
  __exportStar(require("./selection.js"), exports);
20
19
  __exportStar(require("./shared.js"), exports);
@@ -1,6 +1,5 @@
1
1
  import type React from "react";
2
2
  import type { DateLib, DayPickerLocale } from "../classes/DateLib.js";
3
- import type { DeprecatedUI } from "../UI.js";
4
3
  import type { ClassNames, CustomComponents, DateRange, DayEventHandler, Formatters, Labels, Matcher, Mode, Modifiers, ModifiersClassNames, ModifiersStyles, MonthChangeEventHandler, Numerals, Styles } from "./shared.js";
5
4
  /**
6
5
  * The props for the `<DayPicker />` component.
@@ -42,7 +41,7 @@ export interface PropsBase {
42
41
  *
43
42
  * @see https://daypicker.dev/docs/styling
44
43
  */
45
- classNames?: Partial<ClassNames> & Partial<DeprecatedUI<string>>;
44
+ classNames?: Partial<ClassNames>;
46
45
  /**
47
46
  * Change the class name for the day matching the `modifiers`.
48
47
  *
@@ -56,7 +55,7 @@ export interface PropsBase {
56
55
  *
57
56
  * @see https://daypicker.dev/docs/styling
58
57
  */
59
- styles?: Partial<Styles> & Partial<DeprecatedUI<React.CSSProperties>>;
58
+ styles?: Partial<Styles>;
60
59
  /**
61
60
  * Change the class name for the day matching the {@link modifiers}.
62
61
  *
@@ -98,26 +97,6 @@ export interface PropsBase {
98
97
  * @see https://daypicker.dev/docs/navigation#start-and-end-dates
99
98
  */
100
99
  startMonth?: Date | undefined;
101
- /**
102
- * @private
103
- * @deprecated This prop has been removed. Use `hidden={{ before: date }}`
104
- * instead.
105
- * @see https://daypicker.dev/docs/navigation#start-and-end-dates
106
- */
107
- fromDate?: Date | undefined;
108
- /**
109
- * @private
110
- * @deprecated This prop has been renamed to `startMonth`.
111
- * @see https://daypicker.dev/docs/navigation#start-and-end-dates
112
- */
113
- fromMonth?: Date | undefined;
114
- /**
115
- * @private
116
- * @deprecated Use `startMonth` instead. E.g. `startMonth={new Date(year,
117
- * 0)}`.
118
- * @see https://daypicker.dev/docs/navigation#start-and-end-dates
119
- */
120
- fromYear?: number | undefined;
121
100
  /**
122
101
  * The latest month to end the month navigation.
123
102
  *
@@ -125,25 +104,6 @@ export interface PropsBase {
125
104
  * @see https://daypicker.dev/docs/navigation#start-and-end-dates
126
105
  */
127
106
  endMonth?: Date;
128
- /**
129
- * @private
130
- * @deprecated This prop has been removed. Use `hidden={{ after: date }}`
131
- * instead.
132
- * @see https://daypicker.dev/docs/navigation#start-and-end-dates
133
- */
134
- toDate?: Date;
135
- /**
136
- * @private
137
- * @deprecated This prop has been renamed to `endMonth`.
138
- * @see https://daypicker.dev/docs/navigation#start-and-end-dates
139
- */
140
- toMonth?: Date;
141
- /**
142
- * @private
143
- * @deprecated Use `endMonth` instead. E.g. `endMonth={new Date(year, 0)}`.
144
- * @see https://daypicker.dev/docs/navigation#start-and-end-dates
145
- */
146
- toYear?: number;
147
107
  /**
148
108
  * Paginate the month navigation displaying the `numberOfMonths` at a time.
149
109
  *
@@ -203,8 +163,7 @@ export interface PropsBase {
203
163
  * - `after`: Displays the buttons after the caption. This ensures the tab order
204
164
  * matches the visual order.
205
165
  *
206
- * If not set, the buttons default to being displayed after the caption, but
207
- * the tab order may not align with the visual order.
166
+ * Default value is `after`.
208
167
  *
209
168
  * @since 9.7.0
210
169
  * @see https://daypicker.dev/docs/customization#navigation-layouts
@@ -311,11 +270,6 @@ export interface PropsBase {
311
270
  * @see https://daypicker.dev/guides/accessibility#autofocus
312
271
  */
313
272
  autoFocus?: boolean;
314
- /**
315
- * @private
316
- * @deprecated This prop will be removed. Use {@link autoFocus} instead.
317
- */
318
- initialFocus?: boolean;
319
273
  /**
320
274
  * Apply the `disabled` modifier to the matching days. Disabled days cannot be
321
275
  * selected when in a selection mode is set.
@@ -484,14 +438,6 @@ export interface PropsBase {
484
438
  * @see https://daypicker.dev/docs/navigation
485
439
  */
486
440
  onPrevClick?: MonthChangeEventHandler;
487
- /**
488
- * Event handler when a week number is clicked.
489
- *
490
- * @private
491
- * @deprecated Use a custom `WeekNumber` component instead.
492
- * @see https://daypicker.dev/docs/customization#showweeknumber
493
- */
494
- onWeekNumberClick?: any;
495
441
  /** Event handler when a day is clicked. */
496
442
  onDayClick?: DayEventHandler<React.MouseEvent>;
497
443
  /** Event handler when a day is focused. */
@@ -512,46 +458,6 @@ export interface PropsBase {
512
458
  * @experimental
513
459
  */
514
460
  dateLib?: Partial<typeof DateLib.prototype> | undefined;
515
- /**
516
- * @private
517
- * @deprecated Use a custom `DayButton` component instead.
518
- */
519
- onDayKeyUp?: DayEventHandler<React.KeyboardEvent>;
520
- /**
521
- * @private
522
- * @deprecated Use a custom `DayButton` component instead.
523
- */
524
- onDayKeyPress?: DayEventHandler<React.KeyboardEvent>;
525
- /**
526
- * @private
527
- * @deprecated Use a custom `DayButton` component instead.
528
- */
529
- onDayPointerEnter?: DayEventHandler<React.PointerEvent>;
530
- /**
531
- * @private
532
- * @deprecated Use a custom `DayButton` component instead.
533
- */
534
- onDayPointerLeave?: DayEventHandler<React.PointerEvent>;
535
- /**
536
- * @private
537
- * @deprecated Use a custom `DayButton` component instead.
538
- */
539
- onDayTouchCancel?: DayEventHandler<React.TouchEvent>;
540
- /**
541
- * @private
542
- * @deprecated Use a custom `DayButton` component instead.
543
- */
544
- onDayTouchEnd?: DayEventHandler<React.TouchEvent>;
545
- /**
546
- * @private
547
- * @deprecated Use a custom `DayButton` component instead.
548
- */
549
- onDayTouchMove?: DayEventHandler<React.TouchEvent>;
550
- /**
551
- * @private
552
- * @deprecated Use a custom `DayButton` component instead.
553
- */
554
- onDayTouchStart?: DayEventHandler<React.TouchEvent>;
555
461
  }
556
462
  /**
557
463
  * Shared handler type for `onSelect` callback when a selection mode is set.
@@ -1,6 +1,6 @@
1
1
  import type { CSSProperties } from "react";
2
2
  import type * as components from "../components/custom-components.js";
3
- import type { formatCaption, formatDay, formatMonthCaption, formatMonthDropdown, formatWeekdayName, formatWeekNumber, formatWeekNumberHeader, formatYearCaption, formatYearDropdown } from "../formatters/index.js";
3
+ import type { formatCaption, formatDay, formatMonthDropdown, formatWeekdayName, formatWeekNumber, formatWeekNumberHeader, formatYearDropdown } from "../formatters/index.js";
4
4
  import type { labelDayButton, labelGrid, labelGridcell, labelMonthDropdown, labelNav, labelNext, labelPrevious, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown } from "../labels/index.js";
5
5
  import type { Animation, DayFlag, SelectionState, UI } from "../UI.js";
6
6
  /**
@@ -19,13 +19,6 @@ export type Mode = "single" | "multiple" | "range";
19
19
  * @see https://daypicker.dev/guides/custom-components
20
20
  */
21
21
  export type CustomComponents = {
22
- /**
23
- * Render any button element in DayPicker.
24
- *
25
- * @deprecated Use {@link CustomComponents.NextMonthButton} or
26
- * {@link CustomComponents.PreviousMonthButton} instead.
27
- */
28
- Button: typeof components.Button;
29
22
  /** Render the chevron icon used in the navigation buttons and dropdowns. */
30
23
  Chevron: typeof components.Chevron;
31
24
  /** Render the caption label of the month grid. */
@@ -85,13 +78,6 @@ export type Formatters = {
85
78
  formatDay: typeof formatDay;
86
79
  /** Format the label in the month dropdown. */
87
80
  formatMonthDropdown: typeof formatMonthDropdown;
88
- /**
89
- * @ignore
90
- * @deprecated Use {@link Formatters.formatCaption} instead.
91
- *
92
- * **Note:** This formatter will be removed in version 10.0.0.
93
- */
94
- formatMonthCaption: typeof formatMonthCaption;
95
81
  /** Format the week number. */
96
82
  formatWeekNumber: typeof formatWeekNumber;
97
83
  /** Format the header of the week number column. */
@@ -100,11 +86,6 @@ export type Formatters = {
100
86
  formatWeekdayName: typeof formatWeekdayName;
101
87
  /** Format the label in the year dropdown. */
102
88
  formatYearDropdown: typeof formatYearDropdown;
103
- /**
104
- * @ignore
105
- * @deprecated Use {@link Formatters.formatYearDropdown} instead.
106
- */
107
- formatYearCaption: typeof formatYearCaption;
108
89
  };
109
90
  /** A map of functions to translate ARIA labels for various elements. */
110
91
  export type Labels = {
@@ -124,11 +105,6 @@ export type Labels = {
124
105
  labelPrevious: typeof labelPrevious;
125
106
  /** The label for the day button. */
126
107
  labelDayButton: typeof labelDayButton;
127
- /**
128
- * @ignore
129
- * @deprecated Use {@link labelDayButton} instead.
130
- */
131
- labelDay: typeof labelDayButton;
132
108
  /** The label for the weekday. */
133
109
  labelWeekday: typeof labelWeekday;
134
110
  /** The label for the week number. */
@@ -285,26 +261,6 @@ export type ModifiersStyles = Record<string, CSSProperties>;
285
261
  * };
286
262
  */
287
263
  export type ModifiersClassNames = Record<string, string>;
288
- /**
289
- * The props that have been deprecated since version 9.0.0.
290
- *
291
- * @private
292
- * @since 9.0.0
293
- * @see https://daypicker.dev/upgrading
294
- */
295
- export type V9DeprecatedProps =
296
- /** Use `hidden` prop instead. */
297
- "fromDate"
298
- /** Use `hidden` prop instead. */
299
- | "toDate"
300
- /** Use `startMonth` instead. */
301
- | "fromMonth"
302
- /** Use `endMonth` instead. */
303
- | "toMonth"
304
- /** Use `startMonth` instead. */
305
- | "fromYear"
306
- /** Use `endMonth` instead. */
307
- | "toYear";
308
264
  /** The direction to move the focus relative to the current focused date. */
309
265
  export type MoveFocusDir = "after" | "before";
310
266
  /** The temporal unit to move the focus by. */
@@ -97,8 +97,7 @@ function useAnimation(rootElRef, enabled, { classNames, months, focused, dateLib
97
97
  : [];
98
98
  const currentMonthEls = queryMonthEls(rootElRef.current);
99
99
  if (currentMonthEls?.every((el) => el instanceof HTMLElement) &&
100
- previousMonthEls &&
101
- previousMonthEls.every((el) => el instanceof HTMLElement)) {
100
+ previousMonthEls?.every((el) => el instanceof HTMLElement)) {
102
101
  animatingRef.current = true;
103
102
  const cleanUpFunctions = [];
104
103
  // set isolation to isolate to isolate the stacking context during animation
@@ -52,4 +52,4 @@ export interface Calendar {
52
52
  * @returns The calendar object containing displayed days, weeks, months, and
53
53
  * navigation methods.
54
54
  */
55
- export declare function useCalendar(props: Pick<DayPickerProps, "captionLayout" | "endMonth" | "startMonth" | "today" | "fixedWeeks" | "ISOWeek" | "numberOfMonths" | "pagedNavigation" | "reverseMonths" | "disableNavigation" | "onMonthChange" | "month" | "defaultMonth" | "timeZone" | "broadcastCalendar" | "fromMonth" | "fromYear" | "toMonth" | "toYear">, dateLib: DateLib): Calendar;
55
+ export declare function useCalendar(props: Pick<DayPickerProps, "captionLayout" | "endMonth" | "startMonth" | "today" | "fixedWeeks" | "ISOWeek" | "numberOfMonths" | "pagedNavigation" | "reverseMonths" | "disableNavigation" | "onMonthChange" | "month" | "defaultMonth" | "timeZone" | "broadcastCalendar">, dateLib: DateLib): Calendar;
@@ -10,8 +10,3 @@ import type { Matcher } from "../types/index.js";
10
10
  * @group Utilities
11
11
  */
12
12
  export declare function dateMatchModifiers(date: Date, matchers: Matcher | Matcher[], dateLib?: DateLib): boolean;
13
- /**
14
- * @private
15
- * @deprecated Use {@link dateMatchModifiers} instead.
16
- */
17
- export declare const isMatch: typeof dateMatchModifiers;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isMatch = void 0;
4
3
  exports.dateMatchModifiers = dateMatchModifiers;
5
4
  const DateLib_js_1 = require("../classes/DateLib.js");
6
5
  const rangeIncludesDate_js_1 = require("./rangeIncludesDate.js");
@@ -61,8 +60,3 @@ function dateMatchModifiers(date, matchers, dateLib = DateLib_js_1.defaultDateLi
61
60
  return false;
62
61
  });
63
62
  }
64
- /**
65
- * @private
66
- * @deprecated Use {@link dateMatchModifiers} instead.
67
- */
68
- exports.isMatch = dateMatchModifiers;
@@ -10,9 +10,4 @@ import type { DateRange } from "../types/index.js";
10
10
  * @returns `true` if the date is within the range, otherwise `false`.
11
11
  * @group Utilities
12
12
  */
13
- export declare function rangeIncludesDate(range: DateRange, date: Date, excludeEnds?: boolean, dateLib?: import("../classes/DateLib.js").DateLib): boolean;
14
- /**
15
- * @private
16
- * @deprecated Use {@link rangeIncludesDate} instead.
17
- */
18
- export declare const isDateInRange: (range: DateRange, date: Date) => boolean;
13
+ export declare function rangeIncludesDate(range: DateRange, date: Date, excludeEnds?: boolean, dateLib?: import("../index.js").DateLib): boolean;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDateInRange = void 0;
4
3
  exports.rangeIncludesDate = rangeIncludesDate;
5
4
  const index_js_1 = require("../classes/index.js");
6
5
  /**
@@ -34,9 +33,3 @@ function rangeIncludesDate(range, date, excludeEnds = false, dateLib = index_js_
34
33
  }
35
34
  return false;
36
35
  }
37
- /**
38
- * @private
39
- * @deprecated Use {@link rangeIncludesDate} instead.
40
- */
41
- const isDateInRange = (range, date) => rangeIncludesDate(range, date, false, index_js_1.defaultDateLib);
42
- exports.isDateInRange = isDateInRange;
@@ -14,4 +14,4 @@ export declare function rangeOverlaps(rangeLeft: {
14
14
  }, rangeRight: {
15
15
  from: Date;
16
16
  to: Date;
17
- }, dateLib?: import("../classes/DateLib.js").DateLib): boolean;
17
+ }, dateLib?: import("../index.js").DateLib): boolean;