mautourco-components 0.2.20 → 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.
Files changed (108) 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/Inputs/Input/Input.d.ts +1 -1
  4. package/dist/components/molecules/BookingPax/BookingPax.d.ts +43 -0
  5. package/dist/components/molecules/BookingPax/BookingPax.js +43 -0
  6. package/dist/components/molecules/BookingPax/BookingPaxAccom.d.ts +34 -0
  7. package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +10 -0
  8. package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.d.ts +89 -1
  9. package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.js +34 -11
  10. package/dist/components/molecules/BookingPax/BookingPaxExcursion.d.ts +43 -0
  11. package/dist/components/molecules/BookingPax/BookingPaxExcursion.js +19 -0
  12. package/dist/components/molecules/BookingPax/BookingPaxHeader.d.ts +15 -0
  13. package/dist/components/molecules/BookingPax/BookingPaxHeader.js +13 -0
  14. package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.d.ts +30 -0
  15. package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.js +15 -0
  16. package/dist/components/molecules/BookingPax/BookingPaxRemarks.d.ts +14 -0
  17. package/dist/components/molecules/BookingPax/BookingPaxRemarks.js +11 -0
  18. package/dist/components/molecules/BookingPax/BookingPaxTransfer.d.ts +51 -0
  19. package/dist/components/molecules/BookingPax/BookingPaxTransfer.js +19 -2
  20. package/dist/components/molecules/BookingPax/index.d.ts +1 -0
  21. package/dist/components/molecules/BookingPax/index.js +1 -0
  22. package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.d.ts +20 -0
  23. package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.js +17 -6
  24. package/dist/components/molecules/DialogContentPolicy/DialogContentPolicy.d.ts +18 -0
  25. package/dist/components/molecules/DialogContentPolicy/DialogContentPolicy.js +14 -3
  26. package/dist/components/organisms/Booking/BookingPaxList.d.ts +64 -0
  27. package/dist/components/organisms/Booking/BookingPaxList.js +19 -0
  28. package/dist/components/organisms/Booking/BookingStep/BookingStep.d.ts +1 -0
  29. package/dist/components/organisms/Booking/BookingStep/BookingStep.js +5 -2
  30. package/dist/components/organisms/Dialog/Dialog.d.ts +1 -1
  31. package/dist/components/organisms/Dialog/Dialog.js +4 -4
  32. package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.d.ts +29 -0
  33. package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.js +31 -0
  34. package/dist/components/organisms/DialogBookingConfirm/BookingMailSent.d.ts +29 -0
  35. package/dist/components/organisms/DialogBookingConfirm/BookingMailSent.js +31 -0
  36. package/dist/components/organisms/DialogBookingConfirm/BookingReference.d.ts +35 -0
  37. package/dist/components/organisms/DialogBookingConfirm/BookingReference.js +37 -0
  38. package/dist/components/organisms/DialogBookingConfirm/BookingSuccess.d.ts +35 -0
  39. package/dist/components/organisms/DialogBookingConfirm/BookingSuccess.js +33 -0
  40. package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.d.ts +39 -2
  41. package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.js +25 -1
  42. package/dist/components/organisms/DialogBookingConfirm/index.d.ts +5 -0
  43. package/dist/components/organisms/DialogBookingConfirm/index.js +1 -0
  44. package/dist/components/organisms/TabCancellationPolicy/CancellationAccom.d.ts +25 -0
  45. package/dist/components/organisms/TabCancellationPolicy/CancellationAccom.js +16 -0
  46. package/dist/components/organisms/TabCancellationPolicy/CancellationBody.d.ts +24 -0
  47. package/dist/components/organisms/TabCancellationPolicy/CancellationBody.js +24 -0
  48. package/dist/components/organisms/TabCancellationPolicy/CancellationExcursion.d.ts +30 -0
  49. package/dist/components/organisms/TabCancellationPolicy/CancellationExcursion.js +15 -0
  50. package/dist/components/organisms/TabCancellationPolicy/CancellationHeader.d.ts +23 -0
  51. package/dist/components/organisms/TabCancellationPolicy/CancellationHeader.js +23 -0
  52. package/dist/components/organisms/TabCancellationPolicy/CancellationTransfer.d.ts +22 -0
  53. package/dist/components/organisms/TabCancellationPolicy/CancellationTransfer.js +13 -0
  54. package/dist/components/organisms/TabCancellationPolicy/HeaderAccom.d.ts +22 -0
  55. package/dist/components/organisms/TabCancellationPolicy/HeaderAccom.js +13 -0
  56. package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion.d.ts +18 -0
  57. package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion.js +12 -0
  58. package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +7 -0
  59. package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.js +2 -1
  60. package/dist/components/organisms/TabCancellationPolicy/PolicyExcursion.d.ts +18 -0
  61. package/dist/components/organisms/TabCancellationPolicy/PolicyExcursion.js +12 -0
  62. package/dist/components/organisms/TabCancellationPolicy/PolicyTransfer.d.ts +11 -0
  63. package/dist/components/organisms/TabCancellationPolicy/PolicyTransfer.js +11 -0
  64. package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicy.d.ts +29 -0
  65. package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicy.js +29 -0
  66. package/dist/index.d.ts +4 -0
  67. package/dist/index.js +2 -2
  68. package/dist/styles/components/checkbox.css +11 -5
  69. package/package.json +1 -2
  70. package/src/components/atoms/Checkbox/Checkbox.tsx +38 -23
  71. package/src/components/atoms/Inputs/Input/Input.tsx +1 -1
  72. package/src/components/molecules/BookingPax/BookingPax.tsx +43 -0
  73. package/src/components/molecules/BookingPax/BookingPaxAccom.tsx +34 -0
  74. package/src/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +6 -0
  75. package/src/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.tsx +92 -18
  76. package/src/components/molecules/BookingPax/BookingPaxExcursion.tsx +43 -0
  77. package/src/components/molecules/BookingPax/BookingPaxHeader.tsx +28 -1
  78. package/src/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.tsx +30 -0
  79. package/src/components/molecules/BookingPax/BookingPaxRemarks.tsx +14 -0
  80. package/src/components/molecules/BookingPax/BookingPaxTransfer.tsx +52 -2
  81. package/src/components/molecules/BookingPax/index.ts +2 -0
  82. package/src/components/molecules/DialogContentPolicy/DialogCancellationList.tsx +32 -12
  83. package/src/components/molecules/DialogContentPolicy/DialogContentPolicy.tsx +27 -11
  84. package/src/components/organisms/Booking/BookingPaxList.tsx +64 -0
  85. package/src/components/organisms/Booking/BookingStep/BookingStep.tsx +8 -2
  86. package/src/components/organisms/Dialog/Dialog.tsx +13 -20
  87. package/src/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.tsx +44 -0
  88. package/src/components/organisms/DialogBookingConfirm/BookingMailSent.tsx +56 -0
  89. package/src/components/organisms/DialogBookingConfirm/BookingReference.tsx +74 -0
  90. package/src/components/organisms/DialogBookingConfirm/BookingSuccess.tsx +67 -0
  91. package/src/components/organisms/DialogBookingConfirm/DialogBookingConfirm.tsx +43 -2
  92. package/src/components/organisms/DialogBookingConfirm/index.ts +6 -0
  93. package/src/components/organisms/TabCancellationPolicy/CancellationAccom.tsx +25 -0
  94. package/src/components/organisms/TabCancellationPolicy/CancellationBody.tsx +24 -0
  95. package/src/components/organisms/TabCancellationPolicy/CancellationExcursion.tsx +30 -0
  96. package/src/components/organisms/TabCancellationPolicy/CancellationHeader.tsx +23 -0
  97. package/src/components/organisms/TabCancellationPolicy/CancellationTransfer.tsx +22 -0
  98. package/src/components/organisms/TabCancellationPolicy/HeaderAccom.tsx +22 -0
  99. package/src/components/organisms/TabCancellationPolicy/HeaderExcursion.tsx +18 -0
  100. package/src/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +3 -0
  101. package/src/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.tsx +3 -2
  102. package/src/components/organisms/TabCancellationPolicy/PolicyExcursion.tsx +18 -0
  103. package/src/components/organisms/TabCancellationPolicy/PolicyTransfer.tsx +11 -0
  104. package/src/components/organisms/TabCancellationPolicy/TabCancellationPolicy.tsx +29 -0
  105. package/src/styles/components/checkbox.css +11 -5
  106. package/dist/components/ui/checkbox.d.ts +0 -4
  107. package/dist/components/ui/checkbox.js +0 -31
  108. package/src/components/ui/checkbox.tsx +0 -32
@@ -1,13 +1,14 @@
1
1
  import React from 'react';
2
- interface CheckboxProps {
2
+ export interface CheckboxProps {
3
3
  checked?: boolean;
4
4
  disabled?: boolean;
5
5
  error?: boolean;
6
6
  label?: string;
7
- onChange?: (checked: boolean) => void;
8
7
  className?: string;
9
8
  id?: string;
10
9
  leadingContent?: React.ReactNode;
10
+ labelPosition?: 'leading' | 'trailing';
11
+ onChange?: (checked: boolean) => void;
11
12
  }
12
13
  declare const Checkbox: React.FC<CheckboxProps>;
13
14
  export default Checkbox;
@@ -10,18 +10,22 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useEffect, useState } from 'react';
13
14
  import Check from '../Icon/icons/Check';
15
+ import { Text } from '../Typography/Typography';
14
16
  var Checkbox = function (_a) {
15
- var _b = _a.checked, checked = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.error, error = _d === void 0 ? false : _d, label = _a.label, onChange = _a.onChange, _e = _a.className, className = _e === void 0 ? '' : _e, id = _a.id, leadingContent = _a.leadingContent;
17
+ var _b = _a.checked, checked = _b === void 0 ? false : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.error, error = _d === void 0 ? false : _d, label = _a.label, onChange = _a.onChange, _e = _a.className, className = _e === void 0 ? '' : _e, id = _a.id, leadingContent = _a.leadingContent, _f = _a.labelPosition, labelPosition = _f === void 0 ? 'trailing' : _f;
18
+ var _g = useState(false), isChecked = _g[0], setIsChecked = _g[1];
16
19
  var handleChange = function (e) {
17
- if (!disabled && onChange) {
18
- onChange(e.target.checked);
20
+ if (!disabled) {
21
+ setIsChecked(e.target.checked);
19
22
  }
23
+ onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked);
20
24
  };
21
25
  var handleLabelClick = function (e) {
22
26
  if (!disabled && onChange) {
23
27
  e.preventDefault();
24
- onChange(!checked);
28
+ onChange(!isChecked);
25
29
  }
26
30
  };
27
31
  var getStateClasses = function () {
@@ -29,11 +33,17 @@ var Checkbox = function (_a) {
29
33
  return 'checkbox--disabled';
30
34
  if (error)
31
35
  return 'checkbox--error';
32
- if (checked)
36
+ if (isChecked)
33
37
  return 'checkbox--checked';
34
38
  return 'checkbox--default';
35
39
  };
36
40
  var checkboxId = id || "checkbox-".concat(Math.random().toString(36).substr(2, 9));
37
- return (_jsx("div", __assign({ className: "checkbox-container ".concat(getStateClasses(), " ").concat(className) }, { children: _jsxs("label", __assign({ htmlFor: checkboxId, className: "checkbox-label", onClick: handleLabelClick }, { children: [_jsx("input", { type: "checkbox", id: checkboxId, checked: checked, disabled: disabled, onChange: handleChange, className: "checkbox-input", readOnly: true }), _jsx("div", __assign({ className: "checkbox-button" }, { children: _jsx("div", __assign({ className: "checkbox-touch-target" }, { children: _jsx("div", __assign({ className: "checkbox-box" }, { children: checked && (_jsx(Check, { size: "sm", className: "checkbox-icon" })) })) })) })), leadingContent && (_jsx("span", __assign({ className: "checkbox-leading" }, { children: leadingContent }))), label && (_jsx("span", __assign({ className: "checkbox-text" }, { children: label })))] })) })));
41
+ useEffect(function () {
42
+ setIsChecked(checked);
43
+ }, [checked]);
44
+ var renderLabel = function () {
45
+ return (label && (_jsx(Text, __assign({ as: "span", size: "sm", variant: "medium", color: error ? 'state-error' : 'default' }, { children: label }))));
46
+ };
47
+ return (_jsx("div", __assign({ className: "checkbox-container ".concat(getStateClasses(), " ").concat(className) }, { children: _jsxs("label", __assign({ htmlFor: checkboxId, className: "checkbox-label", onClick: handleLabelClick }, { children: [_jsx("input", { type: "checkbox", id: checkboxId, checked: isChecked, disabled: disabled, onChange: handleChange, className: "checkbox-input", readOnly: true }), labelPosition === 'leading' && renderLabel(), _jsx("div", __assign({ className: "checkbox-button" }, { children: _jsx("div", __assign({ className: "checkbox-touch-target" }, { children: _jsx("div", __assign({ className: "checkbox-box" }, { children: isChecked && _jsx(Check, { size: "sm", className: "checkbox-icon" }) })) })) })), leadingContent && _jsx("span", __assign({ className: "checkbox-leading" }, { children: leadingContent })), labelPosition === 'trailing' && renderLabel()] })) })));
38
48
  };
39
49
  export default Checkbox;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { IconName } from '../../Icon/Icon';
3
- interface InputProps {
3
+ export interface InputProps {
4
4
  variant?: 'default' | 'focus' | 'success' | 'error' | 'disabled';
5
5
  placeholder?: string;
6
6
  value?: string;
@@ -1,4 +1,47 @@
1
1
  import React from 'react';
2
+ /**
3
+ * BookingPax is a component that allows the user to display the booking pax.
4
+ *
5
+ * @example
6
+ * <BookingPax>
7
+ * <BookingPax.Accom
8
+ * name="Hotel Name"
9
+ * type="hotel"
10
+ * clientsInfo={clientsInfo}
11
+ * paxCount={1}
12
+ * selectedClientsInfoIds={selectedClientsInfoIds}
13
+ * isSubmitted={false}
14
+ * onPaxChange={onPaxChange}
15
+ * onRemarkChange={onRemarkChange}
16
+ * onError={onError}
17
+ * />
18
+ * <BookingPax.Excursion
19
+ * name="Excursion Name"
20
+ * type="sea"
21
+ * clientsInfo={clientsInfo}
22
+ * paxCount={1}
23
+ * selectedClientsInfoIds={selectedClientsInfoIds}
24
+ * isSubmitted={false}
25
+ * onPaxChange={onPaxChange}
26
+ * onRemarkChange={onRemarkChange}
27
+ * onError={onError}
28
+ * />
29
+ * <BookingPax.Transfer
30
+ * name="Transfer Name"
31
+ * type="transfer"
32
+ * clientsInfo={clientsInfo}
33
+ * paxCount={1}
34
+ * selectedClientsInfoIds={selectedClientsInfoIds}
35
+ * isSubmitted={false}
36
+ * onPaxChange={onPaxChange}
37
+ * onRemarkChange={onRemarkChange}
38
+ * onError={onError}
39
+ * />
40
+ * </BookingPax>
41
+ *
42
+ * @param props - The props for the BookingPax component.
43
+ * @returns The BookingPax component.
44
+ */
2
45
  export declare const BookingPax: {
3
46
  (props: React.PropsWithChildren): import("react/jsx-runtime").JSX.Element;
4
47
  Accom: React.FC<import("./BookingPaxAccom").BookingPaxAccomProps>;
@@ -13,6 +13,49 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { BookingPaxAccom } from './BookingPaxAccom';
14
14
  import { BookingPaxExcursion } from './BookingPaxExcursion';
15
15
  import { BookingPaxTransfer } from './BookingPaxTransfer';
16
+ /**
17
+ * BookingPax is a component that allows the user to display the booking pax.
18
+ *
19
+ * @example
20
+ * <BookingPax>
21
+ * <BookingPax.Accom
22
+ * name="Hotel Name"
23
+ * type="hotel"
24
+ * clientsInfo={clientsInfo}
25
+ * paxCount={1}
26
+ * selectedClientsInfoIds={selectedClientsInfoIds}
27
+ * isSubmitted={false}
28
+ * onPaxChange={onPaxChange}
29
+ * onRemarkChange={onRemarkChange}
30
+ * onError={onError}
31
+ * />
32
+ * <BookingPax.Excursion
33
+ * name="Excursion Name"
34
+ * type="sea"
35
+ * clientsInfo={clientsInfo}
36
+ * paxCount={1}
37
+ * selectedClientsInfoIds={selectedClientsInfoIds}
38
+ * isSubmitted={false}
39
+ * onPaxChange={onPaxChange}
40
+ * onRemarkChange={onRemarkChange}
41
+ * onError={onError}
42
+ * />
43
+ * <BookingPax.Transfer
44
+ * name="Transfer Name"
45
+ * type="transfer"
46
+ * clientsInfo={clientsInfo}
47
+ * paxCount={1}
48
+ * selectedClientsInfoIds={selectedClientsInfoIds}
49
+ * isSubmitted={false}
50
+ * onPaxChange={onPaxChange}
51
+ * onRemarkChange={onRemarkChange}
52
+ * onError={onError}
53
+ * />
54
+ * </BookingPax>
55
+ *
56
+ * @param props - The props for the BookingPax component.
57
+ * @returns The BookingPax component.
58
+ */
16
59
  export var BookingPax = function (props) {
17
60
  return _jsx("div", __assign({ className: "booking-pax space-y-6" }, props));
18
61
  };
@@ -1,14 +1,48 @@
1
1
  import React from 'react';
2
2
  import { BookingPaxClientInfo, BookingPaxClientProps } from './BookingPaxClient/BookingPaxClient';
3
3
  export interface BookingPaxAccomRoom {
4
+ /**
5
+ * The pax count of the room.
6
+ */
4
7
  paxCount: number;
5
8
  }
6
9
  export interface RoomData {
10
+ /**
11
+ * The room of the room data.
12
+ */
7
13
  room: BookingPaxAccomRoom;
14
+ /**
15
+ * The room index of the room data.
16
+ */
8
17
  roomIndex: number;
18
+ /**
19
+ * The selected count of the room data.
20
+ */
9
21
  selectedCount: number;
22
+ /**
23
+ * Whether the pax count is error.
24
+ */
10
25
  isPaxCountError: boolean;
11
26
  }
27
+ /**
28
+ * BookingPaxAccomProps is the props for the BookingPaxAccom component.
29
+ *
30
+ * @example
31
+ * <BookingPaxAccom
32
+ * rooms={rooms}
33
+ * clientsInfo={clientsInfo}
34
+ * hotelName="Hotel Name"
35
+ * roomName="Room Name"
36
+ * selectedClientsInfoIds={selectedClientsInfoIds}
37
+ * isSubmitted={false}
38
+ * onPaxChange={onPaxChange}
39
+ * onRemarkChange={onRemarkChange}
40
+ * onError={onError}
41
+ * />
42
+ *
43
+ * @param props - The props for the BookingPaxAccom component.
44
+ * @returns The BookingPaxAccom component.
45
+ */
12
46
  export interface BookingPaxAccomProps extends Pick<BookingPaxClientProps, 'selectedClientsInfoIds' | 'onPaxChange'> {
13
47
  rooms: BookingPaxAccomRoom[];
14
48
  clientsInfo: BookingPaxClientInfo[];
@@ -2088,3 +2088,13 @@
2088
2088
  grid-template-columns: repeat(2, minmax(0, 1fr));
2089
2089
  }
2090
2090
  }
2091
+
2092
+
2093
+ .booking-pax-client {
2094
+ .checkbox-container {
2095
+ label {
2096
+ padding: 0;
2097
+ background-color: transparent;
2098
+ }
2099
+ }
2100
+ }
@@ -1,31 +1,119 @@
1
1
  /// <reference types="react" />
2
- import { CheckboxProps } from '@radix-ui/react-checkbox';
2
+ import { CheckboxProps } from '@/src/components/atoms/Checkbox/Checkbox';
3
3
  import './BookingPaxClient.css';
4
4
  export interface BookingPaxClientInfo {
5
+ /**
6
+ * The first name of the client.
7
+ */
5
8
  firstName: string;
9
+ /**
10
+ * The last name of the client.
11
+ */
6
12
  lastName: string;
13
+ /**
14
+ * The age of the client.
15
+ */
7
16
  age: number;
17
+ /**
18
+ * The client type.
19
+ */
8
20
  clientType: 'Adult' | 'Teen' | 'Child' | 'Infant';
21
+ /**
22
+ * The client id.
23
+ */
9
24
  clientId: string;
10
25
  }
11
26
  export interface BookingPaxClientOptions {
27
+ /**
28
+ * The client id.
29
+ */
12
30
  clientId: string;
31
+ /**
32
+ * Whether the client is checked.
33
+ */
13
34
  checked: CheckboxProps['checked'];
35
+ /**
36
+ * The selected index.
37
+ */
14
38
  selectedIndex: number;
39
+ /**
40
+ * The selected pax index.
41
+ */
15
42
  selectedPaxIndex?: number;
43
+ /**
44
+ * The pax count.
45
+ */
16
46
  paxCount?: number;
47
+ /**
48
+ * The selected clients info ids.
49
+ */
17
50
  selectedClientsInfoIds?: Record<string | number, string[]>;
51
+ /**
52
+ * The selected clients.
53
+ */
18
54
  selectedClients?: Record<string | number, BookingPaxClientInfo[]>;
19
55
  }
20
56
  export interface BookingPaxClientProps {
57
+ /**
58
+ * The clients to select from.
59
+ */
21
60
  clients: BookingPaxClientInfo[];
61
+ /**
62
+ * The id of the booking pax client.
63
+ */
22
64
  id: string;
65
+ /**
66
+ * The selected clients info ids.
67
+ */
23
68
  selectedClientsInfoIds?: Record<string | number, string[]>;
69
+ /**
70
+ * The selected index.
71
+ */
24
72
  selectedIndex: number;
73
+ /**
74
+ * The selected pax index.
75
+ */
25
76
  selectedPaxIndex?: number;
77
+ /**
78
+ * The pax count.
79
+ */
26
80
  paxCount?: number;
81
+ /**
82
+ * Whether the form has been submitted.
83
+ */
27
84
  isSubmitted?: boolean;
85
+ /**
86
+ * The callback function to call when the pax changes.
87
+ */
28
88
  onPaxChange?: (options: BookingPaxClientOptions) => void;
89
+ /**
90
+ * The callback function to call when the error changes.
91
+ */
29
92
  onError?: (hasError: boolean) => void;
30
93
  }
94
+ /**
95
+ * BookingPaxClient is a component that allows the user to select the pax for a booking.
96
+ *
97
+ * @example
98
+ * <BookingPaxClient
99
+ * clients={clients}
100
+ * id="booking-pax-client"
101
+ * selectedClientsInfoIds={selectedClientsInfoIds}
102
+ * selectedIndex={0}
103
+ * paxCount={1}
104
+ * isSubmitted={false}
105
+ * onPaxChange={onPaxChange}
106
+ * onError={onError}
107
+ * />
108
+ *
109
+ * @param props - The props for the BookingPaxClient component.
110
+ * @param props.clients - The clients to select from.
111
+ * @param props.id - The id of the booking pax client.
112
+ * @param props.selectedClientsInfoIds - The selected clients info ids.
113
+ * @param props.selectedIndex - The selected index.
114
+ * @param props.paxCount - The pax count.
115
+ * @param props.isSubmitted - Whether the form has been submitted.
116
+ * @param props.onPaxChange - The callback function to call when the pax changes.
117
+ * @returns The BookingPaxClient component.
118
+ */
31
119
  export declare const BookingPaxClient: React.FC<BookingPaxClientProps>;
@@ -19,12 +19,37 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
19
19
  return to.concat(ar || Array.prototype.slice.call(from));
20
20
  };
21
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ import Checkbox from '@/src/components/atoms/Checkbox/Checkbox';
22
23
  import { Text } from '@/src/components/atoms/Typography/Typography';
23
- import { Checkbox } from '@/src/components/ui/checkbox';
24
24
  import useBookingPax from '@/src/hooks/useBookingPax';
25
25
  import { cn } from '@/src/lib/utils';
26
26
  import { useCallback, useEffect, useMemo, useState } from 'react';
27
27
  import './BookingPaxClient.css';
28
+ /**
29
+ * BookingPaxClient is a component that allows the user to select the pax for a booking.
30
+ *
31
+ * @example
32
+ * <BookingPaxClient
33
+ * clients={clients}
34
+ * id="booking-pax-client"
35
+ * selectedClientsInfoIds={selectedClientsInfoIds}
36
+ * selectedIndex={0}
37
+ * paxCount={1}
38
+ * isSubmitted={false}
39
+ * onPaxChange={onPaxChange}
40
+ * onError={onError}
41
+ * />
42
+ *
43
+ * @param props - The props for the BookingPaxClient component.
44
+ * @param props.clients - The clients to select from.
45
+ * @param props.id - The id of the booking pax client.
46
+ * @param props.selectedClientsInfoIds - The selected clients info ids.
47
+ * @param props.selectedIndex - The selected index.
48
+ * @param props.paxCount - The pax count.
49
+ * @param props.isSubmitted - Whether the form has been submitted.
50
+ * @param props.onPaxChange - The callback function to call when the pax changes.
51
+ * @returns The BookingPaxClient component.
52
+ */
28
53
  export var BookingPaxClient = function (props) {
29
54
  var clients = props.clients, id = props.id, defaultSelectedClientsInfoIds = props.selectedClientsInfoIds, selectedIndex = props.selectedIndex, _a = props.paxCount, paxCount = _a === void 0 ? 0 : _a, isSubmitted = props.isSubmitted, onPaxChange = props.onPaxChange, onError = props.onError;
30
55
  var _b = useState({}), selectedClientsInfoIds = _b[0], setSelectedClientsInfoIds = _b[1];
@@ -82,15 +107,13 @@ export var BookingPaxClient = function (props) {
82
107
  }) }, { children: clients.map(function (client) {
83
108
  var isSelected = isSelectedClient(selectedIndex, client.clientId);
84
109
  var showError = hasError && !isSelected && clients.length !== paxCount;
85
- return (_jsx("div", { children: _jsxs("div", __assign({ className: "flex items-center gap-x-2" }, { children: [_jsx(Checkbox, { "data-error": showError, id: "pc-".concat(id, "-").concat(selectedIndex, "-").concat(client.clientId), checked: isSelected || clients.length === paxCount, disabled: clients.length === paxCount, onCheckedChange: function (checked) {
86
- handlePaxChange({
87
- clientId: client.clientId,
88
- checked: checked,
89
- paxCount: paxCount,
90
- selectedIndex: selectedIndex,
91
- });
92
- } }), _jsx("label", __assign({ htmlFor: "pc-".concat(id, "-").concat(selectedIndex, "-").concat(client.clientId), className: cn('cursor-pointer', {
93
- 'pointer-events-none': clients.length === paxCount,
94
- }) }, { children: _jsxs(Text, __assign({ size: "sm", leading: "4", as: "span", color: showError ? 'state-error' : undefined }, { children: [client.firstName, " ", client.lastName, " (", client.clientType, client.clientType !== 'Adult' && " - ".concat(client.age, " years old"), ")"] })) }))] })) }, client.clientId));
110
+ return (_jsx("div", { children: _jsx("div", __assign({ className: "flex items-center gap-x-2" }, { children: _jsx(Checkbox, { id: "pc-".concat(id, "-").concat(selectedIndex, "-").concat(client.clientId), checked: isSelected || clients.length === paxCount, disabled: clients.length === paxCount, error: showError, label: "".concat(client.firstName, " ").concat(client.lastName, " (").concat(client.clientType).concat(client.clientType !== 'Adult' ? " - ".concat(client.age, " years old") : '', ")"), onChange: function (checked) {
111
+ handlePaxChange({
112
+ clientId: client.clientId,
113
+ checked: checked,
114
+ paxCount: paxCount,
115
+ selectedIndex: selectedIndex,
116
+ });
117
+ } }) })) }, client.clientId));
95
118
  }) }))] })));
96
119
  };
@@ -2,13 +2,56 @@ import React from 'react';
2
2
  import { BookingPaxClientInfo, BookingPaxClientProps } from './BookingPaxClient/BookingPaxClient';
3
3
  export type ExcursionType = 'sea' | 'land' | 'catamaran';
4
4
  export interface BookingPaxExcursionProps extends Pick<BookingPaxClientProps, 'selectedClientsInfoIds' | 'onPaxChange'> {
5
+ /**
6
+ * The clients info of the booking pax excursion.
7
+ */
5
8
  clientsInfo: BookingPaxClientInfo[];
9
+ /**
10
+ * The name of the booking pax excursion.
11
+ */
6
12
  name: string;
13
+ /**
14
+ * The type of the booking pax excursion.
15
+ */
7
16
  type: ExcursionType;
17
+ /**
18
+ * Whether the booking pax excursion is submitted.
19
+ */
8
20
  isSubmitted?: boolean;
21
+ /**
22
+ * The pax count of the booking pax excursion.
23
+ */
9
24
  paxCount: number;
25
+ /**
26
+ * The max pax count of the booking pax excursion.
27
+ */
10
28
  maxPaxCount?: number;
29
+ /**
30
+ * The callback function to call when the remark changes.
31
+ */
11
32
  onRemarkChange?: (value: string) => void;
33
+ /**
34
+ * The callback function to call when the error changes.
35
+ */
12
36
  onError?: (hasError: boolean) => void;
13
37
  }
38
+ /**
39
+ * BookingPaxExcursion is a component that allows the user to display the booking pax excursion.
40
+ *
41
+ * @example
42
+ * <BookingPaxExcursion
43
+ * name="Excursion Name"
44
+ * type="sea"
45
+ * clientsInfo={clientsInfo}
46
+ * paxCount={1}
47
+ * selectedClientsInfoIds={selectedClientsInfoIds}
48
+ * isSubmitted={false}
49
+ * onPaxChange={onPaxChange}
50
+ * onRemarkChange={onRemarkChange}
51
+ * onError={onError}
52
+ * />
53
+ *
54
+ * @param props - The props for the BookingPaxExcursion component.
55
+ * @returns The BookingPaxExcursion component.
56
+ */
14
57
  export declare const BookingPaxExcursion: React.FC<BookingPaxExcursionProps>;
@@ -21,6 +21,25 @@ var mapType = {
21
21
  land: 'Land excursion',
22
22
  catamaran: 'Cruise excursion',
23
23
  };
24
+ /**
25
+ * BookingPaxExcursion is a component that allows the user to display the booking pax excursion.
26
+ *
27
+ * @example
28
+ * <BookingPaxExcursion
29
+ * name="Excursion Name"
30
+ * type="sea"
31
+ * clientsInfo={clientsInfo}
32
+ * paxCount={1}
33
+ * selectedClientsInfoIds={selectedClientsInfoIds}
34
+ * isSubmitted={false}
35
+ * onPaxChange={onPaxChange}
36
+ * onRemarkChange={onRemarkChange}
37
+ * onError={onError}
38
+ * />
39
+ *
40
+ * @param props - The props for the BookingPaxExcursion component.
41
+ * @returns The BookingPaxExcursion component.
42
+ */
24
43
  export var BookingPaxExcursion = function (props) {
25
44
  var name = props.name, type = props.type, clientsInfo = props.clientsInfo, paxCount = props.paxCount, selectedClientsInfoIds = props.selectedClientsInfoIds, isSubmitted = props.isSubmitted, onPaxChange = props.onPaxChange, onRemarkChange = props.onRemarkChange, onError = props.onError;
26
45
  var _a = useBookingPax(selectedClientsInfoIds), changeOptions = _a.changeOptions, onPaxOptionsChange = _a.onPaxOptionsChange, onSelectedClients = _a.onSelectedClients;
@@ -1,12 +1,27 @@
1
1
  import React from 'react';
2
2
  import { IconName } from '../../atoms/Icon/Icon';
3
3
  export interface BookingPaxWithNameProps {
4
+ /**
5
+ * The name of the booking pax with name.
6
+ */
4
7
  name: string;
8
+ /**
9
+ * The icon of the booking pax with name.
10
+ */
5
11
  icon: IconName;
12
+ /**
13
+ * The location of the booking pax with name.
14
+ */
6
15
  location: string;
7
16
  }
8
17
  export interface BookingPaxWithLocationProps {
18
+ /**
19
+ * The from of the booking pax with location.
20
+ */
9
21
  from: string;
22
+ /**
23
+ * The to of the booking pax with location.
24
+ */
10
25
  to: string;
11
26
  }
12
27
  export declare const BookingPaxHeader: {
@@ -13,6 +13,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import Icon from '../../atoms/Icon/Icon';
14
14
  import { Text } from '../../atoms/Typography/Typography';
15
15
  import TextWithIcon from '../TextWithIcon/TextWithIcon';
16
+ /**
17
+ * BookingPaxWithName is a component that allows the user to display the booking pax with name.
18
+ *
19
+ * @example
20
+ * <BookingPaxWithName
21
+ * name="Hotel Name"
22
+ * icon="hotel"
23
+ * location="Hotel Location"
24
+ * />
25
+ *
26
+ * @param props - The props for the BookingPaxWithName component.
27
+ * @returns The BookingPaxWithName component.
28
+ */
16
29
  var BookingPaxWithName = function (props) {
17
30
  var name = props.name, icon = props.icon, location = props.location;
18
31
  return (_jsxs("div", __assign({ className: "space-y-1" }, { children: [_jsx(Text, __assign({ variant: "bold", size: "sm", leading: "4" }, { children: name })), _jsx(TextWithIcon, __assign({ icon: icon, textLeading: "4" }, { children: location }))] })));
@@ -2,10 +2,40 @@
2
2
  import { IconName } from '@/src/components/atoms/Icon/Icon';
3
3
  import './BookingPaxLayout.css';
4
4
  export interface BookingPaxLayoutProps {
5
+ /**
6
+ * The title of the booking pax layout.
7
+ */
5
8
  title: React.ReactNode;
9
+ /**
10
+ * The icon of the booking pax layout.
11
+ */
6
12
  icon: IconName;
13
+ /**
14
+ * The header of the booking pax layout.
15
+ */
7
16
  header?: React.ReactNode;
17
+ /**
18
+ * The children of the booking pax layout.
19
+ */
8
20
  children?: React.ReactNode;
21
+ /**
22
+ * The class name of the booking pax layout.
23
+ */
9
24
  className?: string;
10
25
  }
26
+ /**
27
+ * BookingPaxLayout is a component that allows the user to display the booking pax layout.
28
+ *
29
+ * @example
30
+ * <BookingPaxLayout
31
+ * title={title}
32
+ * icon={icon}
33
+ * header={header}
34
+ * children={children}
35
+ * className={className}
36
+ * />
37
+ *
38
+ * @param props - The props for the BookingPaxLayout component.
39
+ * @returns The BookingPaxLayout component.
40
+ */
11
41
  export declare const BookingPaxLayout: React.FC<BookingPaxLayoutProps>;
@@ -13,6 +13,21 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { cn } from '@/src/lib/utils';
14
14
  import { ServiceTitle } from '../../ServiceTitle/ServiceTitle';
15
15
  import './BookingPaxLayout.css';
16
+ /**
17
+ * BookingPaxLayout is a component that allows the user to display the booking pax layout.
18
+ *
19
+ * @example
20
+ * <BookingPaxLayout
21
+ * title={title}
22
+ * icon={icon}
23
+ * header={header}
24
+ * children={children}
25
+ * className={className}
26
+ * />
27
+ *
28
+ * @param props - The props for the BookingPaxLayout component.
29
+ * @returns The BookingPaxLayout component.
30
+ */
16
31
  export var BookingPaxLayout = function (props) {
17
32
  var title = props.title, icon = props.icon, header = props.header, children = props.children, className = props.className;
18
33
  return (_jsxs("div", __assign({ className: cn('booking-pax-layout', className) }, { children: [_jsxs("div", __assign({ className: "booking-pax-layout__header" }, { children: [_jsx(ServiceTitle, { title: title, icon: icon }), header] })), _jsx("div", __assign({ className: "booking-pax-layout__content" }, { children: children }))] })));
@@ -1,5 +1,19 @@
1
1
  import React from 'react';
2
2
  export interface BookingPaxRemarksProps {
3
+ /**
4
+ * The callback function to call when the remarks changes.
5
+ */
3
6
  onChange?: (value: string) => void;
4
7
  }
8
+ /**
9
+ * BookingPaxRemarks is a component that allows the user to display the booking pax remarks.
10
+ *
11
+ * @example
12
+ * <BookingPaxRemarks
13
+ * onChange={onChange}
14
+ * />
15
+ *
16
+ * @param props - The props for the BookingPaxRemarks component.
17
+ * @returns The BookingPaxRemarks component.
18
+ */
5
19
  export declare const BookingPaxRemarks: React.FC<BookingPaxRemarksProps>;
@@ -13,6 +13,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { useEffect, useRef, useState } from 'react';
14
14
  import Textarea from '../../atoms/Inputs/Textarea/Textarea';
15
15
  import { Text } from '../../atoms/Typography/Typography';
16
+ /**
17
+ * BookingPaxRemarks is a component that allows the user to display the booking pax remarks.
18
+ *
19
+ * @example
20
+ * <BookingPaxRemarks
21
+ * onChange={onChange}
22
+ * />
23
+ *
24
+ * @param props - The props for the BookingPaxRemarks component.
25
+ * @returns The BookingPaxRemarks component.
26
+ */
16
27
  export var BookingPaxRemarks = function (_a) {
17
28
  var onChange = _a.onChange;
18
29
  var _b = useState(''), remarks = _b[0], setRemarks = _b[1];