mautourco-components 0.2.21 → 0.2.22
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/Checkbox/Checkbox.d.ts +3 -2
- package/dist/components/atoms/Checkbox/Checkbox.js +16 -6
- package/dist/components/atoms/Inputs/Input/Input.d.ts +1 -1
- package/dist/components/molecules/BookingPax/BookingPax.d.ts +43 -0
- package/dist/components/molecules/BookingPax/BookingPax.js +43 -0
- package/dist/components/molecules/BookingPax/BookingPaxAccom.d.ts +34 -0
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +10 -0
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.d.ts +89 -1
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.js +34 -11
- package/dist/components/molecules/BookingPax/BookingPaxExcursion.d.ts +43 -0
- package/dist/components/molecules/BookingPax/BookingPaxExcursion.js +19 -0
- package/dist/components/molecules/BookingPax/BookingPaxHeader.d.ts +15 -0
- package/dist/components/molecules/BookingPax/BookingPaxHeader.js +13 -0
- package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.d.ts +30 -0
- package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.js +15 -0
- package/dist/components/molecules/BookingPax/BookingPaxRemarks.d.ts +14 -0
- package/dist/components/molecules/BookingPax/BookingPaxRemarks.js +11 -0
- package/dist/components/molecules/BookingPax/BookingPaxTransfer.d.ts +51 -0
- package/dist/components/molecules/BookingPax/BookingPaxTransfer.js +19 -2
- package/dist/components/molecules/BookingPax/index.d.ts +1 -0
- package/dist/components/molecules/BookingPax/index.js +1 -0
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.d.ts +20 -0
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.js +17 -6
- package/dist/components/molecules/DialogContentPolicy/DialogContentPolicy.d.ts +18 -0
- package/dist/components/molecules/DialogContentPolicy/DialogContentPolicy.js +14 -3
- package/dist/components/organisms/Booking/BookingPaxList.d.ts +64 -0
- package/dist/components/organisms/Booking/BookingPaxList.js +19 -0
- package/dist/components/organisms/Dialog/Dialog.d.ts +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +4 -4
- package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.d.ts +29 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.js +31 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingMailSent.d.ts +29 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingMailSent.js +31 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingReference.d.ts +35 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingReference.js +37 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingSuccess.d.ts +35 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingSuccess.js +33 -0
- package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.d.ts +39 -2
- package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.js +25 -1
- package/dist/components/organisms/DialogBookingConfirm/index.d.ts +5 -0
- package/dist/components/organisms/DialogBookingConfirm/index.js +1 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationAccom.d.ts +25 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationAccom.js +16 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationBody.d.ts +24 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationBody.js +24 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationExcursion.d.ts +30 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationExcursion.js +15 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationHeader.d.ts +23 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationHeader.js +23 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationTransfer.d.ts +22 -0
- package/dist/components/organisms/TabCancellationPolicy/CancellationTransfer.js +13 -0
- package/dist/components/organisms/TabCancellationPolicy/HeaderAccom.d.ts +22 -0
- package/dist/components/organisms/TabCancellationPolicy/HeaderAccom.js +13 -0
- package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion.d.ts +18 -0
- package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion.js +12 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +7 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.js +2 -1
- package/dist/components/organisms/TabCancellationPolicy/PolicyExcursion.d.ts +18 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyExcursion.js +12 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyTransfer.d.ts +11 -0
- package/dist/components/organisms/TabCancellationPolicy/PolicyTransfer.js +11 -0
- package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicy.d.ts +29 -0
- package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicy.js +29 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -2
- package/dist/styles/components/checkbox.css +11 -5
- package/package.json +1 -2
- package/src/components/atoms/Checkbox/Checkbox.tsx +38 -23
- package/src/components/atoms/Inputs/Input/Input.tsx +1 -1
- package/src/components/molecules/BookingPax/BookingPax.tsx +43 -0
- package/src/components/molecules/BookingPax/BookingPaxAccom.tsx +34 -0
- package/src/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +6 -0
- package/src/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.tsx +92 -18
- package/src/components/molecules/BookingPax/BookingPaxExcursion.tsx +43 -0
- package/src/components/molecules/BookingPax/BookingPaxHeader.tsx +28 -1
- package/src/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.tsx +30 -0
- package/src/components/molecules/BookingPax/BookingPaxRemarks.tsx +14 -0
- package/src/components/molecules/BookingPax/BookingPaxTransfer.tsx +52 -2
- package/src/components/molecules/BookingPax/index.ts +2 -0
- package/src/components/molecules/DialogContentPolicy/DialogCancellationList.tsx +32 -12
- package/src/components/molecules/DialogContentPolicy/DialogContentPolicy.tsx +27 -11
- package/src/components/organisms/Booking/BookingPaxList.tsx +64 -0
- package/src/components/organisms/Dialog/Dialog.tsx +13 -20
- package/src/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.tsx +44 -0
- package/src/components/organisms/DialogBookingConfirm/BookingMailSent.tsx +56 -0
- package/src/components/organisms/DialogBookingConfirm/BookingReference.tsx +74 -0
- package/src/components/organisms/DialogBookingConfirm/BookingSuccess.tsx +67 -0
- package/src/components/organisms/DialogBookingConfirm/DialogBookingConfirm.tsx +43 -2
- package/src/components/organisms/DialogBookingConfirm/index.ts +6 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationAccom.tsx +25 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationBody.tsx +24 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationExcursion.tsx +30 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationHeader.tsx +23 -0
- package/src/components/organisms/TabCancellationPolicy/CancellationTransfer.tsx +22 -0
- package/src/components/organisms/TabCancellationPolicy/HeaderAccom.tsx +22 -0
- package/src/components/organisms/TabCancellationPolicy/HeaderExcursion.tsx +18 -0
- package/src/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +3 -0
- package/src/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.tsx +3 -2
- package/src/components/organisms/TabCancellationPolicy/PolicyExcursion.tsx +18 -0
- package/src/components/organisms/TabCancellationPolicy/PolicyTransfer.tsx +11 -0
- package/src/components/organisms/TabCancellationPolicy/TabCancellationPolicy.tsx +29 -0
- package/src/styles/components/checkbox.css +11 -5
- package/dist/components/ui/checkbox.d.ts +0 -4
- package/dist/components/ui/checkbox.js +0 -31
- package/src/components/ui/checkbox.tsx +0 -32
|
@@ -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
|
|
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
|
-
({
|
|
132
|
+
({mapTransferType[type]})
|
|
83
133
|
</Text>
|
|
84
134
|
</>
|
|
85
135
|
}
|
|
@@ -10,28 +10,48 @@ import {
|
|
|
10
10
|
import { DialogContentPolicy } from './DialogContentPolicy';
|
|
11
11
|
|
|
12
12
|
export interface CancellationItem {
|
|
13
|
+
/**
|
|
14
|
+
* The type of the cancellation.
|
|
15
|
+
*/
|
|
13
16
|
type: 'accommodation' | 'excursion';
|
|
17
|
+
/**
|
|
18
|
+
* The data of the cancellation.
|
|
19
|
+
*/
|
|
14
20
|
data: DialogCancellationAccomProps | DialogCancellationExcursionProps;
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
export interface DialogCancellationListProps {
|
|
24
|
+
/**
|
|
25
|
+
* The cancellations to display.
|
|
26
|
+
*/
|
|
18
27
|
cancellations: CancellationItem[];
|
|
19
28
|
}
|
|
20
29
|
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
const isAccommodation = (
|
|
31
|
+
data: CancellationItem['data']
|
|
32
|
+
): data is DialogCancellationAccomProps => {
|
|
33
|
+
return 'hotelName' in data;
|
|
34
|
+
};
|
|
23
35
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
const isExcursion = (
|
|
37
|
+
data: CancellationItem['data']
|
|
38
|
+
): data is DialogCancellationExcursionProps => {
|
|
39
|
+
return 'excursionName' in data;
|
|
40
|
+
};
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
/**
|
|
43
|
+
* DialogCancellationList is a component that allows the user to display the cancellations.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <DialogCancellationList
|
|
47
|
+
* cancellations={cancellations}
|
|
48
|
+
* />
|
|
49
|
+
*
|
|
50
|
+
* @param props - The props for the DialogCancellationList component.
|
|
51
|
+
* @returns The DialogCancellationList component.
|
|
52
|
+
*/
|
|
53
|
+
export const DialogCancellationList: React.FC<DialogCancellationListProps> = (props) => {
|
|
54
|
+
const { cancellations } = props;
|
|
35
55
|
|
|
36
56
|
return (
|
|
37
57
|
<DialogContentPolicy>
|
|
@@ -1,32 +1,48 @@
|
|
|
1
|
-
import { CheckedState } from '@radix-ui/react-checkbox';
|
|
2
1
|
import React, { useState } from 'react';
|
|
3
2
|
import Button from '../../atoms/Button/Button';
|
|
4
|
-
import
|
|
5
|
-
import { Checkbox } from '../../ui/checkbox';
|
|
3
|
+
import Checkbox from '../../atoms/Checkbox/Checkbox';
|
|
6
4
|
import { DialogCancellationAccom } from './DialogCancellationAccom';
|
|
7
5
|
import { DialogCancellationExcursion } from './DialogCancellationExcursion';
|
|
8
6
|
import { DialogCancellationList } from './DialogCancellationList';
|
|
9
7
|
|
|
10
8
|
export interface DialogContentPolicyProps {
|
|
9
|
+
/**
|
|
10
|
+
* The children to display.
|
|
11
|
+
*/
|
|
11
12
|
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The callback function to call when the submit button is clicked.
|
|
15
|
+
*/
|
|
12
16
|
onSubmit?: () => void;
|
|
13
17
|
}
|
|
14
18
|
|
|
19
|
+
/**
|
|
20
|
+
* DialogContentPolicy is a component that allows the user to display the cancellation policy.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <DialogContentPolicy
|
|
24
|
+
* children={children}
|
|
25
|
+
* onSubmit={onSubmit}
|
|
26
|
+
* />
|
|
27
|
+
*
|
|
28
|
+
* @param props - The props for the DialogContentPolicy component.
|
|
29
|
+
* @returns The DialogContentPolicy component.
|
|
30
|
+
*/
|
|
15
31
|
export const DialogContentPolicy = (props: DialogContentPolicyProps) => {
|
|
16
32
|
const { children, onSubmit } = props;
|
|
17
|
-
const [accepted, setAccepted] = useState<
|
|
33
|
+
const [accepted, setAccepted] = useState<boolean>(false);
|
|
18
34
|
|
|
19
35
|
return (
|
|
20
36
|
<div className="cancellation-policy">
|
|
21
37
|
{children}
|
|
22
|
-
<div className="flex justify-end gap-x-
|
|
38
|
+
<div className="flex justify-end gap-x-5 py-9">
|
|
23
39
|
<div className="flex gap-x-2.5 items-center">
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
<Checkbox
|
|
41
|
+
checked={accepted}
|
|
42
|
+
onChange={setAccepted}
|
|
43
|
+
label="I've read and accept the cancellation policy."
|
|
44
|
+
labelPosition="leading"
|
|
45
|
+
/>
|
|
30
46
|
</div>
|
|
31
47
|
<Button
|
|
32
48
|
className="w-[250px]"
|
|
@@ -11,7 +11,13 @@ import {
|
|
|
11
11
|
} from '../../molecules/BookingPax/BookingPaxClient/BookingPaxClient';
|
|
12
12
|
|
|
13
13
|
export interface BookingPaxData {
|
|
14
|
+
/**
|
|
15
|
+
* The type of the booking pax.
|
|
16
|
+
*/
|
|
14
17
|
type: 'accommodation' | 'excursion' | 'transfer';
|
|
18
|
+
/**
|
|
19
|
+
* The data of the booking pax.
|
|
20
|
+
*/
|
|
15
21
|
data:
|
|
16
22
|
| Omit<BookingPaxAccomProps, 'clientsInfo'>
|
|
17
23
|
| Omit<BookingPaxExcursionProps, 'clientsInfo'>
|
|
@@ -19,25 +25,64 @@ export interface BookingPaxData {
|
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
export interface BookingPaxAutoFilledData {
|
|
28
|
+
/**
|
|
29
|
+
* The type of the booking pax.
|
|
30
|
+
*/
|
|
22
31
|
type: BookingPaxData['type'];
|
|
32
|
+
/**
|
|
33
|
+
* The parent index of the booking pax.
|
|
34
|
+
*/
|
|
23
35
|
parentIndex: number;
|
|
36
|
+
/**
|
|
37
|
+
* The room index of the booking pax.
|
|
38
|
+
*/
|
|
24
39
|
roomIndex?: number;
|
|
40
|
+
/**
|
|
41
|
+
* The selected clients of the booking pax.
|
|
42
|
+
*/
|
|
25
43
|
selectedClients: BookingPaxClientInfo[];
|
|
26
44
|
}
|
|
27
45
|
|
|
28
46
|
export interface BookingPaxProps {
|
|
47
|
+
/**
|
|
48
|
+
* The data of the booking pax.
|
|
49
|
+
*/
|
|
29
50
|
data: BookingPaxData[];
|
|
51
|
+
/**
|
|
52
|
+
* The clients info of the booking pax.
|
|
53
|
+
*/
|
|
30
54
|
clientsInfo: BookingPaxClientInfo[];
|
|
55
|
+
/**
|
|
56
|
+
* Whether the booking pax is submitted.
|
|
57
|
+
*/
|
|
31
58
|
isSubmitted?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The callback function to call when the pax changes.
|
|
61
|
+
*/
|
|
32
62
|
onPaxChange?: (
|
|
33
63
|
index: number,
|
|
34
64
|
type: BookingPaxData['type'],
|
|
35
65
|
options: BookingPaxClientOptions
|
|
36
66
|
) => void;
|
|
67
|
+
/**
|
|
68
|
+
* The callback function to call when the remark changes.
|
|
69
|
+
*/
|
|
37
70
|
onRemarkChange?: (index: number, type: BookingPaxData['type'], value: string) => void;
|
|
71
|
+
/**
|
|
72
|
+
* The callback function to call when the error changes.
|
|
73
|
+
*/
|
|
38
74
|
onError?: (index: number, type: BookingPaxData['type'], hasError: boolean) => void;
|
|
75
|
+
/**
|
|
76
|
+
* The callback function to call when the time changes.
|
|
77
|
+
*/
|
|
39
78
|
onTimeChange?: (index: number, value: string | string[]) => void;
|
|
79
|
+
/**
|
|
80
|
+
* The callback function to call when the flight number changes.
|
|
81
|
+
*/
|
|
40
82
|
onFlightNumberChange?: (index: number, value: string) => void;
|
|
83
|
+
/**
|
|
84
|
+
* The callback function to call when the auto filled data changes.
|
|
85
|
+
*/
|
|
41
86
|
onAutoFilled?: (data: BookingPaxAutoFilledData[]) => void;
|
|
42
87
|
}
|
|
43
88
|
|
|
@@ -60,6 +105,25 @@ const isTransferData = (
|
|
|
60
105
|
return 'from' in data && 'to' in data && 'type' in data;
|
|
61
106
|
};
|
|
62
107
|
|
|
108
|
+
/**
|
|
109
|
+
* BookingPaxList is a component that allows the user to select the pax for a booking.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* <BookingPaxList
|
|
113
|
+
* data={data}
|
|
114
|
+
* clientsInfo={clientsInfo}
|
|
115
|
+
* isSubmitted={isSubmitted}
|
|
116
|
+
* onPaxChange={onPaxChange}
|
|
117
|
+
* onRemarkChange={onRemarkChange}
|
|
118
|
+
* onError={onError}
|
|
119
|
+
* onTimeChange={onTimeChange}
|
|
120
|
+
* onFlightNumberChange={onFlightNumberChange}
|
|
121
|
+
* onAutoFilled={onAutoFilled}
|
|
122
|
+
* />
|
|
123
|
+
*
|
|
124
|
+
* @param props - The props for the BookingPaxList component.
|
|
125
|
+
* @returns The BookingPaxList component.
|
|
126
|
+
*/
|
|
63
127
|
export const BookingPaxList: React.FC<BookingPaxProps> = (props) => {
|
|
64
128
|
const {
|
|
65
129
|
data,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useEffect, useRef } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { useMobile } from '../../../hooks/useMobile';
|
|
4
|
+
import '../../../styles/components/organism/dialog.css';
|
|
4
5
|
import Button from '../../atoms/Button/Button';
|
|
5
6
|
import Icon from '../../atoms/Icon/Icon';
|
|
6
|
-
import '../../../styles/components/organism/dialog.css';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Size variants for the Dialog component
|
|
@@ -25,7 +25,7 @@ export interface DialogProps {
|
|
|
25
25
|
/**
|
|
26
26
|
* Title displayed in the dialog header
|
|
27
27
|
*/
|
|
28
|
-
title
|
|
28
|
+
title?: string;
|
|
29
29
|
/**
|
|
30
30
|
* Content to be rendered in the dialog body
|
|
31
31
|
*/
|
|
@@ -109,7 +109,7 @@ export interface DialogProps {
|
|
|
109
109
|
export const Dialog: React.FC<DialogProps> = ({
|
|
110
110
|
isOpen,
|
|
111
111
|
onClose,
|
|
112
|
-
title,
|
|
112
|
+
title = '',
|
|
113
113
|
children,
|
|
114
114
|
footer,
|
|
115
115
|
size = 'responsive',
|
|
@@ -210,8 +210,10 @@ export const Dialog: React.FC<DialogProps> = ({
|
|
|
210
210
|
};
|
|
211
211
|
|
|
212
212
|
// Generate unique IDs for accessibility
|
|
213
|
-
const titleId =
|
|
214
|
-
|
|
213
|
+
const titleId =
|
|
214
|
+
ariaLabelledBy || `dialog-title-${title.replace(/\s+/g, '-').toLowerCase()}`;
|
|
215
|
+
const bodyId =
|
|
216
|
+
ariaDescribedBy || `dialog-body-${title.replace(/\s+/g, '-').toLowerCase()}`;
|
|
215
217
|
|
|
216
218
|
// Build class names
|
|
217
219
|
const contentClasses = [
|
|
@@ -273,11 +275,7 @@ export const Dialog: React.FC<DialogProps> = ({
|
|
|
273
275
|
const dialogContent = (
|
|
274
276
|
<>
|
|
275
277
|
{/* Overlay */}
|
|
276
|
-
<div
|
|
277
|
-
className="dialog-overlay"
|
|
278
|
-
onClick={handleOverlayClick}
|
|
279
|
-
aria-hidden="true"
|
|
280
|
-
/>
|
|
278
|
+
<div className="dialog-overlay" onClick={handleOverlayClick} aria-hidden="true" />
|
|
281
279
|
|
|
282
280
|
{/* Dialog container */}
|
|
283
281
|
<div
|
|
@@ -288,8 +286,7 @@ export const Dialog: React.FC<DialogProps> = ({
|
|
|
288
286
|
aria-describedby={bodyId}
|
|
289
287
|
ref={dialogRef}
|
|
290
288
|
tabIndex={-1}
|
|
291
|
-
onClick={handleOverlayClick}
|
|
292
|
-
>
|
|
289
|
+
onClick={handleOverlayClick}>
|
|
293
290
|
{/* Dialog content */}
|
|
294
291
|
<div className={contentClasses}>
|
|
295
292
|
{/* Header */}
|
|
@@ -302,8 +299,7 @@ export const Dialog: React.FC<DialogProps> = ({
|
|
|
302
299
|
type="button"
|
|
303
300
|
className={closeButtonClasses}
|
|
304
301
|
onClick={onClose}
|
|
305
|
-
aria-label="Close dialog"
|
|
306
|
-
>
|
|
302
|
+
aria-label="Close dialog">
|
|
307
303
|
<Icon name="close" size="md" />
|
|
308
304
|
</button>
|
|
309
305
|
)}
|
|
@@ -324,15 +320,13 @@ export const Dialog: React.FC<DialogProps> = ({
|
|
|
324
320
|
<Button
|
|
325
321
|
variant="outline-secondary"
|
|
326
322
|
size={isMobileSize ? 'sm' : 'md'}
|
|
327
|
-
onClick={handleSecondaryClick}
|
|
328
|
-
>
|
|
323
|
+
onClick={handleSecondaryClick}>
|
|
329
324
|
{secondaryButtonText}
|
|
330
325
|
</Button>
|
|
331
326
|
<Button
|
|
332
327
|
variant="secondary"
|
|
333
328
|
size={isMobileSize ? 'sm' : 'md'}
|
|
334
|
-
onClick={handlePrimaryClick}
|
|
335
|
-
>
|
|
329
|
+
onClick={handlePrimaryClick}>
|
|
336
330
|
{primaryButtonText}
|
|
337
331
|
</Button>
|
|
338
332
|
</div>
|
|
@@ -349,4 +343,3 @@ export const Dialog: React.FC<DialogProps> = ({
|
|
|
349
343
|
};
|
|
350
344
|
|
|
351
345
|
export default Dialog;
|
|
352
|
-
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DialogContentPolicy } from '../../molecules/DialogContentPolicy';
|
|
2
|
+
import { CancellationItem } from '../../molecules/DialogContentPolicy/DialogCancellationList';
|
|
3
|
+
import { DialogBookingConfirm } from './DialogBookingConfirm';
|
|
4
|
+
|
|
5
|
+
export interface BookingCancellationPolicyProps {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the dialog is open.
|
|
8
|
+
*/
|
|
9
|
+
open: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The callback function to call when the dialog is closed.
|
|
12
|
+
*/
|
|
13
|
+
setOpen: (open: boolean) => void;
|
|
14
|
+
/**
|
|
15
|
+
* The cancellations to display.
|
|
16
|
+
*/
|
|
17
|
+
cancellations: CancellationItem[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* BookingCancellationPolicy is a component that allows the user to display the booking cancellation policy.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <BookingCancellationPolicy
|
|
25
|
+
* open={open}
|
|
26
|
+
* setOpen={setOpen}
|
|
27
|
+
* cancellations={cancellations}
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* @param props - The props for the BookingCancellationPolicy component.
|
|
31
|
+
* @returns The BookingCancellationPolicy component.
|
|
32
|
+
*/
|
|
33
|
+
export const BookingCancellationPolicy = (props: BookingCancellationPolicyProps) => {
|
|
34
|
+
const { open, setOpen, cancellations } = props;
|
|
35
|
+
return (
|
|
36
|
+
<DialogBookingConfirm
|
|
37
|
+
open={open}
|
|
38
|
+
setOpen={setOpen}
|
|
39
|
+
title="Confirmation of Terms & Cancellation policy"
|
|
40
|
+
className="!max-w-[800px]">
|
|
41
|
+
<DialogContentPolicy.List cancellations={cancellations} />
|
|
42
|
+
</DialogBookingConfirm>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Button, Heading } from '@/src';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { DialogBookingConfirm } from './DialogBookingConfirm';
|
|
4
|
+
|
|
5
|
+
export interface BookingMailSentProps {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the dialog is open.
|
|
8
|
+
*/
|
|
9
|
+
open: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The callback function to call when the dialog is closed.
|
|
12
|
+
*/
|
|
13
|
+
setOpen: (open: boolean) => void;
|
|
14
|
+
/**
|
|
15
|
+
* The callback function to call when the next button is clicked.
|
|
16
|
+
*/
|
|
17
|
+
onNext: () => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* BookingMailSent is a component that allows the user to display the booking mail sent confirmation.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <BookingMailSent
|
|
25
|
+
* open={open}
|
|
26
|
+
* setOpen={setOpen}
|
|
27
|
+
* onNext={onNext}
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* @param props - The props for the BookingMailSent component.
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
export const BookingMailSent: React.FC<BookingMailSentProps> = (props) => {
|
|
34
|
+
const { open, setOpen, onNext } = props;
|
|
35
|
+
return (
|
|
36
|
+
<DialogBookingConfirm open={open} setOpen={setOpen} className="!max-w-[800px]">
|
|
37
|
+
<div className="space-y-9">
|
|
38
|
+
<div className="space-y-8">
|
|
39
|
+
<img
|
|
40
|
+
src="/images/svg/booking-mail-sent.svg"
|
|
41
|
+
alt="Booking success"
|
|
42
|
+
className="mx-auto"
|
|
43
|
+
width={150}
|
|
44
|
+
height={150}
|
|
45
|
+
/>
|
|
46
|
+
<Heading as="p" level={6} variant="medium" className="text-center">
|
|
47
|
+
You will receive a copy of your booking in your mail inbox.
|
|
48
|
+
</Heading>
|
|
49
|
+
</div>
|
|
50
|
+
<Button variant="secondary" onClick={onNext} className="w-full">
|
|
51
|
+
Go to booking grid
|
|
52
|
+
</Button>
|
|
53
|
+
</div>
|
|
54
|
+
</DialogBookingConfirm>
|
|
55
|
+
);
|
|
56
|
+
};
|