@7shifts/sous-chef 2.8.2 → 2.10.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.
@@ -0,0 +1,23 @@
1
+ import React, { MutableRefObject } from 'react';
2
+ import '../../forms/DatePickerCalendar/date-picker-calendar.scss';
3
+ import 'react-day-picker/lib/style.css';
4
+ import { BlockedDays, WeekStart } from '../../utils/date';
5
+ import { CalendarMode, CalendarPlacement } from './types';
6
+ declare type Props = {
7
+ mode?: CalendarMode;
8
+ /** Note that if the calendar is not able to fit in the selected position,
9
+ * it will override this selection and select the one that fits in the window. */
10
+ position?: CalendarPlacement;
11
+ weekStart?: WeekStart;
12
+ selected?: Date;
13
+ onSelect: (selected: Date) => void;
14
+ onClickOutside: () => void;
15
+ /** It disable some dates so the user can't click on them. Refer to this
16
+ * [doc](https://react-day-picker-v7.netlify.app/api/DayPicker#disabledDays) to see what
17
+ * values you can use. */
18
+ disabledDays?: BlockedDays;
19
+ anchorRef: MutableRefObject<HTMLElement | null>;
20
+ };
21
+ /**Calendar overlay component*/
22
+ declare const Calendar: React.FC<Props>;
23
+ export default Calendar;
@@ -0,0 +1,8 @@
1
+ export declare const CALENDAR_MODE: {
2
+ DAY: "day";
3
+ WEEK: "week";
4
+ };
5
+ export declare const CALENDAR_PLACEMENT: {
6
+ BOTTOM: "bottom";
7
+ TOP: "top";
8
+ };
@@ -0,0 +1,7 @@
1
+ import { CalendarPlacement } from './types';
2
+ declare type Position = {
3
+ left: number;
4
+ top: number;
5
+ };
6
+ export declare const calculateCalendarPosition: (placement: CalendarPlacement, anchorPosition: DOMRect, calendarDimensions?: DOMRect | undefined) => Position;
7
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './Calendar';
@@ -0,0 +1,2 @@
1
+ export declare type CalendarPlacement = 'top' | 'bottom';
2
+ export declare type CalendarMode = 'day' | 'week';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  declare type Props = {
3
- onClick: () => void;
3
+ onClick: (e: React.MouseEvent | React.KeyboardEvent) => void;
4
4
  children: React.ReactNode;
5
5
  };
6
6
  declare const MenuItem: React.FC<Props>;
@@ -2,4 +2,5 @@ import Tooltip from './Tooltip';
2
2
  import Modal from './Modal';
3
3
  import ModalBody from './Modal/ModalBody';
4
4
  import ModalFooter from './Modal/ModalFooter';
5
- export { Tooltip, Modal, ModalBody, ModalFooter };
5
+ import Calendar from './Calendar/Calendar';
6
+ export { Tooltip, Modal, ModalBody, ModalFooter, Calendar };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7shifts/sous-chef",
3
- "version": "2.8.2",
3
+ "version": "2.10.0",
4
4
  "description": "7shifts component library",
5
5
  "author": "7shifts",
6
6
  "license": "MIT",