react-beauty-calendar 1.0.8 → 1.2.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.
Files changed (41) hide show
  1. package/dist/@types/calendar-instance.d.ts +10 -3
  2. package/dist/build/assets/main.css +1 -1
  3. package/dist/build/main.cjs.js +46 -37
  4. package/dist/build/main.es.js +7592 -7113
  5. package/dist/components/ui/Badge.d.ts +9 -0
  6. package/dist/components/ui/Button.d.ts +1 -1
  7. package/dist/context/drag/dragStore.d.ts +4 -4
  8. package/dist/context/drag/useDragStateAtStore.d.ts +8 -0
  9. package/dist/context/global/config/ConfigProvider.d.ts +5 -0
  10. package/dist/context/global/config/config-context.d.ts +2 -0
  11. package/dist/context/global/config/config-store.d.ts +13 -0
  12. package/dist/context/global/days-and-week/day-and-week-store.d.ts +2 -0
  13. package/dist/context/index.d.ts +3 -1
  14. package/dist/context/new-event/new-event-store.d.ts +2 -0
  15. package/dist/core/Root.d.ts +1 -1
  16. package/dist/core/booking-card/BookingCard.d.ts +9 -2
  17. package/dist/core/booking-create/BookingCreate.d.ts +17 -0
  18. package/dist/core/calendar/CalendarHolder.d.ts +4 -1
  19. package/dist/core/calendar/HourWithActions.d.ts +0 -1
  20. package/dist/core/calendar/ViewTypes.d.ts +3 -5
  21. package/dist/core/card-slots/SlotTrigger.d.ts +1 -2
  22. package/dist/core/header-calendar/HeaderTodayAction.d.ts +1 -2
  23. package/dist/core/slots/Card.d.ts +5 -3
  24. package/dist/core/slots/CardBlockContent.d.ts +8 -0
  25. package/dist/core/slots/CardContent.d.ts +9 -2
  26. package/dist/core/slots/CardOverlay.d.ts +1 -1
  27. package/dist/core/slots/EventsTab.d.ts +4 -5
  28. package/dist/core/slots/SlotRender.d.ts +14 -0
  29. package/dist/core/slots/Slots.d.ts +2 -3
  30. package/dist/core/slots/TimeInfo.d.ts +6 -1
  31. package/dist/core/slots/actualTimeIndicator/ActualTimeIndicator.d.ts +2 -2
  32. package/dist/core/slots/actualTimeIndicator/FirstDaySlot.d.ts +6 -0
  33. package/dist/core/slots/actualTimeIndicator/position-based-on-seconds.d.ts +1 -3
  34. package/dist/core/slots/innerCardHandle/inner-card-handle.d.ts +5 -0
  35. package/dist/core/slots/useResizableCardHook.d.ts +4 -0
  36. package/dist/hooks/use-booking-model.d.ts +1 -1
  37. package/dist/hooks/useGlobalConfig.d.ts +3 -0
  38. package/dist/mock/booking-mock.d.ts +2 -1
  39. package/dist/utils/date-utils.d.ts +4 -0
  40. package/dist/utils/hours.d.ts +1 -1
  41. package/package.json +14 -13
@@ -0,0 +1,9 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import type * as React from "react";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
+ }
8
+ declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
9
+ export { Badge, badgeVariants };
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  declare const buttonVariants: (props?: ({
3
3
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
4
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
4
+ size?: "default" | "icon" | "sm" | "lg" | 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> & {
7
7
  asChild?: boolean;
@@ -1,8 +1,8 @@
1
- export interface DragProps {
1
+ export interface DragStoreProps {
2
2
  isDragging: boolean;
3
3
  }
4
- export interface DragState extends DragProps {
5
- updateIsDragging: (status: boolean) => void;
4
+ export interface DragStoreState extends DragStoreProps {
5
+ updateIsDragging: (isDragging: boolean) => void;
6
6
  }
7
- declare const useDragStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DragState>>;
7
+ declare const useDragStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DragStoreState>>;
8
8
  export default useDragStore;
@@ -0,0 +1,8 @@
1
+ export interface DragProps {
2
+ startAt: string;
3
+ }
4
+ export interface DragState extends DragProps {
5
+ updateStartAt: (startAt: string) => void;
6
+ }
7
+ declare const useDragStartAtStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DragState>>;
8
+ export default useDragStartAtStore;
@@ -0,0 +1,5 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { ConfigStoreProps } from './config-store';
3
+ type ConfigProviderProps = PropsWithChildren<ConfigStoreProps>;
4
+ declare const ConfigProvider: ({ children, ...props }: ConfigProviderProps) => import("react/jsx-runtime").JSX.Element;
5
+ export { ConfigProvider };
@@ -0,0 +1,2 @@
1
+ declare const ConfigContext: import('react').Context<import('zustand').StoreApi<import('./config-store').ConfigStoreState> | null>;
2
+ export default ConfigContext;
@@ -0,0 +1,13 @@
1
+ export type SystemColor = "#1700af" | "#b50000" | "#000000";
2
+ export declare const initialConfigState: ConfigStoreProps;
3
+ export interface ConfigStoreProps {
4
+ systemColor?: SystemColor;
5
+ isTimeInfoVisible?: boolean;
6
+ }
7
+ export interface ConfigStoreState extends ConfigStoreProps {
8
+ updateSystemColor: (systemColor: SystemColor) => void;
9
+ changeTimeInfoVisibility: (status: boolean) => void;
10
+ }
11
+ declare const configStore: (initialProps?: Partial<ConfigStoreState>) => import('zustand').StoreApi<ConfigStoreState>;
12
+ export type ConfigStore = ReturnType<typeof configStore>;
13
+ export { configStore };
@@ -1,6 +1,8 @@
1
1
  import { StateCreator } from 'zustand';
2
2
  import { HourWithActionsRef } from '../../../core/calendar/HourWithActions';
3
3
  import { Times } from '../../../utils/hours';
4
+ export declare const START_TIME = 1;
5
+ export declare const END_24_HOUR_FORMAT = 24;
4
6
  export type DaysOfWeek = Date[];
5
7
  export interface NextAndPreviousWeek {
6
8
  firstDayOfWeek: Date;
@@ -1,4 +1,6 @@
1
1
  import { default as BookingProvider } from './booking/bookingProvider';
2
2
  import { default as BookingModalProvider } from './bookingModal/BookingModalProvider';
3
+ import { ConfigProvider } from './global/config/ConfigProvider';
3
4
  import { default as MonthDescriptionProvider } from './month-description/MonthDescriptionProvider';
4
- export { MonthDescriptionProvider, BookingModalProvider, BookingProvider };
5
+ import { NewEventProvider } from './new-event/new-event-context';
6
+ export { MonthDescriptionProvider, BookingModalProvider, BookingProvider, NewEventProvider, ConfigProvider, };
@@ -6,6 +6,7 @@ export interface NewEventFormProps {
6
6
  date: string;
7
7
  startAt: string;
8
8
  finishAt: string;
9
+ slotStartAt: string;
9
10
  ref?: Ref<NewEventFormRef>;
10
11
  }
11
12
  export interface NewEventFormState extends NewEventFormProps {
@@ -16,6 +17,7 @@ export interface NewEventFormState extends NewEventFormProps {
16
17
  updateDate: (dateAsString: string) => void;
17
18
  updateFinishAtWithOffset: (time: string, increasingMinutes?: number) => string;
18
19
  resetForm: () => void;
20
+ updatePrevStartAt: (slotStartAt: string) => void;
19
21
  }
20
22
  export declare const initialFormState: NewEventFormProps;
21
23
  export type NewEventStore = ReturnType<typeof newEventFormStore>;
@@ -1,3 +1,3 @@
1
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;
2
+ declare const Root: ({ viewModes, createBookingModal, onChangeViewType, onCardDropCallback, onCardResizeEnd, onDayChange, onHeaderDayClick, onTodayClick, onSlotClick, onModalClose, bookings, isTimeInfoVisible, systemColor, ref, }: RootProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Root;
@@ -1,10 +1,17 @@
1
+ import { Ref } from 'react';
1
2
  import { Booking, BookingDateAndTime } from '../../@types/booking';
3
+ export interface BookingCardRef {
4
+ changeCurrentCardResize: () => void;
5
+ }
2
6
  interface BookingCardProps {
3
7
  booking: Booking;
4
8
  slotData: BookingDateAndTime;
5
9
  customClasses?: string;
6
- heightStyleTransformer?: string;
10
+ heightStyle: number;
11
+ layerCount?: number;
12
+ half?: boolean;
7
13
  onClick?: () => void;
14
+ ref?: Ref<BookingCardRef>;
8
15
  }
9
- declare const BookingCard: ({ booking, slotData, onClick, heightStyleTransformer, customClasses, }: BookingCardProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const BookingCard: ({ booking, slotData, onClick, heightStyle, customClasses, ref, }: BookingCardProps) => import("react/jsx-runtime").JSX.Element;
10
17
  export default BookingCard;
@@ -0,0 +1,17 @@
1
+ import { JSX, Ref } from 'react';
2
+ import { Side } from '../booking-options/BookingInfoOptions';
3
+ interface BookingCreateProps {
4
+ modal?: boolean;
5
+ side?: Side;
6
+ buttonTrigger?: JSX.Element;
7
+ onClose?: () => void;
8
+ onOpenChange?: (status: boolean) => void;
9
+ ref: Ref<BookingCreateRef>;
10
+ }
11
+ export interface BookingCreateRef {
12
+ showCreationModal: () => void;
13
+ closeModal: () => void;
14
+ isModalOpen: () => boolean;
15
+ }
16
+ declare const BookingCreate: ({ modal, side, onClose, onOpenChange, buttonTrigger, ref, }: BookingCreateProps) => import("react/jsx-runtime").JSX.Element;
17
+ export default BookingCreate;
@@ -1,2 +1,5 @@
1
- declare const CalendarHolder: () => import("react/jsx-runtime").JSX.Element;
1
+ interface CalendarHolderProps {
2
+ isLoading: boolean;
3
+ }
4
+ declare const CalendarHolder: ({ isLoading }: CalendarHolderProps) => import("react/jsx-runtime").JSX.Element;
2
5
  export default CalendarHolder;
@@ -4,7 +4,6 @@ export interface HourWithActionsProps {
4
4
  ref: Ref<HourWithActionsRef>;
5
5
  }
6
6
  export interface HourWithActionsRef {
7
- setDisabledHour: () => void;
8
7
  setActivateHour: () => void;
9
8
  }
10
9
  declare const HourWithActions: ({ hour, ref }: HourWithActionsProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,4 @@
1
- import { BookingViewType } from '../../@types/booking';
2
- interface HandleViewTypeProps {
3
- bookingViewType: BookingViewType;
4
- }
5
- declare const HandleViewType: ({ bookingViewType }: HandleViewTypeProps) => import("react/jsx-runtime").JSX.Element | null;
1
+ import { PropsWithChildren } from 'react';
2
+ type HandleViewTypePropsWithChildren = PropsWithChildren;
3
+ declare const HandleViewType: ({ children }: HandleViewTypePropsWithChildren) => import('react').ReactNode;
6
4
  export default HandleViewType;
@@ -9,7 +9,6 @@ interface SlotTriggerProps {
9
9
  slotPosition: TimesBlock;
10
10
  disabledCss: string;
11
11
  events: SlotEvents;
12
- border?: boolean;
13
12
  children?: ReactNode;
14
13
  actualTimerIndicatorChildren?: ReactNode;
15
14
  ref: Ref<SlotTriggerForwardRef>;
@@ -19,5 +18,5 @@ export interface SlotTriggerForwardRef {
19
18
  closeEvent: () => void;
20
19
  onOpenCloseChange: (status: boolean) => void;
21
20
  }
22
- declare const SlotTrigger: ({ slotData, slotPosition, disabledCss, events, border, actualTimerIndicatorChildren, children, ref, }: SlotTriggerProps) => import("react/jsx-runtime").JSX.Element;
21
+ declare const SlotTrigger: ({ slotData, slotPosition, disabledCss, events, actualTimerIndicatorChildren, children, ref, }: SlotTriggerProps) => import("react/jsx-runtime").JSX.Element;
23
22
  export default SlotTrigger;
@@ -1,6 +1,5 @@
1
1
  interface HeaderTodayActionProps {
2
- mobileLayout: boolean;
3
2
  onClick: () => void;
4
3
  }
5
- declare const HeaderTodayAction: ({ mobileLayout, onClick, }: HeaderTodayActionProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const HeaderTodayAction: ({ onClick }: HeaderTodayActionProps) => import("react/jsx-runtime").JSX.Element;
6
5
  export default HeaderTodayAction;
@@ -3,12 +3,14 @@ import { Booking, BookingDateAndTime } from '../../@types/booking';
3
3
  interface CardProps {
4
4
  booking: Booking;
5
5
  slotData: BookingDateAndTime;
6
+ lastCard?: boolean;
7
+ half?: boolean;
8
+ cardsQuantity?: number;
9
+ cardIndex?: number;
6
10
  ref?: Ref<CardRef>;
7
11
  }
8
- export declare const INITIAL_HEIGHT = 600;
9
- export declare const MIN_DIFF_TIME_THRESHOLD = 15;
10
12
  export interface CardRef {
11
13
  bookingId: string;
12
14
  }
13
- declare const Card: ({ booking, slotData, ref }: CardProps) => import("react/jsx-runtime").JSX.Element;
15
+ declare const Card: ({ booking, slotData, cardsQuantity, cardIndex, lastCard, half, ref, }: CardProps) => import("react/jsx-runtime").JSX.Element;
14
16
  export default Card;
@@ -0,0 +1,8 @@
1
+ import { Booking, BookingDateAndTime } from '../../@types';
2
+ interface CardBlockContentProps {
3
+ bookings?: Booking[];
4
+ blockTimeString: string;
5
+ slotData?: BookingDateAndTime;
6
+ }
7
+ declare const CardBlockContent: ({ bookings, blockTimeString, slotData, }: CardBlockContentProps) => import("react/jsx-runtime").JSX.Element | null | undefined;
8
+ export default CardBlockContent;
@@ -4,6 +4,7 @@ import { BookingDateAndTime } from '../../@types/booking';
4
4
  import { DraggableAttributes } from '@dnd-kit/core';
5
5
  import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
6
6
  import { ResizeCallbackData, ResizeHandle } from 'react-resizable';
7
+ import { BookingCardRef } from '../booking-card/BookingCard';
7
8
  interface ResizableState {
8
9
  height: number;
9
10
  width: number;
@@ -20,18 +21,24 @@ interface CardContentProps {
20
21
  bookingInit: Booking;
21
22
  bookingViewType: string;
22
23
  slotData: BookingDateAndTime;
23
- heightStyleTransformer: string;
24
+ heightStyle: number;
25
+ topHeightIncrement?: number;
24
26
  listeners?: SyntheticListenerMap | undefined;
25
27
  attributes?: DraggableAttributes;
26
28
  onClick?: () => void;
27
29
  customClasses?: string;
28
30
  open?: boolean;
31
+ lastCard?: boolean;
32
+ half?: boolean;
33
+ cardsQuantity?: number;
34
+ cardIndex?: number;
29
35
  resizableParam?: ResizableParam;
30
36
  events?: {
31
37
  onUnmount: () => void;
32
38
  };
39
+ cardContentRef?: Ref<BookingCardRef>;
33
40
  ref?: Ref<CardContentForward>;
34
41
  }
35
42
  type CardContentForward = HTMLDivElement;
36
- declare const CardContent: ({ bookingInit, slotData, heightStyleTransformer, onClick, customClasses, bookingViewType, resizableParam, events, open, ref, }: CardContentProps) => import("react/jsx-runtime").JSX.Element | null;
43
+ declare const CardContent: ({ bookingInit, slotData, heightStyle, topHeightIncrement, onClick, customClasses, bookingViewType, resizableParam, events, open, lastCard, half, cardContentRef: dataRef, cardsQuantity, cardIndex, ref, }: CardContentProps) => import("react/jsx-runtime").JSX.Element | null;
37
44
  export default CardContent;
@@ -3,7 +3,7 @@ import { BookingDateAndTime } from '../../@types/booking';
3
3
  interface CardOverlayProps {
4
4
  bookingInit: Booking;
5
5
  slotData: BookingDateAndTime;
6
- heightStyle: string;
6
+ heightStyle: number;
7
7
  }
8
8
  declare const CardOverlay: ({ bookingInit, slotData, heightStyle, }: CardOverlayProps) => import("react/jsx-runtime").JSX.Element;
9
9
  export default CardOverlay;
@@ -1,13 +1,12 @@
1
1
  import { JSX, PropsWithChildren } from 'react';
2
- import { EmptySlotNodes } from '../../context/emptySlotsStore.ts/useEmptySlotStore';
3
2
  import { Side } from '../booking-options/BookingInfoOptions';
4
3
  interface EventTabsProps {
5
- emptySlotNodes?: EmptySlotNodes;
6
- side: Side;
7
- buttonTrigger: JSX.Element;
4
+ side?: Side;
5
+ buttonTrigger?: JSX.Element;
6
+ modal?: boolean;
8
7
  onClose: (event: React.MouseEvent) => void;
9
8
  onOpenChange: (status: boolean) => void;
10
9
  }
11
10
  type EventTabsWithChildren = PropsWithChildren<EventTabsProps>;
12
- declare const EventTabs: ({ onClose, side, onOpenChange, buttonTrigger, children, }: EventTabsWithChildren) => import("react/jsx-runtime").JSX.Element;
11
+ declare const EventTabs: ({ onClose, side, onOpenChange, buttonTrigger, modal, children, }: EventTabsWithChildren) => import("react/jsx-runtime").JSX.Element;
13
12
  export default EventTabs;
@@ -0,0 +1,14 @@
1
+ import { Booking, BookingDateAndTime } from '../../@types/booking';
2
+ import { BlocksTimeStructure } from './EmptySlot';
3
+ interface SlotRenderProps {
4
+ firstDay: boolean;
5
+ booking: Booking[];
6
+ dayHour: BookingDateAndTime;
7
+ disabledCss: string;
8
+ firstBlockTimeData: BlocksTimeStructure;
9
+ secondBlockTimeData: BlocksTimeStructure;
10
+ thirdBlockTimeData: BlocksTimeStructure;
11
+ fourthBlockTimeData: BlocksTimeStructure;
12
+ }
13
+ declare const SlotRender: import('react').MemoExoticComponent<({ firstDay, booking, dayHour, disabledCss, firstBlockTimeData, secondBlockTimeData, thirdBlockTimeData, fourthBlockTimeData, }: SlotRenderProps) => import("react/jsx-runtime").JSX.Element>;
14
+ export default SlotRender;
@@ -1,4 +1,4 @@
1
- import { Booking, BookingDateAndTime, BookingViewType } from '../../@types/booking';
1
+ import { Booking, BookingDateAndTime } from '../../@types/booking';
2
2
  export type TimesBlock = "first" | "second" | "third" | "fourth";
3
3
  interface SlotsProps {
4
4
  dayHour: BookingDateAndTime;
@@ -7,8 +7,7 @@ interface SlotsProps {
7
7
  finishAt: string;
8
8
  };
9
9
  firstDay: boolean;
10
- bookingViewType: BookingViewType;
11
10
  bookingBulk: Booking[];
12
11
  }
13
- declare const Slots: ({ dayHour, lunchTimeBlock, firstDay, bookingBulk, bookingViewType, }: SlotsProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const Slots: ({ dayHour, lunchTimeBlock, firstDay, bookingBulk, }: SlotsProps) => import("react/jsx-runtime").JSX.Element;
14
13
  export default Slots;
@@ -5,10 +5,15 @@ interface TimeInfoEvents {
5
5
  openOptions: () => void;
6
6
  resetPrevView: () => void;
7
7
  }
8
+ export interface TimeInfoRef {
9
+ show: () => void;
10
+ hide: () => void;
11
+ changeIsOpen: (isOpen: boolean) => void;
12
+ }
8
13
  interface TimeInfoProps {
9
14
  isDragging: boolean;
10
15
  slotData: BlocksTimeStructure;
11
16
  events: TimeInfoEvents;
12
17
  }
13
- declare const TimeInfo: ({ isDragging, slotData, events: { onClick, renderPreviewCard, resetPrevView }, }: TimeInfoProps) => import("react/jsx-runtime").JSX.Element;
18
+ declare const TimeInfo: import('react').ForwardRefExoticComponent<TimeInfoProps & import('react').RefAttributes<TimeInfoRef>>;
14
19
  export default TimeInfo;
@@ -1,8 +1,8 @@
1
1
  import { BlocksTimeStructure } from '../EmptySlot';
2
2
  interface ActualTimerIndicatorProps {
3
- tailwindColor: string;
3
+ color?: string;
4
4
  isFirstDay: boolean;
5
5
  slotData: BlocksTimeStructure;
6
6
  }
7
- export declare const ActualTimerIndicator: ({ tailwindColor, isFirstDay, slotData, }: ActualTimerIndicatorProps) => import("react/jsx-runtime").JSX.Element | undefined;
7
+ export declare const ActualTimerIndicator: ({ color, isFirstDay, slotData, }: ActualTimerIndicatorProps) => import("react/jsx-runtime").JSX.Element | undefined;
8
8
  export default ActualTimerIndicator;
@@ -0,0 +1,6 @@
1
+ interface FirstDaySlotProps {
2
+ dateToRender: string;
3
+ isFirstDay: boolean;
4
+ }
5
+ declare const FirstDaySlot: ({ dateToRender, isFirstDay }: FirstDaySlotProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default FirstDaySlot;
@@ -1,7 +1,5 @@
1
- import { HourWithActionsRef } from '../../calendar/HourWithActions';
2
1
  declare class TimeIndicatorPosition {
3
- positionBasedOnSeconds: (slotDataTime: string, dateToRender: string, timesRendered: Map<string, HourWithActionsRef>) => number;
4
- toggleTimeVisibility: (slotDataTime: string, dateToRenderHour: string, minutes: number, timesRendered: Map<string, HourWithActionsRef>) => void;
2
+ positionBasedOnSeconds: (dateToRender: string) => number;
5
3
  normalizingMinutes: (minutes: number) => number;
6
4
  isInitialMinute: (minutes: number) => boolean;
7
5
  isSameHour: (dateToRenderHour: string, slotDataTime: string) => boolean;
@@ -0,0 +1,5 @@
1
+ import { Booking } from '../../../@types';
2
+ declare const InnerCardsHandle: {
3
+ calculateOverlappingBookings: (currentBooking: Booking, allBookings: Booking[]) => number;
4
+ };
5
+ export { InnerCardsHandle };
@@ -8,6 +8,9 @@ interface useResizableCardHookProps {
8
8
  onSubTime?: (datetime: Date) => void;
9
9
  starter?: boolean;
10
10
  }
11
+ export declare const INITIAL_SIZE = 600;
12
+ export declare const MIN_DIFF_TIME_THRESHOLD = 15;
13
+ export declare const BASE_VALUE: number;
11
14
  declare const useResizableCardHook: ({ booking, onAddTime, onAddStartTime, onSubTime, starter, }: useResizableCardHookProps) => {
12
15
  state: {
13
16
  height: number;
@@ -20,6 +23,7 @@ declare const useResizableCardHook: ({ booking, onAddTime, onAddStartTime, onSub
20
23
  resetState: () => void;
21
24
  resetHeightStyle: () => void;
22
25
  heightStyle: number;
26
+ topHeightIncrement: number;
23
27
  onResize: (event: SyntheticEvent, { size, handle }: ResizeCallbackData) => void;
24
28
  updateHeightStyle: (finishMock: Date, startMock: Date) => void;
25
29
  };
@@ -1,2 +1,2 @@
1
- export declare const useBookingModal: () => import('../context/bookingModal/BookingModalProvider').BookingModalContextProps;
1
+ declare const useBookingModal: () => import('../context/bookingModal/BookingModalProvider').BookingModalContextProps;
2
2
  export default useBookingModal;
@@ -0,0 +1,3 @@
1
+ import { ConfigStoreState } from '../context/global/config/config-store';
2
+ declare const useGlobalConfig: <T>(selector: (state: ConfigStoreState) => T) => T;
3
+ export default useGlobalConfig;
@@ -1,4 +1,5 @@
1
1
  import { Booking, User } from '../@types';
2
2
  declare const mockUser: User;
3
3
  declare const mockBooking: Booking[];
4
- export { mockBooking, mockUser };
4
+ declare const nextWeekBookingMock: Booking[];
5
+ export { mockBooking, nextWeekBookingMock, mockUser };
@@ -1,3 +1,4 @@
1
+ import { Booking } from '../@types';
1
2
  import { DaysOfWeek, NextAndPreviousWeek } from '../context/global/days-and-week/day-and-week-store';
2
3
  export declare const WEEK_DAYS: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
3
4
  type WeekDays = (typeof WEEK_DAYS)[number];
@@ -13,6 +14,9 @@ export declare const DateUtils: {
13
14
  addDay(currentDate: Date, numberOfDays: number): Date;
14
15
  formatDate(time: string): string;
15
16
  dateTimeAsString(date: Date): string;
17
+ getTimeDiff(startTime: Date, endTime: Date): string;
18
+ bookingTimeRange: (booking: Booking, overId: string) => Booking;
19
+ getNewFinishAt(newStartAt: string, timeString: string): Date;
16
20
  minuteDifference(date1: Date, date2: Date): number;
17
21
  dateAndHourDateToString(date: Date): string;
18
22
  shortMonthDescription(...month: Date[]): string;
@@ -1,5 +1,5 @@
1
1
  export type Times = string[];
2
- declare const generateTimes: (start: string, end: string, interval: number) => Times;
2
+ declare const generateTimes: (start: number, end: number) => Times;
3
3
  interface WorkingTimesSlots {
4
4
  time: string;
5
5
  available: boolean;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "license": "MIT",
13
13
  "private": false,
14
- "version": "1.0.8",
14
+ "version": "1.2.0",
15
15
  "keywords": [
16
16
  "react",
17
17
  "component",
@@ -60,6 +60,7 @@
60
60
  "dayjs": "^1.11.13",
61
61
  "react-resizable": "^3.0.5",
62
62
  "react-router": "^7.4.0",
63
+ "react-spinners": "^0.16.1",
63
64
  "tailwindcss": "^4.0.15",
64
65
  "tw-animate-css": "^1.2.4",
65
66
  "vite-plugin-lib-inject-css": "^2.2.1",
@@ -72,6 +73,16 @@
72
73
  "@commitlint/cli": "^19.8.0",
73
74
  "@commitlint/config-conventional": "^19.8.0",
74
75
  "@eslint/js": "^9.21.0",
76
+ "@radix-ui/react-dropdown-menu": "^2.1.6",
77
+ "@radix-ui/react-icons": "^1.3.2",
78
+ "@radix-ui/react-label": "^2.1.2",
79
+ "@radix-ui/react-popover": "^1.1.6",
80
+ "@radix-ui/react-select": "^2.1.6",
81
+ "@radix-ui/react-separator": "^1.1.2",
82
+ "@radix-ui/react-slot": "^1.1.2",
83
+ "@radix-ui/react-tabs": "^1.1.3",
84
+ "@radix-ui/react-toggle": "^1.1.2",
85
+ "@radix-ui/react-tooltip": "^1.1.8",
75
86
  "@storybook/addon-essentials": "^8.6.8",
76
87
  "@storybook/addon-mdx-gfm": "^8.6.8",
77
88
  "@storybook/addon-onboarding": "^8.6.8",
@@ -96,6 +107,7 @@
96
107
  "eslint-plugin-storybook": "^0.11.6",
97
108
  "globals": "^15.15.0",
98
109
  "husky": "^9.1.7",
110
+ "lucide-react": "^0.483.0",
99
111
  "playwright": "^1.51.1",
100
112
  "react": "^19.0.0",
101
113
  "react-dom": "^19.0.0",
@@ -105,17 +117,7 @@
105
117
  "typescript-eslint": "^8.24.1",
106
118
  "vite": "^6.2.0",
107
119
  "vite-plugin-dts": "^4.5.3",
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"
120
+ "vitest": "^3.0.9"
119
121
  },
120
122
  "eslintConfig": {
121
123
  "extends": [
@@ -126,7 +128,6 @@
126
128
  "**/*.css"
127
129
  ],
128
130
  "peerDependencies": {
129
- "lucide-react": "^0.483.0",
130
131
  "react": ">=18.0.0 <20.0.0",
131
132
  "react-dom": ">=18.0.0 <20.0.0"
132
133
  }