react-beauty-calendar 1.0.7 → 1.1.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 (115) hide show
  1. package/README.md +43 -0
  2. package/dist/{lib/@types → @types}/booking.d.ts +1 -1
  3. package/dist/@types/calendar-instance.d.ts +36 -0
  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 +8685 -8503
  7. package/dist/classes/reference-error.d.ts +4 -0
  8. package/dist/components/ui/Badge.d.ts +9 -0
  9. package/dist/{lib/components → components}/ui/Button.d.ts +2 -2
  10. package/dist/constants/booking-view-type.constant.d.ts +6 -0
  11. package/dist/{lib/context → context}/bookingModal/BookingModalProvider.d.ts +2 -1
  12. package/dist/{lib/context → context}/drag/dragStore.d.ts +0 -3
  13. package/dist/context/emptySlotsStore.ts/retrieveSlotKey.d.ts +6 -0
  14. package/dist/{lib/context → context}/emptySlotsStore.ts/useEmptySlotStore.d.ts +1 -1
  15. package/dist/{lib/context → context}/global/days-and-week/day-and-week-store.d.ts +6 -6
  16. package/dist/{lib/context → context}/month-description/month-description-store.d.ts +1 -0
  17. package/dist/{lib/context → context}/new-event/new-event-context.d.ts +1 -1
  18. package/dist/{lib/context → context}/new-event/new-event-store.d.ts +6 -0
  19. package/dist/core/Root.d.ts +3 -0
  20. package/dist/core/booking-card/BookingCard.d.ts +11 -0
  21. package/dist/{lib/core → core}/calendar/HourWithActions.d.ts +0 -1
  22. package/dist/{lib/core → core}/card-slots/SlotTrigger.d.ts +2 -3
  23. package/dist/core/header-calendar/HeaderDayActions.d.ts +6 -0
  24. package/dist/core/header-calendar/HeaderTodayAction.d.ts +5 -0
  25. package/dist/{lib/core → core}/slots/Card.d.ts +0 -2
  26. package/dist/{lib/core → core}/slots/CardContent.d.ts +1 -1
  27. package/dist/{lib/core → core}/slots/EventsTab.d.ts +3 -1
  28. package/dist/{lib/core → core}/slots/TimeInfo.d.ts +2 -1
  29. package/dist/core/slots/actualTimeIndicator/ActualTimeIndicator.d.ts +8 -0
  30. package/dist/core/slots/actualTimeIndicator/FirstDaySlot.d.ts +6 -0
  31. package/dist/{lib/core → core}/slots/actualTimeIndicator/position-based-on-seconds.d.ts +1 -3
  32. package/dist/core/slots/innerCardHandle/inner-card-handle.d.ts +5 -0
  33. package/dist/{lib/core → core}/slots/useResizableCardHook.d.ts +2 -0
  34. package/dist/hooks/use-calendar-instance.d.ts +3 -0
  35. package/dist/{lib/utils → utils}/date-utils.d.ts +3 -2
  36. package/dist/{lib/utils → utils}/types.d.ts +1 -1
  37. package/package.json +24 -14
  38. package/dist/lib/@types/calendar-instance.d.ts +0 -21
  39. package/dist/lib/constants/booking-view-type.constant.d.ts +0 -6
  40. package/dist/lib/core/Root.d.ts +0 -6
  41. package/dist/lib/core/booking-card/BookingCard.d.ts +0 -10
  42. package/dist/lib/core/slots/actualTimeIndicator/ActualTimeIndicator.d.ts +0 -8
  43. package/dist/lib/hooks/use-calendar-instance.d.ts +0 -7
  44. /package/dist/{lib/@types → @types}/calendar.d.ts +0 -0
  45. /package/dist/{lib/@types → @types}/index.d.ts +0 -0
  46. /package/dist/{lib/@types → @types}/profile.d.ts +0 -0
  47. /package/dist/{lib/@types → @types}/user.d.ts +0 -0
  48. /package/dist/{lib/@types → @types}/working-time.d.ts +0 -0
  49. /package/dist/{lib/components → components}/ui/Dropdown-menu.d.ts +0 -0
  50. /package/dist/{lib/components → components}/ui/Input.d.ts +0 -0
  51. /package/dist/{lib/components → components}/ui/Label.d.ts +0 -0
  52. /package/dist/{lib/components → components}/ui/Popover.d.ts +0 -0
  53. /package/dist/{lib/components → components}/ui/Select.d.ts +0 -0
  54. /package/dist/{lib/components → components}/ui/Separator.d.ts +0 -0
  55. /package/dist/{lib/components → components}/ui/Table.d.ts +0 -0
  56. /package/dist/{lib/components → components}/ui/Tabs.d.ts +0 -0
  57. /package/dist/{lib/components → components}/ui/Toggle.d.ts +0 -0
  58. /package/dist/{lib/components → components}/ui/Tooltip.d.ts +0 -0
  59. /package/dist/{lib/constants → constants}/index.d.ts +0 -0
  60. /package/dist/{lib/constants → constants}/month.constant.d.ts +0 -0
  61. /package/dist/{lib/constants → constants}/payment.constant.d.ts +0 -0
  62. /package/dist/{lib/constants → constants}/side-options.constant.d.ts +0 -0
  63. /package/dist/{lib/constants → constants}/system-colors.constant.d.ts +0 -0
  64. /package/dist/{lib/constants → constants}/url-param.constant.d.ts +0 -0
  65. /package/dist/{lib/context → context}/booking/booking-context.d.ts +0 -0
  66. /package/dist/{lib/context → context}/booking/booking-store.d.ts +0 -0
  67. /package/dist/{lib/context → context}/booking/bookingProvider.d.ts +0 -0
  68. /package/dist/{lib/context → context}/bookingModal/booking-modal-context.d.ts +0 -0
  69. /package/dist/{lib/context → context}/date-and-time/DateAndTimeContext.d.ts +0 -0
  70. /package/dist/{lib/context → context}/emptySlotsStore.ts/emptySlotKey.d.ts +0 -0
  71. /package/dist/{lib/context → context}/global/booking-info/booking-info.d.ts +0 -0
  72. /package/dist/{lib/context → context}/global/slice-global/slice-global-store.d.ts +0 -0
  73. /package/dist/{lib/context → context}/index.d.ts +0 -0
  74. /package/dist/{lib/context → context}/month-description/MonthDescriptionProvider.d.ts +0 -0
  75. /package/dist/{lib/context → context}/month-description/month-description-context.d.ts +0 -0
  76. /package/dist/{lib/core → core}/booking-options/BookingInfoContent.d.ts +0 -0
  77. /package/dist/{lib/core → core}/booking-options/BookingInfoOptions.d.ts +0 -0
  78. /package/dist/{lib/core → core}/calendar/CalendarHolder.d.ts +0 -0
  79. /package/dist/{lib/core → core}/calendar/CalendarView.d.ts +0 -0
  80. /package/dist/{lib/core → core}/calendar/ViewTypes.d.ts +0 -0
  81. /package/dist/{lib/core → core}/favorite-booking/FavoriteBooking.d.ts +0 -0
  82. /package/dist/{lib/core → core}/header-calendar/DaysOfWeek.d.ts +0 -0
  83. /package/dist/{lib/core → core}/header-calendar/Header.d.ts +0 -0
  84. /package/dist/{lib/core → core}/header-calendar/HeaderViewType.d.ts +0 -0
  85. /package/dist/{lib/core → core}/header-calendar/SelectItem.d.ts +0 -0
  86. /package/dist/{lib/core → core}/info/Info.d.ts +0 -0
  87. /package/dist/{lib/core → core}/shortcut-commands/ShortcutCommands.d.ts +0 -0
  88. /package/dist/{lib/core → core}/slots/CardOverlay.d.ts +0 -0
  89. /package/dist/{lib/core → core}/slots/EmptySlot.d.ts +0 -0
  90. /package/dist/{lib/core → core}/slots/Slots.d.ts +0 -0
  91. /package/dist/{lib/core → core}/slots/TabsContent.d.ts +0 -0
  92. /package/dist/{lib/core → core}/slots/service/ProcedureWithColor.d.ts +0 -0
  93. /package/dist/{lib/core → core}/slots/service/StartAt.d.ts +0 -0
  94. /package/dist/{lib/core → core}/table-view-type/TableViewType.d.ts +0 -0
  95. /package/dist/{lib/hoc → hoc}/WithTooltip.d.ts +0 -0
  96. /package/dist/{lib/hooks → hooks}/index.d.ts +0 -0
  97. /package/dist/{lib/hooks → hooks}/use-booking-model.d.ts +0 -0
  98. /package/dist/{lib/hooks → hooks}/use-days-selected-view.d.ts +0 -0
  99. /package/dist/{lib/hooks → hooks}/use-global-store.d.ts +0 -0
  100. /package/dist/{lib/hooks → hooks}/use-is-mobile.d.ts +0 -0
  101. /package/dist/{lib/hooks → hooks}/use-month-description.d.ts +0 -0
  102. /package/dist/{lib/hooks → hooks}/use-tanstack-table.d.ts +0 -0
  103. /package/dist/{lib/hooks → hooks}/useBooking.d.ts +0 -0
  104. /package/dist/{lib/hooks → hooks}/useDebounce.d.ts +0 -0
  105. /package/dist/{lib/hooks → hooks}/useEventPrevention.d.ts +0 -0
  106. /package/dist/{lib/hooks → hooks}/useMutation.d.ts +0 -0
  107. /package/dist/{lib/hooks → hooks}/useNewEventStore.d.ts +0 -0
  108. /package/dist/{lib/hooks → hooks}/useQuery.d.ts +0 -0
  109. /package/dist/{lib/hooks → hooks}/useTrottleCallback.d.ts +0 -0
  110. /package/dist/{lib/hooks → hooks}/useUrlParam.d.ts +0 -0
  111. /package/dist/lib/{lib/utils.d.ts → utils.d.ts} +0 -0
  112. /package/dist/{lib/main.d.ts → main.d.ts} +0 -0
  113. /package/dist/{lib/mock → mock}/booking-mock.d.ts +0 -0
  114. /package/dist/{lib/utils → utils}/hours.d.ts +0 -0
  115. /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;
@@ -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
- variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
4
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
3
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | 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;
@@ -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,11 @@
1
+ import { Booking, BookingDateAndTime } from '../../@types/booking';
2
+ interface BookingCardProps {
3
+ booking: Booking;
4
+ slotData: BookingDateAndTime;
5
+ customClasses?: string;
6
+ heightStyleTransformer?: string;
7
+ layerCount?: number;
8
+ onClick?: () => void;
9
+ }
10
+ declare const BookingCard: ({ booking, slotData, layerCount, onClick, heightStyleTransformer, customClasses, }: BookingCardProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default BookingCard;
@@ -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;
@@ -9,15 +9,14 @@ 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>;
16
15
  }
17
16
  export interface SlotTriggerForwardRef {
18
- showEvent: () => void;
17
+ showEvent: (slotNode: string) => void;
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;
@@ -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,5 @@
1
+ interface HeaderTodayActionProps {
2
+ onClick: () => void;
3
+ }
4
+ declare const HeaderTodayAction: ({ onClick }: HeaderTodayActionProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default HeaderTodayAction;
@@ -5,8 +5,6 @@ interface CardProps {
5
5
  slotData: BookingDateAndTime;
6
6
  ref?: Ref<CardRef>;
7
7
  }
8
- export declare const INITIAL_HEIGHT = 600;
9
- export declare const MIN_DIFF_TIME_THRESHOLD = 15;
10
8
  export interface CardRef {
11
9
  bookingId: string;
12
10
  }
@@ -33,5 +33,5 @@ interface CardContentProps {
33
33
  ref?: Ref<CardContentForward>;
34
34
  }
35
35
  type CardContentForward = HTMLDivElement;
36
- declare const CardContent: ({ bookingInit, slotData, heightStyleTransformer, onClick, customClasses, bookingViewType, resizableParam, events, open, }: 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;
37
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,8 @@
1
+ import { BlocksTimeStructure } from '../EmptySlot';
2
+ interface ActualTimerIndicatorProps {
3
+ color?: string;
4
+ isFirstDay: boolean;
5
+ slotData: BlocksTimeStructure;
6
+ }
7
+ export declare const ActualTimerIndicator: ({ color, isFirstDay, slotData, }: ActualTimerIndicatorProps) => import("react/jsx-runtime").JSX.Element | undefined;
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,8 @@ interface useResizableCardHookProps {
8
8
  onSubTime?: (datetime: Date) => void;
9
9
  starter?: boolean;
10
10
  }
11
+ export declare const INITIAL_HEIGHT = 600;
12
+ export declare const MIN_DIFF_TIME_THRESHOLD = 15;
11
13
  declare const useResizableCardHook: ({ booking, onAddTime, onAddStartTime, onSubTime, starter, }: useResizableCardHookProps) => {
12
14
  state: {
13
15
  height: number;
@@ -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.7",
14
+ "version": "1.1.0",
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,9 +58,9 @@
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",
63
+ "react-spinners": "^0.16.1",
66
64
  "tailwindcss": "^4.0.15",
67
65
  "tw-animate-css": "^1.2.4",
68
66
  "vite-plugin-lib-inject-css": "^2.2.1",
@@ -75,6 +73,16 @@
75
73
  "@commitlint/cli": "^19.8.0",
76
74
  "@commitlint/config-conventional": "^19.8.0",
77
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",
78
86
  "@storybook/addon-essentials": "^8.6.8",
79
87
  "@storybook/addon-mdx-gfm": "^8.6.8",
80
88
  "@storybook/addon-onboarding": "^8.6.8",
@@ -92,12 +100,14 @@
92
100
  "@vitest/browser": "^3.0.9",
93
101
  "@vitest/coverage-v8": "^3.0.9",
94
102
  "chromatic": "^11.27.0",
103
+ "concurrently": "^9.1.2",
95
104
  "eslint": "^9.21.0",
96
105
  "eslint-plugin-react-hooks": "^5.1.0",
97
106
  "eslint-plugin-react-refresh": "^0.4.19",
98
107
  "eslint-plugin-storybook": "^0.11.6",
99
108
  "globals": "^15.15.0",
100
109
  "husky": "^9.1.7",
110
+ "lucide-react": "^0.483.0",
101
111
  "playwright": "^1.51.1",
102
112
  "react": "^19.0.0",
103
113
  "react-dom": "^19.0.0",
@@ -1,21 +0,0 @@
1
- import { JSX, Ref } from 'react';
2
- import { CalendarInstanceRef } from '../../src/App';
3
- import { ActionType } from '../core/header-calendar/Header';
4
- import { BlockTimeData } from '../core/slots/EmptySlot';
5
- import { Booking, BookingDateAndTime, BookingViewType } from './booking';
6
- import { ViewModes } from './calendar';
7
- export type UseBookingInstanceProps = RootProps;
8
- export interface RootProps extends RootEventsProps {
9
- bookings: Booking[];
10
- createBookingModal: JSX.Element;
11
- viewModes: ViewModes;
12
- ref?: Ref<CalendarInstanceRef>;
13
- }
14
- export interface RootEventsProps {
15
- onChangeViewType: (bookingViewType: BookingViewType) => void;
16
- onTodayClick: (date: Date) => void;
17
- onCardDropCallback: (booking: Booking, overId: string, slotData: BookingDateAndTime) => Promise<void>;
18
- onDayChange: (date: Date[], actionType: ActionType) => void;
19
- onModalClose: () => void;
20
- onSlotClick: (slotData: BlockTimeData) => void;
21
- }
@@ -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,10 +0,0 @@
1
- import { Booking, BookingDateAndTime } from '../../@types/booking';
2
- interface BookingCardProps {
3
- booking: Booking;
4
- slotData: BookingDateAndTime;
5
- customClasses?: string | undefined;
6
- heightStyleTransformer?: string;
7
- onClick?: (() => void) | undefined;
8
- }
9
- declare const BookingCard: ({ booking, slotData, onClick, heightStyleTransformer, customClasses, }: BookingCardProps) => import("react/jsx-runtime").JSX.Element;
10
- export default BookingCard;
@@ -1,8 +0,0 @@
1
- import { BlocksTimeStructure } from '../EmptySlot';
2
- interface ActualTimerIndicatorProps {
3
- tailwindColor: string;
4
- isFirstDay: boolean;
5
- slotData: BlocksTimeStructure;
6
- }
7
- export declare const ActualTimerIndicator: ({ tailwindColor, isFirstDay, slotData, }: ActualTimerIndicatorProps) => import("react/jsx-runtime").JSX.Element | undefined;
8
- export default ActualTimerIndicator;
@@ -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