mautourco-components 0.2.21 → 0.2.23

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 (141) hide show
  1. package/dist/components/atoms/Checkbox/Checkbox.d.ts +3 -2
  2. package/dist/components/atoms/Checkbox/Checkbox.js +16 -6
  3. package/dist/components/atoms/Icon/icons/PlusCircleIcon.js +1 -1
  4. package/dist/components/atoms/Inputs/Input/Input.d.ts +1 -1
  5. package/dist/components/molecules/AddItemButton/AddItemButton.css +2088 -0
  6. package/dist/components/molecules/AddItemButton/AddItemButton.d.ts +7 -0
  7. package/dist/components/molecules/AddItemButton/AddItemButton.js +19 -0
  8. package/dist/components/molecules/BookingPax/BookingPax.d.ts +43 -0
  9. package/dist/components/molecules/BookingPax/BookingPax.js +43 -0
  10. package/dist/components/molecules/BookingPax/BookingPaxAccom.d.ts +34 -0
  11. package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +10 -0
  12. package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.d.ts +89 -1
  13. package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.js +34 -11
  14. package/dist/components/molecules/BookingPax/BookingPaxExcursion.d.ts +43 -0
  15. package/dist/components/molecules/BookingPax/BookingPaxExcursion.js +19 -0
  16. package/dist/components/molecules/BookingPax/BookingPaxHeader.d.ts +15 -0
  17. package/dist/components/molecules/BookingPax/BookingPaxHeader.js +13 -0
  18. package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.d.ts +30 -0
  19. package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.js +15 -0
  20. package/dist/components/molecules/BookingPax/BookingPaxRemarks.d.ts +14 -0
  21. package/dist/components/molecules/BookingPax/BookingPaxRemarks.js +11 -0
  22. package/dist/components/molecules/BookingPax/BookingPaxTransfer.d.ts +51 -0
  23. package/dist/components/molecules/BookingPax/BookingPaxTransfer.js +19 -2
  24. package/dist/components/molecules/BookingPax/index.d.ts +1 -0
  25. package/dist/components/molecules/BookingPax/index.js +1 -0
  26. package/dist/components/molecules/Calendar/DateTime.d.ts +5 -5
  27. package/dist/components/molecules/Calendar/DateTime.js +48 -37
  28. package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.d.ts +20 -0
  29. package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.js +17 -6
  30. package/dist/components/molecules/DialogContentPolicy/DialogContentPolicy.d.ts +18 -0
  31. package/dist/components/molecules/DialogContentPolicy/DialogContentPolicy.js +14 -3
  32. package/dist/components/molecules/ServiceSelector/ServiceSelector.d.ts +3 -0
  33. package/dist/components/molecules/ServiceSelector/ServiceSelector.js +23 -12
  34. package/dist/components/organisms/Booking/BookingPaxList.d.ts +64 -0
  35. package/dist/components/organisms/Booking/BookingPaxList.js +19 -0
  36. package/dist/components/organisms/BookingAddItem/AddItemNewService.d.ts +12 -0
  37. package/dist/components/organisms/BookingAddItem/AddItemNewService.js +48 -0
  38. package/dist/components/organisms/BookingAddItem/AddItemSelector.d.ts +9 -0
  39. package/dist/components/organisms/BookingAddItem/AddItemSelector.js +23 -0
  40. package/dist/components/organisms/BookingAddItem/BookingAddItem.d.ts +16 -0
  41. package/dist/components/organisms/BookingAddItem/BookingAddItem.js +66 -0
  42. package/dist/components/organisms/BookingAddItem/index.d.ts +3 -0
  43. package/dist/components/organisms/BookingAddItem/index.js +3 -0
  44. package/dist/components/organisms/DateTimePicker/DateTimePicker.js +11 -7
  45. package/dist/components/organisms/Dialog/Dialog.d.ts +1 -1
  46. package/dist/components/organisms/Dialog/Dialog.js +4 -4
  47. package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.d.ts +29 -0
  48. package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.js +31 -0
  49. package/dist/components/organisms/DialogBookingConfirm/BookingMailSent.d.ts +29 -0
  50. package/dist/components/organisms/DialogBookingConfirm/BookingMailSent.js +31 -0
  51. package/dist/components/organisms/DialogBookingConfirm/BookingReference.d.ts +35 -0
  52. package/dist/components/organisms/DialogBookingConfirm/BookingReference.js +37 -0
  53. package/dist/components/organisms/DialogBookingConfirm/BookingSuccess.d.ts +35 -0
  54. package/dist/components/organisms/DialogBookingConfirm/BookingSuccess.js +33 -0
  55. package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.d.ts +39 -2
  56. package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.js +25 -1
  57. package/dist/components/organisms/DialogBookingConfirm/index.d.ts +5 -0
  58. package/dist/components/organisms/DialogBookingConfirm/index.js +1 -0
  59. package/dist/components/organisms/PaxSelector/PaxSelector.d.ts +1 -0
  60. package/dist/components/organisms/PaxSelector/PaxSelector.js +50 -28
  61. package/dist/components/organisms/TabCancellationPolicy/CancellationAccom.d.ts +25 -0
  62. package/dist/components/organisms/TabCancellationPolicy/CancellationAccom.js +16 -0
  63. package/dist/components/organisms/TabCancellationPolicy/CancellationBody.d.ts +24 -0
  64. package/dist/components/organisms/TabCancellationPolicy/CancellationBody.js +24 -0
  65. package/dist/components/organisms/TabCancellationPolicy/CancellationExcursion.d.ts +30 -0
  66. package/dist/components/organisms/TabCancellationPolicy/CancellationExcursion.js +15 -0
  67. package/dist/components/organisms/TabCancellationPolicy/CancellationHeader.d.ts +23 -0
  68. package/dist/components/organisms/TabCancellationPolicy/CancellationHeader.js +23 -0
  69. package/dist/components/organisms/TabCancellationPolicy/CancellationTransfer.d.ts +22 -0
  70. package/dist/components/organisms/TabCancellationPolicy/CancellationTransfer.js +13 -0
  71. package/dist/components/organisms/TabCancellationPolicy/HeaderAccom.d.ts +22 -0
  72. package/dist/components/organisms/TabCancellationPolicy/HeaderAccom.js +13 -0
  73. package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion.d.ts +18 -0
  74. package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion.js +12 -0
  75. package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +7 -0
  76. package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.js +2 -1
  77. package/dist/components/organisms/TabCancellationPolicy/PolicyExcursion.d.ts +18 -0
  78. package/dist/components/organisms/TabCancellationPolicy/PolicyExcursion.js +12 -0
  79. package/dist/components/organisms/TabCancellationPolicy/PolicyTransfer.d.ts +11 -0
  80. package/dist/components/organisms/TabCancellationPolicy/PolicyTransfer.js +11 -0
  81. package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicy.d.ts +29 -0
  82. package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicy.js +29 -0
  83. package/dist/components/ui/popover.js +1 -1
  84. package/dist/index.d.ts +7 -0
  85. package/dist/index.js +4 -2
  86. package/dist/styles/components/checkbox.css +16 -9
  87. package/dist/styles/components/molecule/calendarInput.css +3 -4
  88. package/dist/styles/components/molecule/service-selector.css +70 -21
  89. package/package.json +1 -2
  90. package/src/components/atoms/Checkbox/Checkbox.tsx +38 -23
  91. package/src/components/atoms/Icon/icons/PlusCircleIcon.tsx +2 -2
  92. package/src/components/atoms/Inputs/Input/Input.tsx +1 -1
  93. package/src/components/molecules/AddItemButton/AddItemButton.css +5 -0
  94. package/src/components/molecules/AddItemButton/AddItemButton.tsx +18 -0
  95. package/src/components/molecules/BookingPax/BookingPax.tsx +43 -0
  96. package/src/components/molecules/BookingPax/BookingPaxAccom.tsx +34 -0
  97. package/src/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +6 -0
  98. package/src/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.tsx +92 -18
  99. package/src/components/molecules/BookingPax/BookingPaxExcursion.tsx +43 -0
  100. package/src/components/molecules/BookingPax/BookingPaxHeader.tsx +28 -1
  101. package/src/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.tsx +30 -0
  102. package/src/components/molecules/BookingPax/BookingPaxRemarks.tsx +14 -0
  103. package/src/components/molecules/BookingPax/BookingPaxTransfer.tsx +52 -2
  104. package/src/components/molecules/BookingPax/index.ts +2 -0
  105. package/src/components/molecules/Calendar/DateTime.tsx +69 -53
  106. package/src/components/molecules/DialogContentPolicy/DialogCancellationList.tsx +32 -12
  107. package/src/components/molecules/DialogContentPolicy/DialogContentPolicy.tsx +27 -11
  108. package/src/components/molecules/ServiceSelector/ServiceSelector.tsx +91 -83
  109. package/src/components/organisms/Booking/BookingPaxList.tsx +64 -0
  110. package/src/components/organisms/BookingAddItem/AddItemNewService.tsx +95 -0
  111. package/src/components/organisms/BookingAddItem/AddItemSelector.tsx +43 -0
  112. package/src/components/organisms/BookingAddItem/BookingAddItem.tsx +120 -0
  113. package/src/components/organisms/BookingAddItem/index.ts +3 -0
  114. package/src/components/organisms/DateTimePicker/DateTimePicker.tsx +13 -7
  115. package/src/components/organisms/Dialog/Dialog.tsx +13 -20
  116. package/src/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.tsx +44 -0
  117. package/src/components/organisms/DialogBookingConfirm/BookingMailSent.tsx +56 -0
  118. package/src/components/organisms/DialogBookingConfirm/BookingReference.tsx +74 -0
  119. package/src/components/organisms/DialogBookingConfirm/BookingSuccess.tsx +67 -0
  120. package/src/components/organisms/DialogBookingConfirm/DialogBookingConfirm.tsx +43 -2
  121. package/src/components/organisms/DialogBookingConfirm/index.ts +6 -0
  122. package/src/components/organisms/PaxSelector/PaxSelector.tsx +305 -193
  123. package/src/components/organisms/TabCancellationPolicy/CancellationAccom.tsx +25 -0
  124. package/src/components/organisms/TabCancellationPolicy/CancellationBody.tsx +24 -0
  125. package/src/components/organisms/TabCancellationPolicy/CancellationExcursion.tsx +30 -0
  126. package/src/components/organisms/TabCancellationPolicy/CancellationHeader.tsx +23 -0
  127. package/src/components/organisms/TabCancellationPolicy/CancellationTransfer.tsx +22 -0
  128. package/src/components/organisms/TabCancellationPolicy/HeaderAccom.tsx +22 -0
  129. package/src/components/organisms/TabCancellationPolicy/HeaderExcursion.tsx +18 -0
  130. package/src/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +3 -0
  131. package/src/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.tsx +3 -2
  132. package/src/components/organisms/TabCancellationPolicy/PolicyExcursion.tsx +18 -0
  133. package/src/components/organisms/TabCancellationPolicy/PolicyTransfer.tsx +11 -0
  134. package/src/components/organisms/TabCancellationPolicy/TabCancellationPolicy.tsx +29 -0
  135. package/src/components/ui/popover.tsx +2 -4
  136. package/src/styles/components/checkbox.css +16 -9
  137. package/src/styles/components/molecule/calendarInput.css +12 -13
  138. package/src/styles/components/molecule/service-selector.css +71 -23
  139. package/dist/components/ui/checkbox.d.ts +0 -4
  140. package/dist/components/ui/checkbox.js +0 -31
  141. package/src/components/ui/checkbox.tsx +0 -32
@@ -3,6 +3,49 @@ import { BookingPaxAccom } from './BookingPaxAccom';
3
3
  import { BookingPaxExcursion } from './BookingPaxExcursion';
4
4
  import { BookingPaxTransfer } from './BookingPaxTransfer';
5
5
 
6
+ /**
7
+ * BookingPax is a component that allows the user to display the booking pax.
8
+ *
9
+ * @example
10
+ * <BookingPax>
11
+ * <BookingPax.Accom
12
+ * name="Hotel Name"
13
+ * type="hotel"
14
+ * clientsInfo={clientsInfo}
15
+ * paxCount={1}
16
+ * selectedClientsInfoIds={selectedClientsInfoIds}
17
+ * isSubmitted={false}
18
+ * onPaxChange={onPaxChange}
19
+ * onRemarkChange={onRemarkChange}
20
+ * onError={onError}
21
+ * />
22
+ * <BookingPax.Excursion
23
+ * name="Excursion Name"
24
+ * type="sea"
25
+ * clientsInfo={clientsInfo}
26
+ * paxCount={1}
27
+ * selectedClientsInfoIds={selectedClientsInfoIds}
28
+ * isSubmitted={false}
29
+ * onPaxChange={onPaxChange}
30
+ * onRemarkChange={onRemarkChange}
31
+ * onError={onError}
32
+ * />
33
+ * <BookingPax.Transfer
34
+ * name="Transfer Name"
35
+ * type="transfer"
36
+ * clientsInfo={clientsInfo}
37
+ * paxCount={1}
38
+ * selectedClientsInfoIds={selectedClientsInfoIds}
39
+ * isSubmitted={false}
40
+ * onPaxChange={onPaxChange}
41
+ * onRemarkChange={onRemarkChange}
42
+ * onError={onError}
43
+ * />
44
+ * </BookingPax>
45
+ *
46
+ * @param props - The props for the BookingPax component.
47
+ * @returns The BookingPax component.
48
+ */
6
49
  export const BookingPax = (props: React.PropsWithChildren) => {
7
50
  return <div className="booking-pax space-y-6" {...props} />;
8
51
  };
@@ -11,16 +11,50 @@ import { BookingPaxLayout } from './BookingPaxLayout/BookingPaxLayout';
11
11
  import { BookingPaxRemarks } from './BookingPaxRemarks';
12
12
 
13
13
  export interface BookingPaxAccomRoom {
14
+ /**
15
+ * The pax count of the room.
16
+ */
14
17
  paxCount: number;
15
18
  }
16
19
 
17
20
  export interface RoomData {
21
+ /**
22
+ * The room of the room data.
23
+ */
18
24
  room: BookingPaxAccomRoom;
25
+ /**
26
+ * The room index of the room data.
27
+ */
19
28
  roomIndex: number;
29
+ /**
30
+ * The selected count of the room data.
31
+ */
20
32
  selectedCount: number;
33
+ /**
34
+ * Whether the pax count is error.
35
+ */
21
36
  isPaxCountError: boolean;
22
37
  }
23
38
 
39
+ /**
40
+ * BookingPaxAccomProps is the props for the BookingPaxAccom component.
41
+ *
42
+ * @example
43
+ * <BookingPaxAccom
44
+ * rooms={rooms}
45
+ * clientsInfo={clientsInfo}
46
+ * hotelName="Hotel Name"
47
+ * roomName="Room Name"
48
+ * selectedClientsInfoIds={selectedClientsInfoIds}
49
+ * isSubmitted={false}
50
+ * onPaxChange={onPaxChange}
51
+ * onRemarkChange={onRemarkChange}
52
+ * onError={onError}
53
+ * />
54
+ *
55
+ * @param props - The props for the BookingPaxAccom component.
56
+ * @returns The BookingPaxAccom component.
57
+ */
24
58
  export interface BookingPaxAccomProps extends Pick<
25
59
  BookingPaxClientProps,
26
60
  'selectedClientsInfoIds' | 'onPaxChange'
@@ -1,4 +1,10 @@
1
1
  .booking-pax-client {
2
2
  @apply grid gap-x-4 gap-y-2;
3
3
  @apply lg:grid-cols-2;
4
+ .checkbox-container {
5
+ label {
6
+ padding: 0;
7
+ background-color: transparent;
8
+ }
9
+ }
4
10
  }
@@ -1,41 +1,128 @@
1
+ import Checkbox, { CheckboxProps } from '@/src/components/atoms/Checkbox/Checkbox';
1
2
  import { Text } from '@/src/components/atoms/Typography/Typography';
2
- import { Checkbox } from '@/src/components/ui/checkbox';
3
3
  import useBookingPax from '@/src/hooks/useBookingPax';
4
4
  import { cn } from '@/src/lib/utils';
5
- import { CheckboxProps } from '@radix-ui/react-checkbox';
6
5
  import { useCallback, useEffect, useMemo, useState } from 'react';
7
6
  import './BookingPaxClient.css';
8
7
 
9
8
  export interface BookingPaxClientInfo {
9
+ /**
10
+ * The first name of the client.
11
+ */
10
12
  firstName: string;
13
+ /**
14
+ * The last name of the client.
15
+ */
11
16
  lastName: string;
17
+ /**
18
+ * The age of the client.
19
+ */
12
20
  age: number;
21
+ /**
22
+ * The client type.
23
+ */
13
24
  clientType: 'Adult' | 'Teen' | 'Child' | 'Infant';
25
+ /**
26
+ * The client id.
27
+ */
14
28
  clientId: string;
15
29
  }
16
30
 
17
31
  export interface BookingPaxClientOptions {
32
+ /**
33
+ * The client id.
34
+ */
18
35
  clientId: string;
36
+ /**
37
+ * Whether the client is checked.
38
+ */
19
39
  checked: CheckboxProps['checked'];
40
+ /**
41
+ * The selected index.
42
+ */
20
43
  selectedIndex: number;
44
+ /**
45
+ * The selected pax index.
46
+ */
21
47
  selectedPaxIndex?: number;
48
+ /**
49
+ * The pax count.
50
+ */
22
51
  paxCount?: number;
52
+ /**
53
+ * The selected clients info ids.
54
+ */
23
55
  selectedClientsInfoIds?: Record<string | number, string[]>;
56
+ /**
57
+ * The selected clients.
58
+ */
24
59
  selectedClients?: Record<string | number, BookingPaxClientInfo[]>;
25
60
  }
26
61
 
27
62
  export interface BookingPaxClientProps {
63
+ /**
64
+ * The clients to select from.
65
+ */
28
66
  clients: BookingPaxClientInfo[];
67
+ /**
68
+ * The id of the booking pax client.
69
+ */
29
70
  id: string;
71
+ /**
72
+ * The selected clients info ids.
73
+ */
30
74
  selectedClientsInfoIds?: Record<string | number, string[]>;
75
+ /**
76
+ * The selected index.
77
+ */
31
78
  selectedIndex: number;
79
+ /**
80
+ * The selected pax index.
81
+ */
32
82
  selectedPaxIndex?: number;
83
+ /**
84
+ * The pax count.
85
+ */
33
86
  paxCount?: number;
87
+ /**
88
+ * Whether the form has been submitted.
89
+ */
34
90
  isSubmitted?: boolean;
91
+ /**
92
+ * The callback function to call when the pax changes.
93
+ */
35
94
  onPaxChange?: (options: BookingPaxClientOptions) => void;
95
+ /**
96
+ * The callback function to call when the error changes.
97
+ */
36
98
  onError?: (hasError: boolean) => void;
37
99
  }
38
100
 
101
+ /**
102
+ * BookingPaxClient is a component that allows the user to select the pax for a booking.
103
+ *
104
+ * @example
105
+ * <BookingPaxClient
106
+ * clients={clients}
107
+ * id="booking-pax-client"
108
+ * selectedClientsInfoIds={selectedClientsInfoIds}
109
+ * selectedIndex={0}
110
+ * paxCount={1}
111
+ * isSubmitted={false}
112
+ * onPaxChange={onPaxChange}
113
+ * onError={onError}
114
+ * />
115
+ *
116
+ * @param props - The props for the BookingPaxClient component.
117
+ * @param props.clients - The clients to select from.
118
+ * @param props.id - The id of the booking pax client.
119
+ * @param props.selectedClientsInfoIds - The selected clients info ids.
120
+ * @param props.selectedIndex - The selected index.
121
+ * @param props.paxCount - The pax count.
122
+ * @param props.isSubmitted - Whether the form has been submitted.
123
+ * @param props.onPaxChange - The callback function to call when the pax changes.
124
+ * @returns The BookingPaxClient component.
125
+ */
39
126
  export const BookingPaxClient: React.FC<BookingPaxClientProps> = (props) => {
40
127
  const {
41
128
  clients,
@@ -151,11 +238,12 @@ export const BookingPaxClient: React.FC<BookingPaxClientProps> = (props) => {
151
238
  <div key={client.clientId}>
152
239
  <div className="flex items-center gap-x-2">
153
240
  <Checkbox
154
- data-error={showError}
155
241
  id={`pc-${id}-${selectedIndex}-${client.clientId}`}
156
242
  checked={isSelected || clients.length === paxCount}
157
243
  disabled={clients.length === paxCount}
158
- onCheckedChange={(checked) => {
244
+ error={showError}
245
+ label={`${client.firstName} ${client.lastName} (${client.clientType}${client.clientType !== 'Adult' ? ` - ${client.age} years old` : ''})`}
246
+ onChange={(checked) => {
159
247
  handlePaxChange({
160
248
  clientId: client.clientId,
161
249
  checked,
@@ -164,20 +252,6 @@ export const BookingPaxClient: React.FC<BookingPaxClientProps> = (props) => {
164
252
  });
165
253
  }}
166
254
  />
167
- <label
168
- htmlFor={`pc-${id}-${selectedIndex}-${client.clientId}`}
169
- className={cn('cursor-pointer', {
170
- 'pointer-events-none': clients.length === paxCount,
171
- })}>
172
- <Text
173
- size="sm"
174
- leading="4"
175
- as="span"
176
- color={showError ? 'state-error' : undefined}>
177
- {client.firstName} {client.lastName} ({client.clientType}
178
- {client.clientType !== 'Adult' && ` - ${client.age} years old`})
179
- </Text>
180
- </label>
181
255
  </div>
182
256
  </div>
183
257
  );
@@ -15,13 +15,37 @@ export interface BookingPaxExcursionProps extends Pick<
15
15
  BookingPaxClientProps,
16
16
  'selectedClientsInfoIds' | 'onPaxChange'
17
17
  > {
18
+ /**
19
+ * The clients info of the booking pax excursion.
20
+ */
18
21
  clientsInfo: BookingPaxClientInfo[];
22
+ /**
23
+ * The name of the booking pax excursion.
24
+ */
19
25
  name: string;
26
+ /**
27
+ * The type of the booking pax excursion.
28
+ */
20
29
  type: ExcursionType;
30
+ /**
31
+ * Whether the booking pax excursion is submitted.
32
+ */
21
33
  isSubmitted?: boolean;
34
+ /**
35
+ * The pax count of the booking pax excursion.
36
+ */
22
37
  paxCount: number;
38
+ /**
39
+ * The max pax count of the booking pax excursion.
40
+ */
23
41
  maxPaxCount?: number;
42
+ /**
43
+ * The callback function to call when the remark changes.
44
+ */
24
45
  onRemarkChange?: (value: string) => void;
46
+ /**
47
+ * The callback function to call when the error changes.
48
+ */
25
49
  onError?: (hasError: boolean) => void;
26
50
  }
27
51
 
@@ -31,6 +55,25 @@ const mapType: Record<BookingPaxExcursionProps['type'], string> = {
31
55
  catamaran: 'Cruise excursion',
32
56
  };
33
57
 
58
+ /**
59
+ * BookingPaxExcursion is a component that allows the user to display the booking pax excursion.
60
+ *
61
+ * @example
62
+ * <BookingPaxExcursion
63
+ * name="Excursion Name"
64
+ * type="sea"
65
+ * clientsInfo={clientsInfo}
66
+ * paxCount={1}
67
+ * selectedClientsInfoIds={selectedClientsInfoIds}
68
+ * isSubmitted={false}
69
+ * onPaxChange={onPaxChange}
70
+ * onRemarkChange={onRemarkChange}
71
+ * onError={onError}
72
+ * />
73
+ *
74
+ * @param props - The props for the BookingPaxExcursion component.
75
+ * @returns The BookingPaxExcursion component.
76
+ */
34
77
  export const BookingPaxExcursion: React.FC<BookingPaxExcursionProps> = (props) => {
35
78
  const {
36
79
  name,
@@ -4,16 +4,43 @@ import { Text } from '../../atoms/Typography/Typography';
4
4
  import TextWithIcon from '../TextWithIcon/TextWithIcon';
5
5
 
6
6
  export interface BookingPaxWithNameProps {
7
+ /**
8
+ * The name of the booking pax with name.
9
+ */
7
10
  name: string;
11
+ /**
12
+ * The icon of the booking pax with name.
13
+ */
8
14
  icon: IconName;
15
+ /**
16
+ * The location of the booking pax with name.
17
+ */
9
18
  location: string;
10
19
  }
11
20
 
12
21
  export interface BookingPaxWithLocationProps {
22
+ /**
23
+ * The from of the booking pax with location.
24
+ */
13
25
  from: string;
26
+ /**
27
+ * The to of the booking pax with location.
28
+ */
14
29
  to: string;
15
30
  }
16
-
31
+ /**
32
+ * BookingPaxWithName is a component that allows the user to display the booking pax with name.
33
+ *
34
+ * @example
35
+ * <BookingPaxWithName
36
+ * name="Hotel Name"
37
+ * icon="hotel"
38
+ * location="Hotel Location"
39
+ * />
40
+ *
41
+ * @param props - The props for the BookingPaxWithName component.
42
+ * @returns The BookingPaxWithName component.
43
+ */
17
44
  const BookingPaxWithName: React.FC<BookingPaxWithNameProps> = (props) => {
18
45
  const { name, icon, location } = props;
19
46
  return (
@@ -4,13 +4,43 @@ import { ServiceTitle } from '../../ServiceTitle/ServiceTitle';
4
4
  import './BookingPaxLayout.css';
5
5
 
6
6
  export interface BookingPaxLayoutProps {
7
+ /**
8
+ * The title of the booking pax layout.
9
+ */
7
10
  title: React.ReactNode;
11
+ /**
12
+ * The icon of the booking pax layout.
13
+ */
8
14
  icon: IconName;
15
+ /**
16
+ * The header of the booking pax layout.
17
+ */
9
18
  header?: React.ReactNode;
19
+ /**
20
+ * The children of the booking pax layout.
21
+ */
10
22
  children?: React.ReactNode;
23
+ /**
24
+ * The class name of the booking pax layout.
25
+ */
11
26
  className?: string;
12
27
  }
13
28
 
29
+ /**
30
+ * BookingPaxLayout is a component that allows the user to display the booking pax layout.
31
+ *
32
+ * @example
33
+ * <BookingPaxLayout
34
+ * title={title}
35
+ * icon={icon}
36
+ * header={header}
37
+ * children={children}
38
+ * className={className}
39
+ * />
40
+ *
41
+ * @param props - The props for the BookingPaxLayout component.
42
+ * @returns The BookingPaxLayout component.
43
+ */
14
44
  export const BookingPaxLayout: React.FC<BookingPaxLayoutProps> = (props) => {
15
45
  const { title, icon, header, children, className } = props;
16
46
  return (
@@ -3,9 +3,23 @@ import Textarea from '../../atoms/Inputs/Textarea/Textarea';
3
3
  import { Text } from '../../atoms/Typography/Typography';
4
4
 
5
5
  export interface BookingPaxRemarksProps {
6
+ /**
7
+ * The callback function to call when the remarks changes.
8
+ */
6
9
  onChange?: (value: string) => void;
7
10
  }
8
11
 
12
+ /**
13
+ * BookingPaxRemarks is a component that allows the user to display the booking pax remarks.
14
+ *
15
+ * @example
16
+ * <BookingPaxRemarks
17
+ * onChange={onChange}
18
+ * />
19
+ *
20
+ * @param props - The props for the BookingPaxRemarks component.
21
+ * @returns The BookingPaxRemarks component.
22
+ */
9
23
  export const BookingPaxRemarks: React.FC<BookingPaxRemarksProps> = ({ onChange }) => {
10
24
  const [remarks, setRemarks] = useState('');
11
25
 
@@ -20,25 +20,75 @@ export interface BookingPaxTransferProps extends Pick<
20
20
  BookingPaxClientProps,
21
21
  'selectedClientsInfoIds' | 'onPaxChange'
22
22
  > {
23
+ /**
24
+ * The clients info of the booking pax transfer.
25
+ */
23
26
  clientsInfo: BookingPaxClientInfo[];
27
+ /**
28
+ * The type of the booking pax transfer.
29
+ */
24
30
  type: 'ARV' | 'DEP' | 'INH';
31
+ /**
32
+ * The from of the booking pax transfer.
33
+ */
25
34
  from: string;
35
+ /**
36
+ * The to of the booking pax transfer.
37
+ */
26
38
  to: string;
39
+ /**
40
+ * Whether the booking pax transfer is submitted.
41
+ */
27
42
  isSubmitted?: boolean;
43
+ /**
44
+ * The pax count of the booking pax transfer.
45
+ */
28
46
  paxCount: number;
47
+ /**
48
+ * The max pax count of the booking pax transfer.
49
+ */
29
50
  maxPaxCount?: number;
51
+ /**
52
+ * The callback function to call when the remark changes.
53
+ */
30
54
  onRemarkChange?: (value: string) => void;
55
+ /**
56
+ * The callback function to call when the flight number changes.
57
+ */
31
58
  onFlightNumberChange?: (value: string) => void;
59
+ /**
60
+ * The callback function to call when the time changes.
61
+ */
32
62
  onTimeChange?: DateTimePickerProps['onValueChange'];
63
+ /**
64
+ * The callback function to call when the error changes.
65
+ */
33
66
  onError?: (hasError: boolean) => void;
34
67
  }
35
68
 
36
- const mapType: Record<BookingPaxTransferProps['type'], string> = {
69
+ export const mapTransferType: Record<BookingPaxTransferProps['type'], string> = {
37
70
  ARV: 'Arrival',
38
71
  DEP: 'Departure',
39
72
  INH: 'Inter-Hotel',
40
73
  };
41
74
 
75
+ /**
76
+ * BookingPaxTransfer is a component that allows the user to display the booking pax transfer.
77
+ *
78
+ * @example
79
+ * <BookingPaxTransfer
80
+ * type="ARV"
81
+ * from="Plaisance Airport"
82
+ * to="Grand Paradise Hotel"
83
+ * clientsInfo={clientsInfo}
84
+ * paxCount={2}
85
+ * selectedClientsInfoIds={{ 0: [] }}
86
+ * isSubmitted={false}
87
+ * onPaxChange={onPaxChange}
88
+ *
89
+ * @param props - The props for the BookingPaxTransfer component.
90
+ * @returns The BookingPaxTransfer component.
91
+ */
42
92
  export const BookingPaxTransfer: React.FC<BookingPaxTransferProps> = (props) => {
43
93
  const {
44
94
  from,
@@ -79,7 +129,7 @@ export const BookingPaxTransfer: React.FC<BookingPaxTransferProps> = (props) =>
79
129
  <>
80
130
  Transfer{' '}
81
131
  <Text as="span" color="accent" variant="bold" size="xl" className="italic">
82
- ({mapType[type]})
132
+ ({mapTransferType[type]})
83
133
  </Text>
84
134
  </>
85
135
  }
@@ -6,4 +6,6 @@ export type {
6
6
  export type { BookingPaxExcursionProps } from './BookingPaxExcursion';
7
7
  export type { BookingPaxTransferProps } from './BookingPaxTransfer';
8
8
 
9
+ export { mapTransferType } from './BookingPaxTransfer';
10
+
9
11
  export * from './BookingPax';