mautourco-components 0.2.84 → 0.2.85
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/molecules/TransferDocket/TransferDocket.d.ts +1 -1
- package/dist/components/molecules/TransferDocket/TransferDocket.js +6 -4
- package/dist/index.d.ts +18 -18
- package/dist/index.js +2 -2
- package/dist/styles/components/molecule/transfer-docket.css +6 -0
- package/package.json +1 -1
- package/src/components/molecules/TransferDocket/TransferDocket.tsx +22 -3
- package/src/styles/components/molecule/transfer-docket.css +5 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TransferDocket as TransferDocketType } from '../../../types/docket/services.types';
|
|
3
2
|
import '../../../styles/components/molecule/transfer-docket.css';
|
|
3
|
+
import { TransferDocket as TransferDocketType } from '../../../types/docket/services.types';
|
|
4
4
|
export interface TransferDocketProps {
|
|
5
5
|
data: TransferDocketType;
|
|
6
6
|
/** Remove mode - replaces price display with remove button */
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import '../../../styles/components/molecule/transfer-docket.css';
|
|
3
4
|
import Button from '../../atoms/Button/Button';
|
|
4
5
|
import Icon from '../../atoms/Icon/Icon';
|
|
5
6
|
import { Text } from '../../atoms/Typography/Typography';
|
|
6
7
|
import { DateDisplay } from '../DateDisplay/DateDisplay';
|
|
7
8
|
import { PriceDisplay } from '../PriceDisplay/PriceDisplay';
|
|
8
9
|
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
9
|
-
import '../../../styles/components/molecule/transfer-docket.css';
|
|
10
10
|
export var TransferDocket = function (_a) {
|
|
11
11
|
var data = _a.data, _b = _a.removeMode, removeMode = _b === void 0 ? false : _b, onRemove = _a.onRemove;
|
|
12
|
-
var TransferDate = data.TransferDate, Currency = data.Currency, TotalPrice = data.TotalPrice, LocationFromName = data.LocationFromName, LocationToName = data.LocationToName, AdultCount = data.AdultCount, ChildCount = data.ChildCount, TeenCount = data.TeenCount, InfantCount = data.InfantCount, VehicleTypeName = data.VehicleTypeName, paxAge = data.paxAge;
|
|
12
|
+
var TransferDate = data.TransferDate, Currency = data.Currency, TotalPrice = data.TotalPrice, LocationFromName = data.LocationFromName, LocationToName = data.LocationToName, AdultCount = data.AdultCount, ChildCount = data.ChildCount, TeenCount = data.TeenCount, InfantCount = data.InfantCount, VehicleTypeName = data.VehicleTypeName, paxAge = data.paxAge, baby_seat_count = data.baby_seat_count;
|
|
13
|
+
// Automatically generate supplements from baby_seat_count
|
|
14
|
+
var showBabySeat = baby_seat_count && baby_seat_count > 0;
|
|
13
15
|
var formatChildrenInfo = function () {
|
|
14
|
-
var totalChildren = (ChildCount || 0) + (TeenCount || 0);
|
|
16
|
+
var totalChildren = (ChildCount || 0) + (TeenCount || 0) + (InfantCount || 0);
|
|
15
17
|
if (totalChildren === 0) {
|
|
16
18
|
return null;
|
|
17
19
|
}
|
|
@@ -44,6 +46,6 @@ export var TransferDocket = function (_a) {
|
|
|
44
46
|
}
|
|
45
47
|
return (_jsx("div", { className: "transfer-docket__children", children: childGroups.map(function (group, index) { return (_jsxs(React.Fragment, { children: [index > 0 && _jsx("div", { className: "transfer-docket__divider-vertical" }), _jsxs("span", { className: "transfer-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: "transfer-docket__child-age", children: [' ', "(", group.age, " y.o)"] })) : null] })] }, "child-".concat(index))); }) }));
|
|
46
48
|
};
|
|
47
|
-
return (_jsxs("div", { className: "transfer-docket", children: [_jsxs("div", { className: "transfer-docket__header", children: [_jsxs("div", { className: "transfer-docket__title-section", children: [_jsx("div", { className: "transfer-docket__title-bar" }), _jsx(Icon, { name: "bus", size: "sm" }), _jsx(Text, { variant: "bold", size: "sm", color: "accent", children: "Transfer" })] }), removeMode ? (_jsx(Button, { variant: "destructive", size: "sm", leadingIcon: "close", onClick: onRemove, className: "transfer-docket__remove-button", children: "Remove" })) : (TotalPrice && Currency && _jsx(PriceDisplay, { currency: Currency, price: TotalPrice }))] }), _jsxs("div", { className: "transfer-docket__details", children: [TransferDate && (_jsx(DateDisplay, { date: TransferDate, calendarSize: "sm", textSize: "sm", colorMode: "green" })), (LocationFromName || LocationToName) && (_jsxs("div", { className: "transfer-docket__transfer-point", children: [_jsx(Text, { variant: "medium", size: "sm", color: "subtle", leading: "none", children: LocationFromName || 'From' }), _jsx(Icon, { name: "arrow-down-outline", size: "sm" }), _jsx(Text, { variant: "medium", size: "sm", color: "subtle", leading: "none", children: LocationToName || 'To' })] })), _jsxs("div", { className: "transfer-docket__guests", children: [AdultCount !== undefined && AdultCount > 0 && (_jsxs(TextWithIcon, { icon: "user", textSize: "sm", color: "subtle", children: [AdultCount, " Adult", AdultCount > 1 ? 's' : ''] })), ((ChildCount && ChildCount > 0) || (TeenCount && TeenCount > 0)) ? (_jsxs("div", { className: "transfer-docket__children-wrapper", children: [_jsx(Icon, { name: "user", size: "sm", color: "var(--color-text-subtle, #303642)" }), formatChildrenInfo()] })) : null] }), VehicleTypeName && (_jsx(TextWithIcon, { icon: "car", textSize: "sm", color: "subtle", textLeading: "none", children: VehicleTypeName }))] })] }));
|
|
49
|
+
return (_jsxs("div", { className: "transfer-docket", children: [_jsxs("div", { className: "transfer-docket__header", children: [_jsxs("div", { className: "transfer-docket__title-section", children: [_jsx("div", { className: "transfer-docket__title-bar" }), _jsx(Icon, { name: "bus", size: "sm" }), _jsx(Text, { variant: "bold", size: "sm", color: "accent", children: "Transfer" })] }), removeMode ? (_jsx(Button, { variant: "destructive", size: "sm", leadingIcon: "close", onClick: onRemove, className: "transfer-docket__remove-button", children: "Remove" })) : (TotalPrice && Currency && _jsx(PriceDisplay, { currency: Currency, price: TotalPrice }))] }), _jsxs("div", { className: "transfer-docket__details", children: [TransferDate && (_jsx(DateDisplay, { date: TransferDate, calendarSize: "sm", textSize: "sm", colorMode: "green" })), (LocationFromName || LocationToName) && (_jsxs("div", { className: "transfer-docket__transfer-point", children: [_jsx(Text, { variant: "medium", size: "sm", color: "subtle", leading: "none", children: LocationFromName || 'From' }), _jsx(Icon, { name: "arrow-down-outline", size: "sm" }), _jsx(Text, { variant: "medium", size: "sm", color: "subtle", leading: "none", children: LocationToName || 'To' })] })), _jsxs("div", { className: "transfer-docket__guests", children: [AdultCount !== undefined && AdultCount > 0 && (_jsxs(TextWithIcon, { icon: "user", textSize: "sm", color: "subtle", children: [AdultCount, " Adult", AdultCount > 1 ? 's' : ''] })), ((ChildCount && ChildCount > 0) || (TeenCount && TeenCount > 0)) || (InfantCount && InfantCount > 0) ? (_jsxs("div", { className: "transfer-docket__children-wrapper", children: [_jsx(Icon, { name: "user", size: "sm", color: "var(--color-text-subtle, #303642)" }), formatChildrenInfo()] })) : null] }), VehicleTypeName && (_jsx(TextWithIcon, { icon: "car", textSize: "sm", color: "subtle", textLeading: "none", children: VehicleTypeName })), showBabySeat && (_jsxs("div", { className: "transfer-docket__supplements", children: [_jsx(Text, { variant: "medium", size: "sm", color: "default", leading: "none", children: "Supplement :" }), _jsxs(TextWithIcon, { icon: "stroller", textSize: "sm", color: "subtle", children: ["Baby seat x", baby_seat_count] })] }))] })] }));
|
|
48
50
|
};
|
|
49
51
|
export default TransferDocket;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { DateDisplay } from './components/molecules/DateDisplay/DateDisplay';
|
|
|
17
17
|
export { DocketPrices } from './components/molecules/DocketPrices/DocketPrices';
|
|
18
18
|
export { PriceDisplay } from './components/molecules/PriceDisplay/PriceDisplay';
|
|
19
19
|
export { TransferDocket } from './components/molecules/TransferDocket/TransferDocket';
|
|
20
|
-
export { ActionDropdown, type ActionDropdownItem
|
|
20
|
+
export { ActionDropdown, type ActionDropdownItem } from './components/molecules/ActionDropdown/ActionDropdown';
|
|
21
21
|
export { AddItemButton } from './components/molecules/AddItemButton/AddItemButton';
|
|
22
22
|
export { default as AgeSelector } from './components/molecules/AgeSelector/AgeSelector';
|
|
23
23
|
export * from './components/molecules/BookingResume';
|
|
@@ -39,11 +39,11 @@ export { ServiceLanguages } from './components/molecules/ServiceLanguages/Servic
|
|
|
39
39
|
export { default as ServiceSelector } from './components/molecules/ServiceSelector/ServiceSelector';
|
|
40
40
|
export { default as Stepper } from './components/molecules/Stepper/Stepper';
|
|
41
41
|
export { default as TextWithIcon } from './components/molecules/TextWithIcon/TextWithIcon';
|
|
42
|
-
export { default as VehicleSupplement } from './components/molecules/VehicleSupplement/VehicleSupplement';
|
|
43
|
-
export type { VehicleSupplementProps, Supplement, SupplementValue } from './components/molecules/VehicleSupplement';
|
|
44
42
|
export { default as TimelineItem } from './components/molecules/TimelineItem/TimelineItem';
|
|
45
43
|
export { default as Toast } from './components/molecules/Toast/Toast';
|
|
46
44
|
export * from './components/molecules/TooltipDisplay/TooltipDisplay';
|
|
45
|
+
export type { Supplement, SupplementValue, VehicleSupplementProps } from './components/molecules/VehicleSupplement';
|
|
46
|
+
export { default as VehicleSupplement } from './components/molecules/VehicleSupplement/VehicleSupplement';
|
|
47
47
|
export { Illustration } from './components/atoms/Illustration/Illustration';
|
|
48
48
|
export * from './components/molecules/BookingPax';
|
|
49
49
|
export { DetailsClientInfo } from './components/molecules/DetailsInfo/DetailsClient/DetailsClient';
|
|
@@ -89,44 +89,44 @@ export { default as UserIcon } from './components/atoms/Icon/icons/User';
|
|
|
89
89
|
export { priceFormatter } from './lib/price-formatter';
|
|
90
90
|
export type { DividerProps } from './components/atoms/Divider/Divider';
|
|
91
91
|
export type { FeatureRowProps } from './components/molecules/FeatureRow/FeatureRow';
|
|
92
|
-
export type { LocationData, LocationDropdownProps, LocationGroup, LocationOption
|
|
93
|
-
export type { ServiceOption, ServiceSelectorProps, ServiceType
|
|
92
|
+
export type { LocationData, LocationDropdownProps, LocationGroup, LocationOption } from './components/molecules/LocationDropdown/LocationDropdown';
|
|
93
|
+
export type { ServiceOption, ServiceSelectorProps, ServiceType } from './components/molecules/ServiceSelector/ServiceSelector';
|
|
94
94
|
export type { StepperProps } from './components/molecules/Stepper/Stepper';
|
|
95
|
-
export type { CarBookingCardPriceRow, CarBookingCardProps, CarBookingCardSize, CarBookingCardState, CarBookingCardType
|
|
96
|
-
export type { CardContainerProps, CardContainerSpacing
|
|
95
|
+
export type { CarBookingCardPriceRow, CarBookingCardProps, CarBookingCardSize, CarBookingCardState, CarBookingCardType } from './components/organisms/CarBookingCard/CarBookingCard';
|
|
96
|
+
export type { CardContainerProps, CardContainerSpacing } from './components/organisms/CardContainer/CardContainer';
|
|
97
97
|
export type { DateTimePickerProps } from './components/organisms/DateTimePicker/DateTimePicker';
|
|
98
98
|
export type { DialogProps, DialogSize } from './components/organisms/Dialog/Dialog';
|
|
99
99
|
export type { FooterProps } from './components/organisms/Footer/Footer';
|
|
100
|
-
export type { DocketDetailsData, DocketServiceType, MultipleQuotationDocketProps
|
|
100
|
+
export type { DocketDetailsData, DocketServiceType, MultipleQuotationDocketProps } from './components/organisms/MultipleQuotationDocket';
|
|
101
101
|
export { CHILD_CATEGORY_AGES } from './components/organisms/PaxSelector/PaxSelector';
|
|
102
|
-
export type { ClientType, PaxData, PaxSelectorProps
|
|
103
|
-
export type { RoundTripData, RoundTripProps, RoundTripTransfer
|
|
104
|
-
export type { SearchBarTransferData, SearchBarTransferProps, TransferMode
|
|
102
|
+
export type { ClientType, PaxData, PaxSelectorProps } from './components/organisms/PaxSelector/PaxSelector';
|
|
103
|
+
export type { RoundTripData, RoundTripProps, RoundTripTransfer } from './components/organisms/RoundTrip/RoundTrip';
|
|
104
|
+
export type { SearchBarTransferData, SearchBarTransferProps, TransferMode } from './components/organisms/SearchBarTransfer/SearchBarTransfer';
|
|
105
105
|
export type { TopNavigationProps } from './components/organisms/TopNavigation/TopNavigation';
|
|
106
|
-
export type { TransferLineData, TransferLineProps, TransferType
|
|
106
|
+
export type { TransferLineData, TransferLineProps, TransferType } from './components/organisms/TransferLine/TransferLine';
|
|
107
107
|
export type { CheckboxProps } from './components/atoms/Checkbox/Checkbox';
|
|
108
108
|
export type { InputProps } from './components/atoms/Inputs/Input/Input';
|
|
109
109
|
export type { AddItemButtonProps } from './components/molecules/AddItemButton/AddItemButton';
|
|
110
110
|
export type { AgeSelectorProps } from './components/molecules/AgeSelector/AgeSelector';
|
|
111
|
-
export type { BreadcrumbsItem, BreadcrumbsProps
|
|
111
|
+
export type { BreadcrumbsItem, BreadcrumbsProps } from './components/molecules/Breadcrumbs/Breadcrumbs';
|
|
112
112
|
export type { DocketPricesProps } from './components/molecules/DocketPrices/DocketPrices';
|
|
113
113
|
export type { FromToProps } from './components/molecules/FromTo/FromTo';
|
|
114
114
|
export type { PaxChipsProps, PaxCount } from './components/molecules/PaxChips/PaxChips';
|
|
115
115
|
export type { PriceDisplayProps } from './components/molecules/PriceDisplay/PriceDisplay';
|
|
116
116
|
export type { SectionTitleProps } from './components/molecules/SectionTitle/SectionTitle';
|
|
117
|
-
export type { DetailsColProps, ItemColProps, RowAccommodationProps, RowExcursionProps, RowTransferProps
|
|
117
|
+
export type { DetailsColProps, ItemColProps, RowAccommodationProps, RowExcursionProps, RowTransferProps } from './components/molecules/TableServiceItem';
|
|
118
118
|
export type { ServiceAccommodationProps } from './components/molecules/TimelineItem/ServiceAccommodation';
|
|
119
119
|
export type { ServiceExcursionProps } from './components/molecules/TimelineItem/ServiceExcursion';
|
|
120
120
|
export type { ServiceTransferProps } from './components/molecules/TimelineItem/ServiceTransfer';
|
|
121
121
|
export type { TimelineHeaderProps } from './components/molecules/TimelineItem/TimelineHeader';
|
|
122
122
|
export type { ToastProps } from './components/molecules/Toast/Toast';
|
|
123
123
|
export type { TransferDocketProps } from './components/molecules/TransferDocket/TransferDocket';
|
|
124
|
-
export type { ComparisonData, DialogComparisonProps, MultiComparisonData
|
|
124
|
+
export type { ComparisonData, DialogComparisonProps, MultiComparisonData } from './components/organisms/DialogComparison/DialogComparison';
|
|
125
125
|
export type { DialogDeleteConfirmProps } from './components/organisms/DialogDeleteConfirm/DialogDeleteConfirm';
|
|
126
126
|
export type { DialogQuoteRenameProps } from './components/organisms/DialogQuoteRename/DialogQuoteRename';
|
|
127
127
|
export type { SelectedQuote } from './components/organisms/DialogSendingMail/DialogSendingMailMultiple/DialogSendingMailMultiple';
|
|
128
|
-
export type { FilterType, QuoteHeaderProps
|
|
129
|
-
export type { TimelineProps, TimelineServices
|
|
130
|
-
export type { AccomodationDocket as AccomodationDocketType, ExcursionDocket as ExcursionDocketType, OtherServiceDocket as OtherServiceDocketType, ServiceDocket as ServiceDocketType, TransferDocket as TransferDocketType
|
|
128
|
+
export type { FilterType, QuoteHeaderProps } from './components/organisms/QuoteHeader/QuoteHeader';
|
|
129
|
+
export type { TimelineProps, TimelineServices } from './components/organisms/Timeline/Timeline';
|
|
130
|
+
export type { AccomodationDocket as AccomodationDocketType, ExcursionDocket as ExcursionDocketType, OtherServiceDocket as OtherServiceDocketType, ServiceDocket as ServiceDocketType, TransferDocket as TransferDocketType } from './types/docket/services.types';
|
|
131
131
|
export * from './types/table';
|
|
132
132
|
export * from './hooks/useStays';
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export { DocketPrices } from './components/molecules/DocketPrices/DocketPrices';
|
|
|
19
19
|
export { PriceDisplay } from './components/molecules/PriceDisplay/PriceDisplay';
|
|
20
20
|
export { TransferDocket } from './components/molecules/TransferDocket/TransferDocket';
|
|
21
21
|
// Molecules - Composed components
|
|
22
|
-
export { ActionDropdown
|
|
22
|
+
export { ActionDropdown } from './components/molecules/ActionDropdown/ActionDropdown';
|
|
23
23
|
export { AddItemButton } from './components/molecules/AddItemButton/AddItemButton';
|
|
24
24
|
export { default as AgeSelector } from './components/molecules/AgeSelector/AgeSelector';
|
|
25
25
|
export * from './components/molecules/BookingResume';
|
|
@@ -41,10 +41,10 @@ export { ServiceLanguages } from './components/molecules/ServiceLanguages/Servic
|
|
|
41
41
|
export { default as ServiceSelector } from './components/molecules/ServiceSelector/ServiceSelector';
|
|
42
42
|
export { default as Stepper } from './components/molecules/Stepper/Stepper';
|
|
43
43
|
export { default as TextWithIcon } from './components/molecules/TextWithIcon/TextWithIcon';
|
|
44
|
-
export { default as VehicleSupplement } from './components/molecules/VehicleSupplement/VehicleSupplement';
|
|
45
44
|
export { default as TimelineItem } from './components/molecules/TimelineItem/TimelineItem';
|
|
46
45
|
export { default as Toast } from './components/molecules/Toast/Toast';
|
|
47
46
|
export * from './components/molecules/TooltipDisplay/TooltipDisplay';
|
|
47
|
+
export { default as VehicleSupplement } from './components/molecules/VehicleSupplement/VehicleSupplement';
|
|
48
48
|
// Organisms - Complex components
|
|
49
49
|
export { Illustration } from './components/atoms/Illustration/Illustration';
|
|
50
50
|
export * from './components/molecules/BookingPax';
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import '../../../styles/components/molecule/transfer-docket.css';
|
|
2
3
|
import { TransferDocket as TransferDocketType } from '../../../types/docket/services.types';
|
|
3
4
|
import Button from '../../atoms/Button/Button';
|
|
4
5
|
import Icon from '../../atoms/Icon/Icon';
|
|
@@ -6,7 +7,6 @@ import { Text } from '../../atoms/Typography/Typography';
|
|
|
6
7
|
import { DateDisplay } from '../DateDisplay/DateDisplay';
|
|
7
8
|
import { PriceDisplay } from '../PriceDisplay/PriceDisplay';
|
|
8
9
|
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
9
|
-
import '../../../styles/components/molecule/transfer-docket.css';
|
|
10
10
|
|
|
11
11
|
export interface TransferDocketProps {
|
|
12
12
|
data: TransferDocketType;
|
|
@@ -33,10 +33,14 @@ export const TransferDocket: React.FC<TransferDocketProps> = ({
|
|
|
33
33
|
InfantCount,
|
|
34
34
|
VehicleTypeName,
|
|
35
35
|
paxAge,
|
|
36
|
+
baby_seat_count,
|
|
36
37
|
} = data;
|
|
37
38
|
|
|
39
|
+
// Automatically generate supplements from baby_seat_count
|
|
40
|
+
const showBabySeat = baby_seat_count && baby_seat_count > 0;
|
|
41
|
+
|
|
38
42
|
const formatChildrenInfo = (): React.ReactNode => {
|
|
39
|
-
const totalChildren = (ChildCount || 0) + (TeenCount || 0);
|
|
43
|
+
const totalChildren = (ChildCount || 0) + (TeenCount || 0) + (InfantCount || 0);
|
|
40
44
|
if (totalChildren === 0) {
|
|
41
45
|
return null;
|
|
42
46
|
}
|
|
@@ -148,7 +152,7 @@ export const TransferDocket: React.FC<TransferDocketProps> = ({
|
|
|
148
152
|
{AdultCount} Adult{AdultCount > 1 ? 's' : ''}
|
|
149
153
|
</TextWithIcon>
|
|
150
154
|
)}
|
|
151
|
-
{((ChildCount && ChildCount > 0) || (TeenCount && TeenCount > 0)) ? (
|
|
155
|
+
{((ChildCount && ChildCount > 0) || (TeenCount && TeenCount > 0)) || (InfantCount && InfantCount > 0) ? (
|
|
152
156
|
<div className="transfer-docket__children-wrapper">
|
|
153
157
|
<Icon
|
|
154
158
|
name="user"
|
|
@@ -165,6 +169,21 @@ export const TransferDocket: React.FC<TransferDocketProps> = ({
|
|
|
165
169
|
{VehicleTypeName}
|
|
166
170
|
</TextWithIcon>
|
|
167
171
|
)}
|
|
172
|
+
|
|
173
|
+
{showBabySeat && (
|
|
174
|
+
<div className="transfer-docket__supplements">
|
|
175
|
+
<Text variant="medium" size="sm" color="default" leading="none">
|
|
176
|
+
Supplement :
|
|
177
|
+
</Text>
|
|
178
|
+
<TextWithIcon
|
|
179
|
+
icon="stroller"
|
|
180
|
+
textSize="sm"
|
|
181
|
+
color="subtle"
|
|
182
|
+
>
|
|
183
|
+
Baby seat x{baby_seat_count}
|
|
184
|
+
</TextWithIcon>
|
|
185
|
+
</div>
|
|
186
|
+
)}
|
|
168
187
|
</div>
|
|
169
188
|
</div>
|
|
170
189
|
);
|