@mindly/ui-components 5.97.13 → 5.98.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 (50) hide show
  1. package/dist/cjs/index.js +6 -6
  2. package/dist/cjs/lib2/features/SessionPreviewFeature/SessionPreviewFeature.stories.d.ts +2 -1
  3. package/dist/cjs/lib2/features/SessionPreviewFeature/styles.d.ts +7 -0
  4. package/dist/cjs/lib2/features/SessionPreviewFeature/types.d.ts +2 -0
  5. package/dist/cjs/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/ReviewSubscriptionSessionFeature.d.ts +18 -0
  6. package/dist/cjs/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/SessionReview.d.ts +19 -0
  7. package/dist/cjs/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/SpecialistReview.d.ts +17 -0
  8. package/dist/cjs/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/constants.d.ts +8 -0
  9. package/dist/cjs/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/index.d.ts +2 -0
  10. package/dist/cjs/lib2/features/SessionReviewsFeature/ReviewTrialSessionFeature/ReviewTrialSessionFeature.d.ts +23 -0
  11. package/dist/cjs/lib2/features/SessionReviewsFeature/ReviewTrialSessionFeature/constants.d.ts +8 -0
  12. package/dist/cjs/lib2/features/SessionReviewsFeature/ReviewTrialSessionFeature/index.d.ts +2 -0
  13. package/dist/cjs/lib2/features/SessionReviewsFeature/components/StarRating.d.ts +7 -0
  14. package/dist/cjs/lib2/features/SessionReviewsFeature/components/TagsList.d.ts +16 -0
  15. package/dist/cjs/lib2/features/SessionReviewsFeature/index.d.ts +4 -0
  16. package/dist/cjs/lib2/features/index.d.ts +1 -0
  17. package/dist/cjs/lib2/shared/types/session.d.ts +13 -0
  18. package/dist/cjs/lib2/shared/ui/Textarea_v2/types.d.ts +1 -0
  19. package/dist/cjs/lib2/shared/utils/index.d.ts +1 -0
  20. package/dist/cjs/lib2/shared/utils/mock.d.ts +1 -0
  21. package/dist/cjs/lib2/shared/utils/session.d.ts +2 -1
  22. package/dist/cjs/lib2/widgets/SessionsListWidget/SessionsListWidgetSkeleton.d.ts +3 -1
  23. package/dist/cjs/lib2/widgets/SessionsListWidget/index.d.ts +1 -0
  24. package/dist/cjs/lib2/widgets/SessionsListWidget/types.d.ts +7 -4
  25. package/dist/esm/index.js +6 -6
  26. package/dist/esm/lib2/features/SessionPreviewFeature/SessionPreviewFeature.stories.d.ts +2 -1
  27. package/dist/esm/lib2/features/SessionPreviewFeature/styles.d.ts +7 -0
  28. package/dist/esm/lib2/features/SessionPreviewFeature/types.d.ts +2 -0
  29. package/dist/esm/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/ReviewSubscriptionSessionFeature.d.ts +18 -0
  30. package/dist/esm/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/SessionReview.d.ts +19 -0
  31. package/dist/esm/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/SpecialistReview.d.ts +17 -0
  32. package/dist/esm/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/constants.d.ts +8 -0
  33. package/dist/esm/lib2/features/SessionReviewsFeature/ReviewSubscriptionSessionFeature/index.d.ts +2 -0
  34. package/dist/esm/lib2/features/SessionReviewsFeature/ReviewTrialSessionFeature/ReviewTrialSessionFeature.d.ts +23 -0
  35. package/dist/esm/lib2/features/SessionReviewsFeature/ReviewTrialSessionFeature/constants.d.ts +8 -0
  36. package/dist/esm/lib2/features/SessionReviewsFeature/ReviewTrialSessionFeature/index.d.ts +2 -0
  37. package/dist/esm/lib2/features/SessionReviewsFeature/components/StarRating.d.ts +7 -0
  38. package/dist/esm/lib2/features/SessionReviewsFeature/components/TagsList.d.ts +16 -0
  39. package/dist/esm/lib2/features/SessionReviewsFeature/index.d.ts +4 -0
  40. package/dist/esm/lib2/features/index.d.ts +1 -0
  41. package/dist/esm/lib2/shared/types/session.d.ts +13 -0
  42. package/dist/esm/lib2/shared/ui/Textarea_v2/types.d.ts +1 -0
  43. package/dist/esm/lib2/shared/utils/index.d.ts +1 -0
  44. package/dist/esm/lib2/shared/utils/mock.d.ts +1 -0
  45. package/dist/esm/lib2/shared/utils/session.d.ts +2 -1
  46. package/dist/esm/lib2/widgets/SessionsListWidget/SessionsListWidgetSkeleton.d.ts +3 -1
  47. package/dist/esm/lib2/widgets/SessionsListWidget/index.d.ts +1 -0
  48. package/dist/esm/lib2/widgets/SessionsListWidget/types.d.ts +7 -4
  49. package/dist/index.d.ts +111 -8
  50. package/package.json +1 -1
@@ -9,5 +9,6 @@ export declare const Soon: Story;
9
9
  export declare const Near: Story;
10
10
  export declare const NearInDays: Story;
11
11
  export declare const Future: Story;
12
- export declare const Past: Story;
12
+ export declare const PastRated: Story;
13
+ export declare const PastNotRated: Story;
13
14
  export declare const Loading: Story;
@@ -2,6 +2,7 @@ export declare const sessionPreviewFeatureStyle: import("tailwind-variants").TVR
2
2
  variant: {
3
3
  default: {
4
4
  root: string;
5
+ label: string;
5
6
  };
6
7
  current: {
7
8
  root: string;
@@ -26,6 +27,7 @@ export declare const sessionPreviewFeatureStyle: import("tailwind-variants").TVR
26
27
  variant: {
27
28
  default: {
28
29
  root: string;
30
+ label: string;
29
31
  };
30
32
  current: {
31
33
  root: string;
@@ -47,6 +49,7 @@ export declare const sessionPreviewFeatureStyle: import("tailwind-variants").TVR
47
49
  variant: {
48
50
  default: {
49
51
  root: string;
52
+ label: string;
50
53
  };
51
54
  current: {
52
55
  root: string;
@@ -68,6 +71,7 @@ export declare const sessionPreviewFeatureStyle: import("tailwind-variants").TVR
68
71
  variant: {
69
72
  default: {
70
73
  root: string;
74
+ label: string;
71
75
  };
72
76
  current: {
73
77
  root: string;
@@ -92,6 +96,7 @@ export declare const sessionPreviewFeatureStyle: import("tailwind-variants").TVR
92
96
  variant: {
93
97
  default: {
94
98
  root: string;
99
+ label: string;
95
100
  };
96
101
  current: {
97
102
  root: string;
@@ -116,6 +121,7 @@ export declare const sessionPreviewFeatureStyle: import("tailwind-variants").TVR
116
121
  variant: {
117
122
  default: {
118
123
  root: string;
124
+ label: string;
119
125
  };
120
126
  current: {
121
127
  root: string;
@@ -137,6 +143,7 @@ export declare const sessionPreviewFeatureStyle: import("tailwind-variants").TVR
137
143
  variant: {
138
144
  default: {
139
145
  root: string;
146
+ label: string;
140
147
  };
141
148
  current: {
142
149
  root: string;
@@ -5,6 +5,8 @@ export type SessionPreviewFeatureProps = {
5
5
  viewPerson?: 'client' | 'specialist';
6
6
  t?: WithTranslation['t'];
7
7
  isLoading?: boolean;
8
+ maxPeriodToReviewPastSessionInHours?: number;
8
9
  onSessionClick?(session: Session): void;
9
10
  onSessionStart?(session: Session): void;
11
+ rateSessionCallback?: (session: Session) => void;
10
12
  };
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { SessionReview } from './SessionReview';
3
+ import { SpecialistReview } from './SpecialistReview';
4
+ export type ReviewSubscriptionSessionFeatureProps = {
5
+ specialistName: string;
6
+ specialistAvatar: string;
7
+ isOpen: boolean;
8
+ specialistReviewNeeded: boolean;
9
+ sessionReviewProps: React.ComponentProps<typeof SessionReview> & {
10
+ onModalAppeared?: () => void;
11
+ };
12
+ specialistReviewProps: React.ComponentProps<typeof SpecialistReview> & {
13
+ onModalAppeared?: () => void;
14
+ };
15
+ onClose: () => void;
16
+ };
17
+ declare const ReviewSubscriptionSessionFeature: React.FC<ReviewSubscriptionSessionFeatureProps>;
18
+ export default ReviewSubscriptionSessionFeature;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ type SessionReviewProps = {
3
+ specialistName: string;
4
+ onSubmit: (data: {
5
+ rate: number;
6
+ reason: string;
7
+ is_custom_reason: boolean;
8
+ comment?: string;
9
+ }) => Promise<void>;
10
+ specialistReviewNeeded?: boolean;
11
+ onModalAppeared?: () => void;
12
+ onStarsClick?: (rate: number) => void;
13
+ onReasonClick?: (rate: number, reason: string, is_custom_reason: boolean) => void;
14
+ onCommentBlur?: (rate: number, reason: string, is_custom_reason: boolean, comment: string) => void;
15
+ onContinueClick?: (rate: number, reason: string, is_custom_reason: boolean, comment: string) => void;
16
+ t?: (key: string) => string;
17
+ };
18
+ export declare const SessionReview: React.FC<SessionReviewProps>;
19
+ export {};
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ type SpecialistReviewProps = {
3
+ specialistName: string;
4
+ specialistAvatar: string;
5
+ specialistReviewNeeded?: boolean;
6
+ onSubmit: (data: {
7
+ rate: number;
8
+ comment?: string;
9
+ }) => Promise<void>;
10
+ onModalAppeared?: () => void;
11
+ onStarsClick?: (rate: number) => void;
12
+ onCommentBlur?: (rate: number, comment: string) => void;
13
+ onContinueClick?: (rate: number, comment: string) => void;
14
+ t?: (key: string) => string;
15
+ };
16
+ export declare const SpecialistReview: React.FC<SpecialistReviewProps>;
17
+ export {};
@@ -0,0 +1,8 @@
1
+ export type Tag = {
2
+ id: string;
3
+ name: string;
4
+ };
5
+ export declare const TAGS_LIST_1: Tag[];
6
+ export declare const TAGS_LIST_2: Tag[];
7
+ export declare const TAGS_LIST_3: Tag[];
8
+ export declare const TAGS_BY_RATING: Record<number, Tag[]>;
@@ -0,0 +1,2 @@
1
+ export { default as ReviewSubscriptionSessionFeature } from './ReviewSubscriptionSessionFeature';
2
+ export type { ReviewSubscriptionSessionFeatureProps } from './ReviewSubscriptionSessionFeature';
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ export type ReviewTrialSessionFeatureProps = {
3
+ specialistName: string;
4
+ specialistAvatar: string;
5
+ isOpen: boolean;
6
+ onSubmit: (data: {
7
+ rate: number;
8
+ reason: string;
9
+ is_custom_reason: boolean;
10
+ comment?: string;
11
+ }) => void;
12
+ showMotivation?: () => void;
13
+ continueTherapy?: () => void;
14
+ onModalAppeared?: () => void;
15
+ onStarsClick?: (rate: number) => void;
16
+ onReasonClick?: (rate: number, reason: string, is_custom_reason: boolean) => void;
17
+ onCommentBlur?: (rate: number, reason: string, is_custom_reason: boolean, comment: string) => void;
18
+ onContinueClick?: (rate: number, reason: string, is_custom_reason: boolean, comment: string) => void;
19
+ onClose?: () => void;
20
+ t?: (key: string) => string;
21
+ };
22
+ declare const ReviewTrialSessionFeature: React.FC<ReviewTrialSessionFeatureProps>;
23
+ export default ReviewTrialSessionFeature;
@@ -0,0 +1,8 @@
1
+ export type Tag = {
2
+ id: string;
3
+ name: string;
4
+ };
5
+ export declare const TAGS_LIST_1: Tag[];
6
+ export declare const TAGS_LIST_2: Tag[];
7
+ export declare const TAGS_LIST_3: Tag[];
8
+ export declare const TAGS_BY_RATING: Record<number, Tag[]>;
@@ -0,0 +1,2 @@
1
+ export { default as ReviewTrialSessionFeature } from './ReviewTrialSessionFeature';
2
+ export type { ReviewTrialSessionFeatureProps } from './ReviewTrialSessionFeature';
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ type StarRatingProps = {
3
+ onSelect: (rating: number) => void;
4
+ selected: number | null;
5
+ };
6
+ export declare const StarRating: React.FC<StarRatingProps>;
7
+ export {};
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ type Tag = {
3
+ id: string;
4
+ name: string;
5
+ };
6
+ type TagsListProps = {
7
+ tags: Tag[];
8
+ selected: Tag | null;
9
+ onClick: (tag: Tag) => void;
10
+ comment: string;
11
+ onCommentChange: (comment: string) => void;
12
+ onCommentBlur: () => void;
13
+ t?: (key: string) => string;
14
+ };
15
+ export declare const TagsList: React.FC<TagsListProps>;
16
+ export {};
@@ -0,0 +1,4 @@
1
+ export { ReviewTrialSessionFeature } from './ReviewTrialSessionFeature';
2
+ export { ReviewSubscriptionSessionFeature } from './ReviewSubscriptionSessionFeature';
3
+ export type { ReviewTrialSessionFeatureProps } from './ReviewTrialSessionFeature';
4
+ export type { ReviewSubscriptionSessionFeatureProps } from './ReviewSubscriptionSessionFeature';
@@ -43,3 +43,4 @@ export * from './FirstChatMessageModalFeature';
43
43
  export * from './ContractDataFeature';
44
44
  export * from './MenuFeature';
45
45
  export * from './EmptySpecialistListFeature';
46
+ export * from './SessionReviewsFeature';
@@ -8,6 +8,18 @@ export type SessionTime = {
8
8
  seconds: number;
9
9
  _nanoseconds?: number;
10
10
  } | string;
11
+ export type SessionReview = {
12
+ id: string;
13
+ consultation_id: string;
14
+ specialist_id: string;
15
+ client_id: string;
16
+ stars_count: number;
17
+ reason?: string;
18
+ is_custom_reason?: boolean;
19
+ text_of_review: string;
20
+ client_avatar: string;
21
+ created_at: number;
22
+ };
11
23
  export type Session = {
12
24
  id: string;
13
25
  consultation_time: SessionTime;
@@ -45,6 +57,7 @@ export type Session = {
45
57
  price_default?: number;
46
58
  payment_intent_id?: string;
47
59
  subscription?: Subscription;
60
+ session_review?: SessionReview;
48
61
  };
49
62
  export type SessionVariant = 'default' | 'current' | 'soon' | 'near' | 'past';
50
63
  export type Consultation = Session;
@@ -4,5 +4,6 @@ export interface TextareaV2Props extends Omit<JSX.IonTextarea, 'color' | 'enterk
4
4
  borderTop?: boolean;
5
5
  showCounter?: boolean;
6
6
  className?: string;
7
+ classNameCounter?: string;
7
8
  onKeyPress?: (e: KeyboardEvent<HTMLIonTextareaElement>) => void;
8
9
  }
@@ -7,3 +7,4 @@ export { getSignAgreementsTabs } from './getSignAgreementsTabs';
7
7
  export * from './specialistStatus';
8
8
  export * from './userCan';
9
9
  export * from './filter';
10
+ export * from './session';
@@ -44,4 +44,5 @@ export declare const mockSessions: {
44
44
  price_default?: number | undefined;
45
45
  payment_intent_id?: string | undefined;
46
46
  subscription?: import("../types").Subscription | undefined;
47
+ session_review?: import("../types").SessionReview | undefined;
47
48
  }[];
@@ -3,10 +3,11 @@ export declare const SOON_SESSION_TIME_SECONDS: number;
3
3
  export declare const NEAR_SESSION_TIME_SECONDS: number;
4
4
  export declare const CAN_MANAGE_SESSION_TIME_HOURS = 24;
5
5
  export declare const getStartSessionDate: (sessionTime?: SessionTime) => Date | undefined;
6
+ export declare const getStartSessionTimestamp: (sessionTime?: SessionTime) => number;
6
7
  export declare const getSessionVariant: (session?: Session) => SessionVariant;
7
8
  export declare const getSessionsByYear: (sessions: Session[]) => Map<number, Session[]>;
8
9
  export declare const getSessionsByMonth: (sessions: Session[]) => Map<number, Session[]>;
9
10
  export declare const getSessionsByDay: (sessions: Session[]) => Map<number, Session[]>;
10
11
  export declare const splitSessions: (sessions: Session[]) => Map<string, Session[]>;
11
- export declare const getSessionTimeLabel: (variant: SessionVariant, startSessionDate: Date, t: TFunction<import("react-i18next").FallbackNs<Ns>, KPrefix>) => string;
12
+ export declare const getSessionTimeLabel: (variant: SessionVariant, startSessionDate: Date, t: TFunction<import("react-i18next").FallbackNs<Ns>, KPrefix>, locale: string) => string;
12
13
  export declare const canManageSession: (sessionDate?: Date) => boolean;
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
- declare const SessionsWidgetSkeleton: React.FC;
2
+ declare const SessionsWidgetSkeleton: React.FC<{
3
+ limit?: number;
4
+ }>;
3
5
  export default SessionsWidgetSkeleton;
@@ -1 +1,2 @@
1
1
  export { default as SessionsListWidget } from './SessionsListWidget';
2
+ export type { SessionsWidgetProps } from './types';
@@ -1,14 +1,17 @@
1
1
  import { WithTranslation } from 'react-i18next';
2
2
  import { Session } from '../../shared/types';
3
- export type SessionTab = 'future' | 'past';
4
3
  export type SessionsWidgetProps = {
5
4
  sessions?: Session[];
6
- t?: WithTranslation['t'];
7
5
  locale: string;
8
6
  isLoading?: boolean;
9
- hasMore?: boolean;
7
+ maxPeriodToReviewPastSessionInHours?: number;
8
+ loadPreviousSessions: () => Promise<{
9
+ list: Session[];
10
+ total: number;
11
+ }>;
12
+ rateSessionCallback?: (session: Session) => void;
10
13
  onSessionClick?(session: Session): void;
11
14
  onSessionStart?(session: Session): void;
12
15
  onScheduleSession?(): void;
13
- onLoadMore?(tab: SessionTab): void;
16
+ t?: WithTranslation['t'];
14
17
  };