react-beauty-calendar 1.0.6 → 1.0.8

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 (110) hide show
  1. package/README.md +43 -0
  2. package/dist/{lib/@types → @types}/booking.d.ts +1 -1
  3. package/dist/{lib/@types → @types}/calendar-instance.d.ts +18 -3
  4. package/dist/build/assets/main.css +1 -1
  5. package/dist/build/main.cjs.js +37 -37
  6. package/dist/build/main.es.js +7694 -7440
  7. package/dist/classes/reference-error.d.ts +4 -0
  8. package/dist/{lib/components → components}/ui/Button.d.ts +1 -1
  9. package/dist/constants/booking-view-type.constant.d.ts +6 -0
  10. package/dist/{lib/context → context}/bookingModal/BookingModalProvider.d.ts +2 -1
  11. package/dist/{lib/context → context}/drag/dragStore.d.ts +0 -3
  12. package/dist/context/emptySlotsStore.ts/retrieveSlotKey.d.ts +6 -0
  13. package/dist/{lib/context → context}/emptySlotsStore.ts/useEmptySlotStore.d.ts +1 -1
  14. package/dist/{lib/context → context}/global/days-and-week/day-and-week-store.d.ts +6 -6
  15. package/dist/{lib/context → context}/month-description/month-description-store.d.ts +1 -0
  16. package/dist/{lib/context → context}/new-event/new-event-context.d.ts +1 -1
  17. package/dist/{lib/context → context}/new-event/new-event-store.d.ts +6 -0
  18. package/dist/core/Root.d.ts +3 -0
  19. package/dist/core/booking-card/BookingCard.d.ts +10 -0
  20. package/dist/core/booking-options/BookingInfoContent.d.ts +12 -0
  21. package/dist/{lib/core → core}/booking-options/BookingInfoOptions.d.ts +2 -2
  22. package/dist/{lib/core → core}/card-slots/SlotTrigger.d.ts +1 -1
  23. package/dist/core/header-calendar/HeaderDayActions.d.ts +6 -0
  24. package/dist/core/header-calendar/HeaderTodayAction.d.ts +6 -0
  25. package/dist/{lib/core → core}/slots/CardContent.d.ts +2 -4
  26. package/dist/{lib/core → core}/slots/EventsTab.d.ts +3 -1
  27. package/dist/{lib/core → core}/slots/TimeInfo.d.ts +2 -1
  28. package/dist/hooks/use-calendar-instance.d.ts +3 -0
  29. package/dist/{lib/utils → utils}/date-utils.d.ts +3 -2
  30. package/dist/{lib/utils → utils}/types.d.ts +1 -1
  31. package/package.json +24 -15
  32. package/dist/lib/constants/booking-view-type.constant.d.ts +0 -6
  33. package/dist/lib/core/Root.d.ts +0 -6
  34. package/dist/lib/core/booking-card/BookingCard.d.ts +0 -7
  35. package/dist/lib/hooks/use-calendar-instance.d.ts +0 -7
  36. /package/dist/{lib/@types → @types}/calendar.d.ts +0 -0
  37. /package/dist/{lib/@types → @types}/index.d.ts +0 -0
  38. /package/dist/{lib/@types → @types}/profile.d.ts +0 -0
  39. /package/dist/{lib/@types → @types}/user.d.ts +0 -0
  40. /package/dist/{lib/@types → @types}/working-time.d.ts +0 -0
  41. /package/dist/{lib/components → components}/ui/Dropdown-menu.d.ts +0 -0
  42. /package/dist/{lib/components → components}/ui/Input.d.ts +0 -0
  43. /package/dist/{lib/components → components}/ui/Label.d.ts +0 -0
  44. /package/dist/{lib/components → components}/ui/Popover.d.ts +0 -0
  45. /package/dist/{lib/components → components}/ui/Select.d.ts +0 -0
  46. /package/dist/{lib/components → components}/ui/Separator.d.ts +0 -0
  47. /package/dist/{lib/components → components}/ui/Table.d.ts +0 -0
  48. /package/dist/{lib/components → components}/ui/Tabs.d.ts +0 -0
  49. /package/dist/{lib/components → components}/ui/Toggle.d.ts +0 -0
  50. /package/dist/{lib/components → components}/ui/Tooltip.d.ts +0 -0
  51. /package/dist/{lib/constants → constants}/index.d.ts +0 -0
  52. /package/dist/{lib/constants → constants}/month.constant.d.ts +0 -0
  53. /package/dist/{lib/constants → constants}/payment.constant.d.ts +0 -0
  54. /package/dist/{lib/constants → constants}/side-options.constant.d.ts +0 -0
  55. /package/dist/{lib/constants → constants}/system-colors.constant.d.ts +0 -0
  56. /package/dist/{lib/constants → constants}/url-param.constant.d.ts +0 -0
  57. /package/dist/{lib/context → context}/booking/booking-context.d.ts +0 -0
  58. /package/dist/{lib/context → context}/booking/booking-store.d.ts +0 -0
  59. /package/dist/{lib/context → context}/booking/bookingProvider.d.ts +0 -0
  60. /package/dist/{lib/context → context}/bookingModal/booking-modal-context.d.ts +0 -0
  61. /package/dist/{lib/context → context}/date-and-time/DateAndTimeContext.d.ts +0 -0
  62. /package/dist/{lib/context → context}/emptySlotsStore.ts/emptySlotKey.d.ts +0 -0
  63. /package/dist/{lib/context → context}/global/booking-info/booking-info.d.ts +0 -0
  64. /package/dist/{lib/context → context}/global/slice-global/slice-global-store.d.ts +0 -0
  65. /package/dist/{lib/context → context}/index.d.ts +0 -0
  66. /package/dist/{lib/context → context}/month-description/MonthDescriptionProvider.d.ts +0 -0
  67. /package/dist/{lib/context → context}/month-description/month-description-context.d.ts +0 -0
  68. /package/dist/{lib/core → core}/calendar/CalendarHolder.d.ts +0 -0
  69. /package/dist/{lib/core → core}/calendar/CalendarView.d.ts +0 -0
  70. /package/dist/{lib/core → core}/calendar/HourWithActions.d.ts +0 -0
  71. /package/dist/{lib/core → core}/calendar/ViewTypes.d.ts +0 -0
  72. /package/dist/{lib/core → core}/favorite-booking/FavoriteBooking.d.ts +0 -0
  73. /package/dist/{lib/core → core}/header-calendar/DaysOfWeek.d.ts +0 -0
  74. /package/dist/{lib/core → core}/header-calendar/Header.d.ts +0 -0
  75. /package/dist/{lib/core → core}/header-calendar/HeaderViewType.d.ts +0 -0
  76. /package/dist/{lib/core → core}/header-calendar/SelectItem.d.ts +0 -0
  77. /package/dist/{lib/core → core}/info/Info.d.ts +0 -0
  78. /package/dist/{lib/core → core}/shortcut-commands/ShortcutCommands.d.ts +0 -0
  79. /package/dist/{lib/core → core}/slots/Card.d.ts +0 -0
  80. /package/dist/{lib/core → core}/slots/CardOverlay.d.ts +0 -0
  81. /package/dist/{lib/core → core}/slots/EmptySlot.d.ts +0 -0
  82. /package/dist/{lib/core → core}/slots/Slots.d.ts +0 -0
  83. /package/dist/{lib/core → core}/slots/TabsContent.d.ts +0 -0
  84. /package/dist/{lib/core → core}/slots/actualTimeIndicator/ActualTimeIndicator.d.ts +0 -0
  85. /package/dist/{lib/core → core}/slots/actualTimeIndicator/position-based-on-seconds.d.ts +0 -0
  86. /package/dist/{lib/core → core}/slots/service/ProcedureWithColor.d.ts +0 -0
  87. /package/dist/{lib/core → core}/slots/service/StartAt.d.ts +0 -0
  88. /package/dist/{lib/core → core}/slots/useResizableCardHook.d.ts +0 -0
  89. /package/dist/{lib/core → core}/table-view-type/TableViewType.d.ts +0 -0
  90. /package/dist/{lib/hoc → hoc}/WithTooltip.d.ts +0 -0
  91. /package/dist/{lib/hooks → hooks}/index.d.ts +0 -0
  92. /package/dist/{lib/hooks → hooks}/use-booking-model.d.ts +0 -0
  93. /package/dist/{lib/hooks → hooks}/use-days-selected-view.d.ts +0 -0
  94. /package/dist/{lib/hooks → hooks}/use-global-store.d.ts +0 -0
  95. /package/dist/{lib/hooks → hooks}/use-is-mobile.d.ts +0 -0
  96. /package/dist/{lib/hooks → hooks}/use-month-description.d.ts +0 -0
  97. /package/dist/{lib/hooks → hooks}/use-tanstack-table.d.ts +0 -0
  98. /package/dist/{lib/hooks → hooks}/useBooking.d.ts +0 -0
  99. /package/dist/{lib/hooks → hooks}/useDebounce.d.ts +0 -0
  100. /package/dist/{lib/hooks → hooks}/useEventPrevention.d.ts +0 -0
  101. /package/dist/{lib/hooks → hooks}/useMutation.d.ts +0 -0
  102. /package/dist/{lib/hooks → hooks}/useNewEventStore.d.ts +0 -0
  103. /package/dist/{lib/hooks → hooks}/useQuery.d.ts +0 -0
  104. /package/dist/{lib/hooks → hooks}/useTrottleCallback.d.ts +0 -0
  105. /package/dist/{lib/hooks → hooks}/useUrlParam.d.ts +0 -0
  106. /package/dist/lib/{lib/utils.d.ts → utils.d.ts} +0 -0
  107. /package/dist/{lib/main.d.ts → main.d.ts} +0 -0
  108. /package/dist/{lib/mock → mock}/booking-mock.d.ts +0 -0
  109. /package/dist/{lib/utils → utils}/hours.d.ts +0 -0
  110. /package/dist/{lib/utils → utils}/string.utils.d.ts +0 -0
@@ -0,0 +1,4 @@
1
+ declare class ReferenceErrorCustom extends ReferenceError {
2
+ constructor(message?: string);
3
+ }
4
+ export default ReferenceErrorCustom;
@@ -1,6 +1,6 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  declare const buttonVariants: (props?: ({
3
- variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
3
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
4
4
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
@@ -0,0 +1,6 @@
1
+ export declare const BOOKING_VIEW_TYPE: {
2
+ readonly DAY: "day";
3
+ readonly WEEK: "week";
4
+ readonly TABLE: "table";
5
+ readonly MONTH: "month";
6
+ };
@@ -1,7 +1,8 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
2
  import { BookingViewType, Bookings } from '../../@types/booking';
3
3
  import { RootEventsProps } from '../../@types/calendar-instance';
4
- export interface BookingModalContextProps extends RootEventsProps {
4
+ type BookingModalContextPick = Omit<RootEventsProps, "onChangeViewType">;
5
+ export interface BookingModalContextProps extends BookingModalContextPick {
5
6
  createBookingModal: ReactNode;
6
7
  bookings: Bookings;
7
8
  viewModes: BookingViewType[];
@@ -1,11 +1,8 @@
1
1
  export interface DragProps {
2
2
  isDragging: boolean;
3
- isDelayActive: boolean;
4
3
  }
5
4
  export interface DragState extends DragProps {
6
5
  updateIsDragging: (status: boolean) => void;
7
- updateIsDelayActive: (status: boolean) => void;
8
- onChangeIsDelayActive: () => void;
9
6
  }
10
7
  declare const useDragStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DragState>>;
11
8
  export default useDragStore;
@@ -0,0 +1,6 @@
1
+ interface SlotKeyData {
2
+ date: Date;
3
+ hour: string;
4
+ }
5
+ declare const retrieveSlotKey: (slotKey: string) => SlotKeyData;
6
+ export default retrieveSlotKey;
@@ -7,7 +7,7 @@ export interface EmptySlotStore {
7
7
  }
8
8
  export interface EmptySlotState extends EmptySlotStore {
9
9
  setEmptySlotNode: (node: SlotTriggerForwardRef, slotData: BlockTimeData) => void;
10
- setSelectedNode: (nodeKey: string, closeView?: boolean) => void;
10
+ setSelectedNode: (nodeKey: string) => void;
11
11
  resetSelectedNode: () => void;
12
12
  resetNodes: () => void;
13
13
  }
@@ -1,23 +1,23 @@
1
1
  import { StateCreator } from 'zustand';
2
2
  import { HourWithActionsRef } from '../../../core/calendar/HourWithActions';
3
3
  import { Times } from '../../../utils/hours';
4
+ export type DaysOfWeek = Date[];
4
5
  export interface NextAndPreviousWeek {
5
6
  firstDayOfWeek: Date;
6
7
  lastDayOfWeek: Date;
7
8
  }
8
- export interface DayAndWeekProps extends NextAndPreviousWeek {
9
+ export interface DayAndWeekProps {
9
10
  hours: Times;
10
- selectedDay: string | null;
11
- daysOfWeek: Date[];
11
+ daysOfWeek: DaysOfWeek;
12
12
  timesRendered: Map<string, HourWithActionsRef>;
13
13
  }
14
14
  export interface DayAndWeekState extends DayAndWeekProps {
15
15
  setTodayDay: (date: Date) => Date;
16
16
  setDays: (days: number) => Date[];
17
- todayWeek: (date?: Date) => NextAndPreviousWeek;
17
+ todayWeek: (date?: Date) => DaysOfWeek;
18
18
  getWeek: () => NextAndPreviousWeek;
19
- nextWeek: () => NextAndPreviousWeek;
20
- previousWeek: () => NextAndPreviousWeek;
19
+ nextWeek: () => DaysOfWeek;
20
+ previousWeek: () => DaysOfWeek;
21
21
  addTimesRendered: (element: HourWithActionsRef, hourKey: string) => void;
22
22
  }
23
23
  declare const dayAndWeekStore: StateCreator<DayAndWeekState>;
@@ -10,6 +10,7 @@ export interface MonthDescriptionProps {
10
10
  }
11
11
  export interface MonthDescriptionState extends MonthDescriptionProps {
12
12
  updateMonthMessage: (monthDescriptionProps: Partial<MonthDescriptionProps>) => void;
13
+ updateHeaderDateLabel: (targetDate: Date) => void;
13
14
  }
14
15
  declare const monthDescriptionStore: (initialProps?: Partial<MonthDescriptionState>) => import('zustand').StoreApi<MonthDescriptionState>;
15
16
  export type MonthDescriptionStore = ReturnType<typeof monthDescriptionStore>;
@@ -2,5 +2,5 @@ import { PropsWithChildren } from 'react';
2
2
  import { NewEventFormProps } from './new-event-store';
3
3
  declare const NewEventContext: import('react').Context<import('zustand').StoreApi<import('./new-event-store').NewEventFormState> | null>;
4
4
  type NewEventProviderProps = PropsWithChildren<NewEventFormProps>;
5
- declare const NewEventProvider: ({ children, ...props }: NewEventProviderProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const NewEventProvider: ({ children, ref, ...props }: NewEventProviderProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export { NewEventProvider, NewEventContext };
@@ -1,7 +1,12 @@
1
+ import { Ref } from 'react';
2
+ export interface NewEventFormRef {
3
+ updateFinishAt: (selectedHour: string) => void;
4
+ }
1
5
  export interface NewEventFormProps {
2
6
  date: string;
3
7
  startAt: string;
4
8
  finishAt: string;
9
+ ref?: Ref<NewEventFormRef>;
5
10
  }
6
11
  export interface NewEventFormState extends NewEventFormProps {
7
12
  updateForm: (newEventForm: NewEventFormState) => void;
@@ -9,6 +14,7 @@ export interface NewEventFormState extends NewEventFormProps {
9
14
  updateStartAt: (selectedHour: string) => void;
10
15
  updateFinishAt: (selectedHour: string) => void;
11
16
  updateDate: (dateAsString: string) => void;
17
+ updateFinishAtWithOffset: (time: string, increasingMinutes?: number) => string;
12
18
  resetForm: () => void;
13
19
  }
14
20
  export declare const initialFormState: NewEventFormProps;
@@ -0,0 +1,3 @@
1
+ import { RootProps } from '../@types/calendar-instance';
2
+ declare const Root: ({ viewModes, createBookingModal, onChangeViewType, onCardDropCallback, onDayChange, onHeaderDayClick, onTodayClick, onSlotClick, onModalClose, bookings, ref, }: RootProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Root;
@@ -0,0 +1,10 @@
1
+ import { Booking, BookingDateAndTime } from '../../@types/booking';
2
+ interface BookingCardProps {
3
+ booking: Booking;
4
+ slotData: BookingDateAndTime;
5
+ customClasses?: string;
6
+ heightStyleTransformer?: string;
7
+ onClick?: () => void;
8
+ }
9
+ declare const BookingCard: ({ booking, slotData, onClick, heightStyleTransformer, customClasses, }: BookingCardProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default BookingCard;
@@ -0,0 +1,12 @@
1
+ import { Transform } from '@dnd-kit/utilities';
2
+ import { PropsWithChildren } from 'react';
3
+ import { Side } from './BookingInfoOptions';
4
+ interface BookingInfoContextProps {
5
+ side: Side;
6
+ xAxis: number;
7
+ yAxis: number;
8
+ updatePosition: (transform: Transform | null) => void;
9
+ }
10
+ type BookingInfoContextPropsWithChild = PropsWithChildren<BookingInfoContextProps>;
11
+ declare const BookingInfoContext: ({ side, xAxis, yAxis, updatePosition, children, }: BookingInfoContextPropsWithChild) => import("react/jsx-runtime").JSX.Element;
12
+ export default BookingInfoContext;
@@ -1,10 +1,10 @@
1
- import { Dispatch, PropsWithChildren, SetStateAction } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  import { Booking } from '../../@types/booking';
3
3
  import { SIDE_OPTIONS } from '../../constants';
4
4
  interface BookingInfoOptionsProps {
5
5
  side: Side;
6
6
  booking: Booking;
7
- onOpenChange: Dispatch<SetStateAction<boolean>>;
7
+ onOpenChange: React.Dispatch<React.SetStateAction<boolean>>;
8
8
  isEditingOpen: boolean;
9
9
  }
10
10
  export type Side = (typeof SIDE_OPTIONS)[number];
@@ -15,7 +15,7 @@ interface SlotTriggerProps {
15
15
  ref: Ref<SlotTriggerForwardRef>;
16
16
  }
17
17
  export interface SlotTriggerForwardRef {
18
- showEvent: () => void;
18
+ showEvent: (slotNode: string) => void;
19
19
  closeEvent: () => void;
20
20
  onOpenCloseChange: (status: boolean) => void;
21
21
  }
@@ -0,0 +1,6 @@
1
+ import { ActionType } from './Header';
2
+ interface handleWeekChangeProps {
3
+ handleWeekChange: (actionType: ActionType) => void;
4
+ }
5
+ declare const HeaderDayActions: ({ handleWeekChange }: handleWeekChangeProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default HeaderDayActions;
@@ -0,0 +1,6 @@
1
+ interface HeaderTodayActionProps {
2
+ mobileLayout: boolean;
3
+ onClick: () => void;
4
+ }
5
+ declare const HeaderTodayAction: ({ mobileLayout, onClick, }: HeaderTodayActionProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default HeaderTodayAction;
@@ -1,4 +1,4 @@
1
- import { CSSProperties, Ref, SyntheticEvent } from 'react';
1
+ import { Ref, SyntheticEvent } from 'react';
2
2
  import { Booking } from '../../@types';
3
3
  import { BookingDateAndTime } from '../../@types/booking';
4
4
  import { DraggableAttributes } from '@dnd-kit/core';
@@ -21,8 +21,6 @@ interface CardContentProps {
21
21
  bookingViewType: string;
22
22
  slotData: BookingDateAndTime;
23
23
  heightStyleTransformer: string;
24
- pendingStyle?: React.CSSProperties;
25
- style?: CSSProperties | undefined;
26
24
  listeners?: SyntheticListenerMap | undefined;
27
25
  attributes?: DraggableAttributes;
28
26
  onClick?: () => void;
@@ -35,5 +33,5 @@ interface CardContentProps {
35
33
  ref?: Ref<CardContentForward>;
36
34
  }
37
35
  type CardContentForward = HTMLDivElement;
38
- declare const CardContent: ({ bookingInit, slotData, heightStyleTransformer, onClick, pendingStyle, style, listeners, attributes, customClasses, bookingViewType, resizableParam, events, open, ref, }: CardContentProps) => import("react/jsx-runtime").JSX.Element | null;
36
+ declare const CardContent: ({ bookingInit, slotData, heightStyleTransformer, onClick, customClasses, bookingViewType, resizableParam, events, open, ref, }: CardContentProps) => import("react/jsx-runtime").JSX.Element | null;
39
37
  export default CardContent;
@@ -1,11 +1,13 @@
1
1
  import { JSX, PropsWithChildren } from 'react';
2
2
  import { EmptySlotNodes } from '../../context/emptySlotsStore.ts/useEmptySlotStore';
3
+ import { Side } from '../booking-options/BookingInfoOptions';
3
4
  interface EventTabsProps {
4
5
  emptySlotNodes?: EmptySlotNodes;
6
+ side: Side;
5
7
  buttonTrigger: JSX.Element;
6
8
  onClose: (event: React.MouseEvent) => void;
7
9
  onOpenChange: (status: boolean) => void;
8
10
  }
9
11
  type EventTabsWithChildren = PropsWithChildren<EventTabsProps>;
10
- declare const EventTabs: ({ onClose, onOpenChange, buttonTrigger, }: EventTabsWithChildren) => import("react/jsx-runtime").JSX.Element;
12
+ declare const EventTabs: ({ onClose, side, onOpenChange, buttonTrigger, children, }: EventTabsWithChildren) => import("react/jsx-runtime").JSX.Element;
11
13
  export default EventTabs;
@@ -6,8 +6,9 @@ interface TimeInfoEvents {
6
6
  resetPrevView: () => void;
7
7
  }
8
8
  interface TimeInfoProps {
9
+ isDragging: boolean;
9
10
  slotData: BlocksTimeStructure;
10
11
  events: TimeInfoEvents;
11
12
  }
12
- declare const TimeInfo: ({ slotData, events: { onClick, renderPreviewCard, resetPrevView }, }: TimeInfoProps) => import("react/jsx-runtime").JSX.Element;
13
+ declare const TimeInfo: ({ isDragging, slotData, events: { onClick, renderPreviewCard, resetPrevView }, }: TimeInfoProps) => import("react/jsx-runtime").JSX.Element;
13
14
  export default TimeInfo;
@@ -0,0 +1,3 @@
1
+ import { CalendarInstanceRef, UseBookingInstanceProps } from '../@types/calendar-instance';
2
+ declare const useCalendarInstance: (props: UseBookingInstanceProps) => CalendarInstanceRef;
3
+ export default useCalendarInstance;
@@ -1,10 +1,9 @@
1
+ import { DaysOfWeek, NextAndPreviousWeek } from '../context/global/days-and-week/day-and-week-store';
1
2
  export declare const WEEK_DAYS: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
2
3
  type WeekDays = (typeof WEEK_DAYS)[number];
3
4
  export declare const WEEK_DAYS_FULL_NAME: readonly ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
4
5
  export type DatesData = {
5
6
  week: Date[];
6
- firstDayOfWeek: Date;
7
- lastDayOfWeek: Date;
8
7
  };
9
8
  export declare const DateUtils: {
10
9
  findIndexToStart(date?: Date): number;
@@ -29,5 +28,7 @@ export declare const DateUtils: {
29
28
  addMinutesToHour(startAt: string, interval: number): string;
30
29
  convertStringTimeToDateFormat(timeString: string): Date;
31
30
  isTodayDate(date: Date): boolean;
31
+ firstAndLastWeekDays(week: DaysOfWeek): NextAndPreviousWeek;
32
+ generateWeekMonthLabel(week: DaysOfWeek): string;
32
33
  };
33
34
  export {};
@@ -1,7 +1,7 @@
1
1
  import { JSX, Ref } from 'react';
2
- import { CalendarInstanceRef } from '../../src/App';
3
2
  import { Booking, ViewModes } from '../@types';
4
3
  import { BookingDateAndTime, BookingViewType } from '../@types/booking';
4
+ import { CalendarInstanceRef } from '../@types/calendar-instance';
5
5
  import { ActionType } from '../core/header-calendar/Header';
6
6
  import { BlockTimeData } from '../core/slots/EmptySlot';
7
7
  export type UseBookingInstanceProps = RootProps;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "license": "MIT",
13
13
  "private": false,
14
- "version": "1.0.6",
14
+ "version": "1.0.8",
15
15
  "keywords": [
16
16
  "react",
17
17
  "component",
@@ -28,8 +28,13 @@
28
28
  "dist",
29
29
  "README.md"
30
30
  ],
31
+ "exports": {
32
+ ".": {
33
+ "import": "./dist/build/main.es.js",
34
+ "require": "./dist/build/main.cjs.js"
35
+ }
36
+ },
31
37
  "scripts": {
32
- "dev": "vite",
33
38
  "biome": "npx biome ci .",
34
39
  "preview": "vite preview",
35
40
  "prepare": "husky",
@@ -37,21 +42,14 @@
37
42
  "storybook": "storybook dev -p 6006",
38
43
  "build-storybook": "storybook build",
39
44
  "prepublish": "rm -rf ./dist && npm run build",
40
- "test": ""
45
+ "test": "",
46
+ "build:watch": "vite build --watch",
47
+ "dev": "vite",
48
+ "dev:c": "concurrently \"npm run build:watch\" \"cd ../appointment-react && npm run dev\""
41
49
  },
42
50
  "dependencies": {
43
51
  "@dnd-kit/core": "^6.3.1",
44
52
  "@dnd-kit/modifiers": "^9.0.0",
45
- "@radix-ui/react-dropdown-menu": "^2.1.6",
46
- "@radix-ui/react-icons": "^1.3.2",
47
- "@radix-ui/react-label": "^2.1.2",
48
- "@radix-ui/react-popover": "^1.1.6",
49
- "@radix-ui/react-select": "^2.1.6",
50
- "@radix-ui/react-separator": "^1.1.2",
51
- "@radix-ui/react-slot": "^1.1.2",
52
- "@radix-ui/react-tabs": "^1.1.3",
53
- "@radix-ui/react-toggle": "^1.1.2",
54
- "@radix-ui/react-tooltip": "^1.1.8",
55
53
  "@tailwindcss/vite": "^4.0.15",
56
54
  "@tanstack/react-query": "^5.69.0",
57
55
  "@tanstack/react-table": "^8.21.2",
@@ -60,7 +58,6 @@
60
58
  "cmdk": "^1.1.1",
61
59
  "date-fns": "^4.1.0",
62
60
  "dayjs": "^1.11.13",
63
- "lucide-react": "^0.483.0",
64
61
  "react-resizable": "^3.0.5",
65
62
  "react-router": "^7.4.0",
66
63
  "tailwindcss": "^4.0.15",
@@ -92,6 +89,7 @@
92
89
  "@vitest/browser": "^3.0.9",
93
90
  "@vitest/coverage-v8": "^3.0.9",
94
91
  "chromatic": "^11.27.0",
92
+ "concurrently": "^9.1.2",
95
93
  "eslint": "^9.21.0",
96
94
  "eslint-plugin-react-hooks": "^5.1.0",
97
95
  "eslint-plugin-react-refresh": "^0.4.19",
@@ -107,7 +105,17 @@
107
105
  "typescript-eslint": "^8.24.1",
108
106
  "vite": "^6.2.0",
109
107
  "vite-plugin-dts": "^4.5.3",
110
- "vitest": "^3.0.9"
108
+ "vitest": "^3.0.9",
109
+ "@radix-ui/react-dropdown-menu": "^2.1.6",
110
+ "@radix-ui/react-icons": "^1.3.2",
111
+ "@radix-ui/react-label": "^2.1.2",
112
+ "@radix-ui/react-popover": "^1.1.6",
113
+ "@radix-ui/react-select": "^2.1.6",
114
+ "@radix-ui/react-separator": "^1.1.2",
115
+ "@radix-ui/react-slot": "^1.1.2",
116
+ "@radix-ui/react-tabs": "^1.1.3",
117
+ "@radix-ui/react-toggle": "^1.1.2",
118
+ "@radix-ui/react-tooltip": "^1.1.8"
111
119
  },
112
120
  "eslintConfig": {
113
121
  "extends": [
@@ -118,6 +126,7 @@
118
126
  "**/*.css"
119
127
  ],
120
128
  "peerDependencies": {
129
+ "lucide-react": "^0.483.0",
121
130
  "react": ">=18.0.0 <20.0.0",
122
131
  "react-dom": ">=18.0.0 <20.0.0"
123
132
  }
@@ -1,6 +0,0 @@
1
- export declare const BOOKING_VIEW_TYPE: {
2
- readonly DAY: "DAY";
3
- readonly WEEK: "WEEK";
4
- readonly TABLE: "TABLE";
5
- readonly MONTH: "MONTH";
6
- };
@@ -1,6 +0,0 @@
1
- import { RootProps } from '../@types/calendar-instance';
2
- export interface CalendarInstanceRef {
3
- getStatus: () => boolean;
4
- }
5
- declare const Root: ({ viewModes, createBookingModal, onChangeViewType, onCardDropCallback, onDayChange, onTodayClick, onSlotClick, onModalClose, bookings, ref, }: RootProps) => import("react/jsx-runtime").JSX.Element;
6
- export default Root;
@@ -1,7 +0,0 @@
1
- import { Booking, BookingDateAndTime } from '../../@types/booking';
2
- interface BookingCardProps {
3
- booking: Booking;
4
- slotData: BookingDateAndTime;
5
- }
6
- declare const BookingCard: ({ booking, slotData }: BookingCardProps) => import("react/jsx-runtime").JSX.Element;
7
- export default BookingCard;
@@ -1,7 +0,0 @@
1
- import { JSX } from 'react';
2
- import { UseBookingInstanceProps } from '../@types/calendar-instance';
3
- interface BookingInstance {
4
- getCalendar: () => JSX.Element;
5
- }
6
- declare const useCalendarInstance: (props: UseBookingInstanceProps) => BookingInstance;
7
- export default useCalendarInstance;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes