mautourco-components 0.2.28 → 0.2.30
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.
- package/dist/components/atoms/Icon/icons/BadgeAlertIcon.d.ts +4 -0
- package/dist/components/atoms/Icon/icons/BadgeAlertIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/registry.d.ts +1 -0
- package/dist/components/atoms/Icon/icons/registry.js +2 -0
- package/dist/components/molecules/AccomodationDocket/AccomodationDocket.d.ts +5 -1
- package/dist/components/molecules/AccomodationDocket/AccomodationDocket.js +4 -3
- package/dist/components/molecules/Calendar/CalendarInput.js +2 -1
- package/dist/components/molecules/DateDisplay/DateDisplay.d.ts +4 -0
- package/dist/components/molecules/DateDisplay/DateDisplay.js +3 -5
- package/dist/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.css +50 -0
- package/dist/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.d.ts +2 -0
- package/dist/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.js +3 -2
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationAccom.d.ts +2 -0
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationAccom.js +2 -2
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationExcursion.d.ts +2 -0
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationExcursion.js +2 -2
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.d.ts +1 -0
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.js +14 -11
- package/dist/components/molecules/ExcursionDocket/ExcursionDocket.d.ts +4 -0
- package/dist/components/molecules/ExcursionDocket/ExcursionDocket.js +3 -2
- package/dist/components/molecules/LocationDropdown/LocationDropdown.d.ts +2 -0
- package/dist/components/molecules/LocationDropdown/LocationDropdown.js +9 -3
- package/dist/components/molecules/OtherServiceDocket/OtherServiceDocket.d.ts +4 -0
- package/dist/components/molecules/OtherServiceDocket/OtherServiceDocket.js +3 -2
- package/dist/components/molecules/Toast/Toast.d.ts +25 -0
- package/dist/components/molecules/Toast/Toast.js +29 -0
- package/dist/components/molecules/Toast/index.d.ts +2 -0
- package/dist/components/molecules/Toast/index.js +1 -0
- package/dist/components/molecules/TransferDocket/TransferDocket.d.ts +4 -0
- package/dist/components/molecules/TransferDocket/TransferDocket.js +3 -2
- package/dist/components/organisms/CancelService/CancelPolicy.d.ts +29 -0
- package/dist/components/organisms/CancelService/CancelPolicy.js +19 -0
- package/dist/components/organisms/CancelService/CancelService.d.ts +14 -0
- package/dist/components/organisms/CancelService/CancelService.js +23 -0
- package/dist/components/organisms/CancelService/ConfirmDelete/ConfirmDelete.css +2143 -0
- package/dist/components/organisms/CancelService/ConfirmDelete/ConfirmDelete.d.ts +14 -0
- package/dist/components/organisms/CancelService/ConfirmDelete/ConfirmDelete.js +35 -0
- package/dist/components/organisms/CancelService/FromList.d.ts +12 -0
- package/dist/components/organisms/CancelService/FromList.js +29 -0
- package/dist/components/organisms/CarBookingCard/CarBookingCard.css +13 -1
- package/dist/components/organisms/CarBookingCard/CarBookingCard.d.ts +2 -0
- package/dist/components/organisms/CarBookingCard/CarBookingCard.js +4 -3
- package/dist/components/organisms/CarBookingCard/CarBookingCardSkeleton.css +2334 -0
- package/dist/components/organisms/CarBookingCard/CarBookingCardSkeleton.d.ts +19 -0
- package/dist/components/organisms/CarBookingCard/CarBookingCardSkeleton.js +35 -0
- package/dist/components/organisms/CarBookingCard/index.d.ts +4 -2
- package/dist/components/organisms/CarBookingCard/index.js +2 -1
- package/dist/components/organisms/DateTimePicker/DateTimePicker.d.ts +8 -0
- package/dist/components/organisms/DateTimePicker/DateTimePicker.js +20 -7
- package/dist/components/organisms/Docket/Docket.d.ts +25 -2
- package/dist/components/organisms/Docket/Docket.js +18 -10
- package/dist/components/organisms/PaxSelector/PaxSelector.d.ts +2 -0
- package/dist/components/organisms/PaxSelector/PaxSelector.js +11 -5
- package/dist/components/organisms/RoundTrip/RoundTrip.d.ts +4 -2
- package/dist/components/organisms/RoundTrip/RoundTrip.js +21 -11
- package/dist/components/organisms/SearchBarTransfer/SearchBarTransfer.d.ts +2 -2
- package/dist/components/organisms/SearchBarTransfer/SearchBarTransfer.js +51 -8
- package/dist/components/organisms/Table/Table.js +1 -1
- package/dist/components/organisms/Table/TableCell.d.ts +2 -1
- package/dist/components/organisms/Table/TableCell.js +2 -2
- package/dist/components/organisms/Table/columns/booking-cancel-service-columns.d.ts +5 -0
- package/dist/components/organisms/Table/columns/booking-cancel-service-columns.js +182 -0
- package/dist/components/organisms/Table/columns/detail-resume-columns.d.ts +3 -1
- package/dist/components/organisms/Table/columns/detail-resume-columns.js +5 -3
- package/dist/components/organisms/Table/columns/index.d.ts +6 -1
- package/dist/components/organisms/Table/columns/index.js +2 -0
- package/dist/components/organisms/TransferLine/TransferLine.d.ts +4 -2
- package/dist/components/organisms/TransferLine/TransferLine.js +18 -9
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/popover.js +5 -3
- package/dist/index.d.ts +15 -14
- package/dist/index.js +2 -1
- package/dist/lib/utils.d.ts +21 -0
- package/dist/lib/utils.js +114 -0
- package/dist/styles/components/molecule/calendarInput.css +40 -5
- package/dist/styles/components/molecule/location-dropdown.css +7 -5
- package/dist/styles/components/molecule/toast.css +2185 -0
- package/dist/styles/components/organism/docket.css +7 -1
- package/dist/styles/components/organism/pax-selector.css +12 -1
- package/dist/styles/components/organism/round-trip.css +4 -0
- package/dist/styles/components/organism/transfer-line.css +5 -1
- package/package.json +1 -1
- package/src/components/atoms/Icon/icons/BadgeAlertIcon.tsx +44 -0
- package/src/components/atoms/Icon/icons/registry.tsx +2 -0
- package/src/components/molecules/AccomodationDocket/AccomodationDocket.tsx +26 -6
- package/src/components/molecules/Calendar/CalendarInput.tsx +5 -2
- package/src/components/molecules/DateDisplay/DateDisplay.tsx +7 -7
- package/src/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.css +27 -0
- package/src/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.tsx +12 -1
- package/src/components/molecules/DialogContentPolicy/DialogCancellationAccom.tsx +9 -2
- package/src/components/molecules/DialogContentPolicy/DialogCancellationExcursion.tsx +10 -2
- package/src/components/molecules/DialogContentPolicy/DialogCancellationList.tsx +18 -11
- package/src/components/molecules/ExcursionDocket/ExcursionDocket.tsx +25 -5
- package/src/components/molecules/LocationDropdown/LocationDropdown.tsx +11 -0
- package/src/components/molecules/OtherServiceDocket/OtherServiceDocket.tsx +25 -5
- package/src/components/molecules/Toast/Toast.tsx +49 -0
- package/src/components/molecules/Toast/index.ts +3 -0
- package/src/components/molecules/TransferDocket/TransferDocket.tsx +21 -3
- package/src/components/organisms/CancelService/CancelPolicy.tsx +68 -0
- package/src/components/organisms/CancelService/CancelService.tsx +30 -0
- package/src/components/organisms/CancelService/ConfirmDelete/ConfirmDelete.css +56 -0
- package/src/components/organisms/CancelService/ConfirmDelete/ConfirmDelete.tsx +67 -0
- package/src/components/organisms/CancelService/FromList.tsx +50 -0
- package/src/components/organisms/CarBookingCard/CarBookingCard.css +13 -1
- package/src/components/organisms/CarBookingCard/CarBookingCard.tsx +40 -21
- package/src/components/organisms/CarBookingCard/CarBookingCardSkeleton.css +257 -0
- package/src/components/organisms/CarBookingCard/CarBookingCardSkeleton.tsx +112 -0
- package/src/components/organisms/CarBookingCard/index.ts +10 -15
- package/src/components/organisms/DateTimePicker/DateTimePicker.tsx +39 -3
- package/src/components/organisms/Docket/Docket.tsx +82 -20
- package/src/components/organisms/PaxSelector/PaxSelector.tsx +11 -0
- package/src/components/organisms/RoundTrip/RoundTrip.tsx +31 -10
- package/src/components/organisms/SearchBarTransfer/SearchBarTransfer.tsx +108 -54
- package/src/components/organisms/SearchBarTransfer/index.ts +6 -0
- package/src/components/organisms/Table/Table.tsx +6 -1
- package/src/components/organisms/Table/TableCell.tsx +8 -4
- package/src/components/organisms/Table/columns/booking-cancel-service-columns.tsx +242 -0
- package/src/components/organisms/Table/columns/detail-resume-columns.tsx +19 -5
- package/src/components/organisms/Table/columns/index.ts +2 -0
- package/src/components/organisms/TransferLine/TransferLine.tsx +31 -10
- package/src/components/ui/popover.tsx +7 -7
- package/src/styles/components/molecule/calendarInput.css +33 -4
- package/src/styles/components/molecule/location-dropdown.css +6 -4
- package/src/styles/components/molecule/toast.css +93 -0
- package/src/styles/components/organism/docket.css +5 -1
- package/src/styles/components/organism/pax-selector.css +12 -1
- package/src/styles/components/organism/round-trip.css +4 -0
- package/src/styles/components/organism/transfer-line.css +5 -1
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import Button from '@/src/components/atoms/Button/Button';
|
|
2
|
+
import Chip from '@/src/components/atoms/Chip/Chip';
|
|
3
|
+
import { Text } from '@/src/components/atoms/Typography/Typography';
|
|
4
|
+
import { DateDisplay } from '@/src/components/molecules/DateDisplay/DateDisplay';
|
|
5
|
+
import {
|
|
6
|
+
DetailResumeAccommodation,
|
|
7
|
+
DetailResumeExcursion,
|
|
8
|
+
DetailResumeItem,
|
|
9
|
+
DetailResumeOtherService,
|
|
10
|
+
DetailResumeTransfer,
|
|
11
|
+
ServiceType,
|
|
12
|
+
} from '@/src/types/table';
|
|
13
|
+
import { RowAccommodation } from '../../../molecules/TableServiceItem/RowAccommodation';
|
|
14
|
+
import { RowExcursion } from '../../../molecules/TableServiceItem/RowExcursion';
|
|
15
|
+
import { RowOtherServices } from '../../../molecules/TableServiceItem/RowOtherServices';
|
|
16
|
+
import { RowTransfer } from '../../../molecules/TableServiceItem/RowTransfer';
|
|
17
|
+
import { ColumnType } from '../TableCell';
|
|
18
|
+
|
|
19
|
+
export const bookingCancelServiceColumns: (params?: {
|
|
20
|
+
onRemove?: (value: DetailResumeItem, index?: number, childIndex?: number) => void;
|
|
21
|
+
}) => ColumnType<DetailResumeItem>[] = (params) => {
|
|
22
|
+
const { onRemove } = params || {};
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
header: 'Item',
|
|
26
|
+
key: 'Type',
|
|
27
|
+
width: 260,
|
|
28
|
+
cell: (value, raw) => {
|
|
29
|
+
if (value === ServiceType.ACCOMMODATION) {
|
|
30
|
+
const accom = raw as DetailResumeAccommodation;
|
|
31
|
+
return (
|
|
32
|
+
<RowAccommodation.FirstCol
|
|
33
|
+
serviceName={accom.HotelName as string}
|
|
34
|
+
offers={accom.Offers}
|
|
35
|
+
status={accom.RoomStatus}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
if (value === ServiceType.EXCURSION) {
|
|
40
|
+
const excursion = raw as DetailResumeExcursion;
|
|
41
|
+
return (
|
|
42
|
+
<RowExcursion.FirstCol serviceName={excursion.ExcursionName as string} />
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
if (value === ServiceType.TRANSFER) {
|
|
46
|
+
const transfer = raw as DetailResumeTransfer;
|
|
47
|
+
return (
|
|
48
|
+
<RowTransfer.FirstCol
|
|
49
|
+
serviceName={transfer.VehicleTypeName as string}
|
|
50
|
+
transferType={transfer.TransferType}
|
|
51
|
+
from={transfer.LocationFromName}
|
|
52
|
+
to={transfer.LocationToName}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (value === ServiceType.OTHER_SERVICE) {
|
|
58
|
+
return <RowOtherServices.FirstCol />;
|
|
59
|
+
}
|
|
60
|
+
return <></>;
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
header: 'Details',
|
|
65
|
+
key: 'Type',
|
|
66
|
+
width: 185,
|
|
67
|
+
cell: (value, raw, index) => {
|
|
68
|
+
if (value === ServiceType.ACCOMMODATION) {
|
|
69
|
+
const accom = raw as DetailResumeAccommodation;
|
|
70
|
+
return (
|
|
71
|
+
<RowAccommodation.DetailsCol
|
|
72
|
+
data={{
|
|
73
|
+
RoomName: accom.RoomName,
|
|
74
|
+
Dates: accom.Dates,
|
|
75
|
+
ClientCategory: accom.ClientCategory,
|
|
76
|
+
MealPlan: accom.MealPlan,
|
|
77
|
+
}}
|
|
78
|
+
index={(index || 0) + 1}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
if (value === ServiceType.EXCURSION) {
|
|
83
|
+
const excursion = raw as DetailResumeExcursion;
|
|
84
|
+
return (
|
|
85
|
+
<RowExcursion.DetailsCol
|
|
86
|
+
data={{
|
|
87
|
+
languages: excursion.AvailableLanguages,
|
|
88
|
+
duration: excursion.Duration,
|
|
89
|
+
accessibility: excursion.Accessibility,
|
|
90
|
+
transferType: excursion.TransferType,
|
|
91
|
+
}}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (value === ServiceType.TRANSFER) {
|
|
96
|
+
const transfer = raw as DetailResumeTransfer;
|
|
97
|
+
return (
|
|
98
|
+
<RowTransfer.DetailsCol
|
|
99
|
+
data={{
|
|
100
|
+
carType: transfer.VehicleTypeName,
|
|
101
|
+
clientType: 'STD',
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
if (value === ServiceType.OTHER_SERVICE) {
|
|
107
|
+
return <RowOtherServices.DetailsCol />;
|
|
108
|
+
}
|
|
109
|
+
return <></>;
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
header: 'Date',
|
|
114
|
+
key: 'Type',
|
|
115
|
+
width: 185,
|
|
116
|
+
cell: (value, raw) => {
|
|
117
|
+
let date: string[] = [];
|
|
118
|
+
switch (value) {
|
|
119
|
+
case ServiceType.ACCOMMODATION:
|
|
120
|
+
const accom = raw as DetailResumeAccommodation;
|
|
121
|
+
date = accom.Dates as string[];
|
|
122
|
+
break;
|
|
123
|
+
case ServiceType.EXCURSION:
|
|
124
|
+
const excursion = raw as DetailResumeExcursion;
|
|
125
|
+
date = [excursion.ServiceDate];
|
|
126
|
+
break;
|
|
127
|
+
case ServiceType.TRANSFER:
|
|
128
|
+
const transfer = raw as DetailResumeTransfer;
|
|
129
|
+
date = [transfer.TransferDate];
|
|
130
|
+
break;
|
|
131
|
+
case ServiceType.OTHER_SERVICE:
|
|
132
|
+
const otherService = raw as DetailResumeOtherService;
|
|
133
|
+
date = [otherService.service_date];
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
return <DateDisplay dates={date} direction="vertical" />;
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
header: 'No. of pax',
|
|
141
|
+
key: 'Type',
|
|
142
|
+
width: 329,
|
|
143
|
+
cell: (value, raw) => {
|
|
144
|
+
const pax: Record<'Adult' | 'Teen' | 'Infant' | 'Child', number | undefined> = {
|
|
145
|
+
Adult: 0,
|
|
146
|
+
Teen: 0,
|
|
147
|
+
Infant: 0,
|
|
148
|
+
Child: 0,
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
switch (value) {
|
|
152
|
+
case ServiceType.ACCOMMODATION:
|
|
153
|
+
case ServiceType.EXCURSION:
|
|
154
|
+
case ServiceType.TRANSFER:
|
|
155
|
+
const item = raw as
|
|
156
|
+
| DetailResumeAccommodation
|
|
157
|
+
| DetailResumeExcursion
|
|
158
|
+
| DetailResumeTransfer;
|
|
159
|
+
pax.Adult = item.AdultCount;
|
|
160
|
+
pax.Teen = item.TeenCount;
|
|
161
|
+
pax.Infant = item.InfantCount;
|
|
162
|
+
pax.Child = item.ChildCount;
|
|
163
|
+
break;
|
|
164
|
+
case ServiceType.OTHER_SERVICE:
|
|
165
|
+
const otherService = raw as DetailResumeOtherService;
|
|
166
|
+
pax.Adult = otherService.adult_pax;
|
|
167
|
+
pax.Teen = otherService.teen_pax;
|
|
168
|
+
pax.Infant = otherService.infant_pax;
|
|
169
|
+
pax.Child = otherService.child_pax;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
return (
|
|
173
|
+
<div className="flex items-center gap-x-3">
|
|
174
|
+
{Object.keys(pax).map((k, index) => {
|
|
175
|
+
const count = pax[k as keyof typeof pax] ?? 0;
|
|
176
|
+
const type = count > 0 ? 'filled' : 'outline';
|
|
177
|
+
return (
|
|
178
|
+
<Chip
|
|
179
|
+
key={`pax-${index}`}
|
|
180
|
+
label={`${k} ${count}`}
|
|
181
|
+
size="sm"
|
|
182
|
+
color="accent"
|
|
183
|
+
type={type}
|
|
184
|
+
className="!px-3"
|
|
185
|
+
/>
|
|
186
|
+
);
|
|
187
|
+
})}
|
|
188
|
+
</div>
|
|
189
|
+
);
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
header: 'Price',
|
|
194
|
+
key: 'Type',
|
|
195
|
+
width: 230,
|
|
196
|
+
cell: (value, raw, index = 0, childIndex = 0) => {
|
|
197
|
+
let total: Record<'currency' | 'total', string | undefined> = {
|
|
198
|
+
currency: undefined,
|
|
199
|
+
total: undefined,
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
switch (value) {
|
|
203
|
+
case ServiceType.ACCOMMODATION:
|
|
204
|
+
const accom = raw as DetailResumeAccommodation;
|
|
205
|
+
total.currency = accom.Currency;
|
|
206
|
+
total.total = accom.Total;
|
|
207
|
+
break;
|
|
208
|
+
case ServiceType.EXCURSION:
|
|
209
|
+
case ServiceType.TRANSFER:
|
|
210
|
+
const item = raw as DetailResumeExcursion | DetailResumeTransfer;
|
|
211
|
+
total.currency = item.Currency;
|
|
212
|
+
total.total = item.TotalPrice;
|
|
213
|
+
break;
|
|
214
|
+
case ServiceType.OTHER_SERVICE:
|
|
215
|
+
const otherService = raw as DetailResumeOtherService;
|
|
216
|
+
total.currency = otherService.currency;
|
|
217
|
+
total.total = otherService.total_price;
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const showRemoveButton =
|
|
222
|
+
onRemove && raw.Type !== ServiceType.OTHER_SERVICE && childIndex === 0;
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<div className="flex items-center justify-between">
|
|
226
|
+
<Text size="sm" variant="bold">
|
|
227
|
+
{total.currency} {total.total}
|
|
228
|
+
</Text>
|
|
229
|
+
{showRemoveButton && (
|
|
230
|
+
<Button
|
|
231
|
+
variant="destructive"
|
|
232
|
+
size="sm"
|
|
233
|
+
onClick={() => onRemove(raw, index, childIndex)}>
|
|
234
|
+
Remove
|
|
235
|
+
</Button>
|
|
236
|
+
)}
|
|
237
|
+
</div>
|
|
238
|
+
);
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
];
|
|
242
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Button from '@/src/components/atoms/Button/Button';
|
|
1
2
|
import Chip from '@/src/components/atoms/Chip/Chip';
|
|
2
3
|
import { Text } from '@/src/components/atoms/Typography/Typography';
|
|
3
4
|
import { DateDisplay } from '@/src/components/molecules/DateDisplay/DateDisplay';
|
|
@@ -15,7 +16,10 @@ import { RowOtherServices } from '../../../molecules/TableServiceItem/RowOtherSe
|
|
|
15
16
|
import { RowTransfer } from '../../../molecules/TableServiceItem/RowTransfer';
|
|
16
17
|
import { ColumnType } from '../TableCell';
|
|
17
18
|
|
|
18
|
-
export const detailResumeColumns: (
|
|
19
|
+
export const detailResumeColumns: (params?: {
|
|
20
|
+
onRemove?: (value: DetailResumeItem, index?: number) => void;
|
|
21
|
+
}) => ColumnType<DetailResumeItem>[] = (params) => {
|
|
22
|
+
const { onRemove } = params || {};
|
|
19
23
|
return [
|
|
20
24
|
{
|
|
21
25
|
header: 'Item',
|
|
@@ -190,7 +194,7 @@ export const detailResumeColumns: () => ColumnType<DetailResumeItem>[] = () => {
|
|
|
190
194
|
header: 'Price',
|
|
191
195
|
key: 'Type',
|
|
192
196
|
width: 299,
|
|
193
|
-
cell: (value, raw) => {
|
|
197
|
+
cell: (value, raw, index) => {
|
|
194
198
|
let total: Record<'currency' | 'total', string | undefined> = {
|
|
195
199
|
currency: undefined,
|
|
196
200
|
total: undefined,
|
|
@@ -216,9 +220,19 @@ export const detailResumeColumns: () => ColumnType<DetailResumeItem>[] = () => {
|
|
|
216
220
|
}
|
|
217
221
|
|
|
218
222
|
return (
|
|
219
|
-
<
|
|
220
|
-
|
|
221
|
-
|
|
223
|
+
<div className="flex items-center justify-between">
|
|
224
|
+
<Text size="sm" variant="bold">
|
|
225
|
+
{total.currency} {total.total}
|
|
226
|
+
</Text>
|
|
227
|
+
{onRemove && (
|
|
228
|
+
<Button
|
|
229
|
+
variant="destructive"
|
|
230
|
+
size="sm"
|
|
231
|
+
onClick={() => onRemove(raw, index)}>
|
|
232
|
+
Remove
|
|
233
|
+
</Button>
|
|
234
|
+
)}
|
|
235
|
+
</div>
|
|
222
236
|
);
|
|
223
237
|
},
|
|
224
238
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { bookingCancelServiceColumns } from './booking-cancel-service-columns';
|
|
1
2
|
import { bookingColumns } from './booking-columns';
|
|
2
3
|
import { detailResumeColumns } from './detail-resume-columns';
|
|
3
4
|
import { quotationColumns } from './quotation-columns';
|
|
@@ -6,6 +7,7 @@ const columns = {
|
|
|
6
7
|
quotation: quotationColumns,
|
|
7
8
|
detailResume: detailResumeColumns,
|
|
8
9
|
booking: bookingColumns,
|
|
10
|
+
bookingCancelService: bookingCancelServiceColumns,
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export { columns };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import "../../../styles/components/organism/transfer-line.css";
|
|
2
3
|
import Icon from "../../atoms/Icon/Icon";
|
|
3
4
|
import { Text } from "../../atoms/Typography/Typography";
|
|
4
|
-
import PaxSelector, { PaxData } from "../PaxSelector/PaxSelector";
|
|
5
|
-
import DateTimePicker from "../DateTimePicker/DateTimePicker";
|
|
6
5
|
import LocationDropdown, {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
LocationData,
|
|
7
|
+
LocationGroup,
|
|
8
|
+
LocationOption,
|
|
10
9
|
} from "../../molecules/LocationDropdown/LocationDropdown";
|
|
11
|
-
import "
|
|
10
|
+
import DateTimePicker from "../DateTimePicker/DateTimePicker";
|
|
11
|
+
import PaxSelector, { PaxData } from "../PaxSelector/PaxSelector";
|
|
12
12
|
|
|
13
13
|
export type TransferType = "arrival" | "departure" | "inter-hotel";
|
|
14
14
|
|
|
@@ -60,6 +60,8 @@ export interface TransferLineProps {
|
|
|
60
60
|
showTitle?: boolean;
|
|
61
61
|
/** Additional CSS classes */
|
|
62
62
|
className?: string;
|
|
63
|
+
/** Whether to check if inputs are empty */
|
|
64
|
+
checkEmpty?: boolean;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
const TransferLine: React.FC<TransferLineProps> = ({
|
|
@@ -77,8 +79,9 @@ const TransferLine: React.FC<TransferLineProps> = ({
|
|
|
77
79
|
onDataChange,
|
|
78
80
|
onDelete,
|
|
79
81
|
showDelete = true,
|
|
80
|
-
|
|
82
|
+
showTitle = false,
|
|
81
83
|
className = "",
|
|
84
|
+
checkEmpty = false,
|
|
82
85
|
}) => {
|
|
83
86
|
const [internalPaxData, setInternalPaxData] = useState<PaxData | undefined>(
|
|
84
87
|
paxData
|
|
@@ -257,6 +260,19 @@ const TransferLine: React.FC<TransferLineProps> = ({
|
|
|
257
260
|
onDropoffChange?.(location);
|
|
258
261
|
};
|
|
259
262
|
|
|
263
|
+
// Check if inputs are empty (when checkEmpty is true)
|
|
264
|
+
const isPaxEmpty = checkEmpty && (!internalPaxData ||
|
|
265
|
+
(internalPaxData.adults === 0 &&
|
|
266
|
+
internalPaxData.teens === 0 &&
|
|
267
|
+
internalPaxData.children === 0 &&
|
|
268
|
+
(internalPaxData.infants === undefined || internalPaxData.infants === 0)));
|
|
269
|
+
|
|
270
|
+
const isDateEmpty = checkEmpty && (!internalTransferDate || internalTransferDate === '');
|
|
271
|
+
|
|
272
|
+
const isPickupEmpty = checkEmpty && !internalPickupPoint;
|
|
273
|
+
|
|
274
|
+
const isDropoffEmpty = checkEmpty && !internalDropoffPoint;
|
|
275
|
+
|
|
260
276
|
return (
|
|
261
277
|
<div
|
|
262
278
|
className={`transfer-line transfer-line--${type} ${className}`}
|
|
@@ -284,12 +300,13 @@ const TransferLine: React.FC<TransferLineProps> = ({
|
|
|
284
300
|
<div className="transfer-line__content-container">
|
|
285
301
|
<div className="transfer-line__content">
|
|
286
302
|
{/* Number of pax */}
|
|
287
|
-
<div className=
|
|
303
|
+
<div className={`transfer-line__field transfer-line__field--pax ${isPaxEmpty ? 'transfer-line__field--error' : ''}`}>
|
|
288
304
|
<PaxSelector
|
|
289
305
|
label="Number of pax"
|
|
290
306
|
value={internalPaxData}
|
|
291
307
|
onChange={handlePaxChange}
|
|
292
308
|
placeholder="2 pax"
|
|
309
|
+
className={isPaxEmpty ? 'pax-selector--error' : ''}
|
|
293
310
|
/>
|
|
294
311
|
</div>
|
|
295
312
|
|
|
@@ -311,7 +328,9 @@ const TransferLine: React.FC<TransferLineProps> = ({
|
|
|
311
328
|
showChevron={true}
|
|
312
329
|
onValueChange={handleDateChange}
|
|
313
330
|
selectionMode="single"
|
|
314
|
-
defaultValue={
|
|
331
|
+
defaultValue={internalTransferDate}
|
|
332
|
+
inputClassName="transfer-line__date-picker"
|
|
333
|
+
state={isDateEmpty ? 'error' : undefined}
|
|
315
334
|
/>
|
|
316
335
|
</div>
|
|
317
336
|
|
|
@@ -327,6 +346,7 @@ const TransferLine: React.FC<TransferLineProps> = ({
|
|
|
327
346
|
direction="pickup"
|
|
328
347
|
type={type === 'inter-hotel' ? 'accommodation' : type === 'arrival' ? 'airport-port' : 'accommodation'}
|
|
329
348
|
showGroupTitles={false}
|
|
349
|
+
error={isPickupEmpty}
|
|
330
350
|
/>
|
|
331
351
|
</div>
|
|
332
352
|
|
|
@@ -342,6 +362,7 @@ const TransferLine: React.FC<TransferLineProps> = ({
|
|
|
342
362
|
direction="dropoff"
|
|
343
363
|
type={type === 'inter-hotel' ? 'accommodation' : type === 'departure' ? 'airport-port' : 'accommodation'}
|
|
344
364
|
showGroupTitles={false}
|
|
365
|
+
error={isDropoffEmpty}
|
|
345
366
|
/>
|
|
346
367
|
</div>
|
|
347
368
|
</div>
|
|
@@ -13,15 +13,14 @@ function PopoverTrigger({
|
|
|
13
13
|
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
16
|
+
const PopoverContent = React.forwardRef<
|
|
17
|
+
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
18
|
+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
19
|
+
>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => {
|
|
22
20
|
return (
|
|
23
21
|
<PopoverPrimitive.Portal>
|
|
24
22
|
<PopoverPrimitive.Content
|
|
23
|
+
ref={ref}
|
|
25
24
|
data-slot="popover-content"
|
|
26
25
|
align={align}
|
|
27
26
|
sideOffset={sideOffset}
|
|
@@ -33,7 +32,8 @@ function PopoverContent({
|
|
|
33
32
|
/>
|
|
34
33
|
</PopoverPrimitive.Portal>
|
|
35
34
|
);
|
|
36
|
-
}
|
|
35
|
+
});
|
|
36
|
+
PopoverContent.displayName = 'PopoverContent';
|
|
37
37
|
|
|
38
38
|
function PopoverAnchor({
|
|
39
39
|
...props
|
|
@@ -83,6 +83,27 @@
|
|
|
83
83
|
@apply bg-[var(--color-atoll-green-800)];
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
/* Empty state (no value) - matches Figma design */
|
|
87
|
+
.calendar-input--empty {
|
|
88
|
+
@apply border-[#7f8594];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.calendar-input--empty .calendar-input__field::placeholder {
|
|
92
|
+
@apply text-[#7f8594];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.calendar-input--empty:not(.calendar-input--disabled) .calendar-input__field {
|
|
96
|
+
@apply text-[#7f8594];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.calendar-input--empty:not(.calendar-input--disabled) .calendar-input__icon-button:not(.calendar-input__icon-button--full-bg) {
|
|
100
|
+
@apply text-[#7f8594];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.calendar-input--empty:not(.calendar-input--disabled) .calendar-input__chevron {
|
|
104
|
+
@apply text-[#7f8594];
|
|
105
|
+
}
|
|
106
|
+
|
|
86
107
|
/* Active state (focused) */
|
|
87
108
|
.calendar-input--active {
|
|
88
109
|
@apply border-[var(--color-neutral-800)];
|
|
@@ -112,19 +133,27 @@
|
|
|
112
133
|
|
|
113
134
|
/* Error state */
|
|
114
135
|
.calendar-input--error {
|
|
115
|
-
@apply border-[var(--color-
|
|
136
|
+
@apply border-[var(--color-red-600,#dc2626)] bg-[var(--color-coral-red-50,#fff8f8)];
|
|
116
137
|
}
|
|
117
138
|
|
|
118
139
|
.calendar-input--error .calendar-input__field {
|
|
119
|
-
@apply text-[var(--color-coral-red-600)];
|
|
140
|
+
@apply text-[var(--color-coral-red-600,#f83b3b)];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.calendar-input--error .calendar-input__field::placeholder {
|
|
144
|
+
@apply text-[var(--color-coral-red-600,#f83b3b)];
|
|
120
145
|
}
|
|
121
146
|
|
|
122
147
|
.calendar-input--error .calendar-input__icon-button {
|
|
123
|
-
@apply !bg-none !text-[var(--color-coral-red-600)];
|
|
148
|
+
@apply !bg-none !text-[var(--color-coral-red-600,#f83b3b)];
|
|
124
149
|
}
|
|
125
150
|
|
|
126
151
|
.calendar-input--error .calendar-input__icon-button--full-bg {
|
|
127
|
-
@apply bg-[var(--color-coral-red-600)] !text-white;
|
|
152
|
+
@apply bg-[var(--color-coral-red-600,#f83b3b)] !text-white;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.calendar-input--error .calendar-input__chevron {
|
|
156
|
+
@apply !text-[var(--color-coral-red-600,#f83b3b)];
|
|
128
157
|
}
|
|
129
158
|
|
|
130
159
|
/* Disabled state */
|
|
@@ -64,16 +64,18 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.location-dropdown__input--error {
|
|
67
|
-
@apply border-[var(--color-
|
|
67
|
+
@apply border-[var(--color-red-600,#dc2626)] bg-[var(--color-coral-red-50,#fff8f8)];
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
.location-dropdown__input--error .location-dropdown__input-text
|
|
71
|
-
|
|
70
|
+
.location-dropdown__input--error .location-dropdown__input-text,
|
|
71
|
+
.location-dropdown__input--error .location-dropdown__input-text--placeholder {
|
|
72
|
+
@apply text-[var(--color-coral-red-600,#f83b3b)];
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
.location-dropdown__input--error .location-dropdown__input-icon,
|
|
76
|
+
.location-dropdown__input--error .location-dropdown__input-icon--placeholder,
|
|
75
77
|
.location-dropdown__input--error .location-dropdown__input-chevron {
|
|
76
|
-
@apply text-[var(--color-coral-red-600)];
|
|
78
|
+
@apply text-[var(--color-coral-red-600,#f83b3b)];
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
.location-dropdown__input--disabled {
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* Toast Component Styles */
|
|
2
|
+
|
|
3
|
+
.toast {
|
|
4
|
+
@apply flex flex-row items-stretch overflow-hidden border border-l-8;
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.toast__leading-block {
|
|
9
|
+
@apply shrink-0;
|
|
10
|
+
width: 8px;
|
|
11
|
+
border-top-left-radius: 4px;
|
|
12
|
+
border-bottom-left-radius: 4px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.toast__container {
|
|
16
|
+
@apply flex items-center flex-1 min-w-0;
|
|
17
|
+
gap: 8px;
|
|
18
|
+
padding: 12px;
|
|
19
|
+
border-top-right-radius: 4px;
|
|
20
|
+
border-bottom-right-radius: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.toast__icon-wrapper {
|
|
24
|
+
@apply shrink-0 relative flex items-center justify-center;
|
|
25
|
+
width: 24px;
|
|
26
|
+
height: 24px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.toast__icon {
|
|
30
|
+
@apply w-full h-full;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.toast__text {
|
|
34
|
+
@apply flex-1 min-w-0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Informational Toast */
|
|
38
|
+
.toast--informational {
|
|
39
|
+
@apply border-[var(--color-blue-600,#1e40af)];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.toast--informational .toast__container {
|
|
43
|
+
@apply bg-[var(--color-blue-100,#dbeafe)];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.toast--informational .toast__icon,
|
|
47
|
+
.toast--informational .toast__text {
|
|
48
|
+
@apply text-[var(--color-blue-600,#1e40af)];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Success Toast */
|
|
52
|
+
.toast--success {
|
|
53
|
+
@apply border-[var(--color-green-600,#166534)];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
.toast--success .toast__container {
|
|
58
|
+
@apply bg-[var(--color-green-50,#f0fdf4)];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.toast--success .toast__icon,
|
|
62
|
+
.toast--success .toast__text {
|
|
63
|
+
@apply text-[var(--color-green-600,#166534)];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Warning Toast */
|
|
67
|
+
.toast--warning {
|
|
68
|
+
@apply border-[var(--color-orange-600,#fc6613)];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.toast--warning .toast__container {
|
|
72
|
+
@apply bg-[var(--color-sandy-brown-100,#fff6ed)];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.toast--warning .toast__icon,
|
|
76
|
+
.toast--warning .toast__text {
|
|
77
|
+
@apply text-[var(--color-orange-600,#fc6613)];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Danger Toast */
|
|
81
|
+
.toast--danger {
|
|
82
|
+
@apply border-[var(--color-red-600,#a01414)];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.toast--danger .toast__container {
|
|
86
|
+
@apply bg-[var(--color-coral-red-50,#fff8f8)];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.toast--danger .toast__icon,
|
|
90
|
+
.toast--danger .toast__text {
|
|
91
|
+
@apply text-[var(--color-red-600,#a01414)];
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
.docket__container {
|
|
2
|
+
width: fit-content;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
.docket {
|
|
2
6
|
@apply flex flex-col gap-6 p-6;
|
|
3
7
|
width: 384px;
|
|
4
|
-
|
|
8
|
+
height: fit-content;
|
|
5
9
|
background: var(--color-elevation-level-1, #ffffff);
|
|
6
10
|
border: var(--border-border, 1px) solid var(--color-border-subtle, #e5e5e5);
|
|
7
11
|
border-radius: var(--border-radius-lg, 8px);
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
.pax-selector__label {
|
|
22
22
|
font-family: var(--font-font-family-body, "Satoshi"), "Satoshi", "Inter", "Segoe UI", "system-ui", sans-serif;
|
|
23
23
|
font-size: 14px;
|
|
24
|
-
line-height:
|
|
24
|
+
line-height: 1.5;
|
|
25
25
|
color: var(--input-color-label-default, #262626);
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -45,6 +45,17 @@
|
|
|
45
45
|
border-color: var(--color-text-default, #262626);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
.pax-selector--error .pax-selector__input {
|
|
49
|
+
border-color: var(--color-red-600, #dc2626);
|
|
50
|
+
background: var(--color-coral-red-50, #fff8f8);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.pax-selector--error .pax-selector__input-text,
|
|
54
|
+
.pax-selector--error .pax-selector__input-icon,
|
|
55
|
+
.pax-selector--error .pax-selector__chevron {
|
|
56
|
+
color: var(--color-coral-red-600, #f83b3b);
|
|
57
|
+
}
|
|
58
|
+
|
|
48
59
|
.pax-selector__input-content {
|
|
49
60
|
display: flex;
|
|
50
61
|
align-items: center;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.transfer-line__field p {
|
|
35
|
-
|
|
35
|
+
line-height: 1.5;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/* Mobile layout - stack fields vertically */
|
|
@@ -84,3 +84,7 @@
|
|
|
84
84
|
.transfer-line__delete-icon {
|
|
85
85
|
@apply text-[var(--color-neutral-800)];
|
|
86
86
|
}
|
|
87
|
+
|
|
88
|
+
.transfer-line__date-picker {
|
|
89
|
+
@apply h-11;
|
|
90
|
+
}
|