@mindly/ui-components 5.93.0 → 5.94.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 (92) hide show
  1. package/dist/cjs/index.js +7 -7
  2. package/dist/cjs/lib2/features/AppHeaderPageFeature/AppHeaderPageSkeletonFeature.d.ts +3 -1
  3. package/dist/cjs/lib2/features/ContractDataFeature/ContractDataFeature.d.ts +4 -0
  4. package/dist/cjs/lib2/features/ContractDataFeature/ContractDataFeature.stories.d.ts +11 -0
  5. package/dist/cjs/lib2/features/ContractDataFeature/index.d.ts +1 -0
  6. package/dist/cjs/lib2/features/ContractDataFeature/styles.d.ts +160 -0
  7. package/dist/cjs/lib2/features/ContractDataFeature/types.d.ts +8 -0
  8. package/dist/cjs/lib2/features/MenuFeature/MenuFeature.d.ts +4 -0
  9. package/dist/cjs/lib2/features/MenuFeature/MenuFeatureSkeleton.d.ts +4 -0
  10. package/dist/cjs/lib2/features/MenuFeature/index.d.ts +1 -0
  11. package/dist/cjs/lib2/features/MenuFeature/types.d.ts +13 -0
  12. package/dist/cjs/lib2/features/SessionPreviewFeature/SessionPreviewFeature.d.ts +4 -0
  13. package/dist/cjs/lib2/features/SessionPreviewFeature/SessionPreviewFeature.stories.d.ts +13 -0
  14. package/dist/cjs/lib2/features/SessionPreviewFeature/SessionPreviewFeatureSkeleton.d.ts +3 -0
  15. package/dist/cjs/lib2/features/SessionPreviewFeature/index.d.ts +1 -0
  16. package/dist/cjs/lib2/features/SessionPreviewFeature/styles.d.ts +157 -0
  17. package/dist/cjs/lib2/features/SessionPreviewFeature/types.d.ts +10 -0
  18. package/dist/cjs/lib2/features/index.d.ts +3 -0
  19. package/dist/cjs/lib2/shared/assets/icons/IconCalendarWithDot.d.ts +3 -0
  20. package/dist/cjs/lib2/shared/assets/icons/IconContract.d.ts +3 -0
  21. package/dist/cjs/lib2/shared/assets/icons/IconReceipt.d.ts +3 -0
  22. package/dist/cjs/lib2/shared/assets/icons/index.d.ts +3 -0
  23. package/dist/cjs/lib2/shared/types/contract.d.ts +1 -0
  24. package/dist/cjs/lib2/shared/types/index.d.ts +1 -1
  25. package/dist/cjs/lib2/shared/types/{consultation.d.ts → session.d.ts} +18 -14
  26. package/dist/cjs/lib2/shared/types/subscription.d.ts +3 -2
  27. package/dist/cjs/lib2/shared/utils/format.d.ts +2 -0
  28. package/dist/cjs/lib2/shared/utils/mock.d.ts +41 -1
  29. package/dist/cjs/lib2/shared/utils/session.d.ts +12 -0
  30. package/dist/cjs/lib2/shared/utils/userCan.d.ts +2 -2
  31. package/dist/cjs/lib2/widgets/SessionDetailWidget/SessionDetailWidget.d.ts +4 -0
  32. package/dist/cjs/lib2/widgets/SessionDetailWidget/SessionDetailWidget.stories.d.ts +15 -0
  33. package/dist/cjs/lib2/widgets/SessionDetailWidget/SessionDetailWidgetSkeleton.d.ts +3 -0
  34. package/dist/cjs/lib2/widgets/SessionDetailWidget/index.d.ts +1 -0
  35. package/dist/cjs/lib2/widgets/SessionDetailWidget/types.d.ts +18 -0
  36. package/dist/cjs/lib2/widgets/SessionPaymentsWidget/SessionPaymentsWidget.d.ts +4 -0
  37. package/dist/cjs/lib2/widgets/SessionPaymentsWidget/SessionPaymentsWidget.stories.d.ts +7 -0
  38. package/dist/cjs/lib2/widgets/SessionPaymentsWidget/index.d.ts +1 -0
  39. package/dist/cjs/lib2/widgets/SessionPaymentsWidget/types.d.ts +11 -0
  40. package/dist/cjs/lib2/widgets/SessionsListWidget/SessionsListWidget.d.ts +4 -0
  41. package/dist/cjs/lib2/widgets/SessionsListWidget/SessionsListWidget.stories.d.ts +8 -0
  42. package/dist/cjs/lib2/widgets/SessionsListWidget/SessionsListWidgetSkeleton.d.ts +3 -0
  43. package/dist/cjs/lib2/widgets/SessionsListWidget/index.d.ts +1 -0
  44. package/dist/cjs/lib2/widgets/SessionsListWidget/types.d.ts +14 -0
  45. package/dist/cjs/lib2/widgets/index.d.ts +3 -0
  46. package/dist/esm/index.js +7 -7
  47. package/dist/esm/lib2/features/AppHeaderPageFeature/AppHeaderPageSkeletonFeature.d.ts +3 -1
  48. package/dist/esm/lib2/features/ContractDataFeature/ContractDataFeature.d.ts +4 -0
  49. package/dist/esm/lib2/features/ContractDataFeature/ContractDataFeature.stories.d.ts +11 -0
  50. package/dist/esm/lib2/features/ContractDataFeature/index.d.ts +1 -0
  51. package/dist/esm/lib2/features/ContractDataFeature/styles.d.ts +160 -0
  52. package/dist/esm/lib2/features/ContractDataFeature/types.d.ts +8 -0
  53. package/dist/esm/lib2/features/MenuFeature/MenuFeature.d.ts +4 -0
  54. package/dist/esm/lib2/features/MenuFeature/MenuFeatureSkeleton.d.ts +4 -0
  55. package/dist/esm/lib2/features/MenuFeature/index.d.ts +1 -0
  56. package/dist/esm/lib2/features/MenuFeature/types.d.ts +13 -0
  57. package/dist/esm/lib2/features/SessionPreviewFeature/SessionPreviewFeature.d.ts +4 -0
  58. package/dist/esm/lib2/features/SessionPreviewFeature/SessionPreviewFeature.stories.d.ts +13 -0
  59. package/dist/esm/lib2/features/SessionPreviewFeature/SessionPreviewFeatureSkeleton.d.ts +3 -0
  60. package/dist/esm/lib2/features/SessionPreviewFeature/index.d.ts +1 -0
  61. package/dist/esm/lib2/features/SessionPreviewFeature/styles.d.ts +157 -0
  62. package/dist/esm/lib2/features/SessionPreviewFeature/types.d.ts +10 -0
  63. package/dist/esm/lib2/features/index.d.ts +3 -0
  64. package/dist/esm/lib2/shared/assets/icons/IconCalendarWithDot.d.ts +3 -0
  65. package/dist/esm/lib2/shared/assets/icons/IconContract.d.ts +3 -0
  66. package/dist/esm/lib2/shared/assets/icons/IconReceipt.d.ts +3 -0
  67. package/dist/esm/lib2/shared/assets/icons/index.d.ts +3 -0
  68. package/dist/esm/lib2/shared/types/contract.d.ts +1 -0
  69. package/dist/esm/lib2/shared/types/index.d.ts +1 -1
  70. package/dist/esm/lib2/shared/types/{consultation.d.ts → session.d.ts} +18 -14
  71. package/dist/esm/lib2/shared/types/subscription.d.ts +3 -2
  72. package/dist/esm/lib2/shared/utils/format.d.ts +2 -0
  73. package/dist/esm/lib2/shared/utils/mock.d.ts +41 -1
  74. package/dist/esm/lib2/shared/utils/session.d.ts +12 -0
  75. package/dist/esm/lib2/shared/utils/userCan.d.ts +2 -2
  76. package/dist/esm/lib2/widgets/SessionDetailWidget/SessionDetailWidget.d.ts +4 -0
  77. package/dist/esm/lib2/widgets/SessionDetailWidget/SessionDetailWidget.stories.d.ts +15 -0
  78. package/dist/esm/lib2/widgets/SessionDetailWidget/SessionDetailWidgetSkeleton.d.ts +3 -0
  79. package/dist/esm/lib2/widgets/SessionDetailWidget/index.d.ts +1 -0
  80. package/dist/esm/lib2/widgets/SessionDetailWidget/types.d.ts +18 -0
  81. package/dist/esm/lib2/widgets/SessionPaymentsWidget/SessionPaymentsWidget.d.ts +4 -0
  82. package/dist/esm/lib2/widgets/SessionPaymentsWidget/SessionPaymentsWidget.stories.d.ts +7 -0
  83. package/dist/esm/lib2/widgets/SessionPaymentsWidget/index.d.ts +1 -0
  84. package/dist/esm/lib2/widgets/SessionPaymentsWidget/types.d.ts +11 -0
  85. package/dist/esm/lib2/widgets/SessionsListWidget/SessionsListWidget.d.ts +4 -0
  86. package/dist/esm/lib2/widgets/SessionsListWidget/SessionsListWidget.stories.d.ts +8 -0
  87. package/dist/esm/lib2/widgets/SessionsListWidget/SessionsListWidgetSkeleton.d.ts +3 -0
  88. package/dist/esm/lib2/widgets/SessionsListWidget/index.d.ts +1 -0
  89. package/dist/esm/lib2/widgets/SessionsListWidget/types.d.ts +14 -0
  90. package/dist/esm/lib2/widgets/index.d.ts +3 -0
  91. package/dist/index.d.ts +111 -18
  92. package/package.json +1 -1
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
- declare const AppHeaderSkeleton: React.FC;
2
+ declare const AppHeaderSkeleton: React.FC<{
3
+ hasChildren: boolean;
4
+ }>;
3
5
  export default AppHeaderSkeleton;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ContractDataFeatureProps } from './types';
3
+ declare const ContractDataFeature: React.FC<ContractDataFeatureProps>;
4
+ export default ContractDataFeature;
@@ -0,0 +1,11 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import ContractDataFeature from './ContractDataFeature';
3
+ declare const meta: Meta<typeof ContractDataFeature>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ContractDataFeature>;
6
+ export declare const Default: Story;
7
+ export declare const NotSigned: Story;
8
+ export declare const Pending: Story;
9
+ export declare const Expired: Story;
10
+ export declare const Blocked: Story;
11
+ export declare const None: Story;
@@ -0,0 +1 @@
1
+ export { default as ContractDataFeature } from './ContractDataFeature';
@@ -0,0 +1,160 @@
1
+ export declare const contractDataFeatureStyle: import("tailwind-variants").TVReturnType<{
2
+ status: {
3
+ pending: {
4
+ root: string;
5
+ subtitle: string;
6
+ icon: string;
7
+ };
8
+ not_signed: {
9
+ root: string;
10
+ subtitle: string;
11
+ icon: string;
12
+ };
13
+ expired: {};
14
+ none: {
15
+ root: string;
16
+ };
17
+ expired_none: {
18
+ root: string;
19
+ };
20
+ active: {};
21
+ };
22
+ }, {
23
+ root: string;
24
+ subtitle: string;
25
+ icon: string;
26
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
27
+ status: {
28
+ pending: {
29
+ root: string;
30
+ subtitle: string;
31
+ icon: string;
32
+ };
33
+ not_signed: {
34
+ root: string;
35
+ subtitle: string;
36
+ icon: string;
37
+ };
38
+ expired: {};
39
+ none: {
40
+ root: string;
41
+ };
42
+ expired_none: {
43
+ root: string;
44
+ };
45
+ active: {};
46
+ };
47
+ }, {
48
+ status: {
49
+ pending: {
50
+ root: string;
51
+ subtitle: string;
52
+ icon: string;
53
+ };
54
+ not_signed: {
55
+ root: string;
56
+ subtitle: string;
57
+ icon: string;
58
+ };
59
+ expired: {};
60
+ none: {
61
+ root: string;
62
+ };
63
+ expired_none: {
64
+ root: string;
65
+ };
66
+ active: {};
67
+ };
68
+ }>, {
69
+ status: {
70
+ pending: {
71
+ root: string;
72
+ subtitle: string;
73
+ icon: string;
74
+ };
75
+ not_signed: {
76
+ root: string;
77
+ subtitle: string;
78
+ icon: string;
79
+ };
80
+ expired: {};
81
+ none: {
82
+ root: string;
83
+ };
84
+ expired_none: {
85
+ root: string;
86
+ };
87
+ active: {};
88
+ };
89
+ }, {
90
+ root: string;
91
+ subtitle: string;
92
+ icon: string;
93
+ }, import("tailwind-variants").TVReturnType<{
94
+ status: {
95
+ pending: {
96
+ root: string;
97
+ subtitle: string;
98
+ icon: string;
99
+ };
100
+ not_signed: {
101
+ root: string;
102
+ subtitle: string;
103
+ icon: string;
104
+ };
105
+ expired: {};
106
+ none: {
107
+ root: string;
108
+ };
109
+ expired_none: {
110
+ root: string;
111
+ };
112
+ active: {};
113
+ };
114
+ }, {
115
+ root: string;
116
+ subtitle: string;
117
+ icon: string;
118
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
119
+ status: {
120
+ pending: {
121
+ root: string;
122
+ subtitle: string;
123
+ icon: string;
124
+ };
125
+ not_signed: {
126
+ root: string;
127
+ subtitle: string;
128
+ icon: string;
129
+ };
130
+ expired: {};
131
+ none: {
132
+ root: string;
133
+ };
134
+ expired_none: {
135
+ root: string;
136
+ };
137
+ active: {};
138
+ };
139
+ }, {
140
+ status: {
141
+ pending: {
142
+ root: string;
143
+ subtitle: string;
144
+ icon: string;
145
+ };
146
+ not_signed: {
147
+ root: string;
148
+ subtitle: string;
149
+ icon: string;
150
+ };
151
+ expired: {};
152
+ none: {
153
+ root: string;
154
+ };
155
+ expired_none: {
156
+ root: string;
157
+ };
158
+ active: {};
159
+ };
160
+ }>, unknown, unknown, undefined>>;
@@ -0,0 +1,8 @@
1
+ import { WithTranslation } from 'react-i18next';
2
+ import { Specialist } from '../../shared';
3
+ export type ContractDataFeatureProps = {
4
+ specialist?: Specialist;
5
+ onOpenContract?(): void;
6
+ t?: WithTranslation['t'];
7
+ className?: string;
8
+ };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { MenuFeatureProps } from './types';
3
+ declare const MenuFeature: React.FC<MenuFeatureProps>;
4
+ export default MenuFeature;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { MenuFeatureProps } from './types';
3
+ declare const MenuFeature: React.FC<MenuFeatureProps>;
4
+ export default MenuFeature;
@@ -0,0 +1 @@
1
+ export { default as MenuFeature } from './MenuFeature';
@@ -0,0 +1,13 @@
1
+ import { FC, SVGProps } from 'react';
2
+ export type MenuItem = {
3
+ Icon?: FC<SVGProps<SVGSVGElement>>;
4
+ label: string;
5
+ withArrow?: boolean;
6
+ disabled?: boolean;
7
+ onClick?: () => void;
8
+ };
9
+ export type MenuFeatureProps = {
10
+ items: MenuItem[];
11
+ className?: string;
12
+ isLoading?: boolean;
13
+ };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SessionPreviewFeatureProps } from './types';
3
+ declare const SessionPreviewFeature: React.FC<SessionPreviewFeatureProps>;
4
+ export default SessionPreviewFeature;
@@ -0,0 +1,13 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import SessionPreviewFeature from './SessionPreviewFeature';
3
+ declare const meta: Meta<typeof SessionPreviewFeature>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SessionPreviewFeature>;
6
+ export declare const Default: Story;
7
+ export declare const Current: Story;
8
+ export declare const Soon: Story;
9
+ export declare const Near: Story;
10
+ export declare const NearInDays: Story;
11
+ export declare const Future: Story;
12
+ export declare const Past: Story;
13
+ export declare const Loading: Story;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const SessionPreviewFeatureSkeleton: React.FC;
3
+ export default SessionPreviewFeatureSkeleton;
@@ -0,0 +1 @@
1
+ export { default as SessionPreviewFeature } from './SessionPreviewFeature';
@@ -0,0 +1,157 @@
1
+ export declare const sessionPreviewFeatureStyle: import("tailwind-variants").TVReturnType<{
2
+ variant: {
3
+ default: {
4
+ root: string;
5
+ };
6
+ current: {
7
+ root: string;
8
+ label: string;
9
+ };
10
+ soon: {
11
+ root: string;
12
+ label: string;
13
+ };
14
+ near: {
15
+ root: string;
16
+ label: string;
17
+ };
18
+ past: {
19
+ root: string;
20
+ };
21
+ };
22
+ }, {
23
+ root: string;
24
+ label: string;
25
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
26
+ variant: {
27
+ default: {
28
+ root: string;
29
+ };
30
+ current: {
31
+ root: string;
32
+ label: string;
33
+ };
34
+ soon: {
35
+ root: string;
36
+ label: string;
37
+ };
38
+ near: {
39
+ root: string;
40
+ label: string;
41
+ };
42
+ past: {
43
+ root: string;
44
+ };
45
+ };
46
+ }, {
47
+ variant: {
48
+ default: {
49
+ root: string;
50
+ };
51
+ current: {
52
+ root: string;
53
+ label: string;
54
+ };
55
+ soon: {
56
+ root: string;
57
+ label: string;
58
+ };
59
+ near: {
60
+ root: string;
61
+ label: string;
62
+ };
63
+ past: {
64
+ root: string;
65
+ };
66
+ };
67
+ }>, {
68
+ variant: {
69
+ default: {
70
+ root: string;
71
+ };
72
+ current: {
73
+ root: string;
74
+ label: string;
75
+ };
76
+ soon: {
77
+ root: string;
78
+ label: string;
79
+ };
80
+ near: {
81
+ root: string;
82
+ label: string;
83
+ };
84
+ past: {
85
+ root: string;
86
+ };
87
+ };
88
+ }, {
89
+ root: string;
90
+ label: string;
91
+ }, import("tailwind-variants").TVReturnType<{
92
+ variant: {
93
+ default: {
94
+ root: string;
95
+ };
96
+ current: {
97
+ root: string;
98
+ label: string;
99
+ };
100
+ soon: {
101
+ root: string;
102
+ label: string;
103
+ };
104
+ near: {
105
+ root: string;
106
+ label: string;
107
+ };
108
+ past: {
109
+ root: string;
110
+ };
111
+ };
112
+ }, {
113
+ root: string;
114
+ label: string;
115
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
116
+ variant: {
117
+ default: {
118
+ root: string;
119
+ };
120
+ current: {
121
+ root: string;
122
+ label: string;
123
+ };
124
+ soon: {
125
+ root: string;
126
+ label: string;
127
+ };
128
+ near: {
129
+ root: string;
130
+ label: string;
131
+ };
132
+ past: {
133
+ root: string;
134
+ };
135
+ };
136
+ }, {
137
+ variant: {
138
+ default: {
139
+ root: string;
140
+ };
141
+ current: {
142
+ root: string;
143
+ label: string;
144
+ };
145
+ soon: {
146
+ root: string;
147
+ label: string;
148
+ };
149
+ near: {
150
+ root: string;
151
+ label: string;
152
+ };
153
+ past: {
154
+ root: string;
155
+ };
156
+ };
157
+ }>, unknown, unknown, undefined>>;
@@ -0,0 +1,10 @@
1
+ import { Session } from '../../shared';
2
+ import { WithTranslation } from 'react-i18next';
3
+ export type SessionPreviewFeatureProps = {
4
+ session?: Session;
5
+ viewPerson?: 'client' | 'specialist';
6
+ t?: WithTranslation['t'];
7
+ isLoading?: boolean;
8
+ onSessionClick?(session: Session): void;
9
+ onSessionStart?(session: Session): void;
10
+ };
@@ -36,5 +36,8 @@ export * from './SpecialistEducationsFeature';
36
36
  export * from './SpecialistPreviewFeature';
37
37
  export * from './AppHeaderPageFeature';
38
38
  export * from './TabsToolbarFeature';
39
+ export * from './SessionPreviewFeature';
39
40
  export * from './EmptyChatModalFeature';
40
41
  export * from './FirstChatMessageModalFeature';
42
+ export * from './ContractDataFeature';
43
+ export * from './MenuFeature';
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { IconProps } from '../../types/iconProps';
3
+ export declare const IconCalendarWithDot: React.FC<IconProps>;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { IconProps } from '../../types/iconProps';
3
+ export declare const IconContract: React.FC<IconProps>;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { IconProps } from '../../types/iconProps';
3
+ export declare const IconReceipt: React.FC<IconProps>;
@@ -101,3 +101,6 @@ export * from './IconEmptyList';
101
101
  export * from './IconChat';
102
102
  export * from './IconMindlyMini';
103
103
  export * from './IconSchedule';
104
+ export * from './IconContract';
105
+ export * from './IconReceipt';
106
+ export * from './IconCalendarWithDot';
@@ -10,3 +10,4 @@ export declare enum ClientSpecialistContractStatusEnum {
10
10
  signed_by_client = "signed_by_client",
11
11
  expired = "expired"
12
12
  }
13
+ export declare const MapStatusContractToUIStatus: Record<ClientSpecialistContractStatusEnum, 'active' | 'pending' | 'not_signed' | 'expired'>;
@@ -11,4 +11,4 @@ export * from './review';
11
11
  export * from './contract';
12
12
  export * from './user';
13
13
  export * from './subscription';
14
- export * from './consultation';
14
+ export * from './session';
@@ -1,20 +1,24 @@
1
1
  import { ClientSpecialistContractStatusEnum } from './contract';
2
2
  import { Specialist } from './specialistTypes';
3
- export type Consultation = {
3
+ import { Subscription } from './subscription';
4
+ import { UserType } from './user';
5
+ export type SessionTime = {
6
+ _seconds: number;
7
+ nanoseconds?: number;
8
+ seconds: number;
9
+ _nanoseconds?: number;
10
+ } | string;
11
+ export type Session = {
4
12
  id: string;
5
- consultation_time: {
6
- _seconds: number;
7
- nanoseconds: number;
8
- } | string;
13
+ consultation_time: SessionTime;
14
+ consultation_booking_date?: SessionTime;
15
+ consultation_id?: string;
9
16
  consultation_with: string;
10
17
  duration: number;
11
18
  exchange_rate: string;
12
- payment_date: {
13
- _seconds: number;
14
- nanoseconds: number;
15
- };
19
+ payment_date?: SessionTime;
16
20
  payment_type?: string;
17
- price: number;
21
+ price: number | string;
18
22
  price_uah: number;
19
23
  psychologist_avatar: string;
20
24
  psychologist_id: string;
@@ -27,11 +31,9 @@ export type Consultation = {
27
31
  videochat_url: string;
28
32
  was_rescheduled: boolean;
29
33
  session_status?: 'client_showed' | 'client_not_showed';
30
- consultation_time_before_rescheduling?: {
31
- _seconds: number;
32
- nanoseconds: number;
33
- };
34
+ consultation_time_before_rescheduling?: SessionTime;
34
35
  therapist?: Specialist;
36
+ user?: UserType;
35
37
  client?: {
36
38
  specialist_client_contract_id?: string | null;
37
39
  specialist_client_contract_status?: ClientSpecialistContractStatusEnum | null;
@@ -42,4 +44,6 @@ export type Consultation = {
42
44
  price_type?: string;
43
45
  price_default?: number;
44
46
  payment_intent_id?: string;
47
+ subscription?: Subscription;
45
48
  };
49
+ export type SessionVariant = 'default' | 'current' | 'soon' | 'near' | 'past';
@@ -35,10 +35,11 @@ export type Subscription = {
35
35
  pause_used_at?: number | null;
36
36
  number_of_sessions_per_week: number;
37
37
  used_balance: number;
38
- therapist: Specialist;
39
- user: UserType;
38
+ therapist?: Specialist;
39
+ user?: UserType;
40
40
  next_payment_default_in_cents: number;
41
41
  next_payment_original_in_cents: number;
42
42
  exchange_rate_in_basis_points: number;
43
43
  charge_currency: SupportedCurrency;
44
+ exchange_rate: string;
44
45
  };
@@ -1,2 +1,4 @@
1
1
  export declare const formatByDigits: (value: number) => string;
2
2
  export declare const roundToPrecision: (value: number, decimals?: number) => number;
3
+ export declare const getDateLocale: (locale: string) => Locale;
4
+ export declare const getGMTOffset: (timeZone: string) => string;
@@ -1,7 +1,47 @@
1
+ import { ClientSpecialistContractStatusEnum } from '../types/contract';
1
2
  import { UserType } from '../types/user';
2
3
  import { Specialist } from '../types/specialistTypes';
3
- import { SpecialistReview } from '../types';
4
+ import { Session, SpecialistReview } from '../types';
4
5
  export declare const mockT: (translate?: Record<string, string>) => TFunction<import("react-i18next").FallbackNs<Ns>, KPrefix>;
5
6
  export declare const specialist: Specialist;
6
7
  export declare const currentUser: UserType;
7
8
  export declare const listReviews: SpecialistReview[];
9
+ export declare const mockSession: Session;
10
+ export declare const mockSessions: {
11
+ consultation_time: any;
12
+ id: string;
13
+ consultation_booking_date?: import("../types").SessionTime | undefined;
14
+ consultation_id?: string | undefined;
15
+ consultation_with: string;
16
+ duration: number;
17
+ exchange_rate: string;
18
+ payment_date?: import("../types").SessionTime | undefined;
19
+ payment_type?: string | undefined;
20
+ price: string | number;
21
+ price_uah: number;
22
+ psychologist_avatar: string;
23
+ psychologist_id: string;
24
+ psychologist_name: string;
25
+ psychologist_timezone: string;
26
+ user_avatar: string;
27
+ user_id: string;
28
+ user_name: string;
29
+ user_timezone: string;
30
+ videochat_url: string;
31
+ was_rescheduled: boolean;
32
+ session_status?: "client_showed" | "client_not_showed" | undefined;
33
+ consultation_time_before_rescheduling?: import("../types").SessionTime | undefined;
34
+ therapist?: Specialist | undefined;
35
+ user?: UserType | undefined;
36
+ client?: {
37
+ specialist_client_contract_id?: string | null | undefined;
38
+ specialist_client_contract_status?: ClientSpecialistContractStatusEnum | null | undefined;
39
+ } | undefined;
40
+ applied_promotional_code?: string | null | undefined;
41
+ auto_booking_status?: "enable" | "disable" | undefined;
42
+ subscription_id?: string | null | undefined;
43
+ price_type?: string | undefined;
44
+ price_default?: number | undefined;
45
+ payment_intent_id?: string | undefined;
46
+ subscription?: import("../types").Subscription | undefined;
47
+ }[];
@@ -0,0 +1,12 @@
1
+ import { Session, SessionTime, SessionVariant } from '../types';
2
+ export declare const SOON_SESSION_TIME_SECONDS: number;
3
+ export declare const NEAR_SESSION_TIME_SECONDS: number;
4
+ export declare const CAN_MANAGE_SESSION_TIME_HOURS = 24;
5
+ export declare const getStartSessionDate: (sessionTime?: SessionTime) => Date | undefined;
6
+ export declare const getSessionVariant: (session?: Session) => SessionVariant;
7
+ export declare const getSessionsByYear: (sessions: Session[]) => Record<number, Session[]>;
8
+ export declare const getSessionsByMonth: (sessions: Session[]) => Record<number, Session[]>;
9
+ export declare const getSessionsByDay: (sessions: Session[]) => Record<number, Session[]>;
10
+ export declare const splitSessions: (sessions: Session[]) => Record<string, Session[]>;
11
+ export declare const getSessionTimeLabel: (variant: SessionVariant, startSessionDate: Date, t: TFunction<import("react-i18next").FallbackNs<Ns>, KPrefix>) => string;
12
+ export declare const canManageSession: (sessionDate?: Date) => boolean;
@@ -1,5 +1,5 @@
1
1
  import { AutoComplete } from '../types';
2
- import { Consultation } from '../types/consultation';
2
+ import { Session } from '../types/session';
3
3
  import { Specialist } from '../types/specialistTypes';
4
4
  import { Subscription } from '../types/subscription';
5
5
  export type ClientCanAction = AutoComplete<'book_session'>;
@@ -8,6 +8,6 @@ export type ClientCanParams = {
8
8
  specialist: Specialist;
9
9
  activeSubscription?: Subscription | null;
10
10
  subscriptionAvailableBalance?: number;
11
- consultations?: Consultation[];
11
+ sessions?: Session[];
12
12
  };
13
13
  export declare const isClientCan: ({ action, ...params }: ClientCanParams) => boolean;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SessionDetailWidgetProps } from './types';
3
+ declare const SessionDetailWidget: React.FC<SessionDetailWidgetProps>;
4
+ export default SessionDetailWidget;
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import SessionDetailWidget from './SessionDetailWidget';
3
+ declare const meta: Meta<typeof SessionDetailWidget>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SessionDetailWidget>;
6
+ export declare const Default: Story;
7
+ export declare const Current: Story;
8
+ export declare const Soon: Story;
9
+ export declare const Past: Story;
10
+ export declare const Near: Story;
11
+ export declare const NearInDays: Story;
12
+ export declare const Future: Story;
13
+ export declare const Loading: Story;
14
+ export declare const SpecialistBlocked: Story;
15
+ export declare const TrialSession: Story;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const SessionDetailWidgetSkeleton: React.FC;
3
+ export default SessionDetailWidgetSkeleton;
@@ -0,0 +1 @@
1
+ export { default as SessionDetailWidget } from './SessionDetailWidget';