mautourco-components 0.2.129 → 0.2.130
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/AccessibilityIcon.d.ts +4 -0
- package/dist/components/atoms/Icon/icons/AccessibilityIcon.js +25 -0
- package/dist/components/atoms/Icon/icons/ClockIcon.js +1 -1
- package/dist/components/atoms/Icon/icons/DocumentIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/DocumentIcon.js +25 -0
- package/dist/components/atoms/Icon/icons/registry.d.ts +2 -0
- package/dist/components/atoms/Icon/icons/registry.js +4 -0
- package/dist/components/molecules/AccomodationDocket/AccomodationDocket.d.ts +2 -2
- package/dist/components/molecules/AccomodationDocket/AccomodationDocket.js +11 -36
- package/dist/components/molecules/Accordion/Accordion.d.ts +15 -2
- package/dist/components/molecules/Accordion/Accordion.js +11 -3
- package/dist/components/molecules/ActionDropdown/ActionDropdown.d.ts +5 -1
- package/dist/components/molecules/ActionDropdown/ActionDropdown.js +5 -3
- package/dist/components/molecules/DocketPrices/DocketPrices.d.ts +2 -2
- package/dist/components/molecules/DocketPrices/DocketPrices.js +3 -2
- package/dist/components/molecules/ExcursionDocket/ExcursionDocket.d.ts +2 -2
- package/dist/components/molecules/ExcursionDocket/ExcursionDocket.js +6 -4
- package/dist/components/molecules/OtherServiceDocket/OtherServiceDocket.d.ts +2 -2
- package/dist/components/molecules/OtherServiceDocket/OtherServiceDocket.js +6 -4
- package/dist/components/molecules/PaxDisplayDocket/PaxDisplayDocket.d.ts +27 -0
- package/dist/components/molecules/PaxDisplayDocket/PaxDisplayDocket.js +52 -0
- package/dist/components/molecules/PaxDisplayDocket/index.d.ts +2 -0
- package/dist/components/molecules/PaxDisplayDocket/index.js +1 -0
- package/dist/components/molecules/TransferDocket/TransferDocket.d.ts +2 -2
- package/dist/components/molecules/TransferDocket/TransferDocket.js +5 -39
- package/dist/components/molecules/VehicleSupplement/VehicleSupplement.js +6 -2
- package/dist/components/organisms/CarBookingCard/CarBookingCard.js +1 -1
- package/dist/components/organisms/Docket/Docket.d.ts +32 -69
- package/dist/components/organisms/Docket/Docket.js +38 -49
- package/dist/components/organisms/Docket/DocketCollapsedHeader.d.ts +20 -0
- package/dist/components/organisms/Docket/DocketCollapsedHeader.js +15 -0
- package/dist/components/organisms/Docket/DocketEmptyState.d.ts +12 -0
- package/dist/components/organisms/Docket/DocketEmptyState.js +9 -0
- package/dist/components/organisms/Docket/DocketFooter.d.ts +36 -0
- package/dist/components/organisms/Docket/DocketFooter.js +10 -0
- package/dist/components/organisms/Docket/DocketHeader.d.ts +25 -0
- package/dist/components/organisms/Docket/DocketHeader.js +13 -0
- package/dist/components/organisms/Docket/index.d.ts +11 -0
- package/dist/components/organisms/Docket/index.js +9 -0
- package/dist/components/organisms/DocketAccordion/DocketAccordion.d.ts +26 -0
- package/dist/components/organisms/DocketAccordion/DocketAccordion.js +56 -0
- package/dist/components/organisms/DocketAccordion/index.d.ts +2 -0
- package/dist/components/organisms/DocketAccordion/index.js +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +3 -0
- package/dist/styles/components/molecule/accomodation-docket.css +2 -2
- package/dist/styles/components/molecule/accordion.css +32 -1
- package/dist/styles/components/molecule/excursion-docket.css +1 -1
- package/dist/styles/components/molecule/pax-display-docket.css +38 -0
- package/dist/styles/components/molecule/transfer-docket.css +0 -1
- package/dist/styles/components/organism/docket-accordion.css +287 -0
- package/dist/styles/components/organism/docket.css +54 -22
- package/dist/styles/components/organism/search-bar-transfer.css +7 -2
- package/dist/styles/mautourco.css +2 -0
- package/dist/types/docket/docket.types.d.ts +13 -9
- package/dist/types/docket/services.types.d.ts +52 -75
- package/package.json +1 -1
- package/src/components/atoms/Icon/icons/AccessibilityIcon.tsx +44 -0
- package/src/components/atoms/Icon/icons/ClockIcon.tsx +2 -2
- package/src/components/atoms/Icon/icons/DocumentIcon.tsx +49 -0
- package/src/components/atoms/Icon/icons/registry.tsx +4 -0
- package/src/components/molecules/AccomodationDocket/AccomodationDocket.tsx +41 -96
- package/src/components/molecules/Accordion/Accordion.stories.tsx +60 -0
- package/src/components/molecules/Accordion/Accordion.tsx +34 -8
- package/src/components/molecules/ActionDropdown/ActionDropdown.tsx +21 -9
- package/src/components/molecules/DocketPrices/DocketPrices.tsx +6 -4
- package/src/components/molecules/ExcursionDocket/ExcursionDocket.tsx +31 -27
- package/src/components/molecules/OtherServiceDocket/OtherServiceDocket.tsx +22 -13
- package/src/components/molecules/PaxDisplayDocket/PaxDisplayDocket.tsx +165 -0
- package/src/components/molecules/PaxDisplayDocket/index.ts +2 -0
- package/src/components/molecules/TransferDocket/TransferDocket.tsx +41 -109
- package/src/components/molecules/VehicleSupplement/VehicleSupplement.tsx +19 -10
- package/src/components/organisms/CarBookingCard/CarBookingCard.tsx +103 -71
- package/src/components/organisms/Docket/Docket.tsx +124 -281
- package/src/components/organisms/Docket/DocketCollapsedHeader.tsx +50 -0
- package/src/components/organisms/Docket/DocketEmptyState.tsx +39 -0
- package/src/components/organisms/Docket/DocketFooter.tsx +112 -0
- package/src/components/organisms/Docket/DocketHeader.tsx +63 -0
- package/src/components/organisms/Docket/index.ts +19 -0
- package/src/components/organisms/DocketAccordion/DocketAccordion.tsx +169 -0
- package/src/components/organisms/DocketAccordion/index.ts +2 -0
- package/src/styles/components/molecule/accomodation-docket.css +2 -5
- package/src/styles/components/molecule/accordion.css +24 -1
- package/src/styles/components/molecule/excursion-docket.css +1 -1
- package/src/styles/components/molecule/pax-display-docket.css +34 -0
- package/src/styles/components/molecule/transfer-docket.css +0 -2
- package/src/styles/components/organism/docket-accordion.css +259 -0
- package/src/styles/components/organism/docket.css +47 -23
- package/src/styles/components/organism/search-bar-transfer.css +6 -1
- package/src/types/docket/docket.types.ts +14 -9
- package/src/types/docket/services.types.ts +61 -77
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
var AccessibilityIcon = function (_a) {
|
|
3
|
+
var _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, color = _a.color;
|
|
4
|
+
var getSizeClasses = function () {
|
|
5
|
+
switch (size) {
|
|
6
|
+
case 'xs':
|
|
7
|
+
return 'w-3 h-3';
|
|
8
|
+
case 'sm':
|
|
9
|
+
return 'w-4 h-4';
|
|
10
|
+
case 'md':
|
|
11
|
+
return 'w-5 h-5';
|
|
12
|
+
case 'lg':
|
|
13
|
+
return 'w-6 h-6';
|
|
14
|
+
case 'xl':
|
|
15
|
+
return 'w-8 h-8';
|
|
16
|
+
default:
|
|
17
|
+
return 'w-5 h-5';
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var sizeClasses = getSizeClasses();
|
|
21
|
+
var colorClass = color ? "text-".concat(color) : 'text-current';
|
|
22
|
+
var classes = "".concat(sizeClasses, " ").concat(colorClass, " ").concat(className);
|
|
23
|
+
return (_jsx("svg", { className: classes, viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M3.31832 14.1113C3.51472 13.6441 4.03706 13.3926 4.53219 13.5439C5.06019 13.7054 5.35747 14.264 5.19625 14.792L5.12203 15.0713C4.97231 15.727 4.99 16.4118 5.17574 17.0615C5.38804 17.8038 5.81067 18.4691 6.39254 18.9766C6.97441 19.4839 7.69081 19.8116 8.45504 19.9209C9.21938 20.0302 9.99932 19.9168 10.7002 19.5928C11.2014 19.361 11.7954 19.579 12.0273 20.0801C12.259 20.5812 12.0409 21.1753 11.54 21.4072C10.4887 21.8933 9.31844 22.0653 8.17184 21.9014C7.02531 21.7374 5.95098 21.2446 5.07809 20.4834C4.20525 19.7222 3.57133 18.7248 3.25289 17.6113C2.93453 16.4978 2.94469 15.3156 3.28317 14.208L3.31832 14.1113ZM7.41793 4.18652C7.72573 3.96616 8.13783 3.93636 8.47848 4.12207L13.9785 7.12207C14.2255 7.25681 14.4049 7.48935 14.4716 7.7627C14.5383 8.03607 14.4863 8.32524 14.3291 8.55859L12.54 11.2109C12.6709 11.3075 12.7986 11.4091 12.9218 11.5166C13.0711 11.6468 13.2127 11.7844 13.3476 11.9277L18.8359 11.0137C19.1503 10.9614 19.4712 11.0624 19.6992 11.2852C19.9269 11.508 20.0353 11.8262 19.9902 12.1416L18.9902 19.1416C18.912 19.6883 18.4051 20.0683 17.8584 19.9902C17.3116 19.9121 16.9316 19.4051 17.0097 18.8584L17.8164 13.21L14.5273 13.7588C14.6116 13.964 14.6856 14.174 14.747 14.3887C15.0654 15.5023 15.0543 16.6844 14.7158 17.792C14.5543 18.3201 13.9959 18.6174 13.4677 18.4561C12.9397 18.2946 12.6424 17.7361 12.8037 17.208C13.0294 16.4696 13.0364 15.6809 12.8242 14.9385C12.6119 14.1962 12.1893 13.5309 11.6074 13.0234C11.0255 12.5161 10.3091 12.1885 9.54488 12.0791C8.78061 11.9698 8.00056 12.0833 7.29977 12.4072C6.7986 12.639 6.20452 12.421 5.97262 11.9199C5.74089 11.4188 5.9589 10.8247 6.45992 10.5928C7.51125 10.1067 8.68148 9.93466 9.82809 10.0986C10.1383 10.143 10.4431 10.2124 10.7402 10.3037L12.0566 8.35156L8.1777 6.23535L5.70699 8.70703C5.31649 9.09754 4.68346 9.0975 4.29293 8.70703C3.90241 8.31651 3.90241 7.68349 4.29293 7.29297L7.29293 4.29297L7.41793 4.18652ZM14 4C14 2.89543 14.8954 2 16 2C17.1045 2.00006 18 2.89547 18 4C18 5.10453 17.1045 5.99994 16 6C14.8954 6 14 5.10457 14 4Z", fill: "currenColor" }) }));
|
|
24
|
+
};
|
|
25
|
+
export default AccessibilityIcon;
|
|
@@ -20,6 +20,6 @@ var ClockIcon = function (_a) {
|
|
|
20
20
|
var sizeClasses = getSizeClasses();
|
|
21
21
|
var colorClass = color ? "text-".concat(color) : 'text-current';
|
|
22
22
|
var classes = "".concat(sizeClasses, " ").concat(colorClass, " ").concat(className);
|
|
23
|
-
return (_jsxs("svg", { className: classes, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M7.63187 4.00006C7.98111 4.00006 8.26373 4.2723 8.26373 4.60873V8.51808L10.6838 9.86382C10.9861 10.032 11.0898 10.4041 10.9152 10.6954C10.7405 10.9867 10.3543 11.0865 10.0519 10.9183L7.31593 9.39661C7.12032 9.28783 7 9.08691 7 8.86937V4.60867C7 4.27224 7.28262 4.00006 7.63187 4.00006Z", fill: "
|
|
23
|
+
return (_jsxs("svg", { className: classes, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M7.63187 4.00006C7.98111 4.00006 8.26373 4.2723 8.26373 4.60873V8.51808L10.6838 9.86382C10.9861 10.032 11.0898 10.4041 10.9152 10.6954C10.7405 10.9867 10.3543 11.0865 10.0519 10.9183L7.31593 9.39661C7.12032 9.28783 7 9.08691 7 8.86937V4.60867C7 4.27224 7.28262 4.00006 7.63187 4.00006Z", fill: "currentColor" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 2C11.3136 2 14 4.6864 14 8C14 11.3136 11.3136 14 8 14C4.6864 14 2 11.3136 2 8C2 4.6864 4.6864 2 8 2ZM8 3.06667C5.27547 3.06667 3.06667 5.27547 3.06667 8C3.06667 10.7245 5.27547 12.9333 8 12.9333C10.7245 12.9333 12.9333 10.7245 12.9333 8C12.9333 5.27547 10.7245 3.06667 8 3.06667Z", fill: "currentColor" })] }));
|
|
24
24
|
};
|
|
25
25
|
export default ClockIcon;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
var DocumentIcon = function (_a) {
|
|
3
|
+
var _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, color = _a.color;
|
|
4
|
+
var getSizeClasses = function () {
|
|
5
|
+
switch (size) {
|
|
6
|
+
case 'xs':
|
|
7
|
+
return 'w-3 h-3';
|
|
8
|
+
case 'sm':
|
|
9
|
+
return 'w-4 h-4';
|
|
10
|
+
case 'md':
|
|
11
|
+
return 'w-5 h-5';
|
|
12
|
+
case 'lg':
|
|
13
|
+
return 'w-6 h-6';
|
|
14
|
+
case 'xl':
|
|
15
|
+
return 'w-8 h-8';
|
|
16
|
+
default:
|
|
17
|
+
return 'w-5 h-5';
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var sizeClasses = getSizeClasses();
|
|
21
|
+
var colorClass = color ? "text-".concat(color) : 'text-current';
|
|
22
|
+
var classes = "".concat(sizeClasses, " ").concat(colorClass, " ").concat(className);
|
|
23
|
+
return (_jsx("svg", { className: classes, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M2 13.3333V2.66663C2 2.13619 2.21086 1.62764 2.58594 1.25256C2.96101 0.877491 3.46957 0.666626 4 0.666626H10L10.0658 0.669881C10.2184 0.685008 10.3619 0.75251 10.4714 0.861938L13.8047 4.19527C13.9297 4.3203 14 4.48981 14 4.66663V13.3333C14 13.8637 13.7891 14.3723 13.4141 14.7474C13.039 15.1224 12.5304 15.3333 12 15.3333H4C3.46957 15.3333 2.96101 15.1224 2.58594 14.7474C2.21086 14.3723 2 13.8637 2 13.3333ZM10.6667 10.6666C11.0349 10.6666 11.3333 10.9651 11.3333 11.3333C11.3333 11.7015 11.0349 12 10.6667 12H5.33333C4.96514 12 4.66667 11.7015 4.66667 11.3333C4.66667 10.9651 4.96514 10.6666 5.33333 10.6666H10.6667ZM10.6667 7.99996C11.0349 7.99996 11.3333 8.29844 11.3333 8.66663C11.3333 9.03482 11.0349 9.33329 10.6667 9.33329H5.33333C4.96514 9.33329 4.66667 9.03482 4.66667 8.66663C4.66667 8.29844 4.96514 7.99996 5.33333 7.99996H10.6667ZM6.66667 5.33329C7.03486 5.33329 7.33333 5.63177 7.33333 5.99996C7.33333 6.36815 7.03486 6.66663 6.66667 6.66663H5.33333C4.96514 6.66663 4.66667 6.36815 4.66667 5.99996C4.66667 5.63177 4.96514 5.33329 5.33333 5.33329H6.66667ZM10 3.99996C10 4.17677 10.0703 4.34629 10.1953 4.47131C10.3203 4.59634 10.4899 4.66663 10.6667 4.66663H12.3906L10 2.276V3.99996ZM3.33333 13.3333C3.33333 13.5101 3.40362 13.6796 3.52865 13.8046C3.65367 13.9297 3.82319 14 4 14H12C12.1768 14 12.3463 13.9297 12.4714 13.8046C12.5964 13.6796 12.6667 13.5101 12.6667 13.3333V5.99996H10.6667C10.1362 5.99996 9.62768 5.78909 9.2526 5.41402C8.87753 5.03895 8.66667 4.53039 8.66667 3.99996V1.99996H4C3.82319 1.99996 3.65367 2.07025 3.52865 2.19527C3.40362 2.3203 3.33333 2.48981 3.33333 2.66663V13.3333Z", fill: "currentColor" }) }));
|
|
24
|
+
};
|
|
25
|
+
export default DocumentIcon;
|
|
@@ -34,6 +34,7 @@ export declare const ICONS: {
|
|
|
34
34
|
readonly departure: IconComponent;
|
|
35
35
|
readonly 'map-pin': IconComponent;
|
|
36
36
|
readonly delete: IconComponent;
|
|
37
|
+
readonly document: IconComponent;
|
|
37
38
|
readonly eye: IconComponent;
|
|
38
39
|
readonly info: IconComponent;
|
|
39
40
|
readonly 'check-circle': IconComponent;
|
|
@@ -57,6 +58,7 @@ export declare const ICONS: {
|
|
|
57
58
|
readonly calendar2: IconComponent;
|
|
58
59
|
readonly 'more-vertical': IconComponent;
|
|
59
60
|
readonly accom: IconComponent;
|
|
61
|
+
readonly accessibility: IconComponent;
|
|
60
62
|
readonly night: IconComponent;
|
|
61
63
|
readonly utensils: IconComponent;
|
|
62
64
|
readonly micro: IconComponent;
|
|
@@ -10,6 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import AccessibilityIcon from './AccessibilityIcon';
|
|
13
14
|
import AccomIcon from './AccomIcon';
|
|
14
15
|
import AirIcon from './AirIcon';
|
|
15
16
|
import ArrivalIcon from './ArrivalIcon';
|
|
@@ -36,6 +37,7 @@ import Close from './Close';
|
|
|
36
37
|
import CloseCircleIcon from './CloseCircleIcon';
|
|
37
38
|
import DeleteIcon from './DeleteIcon';
|
|
38
39
|
import DepartureIcon from './DepartureIcon';
|
|
40
|
+
import DocumentIcon from './DocumentIcon';
|
|
39
41
|
import EyeIcon from './EyeIcon';
|
|
40
42
|
import FacebookIcon from './FacebookIcon';
|
|
41
43
|
import HomeIcon from './HomeIcon';
|
|
@@ -106,6 +108,7 @@ export var ICONS = {
|
|
|
106
108
|
departure: DepartureIcon,
|
|
107
109
|
'map-pin': MapPinIcon,
|
|
108
110
|
delete: DeleteIcon,
|
|
111
|
+
document: DocumentIcon,
|
|
109
112
|
eye: EyeIcon,
|
|
110
113
|
info: InfoIcon,
|
|
111
114
|
'check-circle': CheckCircleIcon,
|
|
@@ -129,6 +132,7 @@ export var ICONS = {
|
|
|
129
132
|
calendar2: Calendar2Icon,
|
|
130
133
|
'more-vertical': MoreVerticalIcon,
|
|
131
134
|
accom: AccomIcon,
|
|
135
|
+
accessibility: AccessibilityIcon,
|
|
132
136
|
night: NightIcon,
|
|
133
137
|
utensils: UtensilsIcon,
|
|
134
138
|
micro: MicroIcon,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '../../../styles/components/molecule/accomodation-docket.css';
|
|
3
|
-
import {
|
|
3
|
+
import { AccommodationService } from '../../../types/docket/services.types';
|
|
4
4
|
export interface AccomodationDocketProps {
|
|
5
|
-
data:
|
|
5
|
+
data: AccommodationService;
|
|
6
6
|
/** Remove mode - replaces price chip with remove button */
|
|
7
7
|
removeMode?: boolean;
|
|
8
8
|
/** Handler for remove button click */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { differenceInDays } from 'date-fns';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import '../../../styles/components/molecule/accomodation-docket.css';
|
|
@@ -7,6 +7,7 @@ import Chip from '../../atoms/Chip/Chip';
|
|
|
7
7
|
import Icon from '../../atoms/Icon/Icon';
|
|
8
8
|
import { Text } from '../../atoms/Typography/Typography';
|
|
9
9
|
import { DateDisplay } from '../DateDisplay/DateDisplay';
|
|
10
|
+
import { PaxDisplayDocket } from '../PaxDisplayDocket/PaxDisplayDocket';
|
|
10
11
|
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
11
12
|
var clientTypeMap = {
|
|
12
13
|
standard: 'Standard',
|
|
@@ -16,44 +17,18 @@ var clientTypeMap = {
|
|
|
16
17
|
};
|
|
17
18
|
export var AccomodationDocket = function (_a) {
|
|
18
19
|
var data = _a.data, _b = _a.removeMode, removeMode = _b === void 0 ? false : _b, onRemove = _a.onRemove;
|
|
19
|
-
var HotelName = data.HotelName,
|
|
20
|
-
var calculateNights = function (
|
|
21
|
-
if (
|
|
22
|
-
return differenceInDays(new Date(
|
|
20
|
+
var HotelName = data.HotelName, Total = data.Total, Currency = data.Currency, Rooms = data.Rooms;
|
|
21
|
+
var calculateNights = function (checkIn, checkOut) {
|
|
22
|
+
if (checkIn && checkOut) {
|
|
23
|
+
return differenceInDays(new Date(checkOut), new Date(checkIn));
|
|
23
24
|
}
|
|
24
25
|
return 0;
|
|
25
26
|
};
|
|
26
|
-
var formatChildrenInfo = function (room) {
|
|
27
|
-
if (!room.ChildCount || room.ChildCount === 0) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
var childrenInfo = [];
|
|
31
|
-
var paxAges = room.paxAge || [];
|
|
32
|
-
// Group children by age
|
|
33
|
-
var childGroups = [];
|
|
34
|
-
if (paxAges.length > 0) {
|
|
35
|
-
// Count children by age
|
|
36
|
-
var ageCounts_1 = {};
|
|
37
|
-
paxAges.forEach(function (age) {
|
|
38
|
-
var ageNum = typeof age === 'number' ? age : parseInt(age, 10);
|
|
39
|
-
if (!isNaN(ageNum)) {
|
|
40
|
-
ageCounts_1[ageNum] = (ageCounts_1[ageNum] || 0) + 1;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
Object.entries(ageCounts_1).forEach(function (_a) {
|
|
44
|
-
var age = _a[0], count = _a[1];
|
|
45
|
-
childGroups.push({ count: count, age: parseInt(age, 10) });
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// If no age info, just show total count
|
|
50
|
-
childGroups.push({ count: room.ChildCount, age: 0 });
|
|
51
|
-
}
|
|
52
|
-
return (_jsx("div", { className: "accomodation-docket__children", children: childGroups.map(function (group, index) { return (_jsxs(React.Fragment, { children: [index > 0 && _jsx("div", { className: "accomodation-docket__divider-vertical" }), _jsxs("span", { className: "accomodation-docket__child-info", children: [_jsxs(Text, { size: "sm", variant: "medium", color: "default", children: [group.count, " Child", group.count > 1 ? 'ren' : ''] }), group.age > 0 ? (_jsxs(Text, { size: "sm", variant: "medium", className: "accomodation-docket__child-age", children: [' ', "(", group.age, " y.o)"] })) : null] })] }, "child-".concat(index))); }) }));
|
|
53
|
-
};
|
|
54
27
|
var renderRoomDetails = function (room, index) {
|
|
55
|
-
var isRoomEmpty = room.
|
|
56
|
-
return (_jsxs("div", { className: "accomodation-docket__room", children: [_jsx("div", { className: "accomodation-docket__room-header", children: _jsxs(TextWithIcon, { icon: "accom", textVariant: "bold", textSize: "sm", color: "subtle", children: ["Room ", index + 1] }) }), isRoomEmpty ? (_jsx("div", { className: "accomodation-docket__room-empty", children: _jsx(Text, { variant: "bold", size: "sm", color: "state-error", children: "Please select your second room" }) })) : (_jsxs("div", { className: "accomodation-docket__room-details", children: [_jsxs("div", { className: "accomodation-docket__date-section", children: [room.
|
|
28
|
+
var isRoomEmpty = room.IsEmpty || !room.CheckInDate || !room.CheckOutDate;
|
|
29
|
+
return (_jsxs("div", { className: "accomodation-docket__room", children: [Rooms.length > 1 && (_jsx("div", { className: "accomodation-docket__room-header", children: _jsxs(TextWithIcon, { icon: "accom", textVariant: "bold", textSize: "sm", color: "subtle", children: ["Room ", index + 1] }) })), isRoomEmpty ? (_jsx("div", { className: "accomodation-docket__room-empty", children: _jsx(Text, { variant: "bold", size: "sm", color: "state-error", children: "Please select your second room" }) })) : (_jsxs("div", { className: "accomodation-docket__room-details", children: [_jsxs("div", { className: "accomodation-docket__date-section", children: [room.CheckInDate && room.CheckOutDate && (_jsx(DateDisplay, { dates: [room.CheckInDate, room.CheckOutDate], calendarSize: "sm", arrowSize: "sm", textSize: "sm", colorMode: "green" })), room.CheckInDate && room.CheckOutDate && (_jsxs(TextWithIcon, { icon: "night", textSize: "sm", color: "subtle", children: [calculateNights(room.CheckInDate, room.CheckOutDate), " nights"] }))] }), _jsxs("div", { className: "accomodation-docket__client-info", children: [room.ClientCategory && (_jsxs("div", { className: "accomodation-docket__client-type", children: [_jsxs(Text, { variant: "bold", size: "sm", color: "subtle", children: ["Client type:", ' '] }), _jsx(Text, { variant: "medium", size: "sm", color: "subtle", children: clientTypeMap[room.ClientCategory.toLowerCase()] ||
|
|
30
|
+
room.ClientCategory })] })), _jsx("div", { className: "accomodation-docket__guests", children: _jsx(PaxDisplayDocket, { AdultPax: room.AdultPax, TeenPax: room.TeenPax, ChildPax: room.ChildPax, InfantPax: room.InfantPax, ChildAge: room.ChildAge, TeenAge: room.TeenAge, InfantAge: room.InfantAge, showAll: true, textSize: "sm", color: "subtle" }) })] }), _jsxs("div", { className: "accomodation-docket__room-info", children: [room.RoomName && (_jsx(TextWithIcon, { icon: "accom", textSize: "sm", color: "subtle", textLeading: "none", children: room.RoomName })), room.MealPlan && (_jsxs("div", { className: "accomodation-docket__meal-plan", children: [_jsxs("div", { className: "accomodation-docket__meal-plan-label", children: [_jsx(TextWithIcon, { icon: "utensils", textSize: "sm", color: "subtle", textLeading: "none", children: "Meal-Plan" }), _jsx("div", { className: "accomodation-docket__divider-vertical" })] }), _jsx(Text, { variant: "medium", size: "sm", color: "subtle", leading: "none", children: room.MealPlan })] }))] })] }))] }, "room-".concat(index)));
|
|
57
31
|
};
|
|
58
|
-
return (_jsxs("div", { className: "accomodation-docket", children: [_jsxs("div", { className: "accomodation-docket__header", children: [_jsxs("div", { className: "accomodation-docket__title-section", children: [_jsx("div", { className: "accomodation-docket__title-bar" }), _jsx(Icon, { name: "accom", size: "sm" }), _jsx(Text, { variant: "bold", size: "sm", color: "accent", children: "Accommodation" })] }), removeMode ? (_jsx(Button, { variant: "destructive", size: "sm",
|
|
32
|
+
return (_jsxs("div", { className: "accomodation-docket", children: [_jsxs("div", { className: "accomodation-docket__header", children: [_jsxs("div", { className: "accomodation-docket__title-section", children: [_jsx("div", { className: "accomodation-docket__title-bar" }), _jsx(Icon, { name: "accom", size: "sm" }), _jsx(Text, { variant: "bold", size: "sm", color: "accent", children: "Accommodation" })] }), removeMode ? (_jsx(Button, { variant: "destructive", size: "sm", onClick: onRemove, className: "docket__remove-button", children: "Remove" })) : (Total &&
|
|
33
|
+
Currency && (_jsxs(Chip, { type: "filled", color: "accent", size: "sm", children: [Currency, " ", Total] })))] }), HotelName && (_jsx("div", { className: "accomodation-docket__hotel-name", children: _jsx(Text, { variant: "bold", size: "base", color: "default", children: HotelName.split('\n').map(function (line, index) { return (_jsxs(React.Fragment, { children: [line, index < HotelName.split('\n').length - 1 && _jsx("br", {})] }, "line-".concat(index))); }) }) })), _jsx("div", { className: "accomodation-docket__rooms", children: Rooms.map(function (room, index) { return renderRoomDetails(room, index); }) })] }));
|
|
59
34
|
};
|
|
@@ -2,10 +2,14 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { IconName } from '../../atoms/Icon/icons/registry';
|
|
3
3
|
export type AccordionVariant = 'normal' | 'brand';
|
|
4
4
|
export interface AccordionProps {
|
|
5
|
-
/** Title text displayed in the accordion header */
|
|
6
|
-
title: string;
|
|
5
|
+
/** Title text or custom content displayed in the accordion header */
|
|
6
|
+
title: string | ReactNode;
|
|
7
|
+
/** Function that renders custom title content with expanded state */
|
|
8
|
+
renderTitle?: (isExpanded: boolean) => ReactNode;
|
|
7
9
|
/** Content to be displayed when accordion is expanded */
|
|
8
10
|
children: ReactNode;
|
|
11
|
+
/** Footer text or custom content displayed at the bottom of the accordion body */
|
|
12
|
+
footer?: string | ReactNode;
|
|
9
13
|
/** Whether the accordion is expanded by default */
|
|
10
14
|
defaultExpanded?: boolean;
|
|
11
15
|
/** Controlled expanded state */
|
|
@@ -20,6 +24,8 @@ export interface AccordionProps {
|
|
|
20
24
|
variant?: AccordionVariant;
|
|
21
25
|
/** Additional CSS classes */
|
|
22
26
|
className?: string;
|
|
27
|
+
/** Additional CSS classes applied only when expanded */
|
|
28
|
+
classNameExpanded?: string;
|
|
23
29
|
/** ID for accessibility */
|
|
24
30
|
id?: string;
|
|
25
31
|
}
|
|
@@ -36,6 +42,13 @@ export interface AccordionProps {
|
|
|
36
42
|
* <Accordion title="With leading icon" leadingIcon="info">
|
|
37
43
|
* Content with a leading icon
|
|
38
44
|
* </Accordion>
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <Accordion renderTitle={(isExpanded) => (
|
|
48
|
+
* <div>{isExpanded ? 'Expanded' : 'Collapsed'}</div>
|
|
49
|
+
* )}>
|
|
50
|
+
* Content with dynamic title based on state
|
|
51
|
+
* </Accordion>
|
|
39
52
|
*/
|
|
40
53
|
declare function Accordion(props: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
41
54
|
export default Accordion;
|
|
@@ -14,15 +14,22 @@ import Icon from '../../atoms/Icon/Icon';
|
|
|
14
14
|
* <Accordion title="With leading icon" leadingIcon="info">
|
|
15
15
|
* Content with a leading icon
|
|
16
16
|
* </Accordion>
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <Accordion renderTitle={(isExpanded) => (
|
|
20
|
+
* <div>{isExpanded ? 'Expanded' : 'Collapsed'}</div>
|
|
21
|
+
* )}>
|
|
22
|
+
* Content with dynamic title based on state
|
|
23
|
+
* </Accordion>
|
|
17
24
|
*/
|
|
18
25
|
function Accordion(props) {
|
|
19
|
-
var title = props.title, children = props.children, _a = props.defaultExpanded, defaultExpanded = _a === void 0 ? false : _a, controlledExpanded = props.expanded, onExpandedChange = props.onExpandedChange, leadingIcon = props.leadingIcon, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.variant, variant = _c === void 0 ? 'normal' : _c, _d = props.className, className = _d === void 0 ? '' : _d, providedId = props.id;
|
|
26
|
+
var title = props.title, renderTitle = props.renderTitle, children = props.children, footer = props.footer, _a = props.defaultExpanded, defaultExpanded = _a === void 0 ? false : _a, controlledExpanded = props.expanded, onExpandedChange = props.onExpandedChange, leadingIcon = props.leadingIcon, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.variant, variant = _c === void 0 ? 'normal' : _c, _d = props.className, className = _d === void 0 ? '' : _d, _e = props.classNameExpanded, classNameExpanded = _e === void 0 ? '' : _e, providedId = props.id;
|
|
20
27
|
var generatedId = useId();
|
|
21
28
|
var id = providedId || generatedId;
|
|
22
29
|
var headerId = "".concat(id, "-header");
|
|
23
30
|
var contentId = "".concat(id, "-content");
|
|
24
31
|
// Handle controlled vs uncontrolled state
|
|
25
|
-
var
|
|
32
|
+
var _f = useState(defaultExpanded), internalExpanded = _f[0], setInternalExpanded = _f[1];
|
|
26
33
|
var isControlled = controlledExpanded !== undefined;
|
|
27
34
|
var isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
28
35
|
var handleToggle = useCallback(function () {
|
|
@@ -48,9 +55,10 @@ function Accordion(props) {
|
|
|
48
55
|
disabled && 'accordion--disabled',
|
|
49
56
|
variant === 'brand' && 'accordion--brand',
|
|
50
57
|
className,
|
|
58
|
+
isExpanded && classNameExpanded,
|
|
51
59
|
]
|
|
52
60
|
.filter(Boolean)
|
|
53
61
|
.join(' ');
|
|
54
|
-
return (_jsxs("div", { className: classNames, id: id, children: [_jsxs("div", { className: "accordion__header", id: headerId, role: "button", tabIndex: disabled ? -1 : 0, "aria-expanded": isExpanded, "aria-controls": contentId, "aria-disabled": disabled, onClick: handleToggle, onKeyDown: handleKeyDown, children: [_jsxs("div", { className: "accordion__title", children: [leadingIcon && (_jsx("div", { className: "accordion__leading-icon", children: _jsx(Icon, { name: leadingIcon, size: "lg" }) })), _jsx("span", { className: "accordion__title-text", children: title })] }), _jsx("div", { className: "accordion__chevron", children: _jsx(Icon, { name: 'chevron-
|
|
62
|
+
return (_jsxs("div", { className: classNames, id: id, children: [_jsxs("div", { className: "accordion__header", id: headerId, role: "button", tabIndex: disabled ? -1 : 0, "aria-expanded": isExpanded, "aria-controls": contentId, "aria-disabled": disabled, onClick: handleToggle, onKeyDown: handleKeyDown, children: [_jsxs("div", { className: "accordion__title", children: [leadingIcon && (_jsx("div", { className: "accordion__leading-icon", children: _jsx(Icon, { name: leadingIcon, size: "lg" }) })), renderTitle ? (_jsx("div", { className: "accordion__title-content", children: renderTitle(isExpanded) })) : typeof title === 'string' ? (_jsx("span", { className: "accordion__title-text", children: title })) : (_jsx("div", { className: "accordion__title-content", children: title }))] }), _jsx("div", { className: "accordion__chevron", children: _jsx(Icon, { name: 'chevron-down', size: "lg" }) })] }), isExpanded && (_jsxs("div", { className: "accordion__body", id: contentId, role: "region", "aria-labelledby": headerId, children: [_jsx("div", { className: "accordion__content", children: children }), footer && (_jsx("div", { className: "accordion__footer", children: typeof footer === 'string' ? _jsx("p", { children: footer }) : footer }))] }))] }));
|
|
55
63
|
}
|
|
56
64
|
export default Accordion;
|
|
@@ -13,9 +13,13 @@ export interface ActionDropdownProps {
|
|
|
13
13
|
/** Data for the action dropdown */
|
|
14
14
|
data: ActionDropdownItem[];
|
|
15
15
|
/** Trigger element */
|
|
16
|
-
children?: React.ReactNode;
|
|
16
|
+
children?: React.ReactNode | ((open: boolean) => React.ReactNode);
|
|
17
17
|
/** Maximum width for the action dropdown */
|
|
18
18
|
maxWidth?: string;
|
|
19
|
+
/** Trigger class name */
|
|
20
|
+
triggerClassName?: string;
|
|
21
|
+
/** Popover content class name */
|
|
22
|
+
popoverContentClassName?: string;
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* A dropdown component that displays a list of actions triggered by a more icon button. Uses a Popover for the dropdown menu.
|
|
@@ -15,9 +15,11 @@ import './ActionDropdown.css';
|
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
export function ActionDropdown(props) {
|
|
18
|
-
var data = props.data, children = props.children, _a = props.maxWidth, maxWidth = _a === void 0 ? '153px' : _a;
|
|
19
|
-
var
|
|
20
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, {
|
|
18
|
+
var data = props.data, children = props.children, _a = props.maxWidth, maxWidth = _a === void 0 ? '153px' : _a, _b = props.triggerClassName, triggerClassName = _b === void 0 ? '' : _b, _c = props.popoverContentClassName, popoverContentClassName = _c === void 0 ? '' : _c;
|
|
19
|
+
var _d = useState(false), open = _d[0], setOpen = _d[1];
|
|
20
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { className: triggerClassName, children: typeof children === 'function'
|
|
21
|
+
? children(open)
|
|
22
|
+
: children !== null && children !== void 0 ? children : (_jsx("span", { className: "action-dropdown-trigger", children: _jsx(Icon, { name: "more-vertical" }) })) }), _jsx(PopoverContent, { className: cn('action-dropdown', popoverContentClassName), style: { '--max-width': maxWidth }, align: "end", side: "bottom", avoidCollisions: false, children: data.map(function (item, index) {
|
|
21
23
|
var defaultButton = (_jsx("button", { onClick: function () {
|
|
22
24
|
var _a;
|
|
23
25
|
if (item.disabled) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '../../../styles/components/molecule/docket-prices.css';
|
|
3
|
-
import {
|
|
3
|
+
import { Price } from '../../../types/docket/docket.types';
|
|
4
4
|
export interface DocketPricesProps {
|
|
5
5
|
/**
|
|
6
6
|
* Array of price objects to display
|
|
7
7
|
*/
|
|
8
|
-
prices:
|
|
8
|
+
prices: Price[];
|
|
9
9
|
/**
|
|
10
10
|
* Optional label text (defaults to "Total :")
|
|
11
11
|
*/
|
|
@@ -5,7 +5,7 @@ import { Text } from '../../atoms/Typography/Typography';
|
|
|
5
5
|
* Formats a number with thousand separators and 2 decimal places
|
|
6
6
|
*/
|
|
7
7
|
var formatAmount = function (amount) {
|
|
8
|
-
return amount.toLocaleString('en-US', {
|
|
8
|
+
return amount === null || amount === void 0 ? void 0 : amount.toLocaleString('en-US', {
|
|
9
9
|
minimumFractionDigits: 2,
|
|
10
10
|
maximumFractionDigits: 2,
|
|
11
11
|
});
|
|
@@ -15,6 +15,7 @@ export var DocketPrices = function (_a) {
|
|
|
15
15
|
if (!prices || prices.length === 0) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
console.log('prices', prices);
|
|
19
|
+
return (_jsxs("div", { className: "docket-prices ".concat(className), children: [_jsx(Text, { variant: "bold", size: "sm", color: "default", className: "docket-prices__label", children: label }), _jsx("div", { className: "docket-prices__price-list", children: prices.map(function (price, index) { return (_jsxs(Text, { variant: "bold", size: "sm", color: "default", children: [price.Currency, " ", formatAmount(price.Amount)] }, index)); }) })] }));
|
|
19
20
|
};
|
|
20
21
|
export default DocketPrices;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '../../../styles/components/molecule/excursion-docket.css';
|
|
3
|
-
import {
|
|
3
|
+
import { ExcursionService } from '../../../types/docket/services.types';
|
|
4
4
|
export interface ExcursionDocketProps {
|
|
5
|
-
data:
|
|
5
|
+
data: ExcursionService;
|
|
6
6
|
/** Remove mode - replaces price chip with remove button */
|
|
7
7
|
removeMode?: boolean;
|
|
8
8
|
/** Handler for remove button click */
|
|
@@ -5,16 +5,18 @@ import Chip from '../../atoms/Chip/Chip';
|
|
|
5
5
|
import Icon from '../../atoms/Icon/Icon';
|
|
6
6
|
import { Text } from '../../atoms/Typography/Typography';
|
|
7
7
|
import { DateDisplay } from '../DateDisplay/DateDisplay';
|
|
8
|
+
import { PaxDisplayDocket } from '../PaxDisplayDocket/PaxDisplayDocket';
|
|
8
9
|
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
9
10
|
export var ExcursionDocket = function (_a) {
|
|
10
11
|
var data = _a.data, _b = _a.removeMode, removeMode = _b === void 0 ? false : _b, onRemove = _a.onRemove;
|
|
11
|
-
var ExcursionName = data.ExcursionName, ServiceDate = data.ServiceDate,
|
|
12
|
+
var ExcursionName = data.ExcursionName, ServiceDate = data.ServiceDate, LocationFrom = data.LocationFrom, Currency = data.Currency, Total = data.Total, Duration = data.Duration, MealIncluded = data.MealIncluded, Accessibility = data.Accessibility, TransferType = data.TransferType;
|
|
12
13
|
var formatPrice = function () {
|
|
13
|
-
if (!
|
|
14
|
+
if (!Total)
|
|
14
15
|
return null;
|
|
15
|
-
var price = typeof
|
|
16
|
+
var price = typeof Total === 'string' ? Total : Total.toString();
|
|
16
17
|
return "".concat(Currency, " ").concat(price);
|
|
17
18
|
};
|
|
18
|
-
return (_jsxs("div", { className: "excursion-docket", children: [_jsxs("div", { className: "excursion-docket__header", children: [_jsxs("div", { className: "excursion-docket__title-section", children: [_jsx("div", { className: "excursion-docket__title-bar" }), _jsx(Icon, { name: "map-pin", size: "sm" }), _jsx(Text, { variant: "bold", size: "sm", color: "accent", children: "Excursion" })] }), removeMode ? (_jsx(Button, { variant: "destructive", size: "sm",
|
|
19
|
+
return (_jsxs("div", { className: "excursion-docket", children: [_jsxs("div", { className: "excursion-docket__header", children: [_jsxs("div", { className: "excursion-docket__title-section", children: [_jsx("div", { className: "excursion-docket__title-bar" }), _jsx(Icon, { name: "map-pin", size: "sm" }), _jsx(Text, { variant: "bold", size: "sm", color: "accent", children: "Excursion" })] }), removeMode ? (_jsx(Button, { variant: "destructive", size: "sm", onClick: onRemove, className: "docket__remove-button", children: "Remove" })) : (Total &&
|
|
20
|
+
Currency && (_jsx(Chip, { type: "filled", color: "accent", size: "sm", children: formatPrice() })))] }), ExcursionName && (_jsx("div", { className: "excursion-docket__excursion-name", children: _jsx(Text, { variant: "bold", size: "base", color: "default", children: ExcursionName }) })), _jsxs("div", { className: "excursion-docket__details", children: [ServiceDate && (_jsx(DateDisplay, { date: ServiceDate, calendarSize: "sm", textSize: "sm", colorMode: "green" })), LocationFrom && (_jsxs("div", { className: "excursion-docket__pickup", children: [_jsxs(Text, { variant: "bold", size: "sm", color: "subtle", children: ["Pickup:", ' '] }), _jsx(Text, { variant: "medium", size: "sm", color: "subtle", children: LocationFrom })] })), _jsx(PaxDisplayDocket, { AdultPax: data.AdultPax, TeenPax: data.TeenPax, ChildPax: data.ChildPax, InfantPax: data.InfantPax, ChildAge: data.ChildAge, TeenAge: data.TeenAge, InfantAge: data.InfantAge, showAll: true, textSize: "sm", color: "subtle" }), _jsxs("div", { className: "excursion-docket__details-list", children: [Duration && (_jsxs("div", { className: "excursion-docket__detail-item", children: [_jsx("div", { className: "excursion-docket__detail-label", children: _jsx(TextWithIcon, { icon: "stopwatch", textSize: "sm", color: "subtle", textLeading: "none", children: "Duration" }) }), _jsx(Text, { variant: "medium", size: "sm", color: "subtle", leading: "none", children: "|" }), _jsx(Text, { variant: "regular", size: "sm", color: "subtle", leading: "none", children: Duration })] })), MealIncluded !== undefined && (_jsxs("div", { className: "excursion-docket__detail-item", children: [_jsx("div", { className: "excursion-docket__detail-label", children: _jsx(TextWithIcon, { icon: "utensils", textSize: "sm", color: "subtle", textLeading: "none", children: "Meal" }) }), _jsx(Text, { variant: "medium", size: "sm", color: "subtle", leading: "none", children: "|" }), _jsx(Text, { variant: "regular", size: "sm", color: "subtle", leading: "none", children: MealIncluded ? 'Included' : 'Not included' })] })), Accessibility && (_jsxs("div", { className: "excursion-docket__detail-item", children: [_jsx("div", { className: "excursion-docket__detail-label", children: _jsx(TextWithIcon, { icon: "accessibility", textSize: "sm", color: "subtle", textLeading: "none", children: "Accessibility" }) }), _jsx(Text, { variant: "medium", size: "sm", color: "subtle", leading: "none", children: "|" }), _jsx(Text, { variant: "regular", size: "sm", color: "subtle", leading: "none", children: Accessibility })] })), TransferType && (_jsxs("div", { className: "excursion-docket__detail-item", children: [_jsx("div", { className: "excursion-docket__detail-label", children: _jsx(TextWithIcon, { icon: "car", textSize: "sm", color: "subtle", textLeading: "none", children: "Vehicle" }) }), _jsx(Text, { variant: "medium", size: "sm", color: "subtle", leading: "none", children: "|" }), _jsx(Text, { variant: "regular", size: "sm", color: "subtle", leading: "none", children: TransferType })] }))] })] })] }));
|
|
19
21
|
};
|
|
20
22
|
export default ExcursionDocket;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '../../../styles/components/molecule/other-service-docket.css';
|
|
3
|
-
import {
|
|
3
|
+
import { OtherService } from '../../../types/docket/services.types';
|
|
4
4
|
export interface OtherServiceDocketProps {
|
|
5
|
-
data:
|
|
5
|
+
data: OtherService;
|
|
6
6
|
/** Remove mode - replaces price chip with remove button */
|
|
7
7
|
removeMode?: boolean;
|
|
8
8
|
/** Handler for remove button click */
|
|
@@ -4,16 +4,18 @@ import Button from '../../atoms/Button/Button';
|
|
|
4
4
|
import Chip from '../../atoms/Chip/Chip';
|
|
5
5
|
import Icon from '../../atoms/Icon/Icon';
|
|
6
6
|
import { Text } from '../../atoms/Typography/Typography';
|
|
7
|
+
import { PaxDisplayDocket } from '../PaxDisplayDocket/PaxDisplayDocket';
|
|
7
8
|
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
8
9
|
export var OtherServiceDocket = function (_a) {
|
|
9
10
|
var data = _a.data, _b = _a.removeMode, removeMode = _b === void 0 ? false : _b, onRemove = _a.onRemove;
|
|
10
|
-
var
|
|
11
|
+
var ServiceFor = data.ServiceFor, Currency = data.Currency, Total = data.Total;
|
|
11
12
|
var formatPrice = function () {
|
|
12
|
-
if (!
|
|
13
|
+
if (!Total)
|
|
13
14
|
return null;
|
|
14
|
-
var price = typeof
|
|
15
|
+
var price = typeof Total === 'string' ? Total : Total.toString();
|
|
15
16
|
return "".concat(Currency, " ").concat(price);
|
|
16
17
|
};
|
|
17
|
-
return (_jsxs("div", { className: "other-service-docket", children: [_jsxs("div", { className: "other-service-docket__header", children: [_jsxs("div", { className: "other-service-docket__title-section", children: [_jsx("div", { className: "other-service-docket__title-bar" }), _jsx(Icon, { name: "more", size: "sm" }), _jsx(Text, { variant: "bold", size: "sm", color: "accent", children: "Other services" })] }), removeMode ? (_jsx(Button, { variant: "destructive", size: "sm", leadingIcon: "close", onClick: onRemove, className: "other-service-docket__remove-button", children: "Remove" })) : (
|
|
18
|
+
return (_jsxs("div", { className: "other-service-docket", children: [_jsxs("div", { className: "other-service-docket__header", children: [_jsxs("div", { className: "other-service-docket__title-section", children: [_jsx("div", { className: "other-service-docket__title-bar" }), _jsx(Icon, { name: "more", size: "sm" }), _jsx(Text, { variant: "bold", size: "sm", color: "accent", children: "Other services" })] }), removeMode ? (_jsx(Button, { variant: "destructive", size: "sm", leadingIcon: "close", onClick: onRemove, className: "other-service-docket__remove-button", children: "Remove" })) : (Total &&
|
|
19
|
+
Currency && (_jsx(Chip, { type: "filled", color: "accent", size: "sm", children: formatPrice() })))] }), _jsxs("div", { className: "other-service-docket__details", children: [_jsx("div", { className: "other-service-docket__service-info", children: ServiceFor && (_jsx(TextWithIcon, { icon: "wallet", textSize: "sm", color: "subtle", children: ServiceFor })) }), _jsx(PaxDisplayDocket, { AdultPax: data.AdultPax, TeenPax: data.TeenPax, ChildPax: data.ChildPax, InfantPax: data.InfantPax, ChildAge: data.ChildAge, TeenAge: data.TeenAge, InfantAge: data.InfantAge, showAll: true, textSize: "sm", color: "subtle" })] })] }));
|
|
18
20
|
};
|
|
19
21
|
export default OtherServiceDocket;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../../../styles/components/molecule/pax-display-docket.css';
|
|
3
|
+
import { TextColor } from '../../atoms/Typography/Typography';
|
|
4
|
+
export interface PaxDisplayDocketProps {
|
|
5
|
+
/** Number of adults */
|
|
6
|
+
AdultPax?: number;
|
|
7
|
+
/** Number of teens */
|
|
8
|
+
TeenPax?: number;
|
|
9
|
+
/** Number of children */
|
|
10
|
+
ChildPax?: number;
|
|
11
|
+
/** Number of infants */
|
|
12
|
+
InfantPax?: number;
|
|
13
|
+
/** Ages of children */
|
|
14
|
+
ChildAge?: number[];
|
|
15
|
+
/** Ages of teens */
|
|
16
|
+
TeenAge?: number[];
|
|
17
|
+
/** Ages of infants */
|
|
18
|
+
InfantAge?: number[];
|
|
19
|
+
/** Show all passenger types or only adults */
|
|
20
|
+
showAll?: boolean;
|
|
21
|
+
/** Text size */
|
|
22
|
+
textSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
23
|
+
/** Text color */
|
|
24
|
+
color?: TextColor;
|
|
25
|
+
}
|
|
26
|
+
export declare const PaxDisplayDocket: React.FC<PaxDisplayDocketProps>;
|
|
27
|
+
export default PaxDisplayDocket;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import '../../../styles/components/molecule/pax-display-docket.css';
|
|
4
|
+
import Icon from '../../atoms/Icon/Icon';
|
|
5
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
6
|
+
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
7
|
+
/**
|
|
8
|
+
* Generic function to format passenger information with age groups
|
|
9
|
+
* @param count - Total number of passengers
|
|
10
|
+
* @param ages - Array of ages
|
|
11
|
+
* @param label - Singular label (e.g., 'Child', 'Teen', 'Infant')
|
|
12
|
+
* @param pluralLabel - Plural label (e.g., 'Children', 'Teens', 'Infants')
|
|
13
|
+
*/
|
|
14
|
+
var formatPassengerInfo = function (count, ages, label, pluralLabel) {
|
|
15
|
+
if (!count || count === 0) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
// Group passengers by age
|
|
19
|
+
var passengerGroups = [];
|
|
20
|
+
if (ages.length > 0) {
|
|
21
|
+
// Count passengers by age
|
|
22
|
+
var ageCounts_1 = {};
|
|
23
|
+
ages.forEach(function (age) {
|
|
24
|
+
var ageNum = typeof age === 'number' ? age : parseInt(age, 10);
|
|
25
|
+
if (!isNaN(ageNum)) {
|
|
26
|
+
ageCounts_1[ageNum] = (ageCounts_1[ageNum] || 0) + 1;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
Object.entries(ageCounts_1).forEach(function (_a) {
|
|
30
|
+
var age = _a[0], count = _a[1];
|
|
31
|
+
passengerGroups.push({ count: count, age: parseInt(age, 10) });
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// If no age info, just show total count
|
|
36
|
+
passengerGroups.push({ count: count, age: 0 });
|
|
37
|
+
}
|
|
38
|
+
return (_jsx("div", { className: "pax-display-docket__group", children: passengerGroups.map(function (group, index) { return (_jsxs(React.Fragment, { children: [index > 0 && _jsx("div", { className: "pax-display-docket__divider" }), _jsxs("span", { className: "pax-display-docket__info", children: [_jsxs(Text, { size: "sm", variant: "medium", color: "default", children: [group.count, " ", group.count > 1 ? pluralLabel : label] }), group.age > 0 ? (_jsxs(Text, { size: "sm", variant: "medium", className: "pax-display-docket__age", children: [' ', "(", group.age, " y.o)"] })) : null] })] }, "passenger-".concat(index))); }) }));
|
|
39
|
+
};
|
|
40
|
+
export var PaxDisplayDocket = function (_a) {
|
|
41
|
+
var _b = _a.AdultPax, AdultPax = _b === void 0 ? 0 : _b, _c = _a.TeenPax, TeenPax = _c === void 0 ? 0 : _c, _d = _a.ChildPax, ChildPax = _d === void 0 ? 0 : _d, _e = _a.InfantPax, InfantPax = _e === void 0 ? 0 : _e, _f = _a.ChildAge, ChildAge = _f === void 0 ? [] : _f, _g = _a.TeenAge, TeenAge = _g === void 0 ? [] : _g, _h = _a.InfantAge, InfantAge = _h === void 0 ? [] : _h, _j = _a.showAll, showAll = _j === void 0 ? true : _j, _k = _a.textSize, textSize = _k === void 0 ? 'sm' : _k, _l = _a.color, color = _l === void 0 ? 'subtle' : _l;
|
|
42
|
+
var hasAdults = AdultPax > 0;
|
|
43
|
+
var hasTeens = TeenPax > 0;
|
|
44
|
+
var hasChildren = ChildPax > 0;
|
|
45
|
+
var hasInfants = InfantPax > 0;
|
|
46
|
+
// If no passengers at all, return null
|
|
47
|
+
if (!hasAdults && !hasTeens && !hasChildren && !hasInfants) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return (_jsxs("div", { className: "pax-display-docket", children: [hasAdults && (_jsxs(TextWithIcon, { icon: "user", textSize: textSize, color: color, children: [AdultPax, " Adult", AdultPax > 1 ? 's' : ''] })), showAll && (_jsxs(_Fragment, { children: [hasTeens && (_jsxs("div", { className: "pax-display-docket__wrapper", children: [_jsx(Icon, { name: "user", size: textSize, color: "var(--color-text-subtle, #303642)" }), formatPassengerInfo(TeenPax, TeenAge, 'Teen', 'Teens')] })), hasChildren && (_jsxs("div", { className: "pax-display-docket__wrapper", children: [_jsx(Icon, { name: "user", size: textSize, color: "var(--color-text-subtle, #303642)" }), formatPassengerInfo(ChildPax, ChildAge, 'Child', 'Children')] })), hasInfants && (_jsxs("div", { className: "pax-display-docket__wrapper", children: [_jsx(Icon, { name: "user", size: textSize, color: "var(--color-text-subtle, #303642)" }), formatPassengerInfo(InfantPax, InfantAge, 'Infant', 'Infants')] }))] }))] }));
|
|
51
|
+
};
|
|
52
|
+
export default PaxDisplayDocket;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PaxDisplayDocket } from './PaxDisplayDocket';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '../../../styles/components/molecule/transfer-docket.css';
|
|
3
|
-
import {
|
|
3
|
+
import { TransferService } from '../../../types/docket/services.types';
|
|
4
4
|
export interface TransferDocketProps {
|
|
5
|
-
data:
|
|
5
|
+
data: TransferService;
|
|
6
6
|
/** Remove mode - replaces price display with remove button */
|
|
7
7
|
removeMode?: boolean;
|
|
8
8
|
/** Handler for remove button click */
|