react-day-picker 8.10.0 → 8.10.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.
Files changed (54) hide show
  1. package/README.md +3 -9
  2. package/dist/index.d.ts +49 -46
  3. package/dist/index.esm.js +56 -1409
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +84 -1437
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.min.js +1 -10
  8. package/dist/index.min.js.map +1 -1
  9. package/package.json +4 -4
  10. package/src/DayPicker.tsx +3 -1
  11. package/src/components/Button/Button.tsx +2 -1
  12. package/src/components/Caption/Caption.tsx +4 -2
  13. package/src/components/CaptionDropdowns/CaptionDropdowns.tsx +3 -1
  14. package/src/components/CaptionLabel/CaptionLabel.tsx +3 -1
  15. package/src/components/CaptionNavigation/CaptionNavigation.tsx +2 -2
  16. package/src/components/Day/Day.tsx +2 -1
  17. package/src/components/DayContent/DayContent.tsx +3 -1
  18. package/src/components/Dropdown/Dropdown.tsx +3 -2
  19. package/src/components/Footer/Footer.tsx +3 -1
  20. package/src/components/Head/Head.tsx +3 -1
  21. package/src/components/HeadRow/HeadRow.tsx +3 -1
  22. package/src/components/IconDropdown/IconDropdown.tsx +3 -1
  23. package/src/components/IconLeft/IconLeft.tsx +3 -1
  24. package/src/components/IconRight/IconRight.tsx +3 -1
  25. package/src/components/Months/Months.tsx +2 -2
  26. package/src/components/MonthsDropdown/MonthsDropdown.tsx +2 -2
  27. package/src/components/Navigation/Navigation.tsx +2 -2
  28. package/src/components/Root/Root.tsx +2 -1
  29. package/src/components/Row/Row.tsx +3 -1
  30. package/src/components/Table/Table.tsx +3 -1
  31. package/src/components/WeekNumber/WeekNumber.tsx +2 -2
  32. package/src/components/YearsDropdown/YearsDropdown.tsx +2 -2
  33. package/src/contexts/DayPicker/DayPickerContext.tsx +3 -2
  34. package/src/contexts/Focus/FocusContext.tsx +3 -2
  35. package/src/contexts/Modifiers/ModifiersContext.tsx +3 -2
  36. package/src/contexts/Navigation/NavigationContext.tsx +3 -2
  37. package/src/contexts/RootProvider.tsx +14 -4
  38. package/src/contexts/SelectMultiple/SelectMultipleContext.test.ts +1 -1
  39. package/src/contexts/SelectMultiple/SelectMultipleContext.tsx +4 -3
  40. package/src/contexts/SelectRange/SelectRangeContext.test.ts +1 -1
  41. package/src/contexts/SelectRange/SelectRangeContext.tsx +4 -3
  42. package/src/contexts/SelectSingle/SelectSingleContext.test.ts +1 -1
  43. package/src/contexts/SelectSingle/SelectSingleContext.tsx +4 -3
  44. package/src/hooks/useControlledValue/useControlledValue.test.ts +1 -1
  45. package/src/hooks/useDayEventHandlers/useDayEventHandlers.tsx +1 -1
  46. package/src/hooks/useDayRender/useDayRender.tsx +2 -1
  47. package/src/hooks/useDayRender/utils/getDayStyle.ts +1 -1
  48. package/src/hooks/useInput/useInput.ts +3 -3
  49. package/src/types/DayPickerBase.ts +15 -15
  50. package/src/types/EventHandlers.ts +1 -1
  51. package/src/types/Formatters.ts +1 -1
  52. package/src/types/Modifiers.ts +1 -1
  53. package/src/types/Styles.ts +1 -1
  54. package/src/hooks/useId/useIsomorphicLayoutEffect.ts +0 -31
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from 'react';
1
+ import type { CSSProperties } from 'react';
2
2
 
3
3
  import { Matcher } from './Matchers';
4
4
 
@@ -1,4 +1,4 @@
1
- import { CSSProperties, ReactNode } from 'react';
1
+ import type { CSSProperties, ReactNode } from 'react';
2
2
 
3
3
  /** The style (either via class names or via in-line styles) of an element. */
4
4
  export type StyledElement<T = string | CSSProperties> = {
@@ -1,31 +0,0 @@
1
- import { useEffect, useLayoutEffect } from 'react';
2
-
3
- import { canUseDOM } from './useId';
4
-
5
- /**
6
- * React currently throws a warning when using useLayoutEffect on the server. To
7
- * get around it, we can conditionally useEffect on the server (no-op) and
8
- * useLayoutEffect in the browser. We occasionally need useLayoutEffect to
9
- * ensure we don't get a render flash for certain operations, but we may also
10
- * need affected components to render on the server. One example is when setting
11
- * a component's descendants to retrieve their index values.
12
- *
13
- * Important to note that using this hook as an escape hatch will break the
14
- * eslint dependency warnings unless you rename the import to `useLayoutEffect`.
15
- * Use sparingly only when the effect won't effect the rendered HTML to avoid
16
- * any server/client mismatch.
17
- *
18
- * If a useLayoutEffect is needed and the result would create a mismatch, it's
19
- * likely that the component in question shouldn't be rendered on the server at
20
- * all, so a better approach would be to lazily render those in a parent
21
- * component after client-side hydration.
22
- *
23
- * https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
24
- * https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js
25
- *
26
- * @param effect
27
- * @param deps
28
- */
29
- export const useIsomorphicLayoutEffect = canUseDOM()
30
- ? useLayoutEffect
31
- : useEffect;