@mindly/ui-components 8.5.1 → 8.5.3

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 (30) hide show
  1. package/dist/cjs/index.js +3 -3
  2. package/dist/cjs/lib2/features/RecurringSessionPreviewFeature/types.d.ts +1 -0
  3. package/dist/cjs/lib2/features/SessionManageModalFeature/SessionManageModalFeature.d.ts +3 -2
  4. package/dist/cjs/lib2/features/SessionPreviewFeature/types.d.ts +1 -0
  5. package/dist/cjs/lib2/features/SpecialistScheduleFeature/types.d.ts +1 -0
  6. package/dist/cjs/lib2/shared/hooks/useCalendarData.d.ts +12 -8
  7. package/dist/cjs/lib2/shared/hooks/useSpecialistPayments.d.ts +6 -1
  8. package/dist/cjs/lib2/shared/types/session.d.ts +1 -1
  9. package/dist/cjs/lib2/shared/ui/DrumListPicker/DrumListPicker.d.ts +3 -2
  10. package/dist/cjs/lib2/shared/utils/index.d.ts +1 -0
  11. package/dist/cjs/lib2/shared/utils/session.d.ts +4 -2
  12. package/dist/cjs/lib2/shared/utils/timezone.d.ts +1 -0
  13. package/dist/cjs/lib2/widgets/SessionDetailWidget/types.d.ts +1 -0
  14. package/dist/cjs/lib2/widgets/SessionsListWidget/types.d.ts +1 -0
  15. package/dist/esm/index.js +3 -3
  16. package/dist/esm/lib2/features/RecurringSessionPreviewFeature/types.d.ts +1 -0
  17. package/dist/esm/lib2/features/SessionManageModalFeature/SessionManageModalFeature.d.ts +3 -2
  18. package/dist/esm/lib2/features/SessionPreviewFeature/types.d.ts +1 -0
  19. package/dist/esm/lib2/features/SpecialistScheduleFeature/types.d.ts +1 -0
  20. package/dist/esm/lib2/shared/hooks/useCalendarData.d.ts +12 -8
  21. package/dist/esm/lib2/shared/hooks/useSpecialistPayments.d.ts +6 -1
  22. package/dist/esm/lib2/shared/types/session.d.ts +1 -1
  23. package/dist/esm/lib2/shared/ui/DrumListPicker/DrumListPicker.d.ts +3 -2
  24. package/dist/esm/lib2/shared/utils/index.d.ts +1 -0
  25. package/dist/esm/lib2/shared/utils/session.d.ts +4 -2
  26. package/dist/esm/lib2/shared/utils/timezone.d.ts +1 -0
  27. package/dist/esm/lib2/widgets/SessionDetailWidget/types.d.ts +1 -0
  28. package/dist/esm/lib2/widgets/SessionsListWidget/types.d.ts +1 -0
  29. package/dist/index.d.ts +17 -6
  30. package/package.json +1 -1
@@ -7,4 +7,5 @@ export type RecurringSessionPreviewFeatureProps = {
7
7
  t?: WithTranslation['t'];
8
8
  isLoading?: boolean;
9
9
  onClick?(session: RecurringSession): void;
10
+ timeZone?: string;
10
11
  };
@@ -1,6 +1,6 @@
1
1
  import React, { FC } from 'react';
2
2
  import { WithTranslation } from 'react-i18next';
3
- import { RecurringSchedule } from '../../shared';
3
+ import { RecurringSession } from '../../shared';
4
4
  import { ModalSheetProps } from '../../shared/ui/ModalSheet/types';
5
5
  export declare enum SessionManageTypeEnum {
6
6
  ONLY_THIS_SESSION = "only_this_session",
@@ -9,8 +9,9 @@ export declare enum SessionManageTypeEnum {
9
9
  }
10
10
  type SessionManageModalFeatureProps = {
11
11
  action: 'reschedule' | 'cancel';
12
+ timeZone?: string;
12
13
  sessionStartDate: string;
13
- sessionRecurringSchedule?: RecurringSchedule;
14
+ recurringSession?: RecurringSession;
14
15
  isOpen?: boolean;
15
16
  locale?: string;
16
17
  ref?: React.RefObject<HTMLIonModalElement | null>;
@@ -8,6 +8,7 @@ export type SessionPreviewFeatureProps = {
8
8
  locale: SupportedLocales;
9
9
  maxPeriodToReviewPastSessionInHours?: number;
10
10
  daysBeforeCancelationQueueSession?: number;
11
+ timeZone?: string;
11
12
  onSessionClick?(session: Session | SessionQueue): void;
12
13
  onSessionStart?(session: Session | SessionQueue): void;
13
14
  rateSessionCallback?: (session: Session | SessionQueue) => void;
@@ -26,6 +26,7 @@ export type ScheduleFeatureProps = {
26
26
  bookButtonText?: string;
27
27
  footerContent?: React.ReactNode;
28
28
  sessionType?: SessionTypeEnum;
29
+ timeZone?: string;
29
30
  onDateChange?: (date: ScheduleDate, slots: ScheduleSlot[]) => void;
30
31
  onSlotChange?: (slot: ScheduleSlot | null) => void;
31
32
  onShowAll?: () => void;
@@ -1,11 +1,15 @@
1
- import { SupportedLocales } from '../types';
2
- type CalendarListProps = {
3
- locale?: SupportedLocales;
4
- lastDate: Date;
5
- };
6
- type CalendarListItem = {
7
- value: Date;
1
+ type SelectionItem<T extends string | number> = {
8
2
  label: string;
3
+ value: T;
4
+ };
5
+ type CalendarSelections = {
6
+ day: SelectionItem<number>[];
7
+ month: SelectionItem<string>[];
8
+ year: SelectionItem<number>[];
9
+ };
10
+ type CalendarListProps = {
11
+ locale?: string;
12
+ lastDate?: Date;
9
13
  };
10
- export declare function useCalendarListData({ locale, lastDate, }: CalendarListProps): CalendarListItem[];
14
+ export declare function useCalendarListData({ locale, lastDate, }: CalendarListProps): CalendarSelections;
11
15
  export {};
@@ -10,7 +10,12 @@ type DatesResultType = {
10
10
  isFutureMonth: boolean;
11
11
  };
12
12
  export declare function getDatePosition(calendarDate: Date): DatesResultType;
13
- export declare function getSelectedFormattedDate(date: Date, locale?: string): string;
13
+ type CalendarDefaults = {
14
+ day: string;
15
+ month: string;
16
+ year: string;
17
+ };
18
+ export declare function getSelectedFormattedDate(selectedDate: Date | null | undefined, locale?: string): CalendarDefaults;
14
19
  type FormattedDateProps = {
15
20
  date: Date;
16
21
  locale?: SupportedLocales;
@@ -82,9 +82,9 @@ export type RecurringSession = {
82
82
  id: string;
83
83
  specialistId: string;
84
84
  clientId: string;
85
- userTimezone: string;
86
85
  name?: string;
87
86
  avatarLink?: string;
87
+ timezone?: string;
88
88
  recurring: {
89
89
  interval: 'weekly';
90
90
  day: number;
@@ -7,9 +7,10 @@ type Props = {
7
7
  height?: number;
8
8
  selections: Record<string, SelectionType[]>;
9
9
  defaults?: Record<string, string>;
10
- onChange(value: Record<string, SelectionType>): void;
10
+ onChange(value: Record<string, string>): void;
11
11
  className?: string;
12
12
  compareBy?: 'value' | 'label';
13
+ presentation?: 'date' | 'month' | 'month-year';
13
14
  };
14
- declare const DrumListPicker: ({ height, selections, defaults, onChange, className, compareBy, }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ declare const DrumListPicker: ({ height, selections, defaults, onChange, className, compareBy, presentation, }: Props) => import("react/jsx-runtime").JSX.Element;
15
16
  export default DrumListPicker;
@@ -13,3 +13,4 @@ export * from './mock';
13
13
  export { ONBOARDING_THEME_DEFAULT_COLORS } from './onboarding';
14
14
  export * from './globalAuthState';
15
15
  export * from './validation';
16
+ export * from './timezone';
@@ -1,5 +1,6 @@
1
+ import { DateTime } from 'luxon';
1
2
  import { WithTranslation } from 'react-i18next';
2
- import { Session, SessionTime, SessionVariant, SupportedLocales } from '../types';
3
+ import { RecurringSession, Session, SessionTime, SessionVariant, SupportedLocales } from '../types';
3
4
  export declare const SOON_SESSION_TIME_SECONDS: number;
4
5
  export declare const NEAR_SESSION_TIME_SECONDS: number;
5
6
  export declare const CAN_MANAGE_SESSION_TIME_HOURS = 24;
@@ -11,5 +12,6 @@ export declare const getSessionsByYear: (sessions: Session[]) => Map<number, Ses
11
12
  export declare const getSessionsByMonth: (sessions: Session[]) => Map<number, Session[]>;
12
13
  export declare const getSessionsByDay: (sessions: Session[]) => Map<number, Session[]>;
13
14
  export declare const splitSessions: (sessions: Session[]) => Map<string, Session[]>;
14
- export declare const getSessionTimeLabel: (variant: SessionVariant, startSessionDate: Date, t: WithTranslation["t"], locale: SupportedLocales) => string;
15
+ export declare const getSessionTimeLabel: (variant: SessionVariant, startSessionDate: Date, t: WithTranslation["t"], locale: SupportedLocales, timeZone: string) => string;
15
16
  export declare const canManageSession: (sessionDate?: Date) => boolean;
17
+ export declare const getRecurringSessionDate: (recurringSession: RecurringSession, timeZone: string) => DateTime;
@@ -0,0 +1 @@
1
+ export declare const localTimeZone: string;
@@ -7,6 +7,7 @@ export type SessionDetailWidgetProps = {
7
7
  t?: WithTranslation['t'];
8
8
  viewPerson?: 'client' | 'specialist';
9
9
  locale: SupportedLocales;
10
+ timeZone?: string;
10
11
  onSessionStart?(session: Session): void;
11
12
  onRescheduleClick?(session: Session): void;
12
13
  onCancelClick?(session: Session): void;
@@ -21,4 +21,5 @@ export type SessionsWidgetProps = {
21
21
  onScheduleSession?(): void;
22
22
  onUpdateSubscription?(session: Session): void;
23
23
  t?: WithTranslation['t'];
24
+ timeZone?: string;
24
25
  };