rangeflow 1.0.0
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/README.md +523 -0
- package/dist/Root.d.ts +1 -0
- package/dist/animations/OdometerText.d.ts +6 -0
- package/dist/components/Calendar/CalendarDayButton.d.ts +2 -0
- package/dist/components/Calendar/Chevron.d.ts +2 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/DateSlider/DateLabelsTrack.d.ts +1 -0
- package/dist/components/DateSlider/DateTickers.d.ts +1 -0
- package/dist/components/DateSlider/RangeStepButton.d.ts +7 -0
- package/dist/components/DateSlider/Slider/SliderLeftSpacer.d.ts +1 -0
- package/dist/components/DateSlider/Slider/SliderRightSpacer.d.ts +1 -0
- package/dist/components/DateSlider/Slider/SliderThumb.d.ts +5 -0
- package/dist/components/DateSlider/Slider/index.d.ts +5 -0
- package/dist/components/DateSlider/SliderTrack.d.ts +5 -0
- package/dist/components/DateSlider/SliderValue.d.ts +1 -0
- package/dist/components/DateSlider/index.d.ts +1 -0
- package/dist/components/DateSlider/utils/restrict-inner-to-element.d.ts +14 -0
- package/dist/components/PickerBar/CalendarPopover.d.ts +6 -0
- package/dist/components/PickerBar/SelectedDate.d.ts +1 -0
- package/dist/components/PickerBar/index.d.ts +1 -0
- package/dist/components/Popover/index.d.ts +8 -0
- package/dist/components/RangeTabs/hooks/use-apply-slider-layout.d.ts +1 -0
- package/dist/components/RangeTabs/index.d.ts +1 -0
- package/dist/constants/date-ranges.d.ts +2 -0
- package/dist/constants/slider.d.ts +4 -0
- package/dist/context/ContextProvider.d.ts +7 -0
- package/dist/context/hooks/use-context-api.d.ts +3 -0
- package/dist/context/hooks/use-context-events.d.ts +3 -0
- package/dist/context/hooks/use-context-refs.d.ts +2 -0
- package/dist/context/hooks/use-context-slots.d.ts +2 -0
- package/dist/context/root.d.ts +43 -0
- package/dist/entry.d.ts +3 -0
- package/dist/hooks/use-days-in-range.d.ts +2 -0
- package/dist/hooks/use-emit-date-change.d.ts +1 -0
- package/dist/hooks/use-rangeflow-events.d.ts +1 -0
- package/dist/hooks/use-rangeflow-refs.d.ts +1 -0
- package/dist/hooks/use-rangeflow-slots.d.ts +1 -0
- package/dist/hooks/use-rangeflow-store-api.d.ts +2 -0
- package/dist/hooks/use-rangeflow-store.d.ts +4 -0
- package/dist/hooks/use-rangeflow.d.ts +2 -0
- package/dist/hooks/use-update-selected-date.d.ts +2 -0
- package/dist/icons/CalendarIcon.d.ts +1 -0
- package/dist/icons/DoubleChevronLeftIcon.d.ts +1 -0
- package/dist/icons/DoubleChevronRightIcon.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +852 -0
- package/dist/style.css +3 -0
- package/dist/types.d.ts +58 -0
- package/dist/utils/clamp.d.ts +1 -0
- package/dist/utils/create-slider-values.d.ts +9 -0
- package/dist/utils/derive-selection-from-layout.d.ts +9 -0
- package/dist/utils/interpolate.d.ts +3 -0
- package/package.json +84 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { DayPickerProps } from 'react-day-picker';
|
|
3
|
+
import { GroupImperativeHandle } from 'react-resizable-panels';
|
|
4
|
+
import { StoreApi } from 'zustand/vanilla';
|
|
5
|
+
import { Bounds, DateDisabled, DateRange, RangeListItem, Slots } from '../types';
|
|
6
|
+
type UpdaterFunction = (state: RangeFlowState) => void;
|
|
7
|
+
export interface RangeFlowRefs {
|
|
8
|
+
slider: {
|
|
9
|
+
root: RefObject<GroupImperativeHandle | null>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface RangeFlowState {
|
|
13
|
+
range: DateRange;
|
|
14
|
+
ranges: RangeListItem[];
|
|
15
|
+
selected_date: DateRange;
|
|
16
|
+
default_range: DateRange;
|
|
17
|
+
disabled?: DateDisabled;
|
|
18
|
+
duration?: Bounds;
|
|
19
|
+
calendar?: boolean;
|
|
20
|
+
slider: {
|
|
21
|
+
left: number;
|
|
22
|
+
right: number;
|
|
23
|
+
size: number;
|
|
24
|
+
};
|
|
25
|
+
CalendarProps?: DayPickerProps;
|
|
26
|
+
}
|
|
27
|
+
export interface RangeFlowEvents {
|
|
28
|
+
onChange: (date: DateRange) => void;
|
|
29
|
+
}
|
|
30
|
+
export interface RangeFlowActions {
|
|
31
|
+
update: (fn: UpdaterFunction) => void;
|
|
32
|
+
reset: () => void;
|
|
33
|
+
}
|
|
34
|
+
export type RangeFlowStore = StoreApi<RangeFlowState & RangeFlowActions>;
|
|
35
|
+
export declare const createRangeFlowStore: (initialState: RangeFlowState) => RangeFlowStore;
|
|
36
|
+
interface RangeFlowContext {
|
|
37
|
+
refs: RangeFlowRefs;
|
|
38
|
+
store: RangeFlowStore;
|
|
39
|
+
events: RangeFlowEvents;
|
|
40
|
+
slots: Slots;
|
|
41
|
+
}
|
|
42
|
+
export declare const RangeFlowContext: import('react').Context<RangeFlowContext | null>;
|
|
43
|
+
export {};
|
package/dist/entry.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useEmitDateChange(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRangeFlowEvents(): import('../context/root').RangeFlowEvents;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRangeFlowRefs(): import('../context/root').RangeFlowRefs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRangeFlowSlots(): import('../types').Slots;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CalendarIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DoubleChevronLeftIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DoubleChevronRightIcon(): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
ADDED