react-beauty-calendar 1.0.4 → 1.0.6

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 (101) hide show
  1. package/dist/build/assets/main.css +1 -0
  2. package/dist/build/main.cjs.js +30 -30
  3. package/dist/build/main.es.js +2930 -2940
  4. package/dist/lib/@types/booking.d.ts +16 -0
  5. package/dist/lib/@types/calendar-instance.d.ts +21 -0
  6. package/dist/lib/@types/calendar.d.ts +3 -0
  7. package/dist/lib/@types/index.d.ts +5 -0
  8. package/dist/lib/@types/profile.d.ts +7 -0
  9. package/dist/lib/@types/user.d.ts +8 -0
  10. package/dist/lib/@types/working-time.d.ts +10 -0
  11. package/dist/lib/components/ui/Button.d.ts +9 -0
  12. package/dist/lib/components/ui/Dropdown-menu.d.ts +25 -0
  13. package/dist/lib/components/ui/Input.d.ts +3 -0
  14. package/dist/lib/components/ui/Label.d.ts +4 -0
  15. package/dist/lib/components/ui/Popover.d.ts +7 -0
  16. package/dist/lib/components/ui/Select.d.ts +15 -0
  17. package/dist/lib/components/ui/Separator.d.ts +4 -0
  18. package/dist/lib/components/ui/Table.d.ts +10 -0
  19. package/dist/lib/components/ui/Tabs.d.ts +7 -0
  20. package/dist/lib/components/ui/Toggle.d.ts +9 -0
  21. package/dist/lib/components/ui/Tooltip.d.ts +7 -0
  22. package/dist/lib/constants/booking-view-type.constant.d.ts +6 -0
  23. package/dist/lib/constants/index.d.ts +7 -0
  24. package/dist/lib/constants/month.constant.d.ts +2 -0
  25. package/dist/lib/constants/payment.constant.d.ts +11 -0
  26. package/dist/lib/constants/side-options.constant.d.ts +2 -0
  27. package/dist/lib/constants/system-colors.constant.d.ts +11 -0
  28. package/dist/lib/constants/url-param.constant.d.ts +7 -0
  29. package/dist/lib/context/booking/booking-context.d.ts +2 -0
  30. package/dist/lib/context/booking/booking-store.d.ts +28 -0
  31. package/dist/lib/context/booking/bookingProvider.d.ts +5 -0
  32. package/dist/lib/context/bookingModal/BookingModalProvider.d.ts +11 -0
  33. package/dist/lib/context/bookingModal/booking-modal-context.d.ts +3 -0
  34. package/dist/lib/context/date-and-time/DateAndTimeContext.d.ts +9 -0
  35. package/dist/lib/context/drag/dragStore.d.ts +11 -0
  36. package/dist/lib/context/emptySlotsStore.ts/emptySlotKey.d.ts +3 -0
  37. package/dist/lib/context/emptySlotsStore.ts/useEmptySlotStore.d.ts +15 -0
  38. package/dist/lib/context/global/booking-info/booking-info.d.ts +18 -0
  39. package/dist/lib/context/global/days-and-week/day-and-week-store.d.ts +25 -0
  40. package/dist/lib/context/global/slice-global/slice-global-store.d.ts +12 -0
  41. package/dist/lib/context/index.d.ts +4 -0
  42. package/dist/lib/context/month-description/MonthDescriptionProvider.d.ts +5 -0
  43. package/dist/lib/context/month-description/month-description-context.d.ts +2 -0
  44. package/dist/lib/context/month-description/month-description-store.d.ts +16 -0
  45. package/dist/lib/context/new-event/new-event-context.d.ts +6 -0
  46. package/dist/lib/context/new-event/new-event-store.d.ts +17 -0
  47. package/dist/lib/core/Root.d.ts +6 -0
  48. package/dist/lib/core/booking-card/BookingCard.d.ts +7 -0
  49. package/dist/lib/core/booking-options/BookingInfoOptions.d.ts +20 -0
  50. package/dist/lib/core/calendar/CalendarHolder.d.ts +2 -0
  51. package/dist/lib/core/calendar/CalendarView.d.ts +2 -0
  52. package/dist/lib/core/calendar/HourWithActions.d.ts +11 -0
  53. package/dist/lib/core/calendar/ViewTypes.d.ts +6 -0
  54. package/dist/lib/core/card-slots/SlotTrigger.d.ts +23 -0
  55. package/dist/lib/core/favorite-booking/FavoriteBooking.d.ts +2 -0
  56. package/dist/lib/core/header-calendar/DaysOfWeek.d.ts +7 -0
  57. package/dist/lib/core/header-calendar/Header.d.ts +9 -0
  58. package/dist/lib/core/header-calendar/HeaderViewType.d.ts +2 -0
  59. package/dist/lib/core/header-calendar/SelectItem.d.ts +7 -0
  60. package/dist/lib/core/info/Info.d.ts +7 -0
  61. package/dist/lib/core/shortcut-commands/ShortcutCommands.d.ts +5 -0
  62. package/dist/lib/core/slots/Card.d.ts +14 -0
  63. package/dist/lib/core/slots/CardContent.d.ts +39 -0
  64. package/dist/lib/core/slots/CardOverlay.d.ts +9 -0
  65. package/dist/lib/core/slots/EmptySlot.d.ts +24 -0
  66. package/dist/lib/core/slots/EventsTab.d.ts +11 -0
  67. package/dist/lib/core/slots/Slots.d.ts +14 -0
  68. package/dist/lib/core/slots/TabsContent.d.ts +3 -0
  69. package/dist/lib/core/slots/TimeInfo.d.ts +13 -0
  70. package/dist/lib/core/slots/actualTimeIndicator/ActualTimeIndicator.d.ts +8 -0
  71. package/dist/lib/core/slots/actualTimeIndicator/position-based-on-seconds.d.ts +13 -0
  72. package/dist/lib/core/slots/service/ProcedureWithColor.d.ts +1 -0
  73. package/dist/lib/core/slots/service/StartAt.d.ts +9 -0
  74. package/dist/lib/core/slots/useResizableCardHook.d.ts +26 -0
  75. package/dist/lib/core/table-view-type/TableViewType.d.ts +1 -0
  76. package/dist/lib/hoc/WithTooltip.d.ts +10 -0
  77. package/dist/lib/hooks/index.d.ts +10 -0
  78. package/dist/lib/hooks/use-booking-model.d.ts +2 -0
  79. package/dist/lib/hooks/use-calendar-instance.d.ts +7 -0
  80. package/dist/lib/hooks/use-days-selected-view.d.ts +4 -0
  81. package/dist/lib/hooks/use-global-store.d.ts +5 -0
  82. package/dist/lib/hooks/use-is-mobile.d.ts +2 -0
  83. package/dist/lib/hooks/use-month-description.d.ts +3 -0
  84. package/dist/lib/hooks/use-tanstack-table.d.ts +20 -0
  85. package/dist/lib/hooks/useBooking.d.ts +3 -0
  86. package/dist/lib/hooks/useDebounce.d.ts +2 -0
  87. package/dist/lib/hooks/useEventPrevention.d.ts +4 -0
  88. package/dist/lib/hooks/useMutation.d.ts +9 -0
  89. package/dist/lib/hooks/useNewEventStore.d.ts +3 -0
  90. package/dist/lib/hooks/useQuery.d.ts +9 -0
  91. package/dist/lib/hooks/useTrottleCallback.d.ts +2 -0
  92. package/dist/lib/hooks/useUrlParam.d.ts +6 -0
  93. package/dist/lib/lib/utils.d.ts +2 -0
  94. package/dist/lib/main.d.ts +4 -0
  95. package/dist/lib/mock/booking-mock.d.ts +4 -0
  96. package/dist/lib/utils/date-utils.d.ts +33 -0
  97. package/dist/lib/utils/hours.d.ts +8 -0
  98. package/dist/lib/utils/string.utils.d.ts +4 -0
  99. package/dist/lib/utils/types.d.ts +21 -0
  100. package/package.json +6 -5
  101. package/dist/build/assets/react-beauty-calendar.css +0 -1
@@ -0,0 +1,7 @@
1
+ import { CardInfoOptions } from '../booking-options/BookingInfoOptions';
2
+ export interface SelectOptionsProps {
3
+ options: CardInfoOptions[];
4
+ onChange: (option: string) => void;
5
+ }
6
+ declare const SelectOptions: ({ options, onChange }: SelectOptionsProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default SelectOptions;
@@ -0,0 +1,7 @@
1
+ type InfoLevel = "info" | "warning" | "error";
2
+ interface InfoProps {
3
+ message: string;
4
+ level: InfoLevel;
5
+ }
6
+ declare const Info: ({ message, level }: InfoProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default Info;
@@ -0,0 +1,5 @@
1
+ export interface ShortcutCommandsProps {
2
+ code: string;
3
+ }
4
+ declare const ShortcutCommands: ({ code }: ShortcutCommandsProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default ShortcutCommands;
@@ -0,0 +1,14 @@
1
+ import { Ref } from 'react';
2
+ import { Booking, BookingDateAndTime } from '../../@types/booking';
3
+ interface CardProps {
4
+ booking: Booking;
5
+ slotData: BookingDateAndTime;
6
+ ref?: Ref<CardRef>;
7
+ }
8
+ export declare const INITIAL_HEIGHT = 600;
9
+ export declare const MIN_DIFF_TIME_THRESHOLD = 15;
10
+ export interface CardRef {
11
+ bookingId: string;
12
+ }
13
+ declare const Card: ({ booking, slotData, ref }: CardProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default Card;
@@ -0,0 +1,39 @@
1
+ import { CSSProperties, Ref, SyntheticEvent } from 'react';
2
+ import { Booking } from '../../@types';
3
+ import { BookingDateAndTime } from '../../@types/booking';
4
+ import { DraggableAttributes } from '@dnd-kit/core';
5
+ import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
6
+ import { ResizeCallbackData, ResizeHandle } from 'react-resizable';
7
+ interface ResizableState {
8
+ height: number;
9
+ width: number;
10
+ }
11
+ export interface ResizableParam {
12
+ state: ResizableState;
13
+ customClass?: string;
14
+ onResize: (event: SyntheticEvent<Element, Event>, args_1: ResizeCallbackData) => void;
15
+ onResizeStart?: (e: React.SyntheticEvent, data: ResizeCallbackData) => void;
16
+ onResizeStop?: (e: React.SyntheticEvent, data: ResizeCallbackData) => void;
17
+ resizeHandle?: ResizeHandle[];
18
+ }
19
+ interface CardContentProps {
20
+ bookingInit: Booking;
21
+ bookingViewType: string;
22
+ slotData: BookingDateAndTime;
23
+ heightStyleTransformer: string;
24
+ pendingStyle?: React.CSSProperties;
25
+ style?: CSSProperties | undefined;
26
+ listeners?: SyntheticListenerMap | undefined;
27
+ attributes?: DraggableAttributes;
28
+ onClick?: () => void;
29
+ customClasses?: string;
30
+ open?: boolean;
31
+ resizableParam?: ResizableParam;
32
+ events?: {
33
+ onUnmount: () => void;
34
+ };
35
+ ref?: Ref<CardContentForward>;
36
+ }
37
+ 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;
39
+ export default CardContent;
@@ -0,0 +1,9 @@
1
+ import { Booking } from '../../@types';
2
+ import { BookingDateAndTime } from '../../@types/booking';
3
+ interface CardOverlayProps {
4
+ bookingInit: Booking;
5
+ slotData: BookingDateAndTime;
6
+ heightStyle: string;
7
+ }
8
+ declare const CardOverlay: ({ bookingInit, slotData, heightStyle, }: CardOverlayProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default CardOverlay;
@@ -0,0 +1,24 @@
1
+ import { CSSProperties } from 'react';
2
+ import { Booking } from '../../@types';
3
+ import { BookingDateAndTime } from '../../@types/booking';
4
+ export interface BlockTimeRef {
5
+ ref: (element: HTMLElement | null) => void;
6
+ style: CSSProperties;
7
+ }
8
+ export interface BlockTimeData {
9
+ key: string;
10
+ time: string;
11
+ }
12
+ export type BlocksTimeStructure = BlockTimeRef & BlockTimeData;
13
+ export interface EmptySlotProps {
14
+ bookings?: Booking[];
15
+ dayHour?: BookingDateAndTime;
16
+ first: BlocksTimeStructure;
17
+ second: BlocksTimeStructure;
18
+ third: BlocksTimeStructure;
19
+ fourth: BlocksTimeStructure;
20
+ disabledCss: string;
21
+ firstDay: boolean;
22
+ }
23
+ declare const EmptySlot: ({ bookings, first, second, third, fourth, disabledCss, firstDay, dayHour, }: EmptySlotProps) => import("react/jsx-runtime").JSX.Element;
24
+ export default EmptySlot;
@@ -0,0 +1,11 @@
1
+ import { JSX, PropsWithChildren } from 'react';
2
+ import { EmptySlotNodes } from '../../context/emptySlotsStore.ts/useEmptySlotStore';
3
+ interface EventTabsProps {
4
+ emptySlotNodes?: EmptySlotNodes;
5
+ buttonTrigger: JSX.Element;
6
+ onClose: (event: React.MouseEvent) => void;
7
+ onOpenChange: (status: boolean) => void;
8
+ }
9
+ type EventTabsWithChildren = PropsWithChildren<EventTabsProps>;
10
+ declare const EventTabs: ({ onClose, onOpenChange, buttonTrigger, }: EventTabsWithChildren) => import("react/jsx-runtime").JSX.Element;
11
+ export default EventTabs;
@@ -0,0 +1,14 @@
1
+ import { Booking, BookingDateAndTime, BookingViewType } from '../../@types/booking';
2
+ export type TimesBlock = "first" | "second" | "third" | "fourth";
3
+ interface SlotsProps {
4
+ dayHour: BookingDateAndTime;
5
+ lunchTimeBlock: {
6
+ startAt: string;
7
+ finishAt: string;
8
+ };
9
+ firstDay: boolean;
10
+ bookingViewType: BookingViewType;
11
+ bookingBulk: Booking[];
12
+ }
13
+ declare const Slots: ({ dayHour, lunchTimeBlock, firstDay, bookingBulk, bookingViewType, }: SlotsProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default Slots;
@@ -0,0 +1,3 @@
1
+ export type BookingType = "service" | "event";
2
+ declare const TabsContentCore: () => import("react/jsx-runtime").JSX.Element;
3
+ export default TabsContentCore;
@@ -0,0 +1,13 @@
1
+ import { BlocksTimeStructure } from './EmptySlot';
2
+ interface TimeInfoEvents {
3
+ onClick: (finishAt?: string) => void;
4
+ renderPreviewCard: () => void;
5
+ openOptions: () => void;
6
+ resetPrevView: () => void;
7
+ }
8
+ interface TimeInfoProps {
9
+ slotData: BlocksTimeStructure;
10
+ events: TimeInfoEvents;
11
+ }
12
+ declare const TimeInfo: ({ slotData, events: { onClick, renderPreviewCard, resetPrevView }, }: TimeInfoProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default TimeInfo;
@@ -0,0 +1,8 @@
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;
@@ -0,0 +1,13 @@
1
+ import { HourWithActionsRef } from '../../calendar/HourWithActions';
2
+ 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;
5
+ normalizingMinutes: (minutes: number) => number;
6
+ isInitialMinute: (minutes: number) => boolean;
7
+ isSameHour: (dateToRenderHour: string, slotDataTime: string) => boolean;
8
+ }
9
+ declare class TimeEquality {
10
+ is15MinLess: (slotDataTime: string) => boolean;
11
+ normalizeDateNow: (dateNow: Date) => string;
12
+ }
13
+ export { TimeIndicatorPosition, TimeEquality };
@@ -0,0 +1,9 @@
1
+ interface StartAtFieldProps {
2
+ formStartAt: string;
3
+ onStartTimeChange: (value: string) => void;
4
+ generateHoursArray: (startHour: string, isStartHour?: boolean) => string[];
5
+ }
6
+ export declare const INITIAL_START_TIME = "08:00";
7
+ export declare const TIME_INTERVAL_IN_MINUTES = 15;
8
+ declare const StartAtField: ({ formStartAt, onStartTimeChange, generateHoursArray, }: StartAtFieldProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default StartAtField;
@@ -0,0 +1,26 @@
1
+ import { SyntheticEvent } from 'react';
2
+ import { ResizeCallbackData } from 'react-resizable';
3
+ import { Booking } from '../../@types';
4
+ interface useResizableCardHookProps {
5
+ booking: Booking;
6
+ onAddTime?: (datetime: Date) => void;
7
+ onAddStartTime?: (datetime: Date) => void;
8
+ onSubTime?: (datetime: Date) => void;
9
+ starter?: boolean;
10
+ }
11
+ declare const useResizableCardHook: ({ booking, onAddTime, onAddStartTime, onSubTime, starter, }: useResizableCardHookProps) => {
12
+ state: {
13
+ height: number;
14
+ width: number;
15
+ };
16
+ setState: import('react').Dispatch<import('react').SetStateAction<{
17
+ height: number;
18
+ width: number;
19
+ }>>;
20
+ resetState: () => void;
21
+ resetHeightStyle: () => void;
22
+ heightStyle: number;
23
+ onResize: (event: SyntheticEvent, { size, handle }: ResizeCallbackData) => void;
24
+ updateHeightStyle: (finishMock: Date, startMock: Date) => void;
25
+ };
26
+ export default useResizableCardHook;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ interface WithTooltipProps {
3
+ content: string;
4
+ }
5
+ type PropsWithChildren<P = unknown> = P & {
6
+ children: ReactNode;
7
+ };
8
+ type WithTooltipChildren = PropsWithChildren<WithTooltipProps>;
9
+ declare const WithTooltip: ({ children, content }: WithTooltipChildren) => import("react/jsx-runtime").JSX.Element;
10
+ export default WithTooltip;
@@ -0,0 +1,10 @@
1
+ import { default as useDaysSelectedView } from './use-days-selected-view';
2
+ import { default as useGlobalStore } from './use-global-store';
3
+ import { default as useMonthDescription } from './use-month-description';
4
+ import { default as useBooking } from './useBooking';
5
+ import { default as useEventPrevention } from './useEventPrevention';
6
+ import { default as useNewEventStore } from './useNewEventStore';
7
+ import { default as useQueryData } from './useQuery';
8
+ import { default as useThrottleCallback } from './useTrottleCallback';
9
+ import { default as useUrlParam } from './useUrlParam';
10
+ export { useBooking, useEventPrevention, useThrottleCallback, useDaysSelectedView, useMonthDescription, useUrlParam, useGlobalStore, useQueryData, useNewEventStore, };
@@ -0,0 +1,2 @@
1
+ export declare const useBookingModal: () => import('../context/bookingModal/BookingModalProvider').BookingModalContextProps;
2
+ export default useBookingModal;
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,4 @@
1
+ declare const useDaysSelectedView: () => {
2
+ onViewTypeChange: (option: string) => void;
3
+ };
4
+ export default useDaysSelectedView;
@@ -0,0 +1,5 @@
1
+ import { BookingInfoState } from '../context/global/booking-info/booking-info';
2
+ import { DayAndWeekState } from '../context/global/days-and-week/day-and-week-store';
3
+ import { SliceGlobalState } from '../context/global/slice-global/slice-global-store';
4
+ declare const useGlobalStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DayAndWeekState & BookingInfoState & SliceGlobalState>>;
5
+ export default useGlobalStore;
@@ -0,0 +1,2 @@
1
+ declare const useIsMobile: () => boolean;
2
+ export default useIsMobile;
@@ -0,0 +1,3 @@
1
+ import { MonthDescriptionState } from '../context/month-description/month-description-store';
2
+ declare const useMonthDescription: <T>(selector: (state: MonthDescriptionState) => T) => T;
3
+ export default useMonthDescription;
@@ -0,0 +1,20 @@
1
+ import { ColumnDef, ColumnFiltersState, PaginationState, RowSelectionState, SortingState, Table as TStack, VisibilityState } from '@tanstack/react-table';
2
+ interface UseTanstackTable<T> {
3
+ data: T[];
4
+ columns: ColumnDef<T>[];
5
+ setSorting: React.Dispatch<React.SetStateAction<SortingState>>;
6
+ setColumnFilters: React.Dispatch<React.SetStateAction<ColumnFiltersState>>;
7
+ setPagination: React.Dispatch<React.SetStateAction<{
8
+ pageIndex: number;
9
+ pageSize: number;
10
+ }>>;
11
+ setColumnVisibility: React.Dispatch<React.SetStateAction<VisibilityState>>;
12
+ setRowSelection: React.Dispatch<React.SetStateAction<object>>;
13
+ sorting?: SortingState | undefined;
14
+ columnFilters?: ColumnFiltersState | undefined;
15
+ columnVisibility?: VisibilityState | undefined;
16
+ rowSelection?: RowSelectionState | undefined;
17
+ pagination?: PaginationState | undefined;
18
+ }
19
+ declare const useTanstackTable: <T>({ data, columns, setSorting, setColumnFilters, setPagination, setColumnVisibility, setRowSelection, sorting, columnFilters, columnVisibility, rowSelection, pagination, }: UseTanstackTable<T>) => TStack<T>;
20
+ export default useTanstackTable;
@@ -0,0 +1,3 @@
1
+ import { BookingState } from '../context/booking/booking-store';
2
+ declare const useBooking: <T>(selector: (state: BookingState) => T) => T;
3
+ export default useBooking;
@@ -0,0 +1,2 @@
1
+ declare const useDebounceCallback: (callback: () => void, delay?: number) => (() => void);
2
+ export default useDebounceCallback;
@@ -0,0 +1,4 @@
1
+ import { FormEvent, MouseEvent } from 'react';
2
+ type EventType = MouseEvent | FormEvent;
3
+ declare const useEventPrevention: <T extends EventType>(callback: () => void) => (event: T) => void;
4
+ export default useEventPrevention;
@@ -0,0 +1,9 @@
1
+ declare const useMutationData: <T>(callbackQueryFunction: () => Promise<T>, ...queryKeys: string[]) => {
2
+ isPending: boolean;
3
+ isSuccess: boolean;
4
+ isError: boolean;
5
+ error: Error | null;
6
+ status: "error" | "success" | "pending" | "idle";
7
+ data: T | undefined;
8
+ };
9
+ export default useMutationData;
@@ -0,0 +1,3 @@
1
+ import { NewEventFormState } from '../context/new-event/new-event-store';
2
+ declare const useNewEventStore: <T>(selector: (state: NewEventFormState) => T) => T;
3
+ export default useNewEventStore;
@@ -0,0 +1,9 @@
1
+ declare const useQueryData: <T>(queryKey: string, callbackQueryFunction: (...params: string[]) => Promise<T>, params?: unknown) => {
2
+ isPending: boolean;
3
+ isLoading: boolean;
4
+ isError: boolean;
5
+ error: Error | null;
6
+ status: "error" | "success" | "pending";
7
+ data: T | undefined;
8
+ };
9
+ export default useQueryData;
@@ -0,0 +1,2 @@
1
+ declare const useThrottleCallback: <T extends (...args: never[]) => void>(fn: T, delay?: number) => ((...args: Parameters<T>) => void);
2
+ export default useThrottleCallback;
@@ -0,0 +1,6 @@
1
+ declare const useUrlParam: (urlQuery: string) => {
2
+ fromParam: string | null;
3
+ toRoute: (value: string | Record<string, string>) => void;
4
+ redirectToRoute: (urlQuery: string) => void | Promise<void>;
5
+ };
6
+ export default useUrlParam;
@@ -0,0 +1,2 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,4 @@
1
+ import { default as useCalendarInstance } from './hooks/use-calendar-instance';
2
+ export * from './utils/types';
3
+ export * from './hooks/use-calendar-instance';
4
+ export { useCalendarInstance };
@@ -0,0 +1,4 @@
1
+ import { Booking, User } from '../@types';
2
+ declare const mockUser: User;
3
+ declare const mockBooking: Booking[];
4
+ export { mockBooking, mockUser };
@@ -0,0 +1,33 @@
1
+ export declare const WEEK_DAYS: readonly ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
2
+ type WeekDays = (typeof WEEK_DAYS)[number];
3
+ export declare const WEEK_DAYS_FULL_NAME: readonly ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
4
+ export type DatesData = {
5
+ week: Date[];
6
+ firstDayOfWeek: Date;
7
+ lastDayOfWeek: Date;
8
+ };
9
+ export declare const DateUtils: {
10
+ findIndexToStart(date?: Date): number;
11
+ findActualDayIndex(today: WeekDays): number;
12
+ generateWeekDays(newDate?: Date): DatesData;
13
+ generateDays(date: Date, daysForwardOrBack: number): Date[];
14
+ addDay(currentDate: Date, numberOfDays: number): Date;
15
+ formatDate(time: string): string;
16
+ dateTimeAsString(date: Date): string;
17
+ minuteDifference(date1: Date, date2: Date): number;
18
+ dateAndHourDateToString(date: Date): string;
19
+ shortMonthDescription(...month: Date[]): string;
20
+ timeDiffInSeconds(startAt: Date, finishAt: Date): number;
21
+ subtractMinutes(startAt: Date, amount: number): Date;
22
+ addMinuteToHour(hour: string, minutes: number): string;
23
+ dateToString(date: Date): string;
24
+ dateToStringSelected(date: Date): string;
25
+ roundMinutes(minutes: number): number;
26
+ hourMinutesStringToDate(hourMinutes: string): Date;
27
+ addMinutesToDate(targetDate: Date, minutes: number): Date;
28
+ newDateKey(date: string, hour: string): string;
29
+ addMinutesToHour(startAt: string, interval: number): string;
30
+ convertStringTimeToDateFormat(timeString: string): Date;
31
+ isTodayDate(date: Date): boolean;
32
+ };
33
+ export {};
@@ -0,0 +1,8 @@
1
+ export type Times = string[];
2
+ declare const generateTimes: (start: string, end: string, interval: number) => Times;
3
+ interface WorkingTimesSlots {
4
+ time: string;
5
+ available: boolean;
6
+ }
7
+ declare const generateWorkingTimes: (start: string, end: string, interval: number) => WorkingTimesSlots[];
8
+ export { generateTimes, generateWorkingTimes };
@@ -0,0 +1,4 @@
1
+ export declare const StringUtils: {
2
+ capitalize(text: string): string;
3
+ returnFirstChar(text: string): string;
4
+ };
@@ -0,0 +1,21 @@
1
+ import { JSX, Ref } from 'react';
2
+ import { CalendarInstanceRef } from '../../src/App';
3
+ import { Booking, ViewModes } from '../@types';
4
+ import { BookingDateAndTime, BookingViewType } from '../@types/booking';
5
+ import { ActionType } from '../core/header-calendar/Header';
6
+ import { BlockTimeData } from '../core/slots/EmptySlot';
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
+ }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "license": "MIT",
13
13
  "private": false,
14
- "version": "1.0.4",
14
+ "version": "1.0.6",
15
15
  "keywords": [
16
16
  "react",
17
17
  "component",
@@ -63,9 +63,9 @@
63
63
  "lucide-react": "^0.483.0",
64
64
  "react-resizable": "^3.0.5",
65
65
  "react-router": "^7.4.0",
66
- "tailwind-merge": "^3.0.2",
67
66
  "tailwindcss": "^4.0.15",
68
67
  "tw-animate-css": "^1.2.4",
68
+ "vite-plugin-lib-inject-css": "^2.2.1",
69
69
  "zustand": "^5.0.3"
70
70
  },
71
71
  "devDependencies": {
@@ -99,14 +99,15 @@
99
99
  "globals": "^15.15.0",
100
100
  "husky": "^9.1.7",
101
101
  "playwright": "^1.51.1",
102
+ "react": "^19.0.0",
103
+ "react-dom": "^19.0.0",
102
104
  "storybook": "^8.6.8",
105
+ "tailwind-merge": "^3.0.2",
103
106
  "typescript": "~5.7.2",
104
107
  "typescript-eslint": "^8.24.1",
105
108
  "vite": "^6.2.0",
106
109
  "vite-plugin-dts": "^4.5.3",
107
- "vitest": "^3.0.9",
108
- "react": "^19.0.0",
109
- "react-dom": "^19.0.0"
110
+ "vitest": "^3.0.9"
110
111
  },
111
112
  "eslintConfig": {
112
113
  "extends": [
@@ -1 +0,0 @@
1
- ._calendarHeader_ocihc_1{max-width:4rem;min-width:4rem;width:1rem}@media screen and (max-width: 1189px){._calendarHeader_ocihc_1{max-width:4rem;min-width:4rem}}@property --progress{syntax: "<number>"; initial-value: 0; inherits: false;}._Draggable_1rwnc_7{position:relative;transition:transform .25s ease}._Draggable_1rwnc_7>div{-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:0;border-radius:5px;box-shadow:var(--box-shadow);transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scale(var(--scale, 1));transition:box-shadow .3s ease}._Draggable_1rwnc_7._pendingDelay_1rwnc_22{animation:_pending_1rwnc_22 linear;background-image:linear-gradient(90deg,rgb(0,47,255) calc(var(--progress)* 1%),transparent calc(var(--progress)* 1% + 1%))}._Draggable_1rwnc_7:not(._handle_1rwnc_29)>div{touch-action:none;cursor:grab}._Draggable_1rwnc_7:not(._handle_1rwnc_29)>div:focus-visible:not(._active_1rwnc_34 :is(._Draggable_1rwnc_7:not(._handle_1rwnc_29)>div)){box-shadow:0 0 0 3px #4c9ffe}._Draggable_1rwnc_7._handle_1rwnc_29>div{--action-background: rgba(255, 255, 255, .1)}._Draggable_1rwnc_7._handle_1rwnc_29>div>svg{margin-right:5px}._Draggable_1rwnc_7._handle_1rwnc_29>div>div{margin-right:-10px}._Draggable_1rwnc_7 img{-webkit-user-select:none;user-select:none;pointer-events:none}._Draggable_1rwnc_7._dragging_1rwnc_59{z-index:1;transition:none}._Draggable_1rwnc_7._dragging_1rwnc_59 *{cursor:grabbing}._Draggable_1rwnc_7._dragging_1rwnc_59>div{--scale: 1.06;--box-shadow: -1px 0 15px 0 rgba(34, 33, 81, .01), 0px 15px 15px 0 rgba(34, 33, 81, .25)}._Draggable_1rwnc_7._dragging_1rwnc_59>div:focus-visible{--box-shadow: 0 0px 10px 2px #4c9ffe}._Draggable_1rwnc_7._dragging_1rwnc_59 label{animation:none;opacity:0}._Draggable_1rwnc_7._dragOverlay_1rwnc_83>div,._Draggable_1rwnc_7._dragging_1rwnc_59>div{animation:_pop_1rwnc_1 .25s cubic-bezier(.18,.67,.6,1.22)}@keyframes _pulse_1rwnc_1{0%{opacity:0}to{opacity:1}}@keyframes _pop_1rwnc_1{0%{transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scale(1)}to{transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scale(var(--scale));box-shadow:var(--box-shadow)}}@keyframes _pending_1rwnc_22{to{--progress: 100}}#root{margin:0 auto;text-align:center}.react-resizable{position:relative}.react-resizable:hover .react-resizable-handle-s{display:inline}.dragging-effect{border:2px solid rgba(255,21,0,.682)}.show-handle.react-resizable .react-resizable-handle-s{display:inline}.react-resizable.slot-resizable>.react-resizable-handle{width:100%;height:100%}.react-resizable.slot-resizable>.react-resizable-handle.react-resizable-handle-se{cursor:default;background-image:none}.react-resizable.slot-resizable>.react-resizable-handle.react-resizable-handle-se:hover{cursor:default;background-image:none}.react-resizable-handle{position:absolute;width:20px;height:20px;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E %3Cpath d='M5 14H19M5 10H19' stroke='%23fff' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'%3E%3C/path%3E %3C/g%3E%3C/svg%3E");background-position:bottom right}.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-resizable-handle-se{bottom:0;left:0;cursor:se-resize;z-index:100}.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-resizable-handle-w,.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0}.react-resizable-handle-n,.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-resizable-handle-n{top:-5px;z-index:100}.react-resizable-handle-s{display:none;bottom:-5px;z-index:100}.rdp-day:hover{background-color:#edecec!important;color:#1f1f1f!important;border-radius:50%!important}.rdp-chevron{fill:#5403d6!important}.rdp-day.rdp-today{color:#fff!important;border-radius:50%;background-color:#8574e5!important}.rdp-day::selection{background-color:#8574e5!important;color:red!important}.rdp-day.rdp-selected>.rdp-day_button{background:#d5d0f7;color:#322290;border:none}.shadow{box-shadow:2px 2px 6px 1px #0000004d}@keyframes spinBorder{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}.animate-spin-border{animation:spinBorder 3s linear infinite;background-size:200% 200%}.disableVisibilityTime{display:none}.activateVisibilityTime{display:block}