-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor DateRangeCanlendar to use it as individual component
affects: @medly-components/core
- Loading branch information
Showing
6 changed files
with
56 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 11 additions & 12 deletions
23
packages/core/src/components/DateRangePicker/DateRangeCalendar/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
import { HTMLProps } from '@medly-components/utils'; | ||
import { Placement } from '../../Popover/types'; | ||
import { DateRangeProps } from '../types'; | ||
import { DateRangeProps, FOCUS_ELEMENT } from '../types'; | ||
|
||
export type CalendarAnimationTypes = 'move-out-left' | 'move-out-right' | 'move-in-left' | 'move-in-right'; | ||
|
||
export type Props = { | ||
id: string; | ||
size: 'S' | 'M'; | ||
placement: Placement; | ||
export type Props = Omit<HTMLProps<HTMLDivElement>, 'size'> & { | ||
id?: string; | ||
size?: 'S' | 'M'; | ||
placement?: Placement; | ||
selectedDates: Required<DateRangeProps>['value']; | ||
minSelectableDate: Date; | ||
maxSelectableDate: Date; | ||
withSingleMonth?: boolean; | ||
focusedElement: 'START_DATE' | 'END_DATE'; | ||
onDateSelection: Required<DateRangeProps>['onChange']; | ||
setFocusedElement: React.Dispatch<React.SetStateAction<'START_DATE' | 'END_DATE'>>; | ||
setActive: (val: boolean) => void; | ||
focusElement: (element: 'START_DATE' | `END_DATE`) => void; | ||
minSelectableDate?: Date; | ||
maxSelectableDate?: Date; | ||
withSingleMonth?: boolean; | ||
focusedElement?: FOCUS_ELEMENT; | ||
onFocusChange?: (element: FOCUS_ELEMENT) => void; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters