@novie/ui 1.0.5 → 1.0.6

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.
@@ -1,11 +1,29 @@
1
1
  import * as React from "react";
2
- type CalendarProps = Omit<React.ComponentProps<"div">, "onSelect"> & {
3
- selected?: Date;
4
- onSelect?: (date: Date) => void;
2
+ type CalendarDateRange = {
3
+ from?: Date;
4
+ to?: Date;
5
+ };
6
+ type CalendarBaseProps = Omit<React.ComponentProps<"div">, "onSelect"> & {
5
7
  month?: Date;
6
8
  onMonthChange?: (date: Date) => void;
7
9
  };
8
- declare function Calendar({ className, selected, onSelect, month: controlledMonth, onMonthChange, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
9
- export { Calendar };
10
- export type { CalendarProps };
10
+ type CalendarSingleProps = CalendarBaseProps & {
11
+ mode?: "single";
12
+ selected?: Date;
13
+ onSelect?: (date: Date) => void;
14
+ selectedRange?: never;
15
+ onRangeSelect?: never;
16
+ };
17
+ type CalendarRangeProps = CalendarBaseProps & {
18
+ mode: "range";
19
+ selectedRange?: CalendarDateRange;
20
+ onRangeSelect?: (range: CalendarDateRange) => void;
21
+ selected?: never;
22
+ onSelect?: never;
23
+ };
24
+ type CalendarProps = CalendarSingleProps | CalendarRangeProps;
25
+ declare function getNextCalendarDateRange(currentRange: CalendarDateRange | undefined, selectedDate: Date): CalendarDateRange;
26
+ declare function Calendar({ className, mode, selected, onSelect, selectedRange, onRangeSelect, month: controlledMonth, onMonthChange, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
27
+ export { Calendar, getNextCalendarDateRange };
28
+ export type { CalendarDateRange, CalendarProps };
11
29
  //# sourceMappingURL=calendar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,KAAK,aAAa,GAAG,IAA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