mautourco-components 0.2.15 → 0.2.16
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/BusIcon.js +1 -1
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.css +2097 -0
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +11 -0
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js +20 -0
- package/dist/components/molecules/TableServiceItem/DetailsCol.d.ts +2 -2
- package/dist/components/molecules/TableServiceItem/DetailsCol.js +3 -2
- package/dist/components/molecules/TextWithIcon/TextWithIcon.js +2 -2
- package/dist/components/molecules/TimelineItem/ServiceAccommodation.d.ts +9 -0
- package/dist/components/molecules/TimelineItem/ServiceAccommodation.js +20 -0
- package/dist/components/molecules/TimelineItem/ServiceExcursion.d.ts +8 -0
- package/dist/components/molecules/TimelineItem/ServiceExcursion.js +20 -0
- package/dist/components/molecules/TimelineItem/ServiceTransfer.d.ts +11 -0
- package/dist/components/molecules/TimelineItem/ServiceTransfer.js +19 -0
- package/dist/components/molecules/TimelineItem/TimelineHeader.css +2166 -0
- package/dist/components/molecules/TimelineItem/TimelineHeader.d.ts +10 -0
- package/dist/components/molecules/TimelineItem/TimelineHeader.js +21 -0
- package/dist/components/molecules/TimelineItem/TimelineItem.css +2084 -0
- package/dist/components/molecules/TimelineItem/TimelineItem.d.ts +12 -0
- package/dist/components/molecules/TimelineItem/TimelineItem.js +23 -0
- package/dist/components/organisms/Timeline/Timeline.d.ts +14 -0
- package/dist/components/organisms/Timeline/Timeline.js +19 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
- package/src/components/atoms/Icon/icons/BusIcon.tsx +6 -2
- package/src/components/molecules/Breadcrumbs/Breadcrumbs.css +10 -0
- package/src/components/molecules/Breadcrumbs/Breadcrumbs.tsx +47 -0
- package/src/components/molecules/TableServiceItem/DetailsCol.tsx +9 -5
- package/src/components/molecules/TextWithIcon/TextWithIcon.tsx +19 -5
- package/src/components/molecules/TimelineItem/ServiceAccommodation.tsx +29 -0
- package/src/components/molecules/TimelineItem/ServiceExcursion.tsx +28 -0
- package/src/components/molecules/TimelineItem/ServiceTransfer.tsx +25 -0
- package/src/components/molecules/TimelineItem/TimelineHeader.css +44 -0
- package/src/components/molecules/TimelineItem/TimelineHeader.tsx +41 -0
- package/src/components/molecules/TimelineItem/TimelineItem.css +7 -0
- package/src/components/molecules/TimelineItem/TimelineItem.tsx +17 -0
- package/src/components/organisms/Timeline/Timeline.tsx +57 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './TimelineItem.css';
|
|
3
|
+
export interface TimelineItemProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare function TimelineItem(props: TimelineItemProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare namespace TimelineItem {
|
|
8
|
+
var Transfer: import("react").FC<import("./ServiceTransfer").ServiceTransferProps>;
|
|
9
|
+
var Accommodation: import("react").FC<import("./ServiceAccommodation").ServiceAccommodationProps>;
|
|
10
|
+
var Excursion: import("react").FC<import("./ServiceExcursion").ServiceExcursionProps>;
|
|
11
|
+
}
|
|
12
|
+
export default TimelineItem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { ServiceAccommodation } from './ServiceAccommodation';
|
|
14
|
+
import { ServiceExcursion } from './ServiceExcursion';
|
|
15
|
+
import { ServiceTransfer } from './ServiceTransfer';
|
|
16
|
+
import './TimelineItem.css';
|
|
17
|
+
export default function TimelineItem(props) {
|
|
18
|
+
var children = props.children;
|
|
19
|
+
return _jsx("div", __assign({ className: "timeline-item" }, { children: children }));
|
|
20
|
+
}
|
|
21
|
+
TimelineItem.Transfer = ServiceTransfer;
|
|
22
|
+
TimelineItem.Accommodation = ServiceAccommodation;
|
|
23
|
+
TimelineItem.Excursion = ServiceExcursion;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ServiceAccommodationProps } from '../../molecules/TimelineItem/ServiceAccommodation';
|
|
3
|
+
import { ServiceExcursionProps } from '../../molecules/TimelineItem/ServiceExcursion';
|
|
4
|
+
import { ServiceTransferProps } from '../../molecules/TimelineItem/ServiceTransfer';
|
|
5
|
+
export interface TimelineServices {
|
|
6
|
+
type: 'transfer' | 'accommodation' | 'excursion';
|
|
7
|
+
data: ServiceTransferProps | ServiceAccommodationProps | ServiceExcursionProps;
|
|
8
|
+
}
|
|
9
|
+
export interface TimelineProps {
|
|
10
|
+
arrival: string;
|
|
11
|
+
departure: string;
|
|
12
|
+
services: TimelineServices[];
|
|
13
|
+
}
|
|
14
|
+
export declare const Timeline: React.FC<TimelineProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
14
|
+
import TextWithIcon from '../../molecules/TextWithIcon/TextWithIcon';
|
|
15
|
+
import TimelineItem from '../../molecules/TimelineItem/TimelineItem';
|
|
16
|
+
export var Timeline = function (props) {
|
|
17
|
+
var arrival = props.arrival, departure = props.departure, services = props.services;
|
|
18
|
+
return (_jsxs("div", __assign({ className: "space-y-10" }, { children: [_jsxs(TextWithIcon, __assign({ icon: "arrival", color: "accent", iconSize: "lg" }, { children: ["Arrival :", ' ', _jsx(Text, __assign({ variant: "regular", size: "lg", leading: "5", color: "default", as: "span" }, { children: arrival }))] })), _jsx("div", __assign({ className: "overflow-x-auto" }, { children: _jsx("div", __assign({ className: "flex gap-x-3 pb-8 2xl:pb-0" }, { children: services.map(function (service, index) { return (_jsxs(TimelineItem, { children: [service.type === 'transfer' && (_jsx(TimelineItem.Transfer, __assign({}, service.data))), service.type === 'accommodation' && (_jsx(TimelineItem.Accommodation, __assign({}, service.data))), service.type === 'excursion' && (_jsx(TimelineItem.Excursion, __assign({}, service.data)))] }, "tm-".concat(index))); }) })) })), _jsxs(TextWithIcon, __assign({ icon: "departure", color: "accent", iconSize: "lg" }, { children: ["Departure :", ' ', _jsx(Text, __assign({ variant: "regular", size: "lg", leading: "5", color: "default", as: "span" }, { children: departure }))] }))] })));
|
|
19
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export { default as SectionTitle } from './components/molecules/SectionTitle/Sec
|
|
|
26
26
|
export { default as ServiceSelector } from './components/molecules/ServiceSelector/ServiceSelector';
|
|
27
27
|
export { default as Stepper } from './components/molecules/Stepper/Stepper';
|
|
28
28
|
export { default as TextWithIcon } from './components/molecules/TextWithIcon/TextWithIcon';
|
|
29
|
+
export { default as TimelineItem } from './components/molecules/TimelineItem/TimelineItem';
|
|
29
30
|
export { Illustration } from './components/atoms/Illustration/Illustration';
|
|
30
31
|
export { default as TableServiceItem } from './components/molecules/TableServiceItem';
|
|
31
32
|
export { default as CarBookingCard } from './components/organisms/CarBookingCard/CarBookingCard';
|
|
@@ -39,6 +40,7 @@ export { QuoteHeader } from './components/organisms/QuoteHeader/QuoteHeader';
|
|
|
39
40
|
export { default as RoundTrip } from './components/organisms/RoundTrip/RoundTrip';
|
|
40
41
|
export { default as SearchBarTransfer } from './components/organisms/SearchBarTransfer/SearchBarTransfer';
|
|
41
42
|
export * from './components/organisms/Table';
|
|
43
|
+
export { Timeline } from './components/organisms/Timeline/Timeline';
|
|
42
44
|
export { TopNavigation } from './components/organisms/TopNavigation/TopNavigation';
|
|
43
45
|
export { default as TransferLine } from './components/organisms/TransferLine/TransferLine';
|
|
44
46
|
export { default as ButtonSpinner } from './components/atoms/Spinner/variants/ButtonSpinner';
|
|
@@ -71,5 +73,10 @@ export type { TransferLineData, TransferLineProps, TransferType, } from './compo
|
|
|
71
73
|
export type { FromToProps } from './components/molecules/FromTo/FromTo';
|
|
72
74
|
export type { SectionTitleProps } from './components/molecules/SectionTitle/SectionTitle';
|
|
73
75
|
export type { DetailsColProps, ItemColProps, RowAccommodationProps, RowExcursionProps, RowTransferProps, } from './components/molecules/TableServiceItem';
|
|
76
|
+
export type { ServiceAccommodationProps } from './components/molecules/TimelineItem/ServiceAccommodation';
|
|
77
|
+
export type { ServiceExcursionProps } from './components/molecules/TimelineItem/ServiceExcursion';
|
|
78
|
+
export type { ServiceTransferProps } from './components/molecules/TimelineItem/ServiceTransfer';
|
|
79
|
+
export type { TimelineHeaderProps } from './components/molecules/TimelineItem/TimelineHeader';
|
|
74
80
|
export type { QuoteHeaderProps } from './components/organisms/QuoteHeader/QuoteHeader';
|
|
81
|
+
export type { TimelineProps, TimelineServices, } from './components/organisms/Timeline/Timeline';
|
|
75
82
|
export * from './types/table';
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,7 @@ export { default as SectionTitle } from './components/molecules/SectionTitle/Sec
|
|
|
28
28
|
export { default as ServiceSelector } from './components/molecules/ServiceSelector/ServiceSelector';
|
|
29
29
|
export { default as Stepper } from './components/molecules/Stepper/Stepper';
|
|
30
30
|
export { default as TextWithIcon } from './components/molecules/TextWithIcon/TextWithIcon';
|
|
31
|
+
export { default as TimelineItem } from './components/molecules/TimelineItem/TimelineItem';
|
|
31
32
|
// Organisms - Complex components
|
|
32
33
|
export { Illustration } from './components/atoms/Illustration/Illustration';
|
|
33
34
|
export { default as TableServiceItem } from './components/molecules/TableServiceItem';
|
|
@@ -42,6 +43,7 @@ export { QuoteHeader } from './components/organisms/QuoteHeader/QuoteHeader';
|
|
|
42
43
|
export { default as RoundTrip } from './components/organisms/RoundTrip/RoundTrip';
|
|
43
44
|
export { default as SearchBarTransfer } from './components/organisms/SearchBarTransfer/SearchBarTransfer';
|
|
44
45
|
export * from './components/organisms/Table';
|
|
46
|
+
export { Timeline } from './components/organisms/Timeline/Timeline';
|
|
45
47
|
export { TopNavigation } from './components/organisms/TopNavigation/TopNavigation';
|
|
46
48
|
export { default as TransferLine } from './components/organisms/TransferLine/TransferLine';
|
|
47
49
|
// Spinner Variants
|
package/package.json
CHANGED
|
@@ -33,11 +33,15 @@ const BusIcon: React.FC<BusIconProps> = ({ size = 'md', className = '', color })
|
|
|
33
33
|
const classes = `${sizeClasses} ${colorClass} ${className}`;
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
|
-
<svg
|
|
36
|
+
<svg
|
|
37
|
+
className={classes}
|
|
38
|
+
viewBox="0 0 16 16"
|
|
39
|
+
fill="none"
|
|
40
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
37
41
|
<g clip-path="url(#clip0_7033_40084)">
|
|
38
42
|
<path
|
|
39
43
|
d="M12.5821 8.08301H3.41512V11.333C3.41512 11.6552 3.67694 11.917 3.99911 11.917H11.9991C12.3211 11.9168 12.5821 11.6551 12.5821 11.333V8.08301ZM5.33895 9.25L5.41512 9.25391C5.79348 9.29216 6.08895 9.61156 6.08895 10C6.08895 10.3884 5.79348 10.7078 5.41512 10.7461L5.33895 10.75H5.33211C4.9179 10.75 4.58211 10.4142 4.58211 10C4.58211 9.58579 4.9179 9.25 5.33211 9.25H5.33895ZM10.672 9.25C11.0862 9.25 11.422 9.58579 11.422 10C11.422 10.4142 11.0862 10.75 10.672 10.75H10.6651C10.2511 10.7498 9.91512 10.4141 9.91512 10C9.91512 9.5859 10.2511 9.25018 10.6651 9.25H10.672ZM3.99911 2.75C3.67705 2.75 3.4153 3.01099 3.41512 3.33301V6.58301H12.5821V3.33301C12.5819 3.0111 12.321 2.75018 11.9991 2.75H3.99911ZM9.33211 3.25C9.74633 3.25 10.0821 3.58579 10.0821 4C10.0821 4.41421 9.74633 4.75 9.33211 4.75H6.66512C6.25106 4.74982 5.91512 4.41411 5.91512 4C5.91512 3.58589 6.25106 3.25018 6.66512 3.25H9.33211ZM14.0821 11.333C14.0821 12.2187 13.5284 12.973 12.7491 13.2744V14C12.7491 14.4141 12.4132 14.7498 11.9991 14.75C11.5849 14.75 11.2491 14.4142 11.2491 14V13.417H4.74911V14C4.74911 14.4141 4.41317 14.7498 3.99911 14.75C3.58489 14.75 3.24911 14.4142 3.24911 14V13.2754C2.46934 12.9742 1.91512 12.219 1.91512 11.333V5.21387L1.66708 5.33789C1.29669 5.52273 0.846371 5.37226 0.661216 5.00195C0.476074 4.63149 0.626713 4.18131 0.997153 3.99609L1.91512 3.53613V3.33301C1.9153 2.18256 2.84862 1.25 3.99911 1.25H11.9991C13.1494 1.25018 14.0819 2.18267 14.0821 3.33301V3.53613L15.0011 3.99609C15.3714 4.18142 15.5212 4.63156 15.336 5.00195C15.1508 5.37235 14.7006 5.52293 14.3302 5.33789L14.0821 5.21289V11.333Z"
|
|
40
|
-
fill="
|
|
44
|
+
fill="currentColor"
|
|
41
45
|
/>
|
|
42
46
|
</g>
|
|
43
47
|
<defs>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { cn } from '@/src/lib/utils';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '../../atoms/Icon/Icon';
|
|
4
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
5
|
+
import './Breadcrumbs.css';
|
|
6
|
+
|
|
7
|
+
export interface BreadcrumbsItem {
|
|
8
|
+
label: string;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface BreadcrumbsProps {
|
|
13
|
+
items: BreadcrumbsItem[];
|
|
14
|
+
onBack: () => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Breadcrumbs: React.FC<BreadcrumbsProps> = (props) => {
|
|
18
|
+
const { items, onBack } = props;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<ol className="breadcrumbs">
|
|
22
|
+
<Text
|
|
23
|
+
variant="medium"
|
|
24
|
+
size="sm"
|
|
25
|
+
leading="4"
|
|
26
|
+
as="li"
|
|
27
|
+
className="cursor-pointer"
|
|
28
|
+
onClick={onBack}>
|
|
29
|
+
<Icon name="chevron-left" size="sm" />
|
|
30
|
+
Back
|
|
31
|
+
</Text>
|
|
32
|
+
{items.map((item, index) => (
|
|
33
|
+
<Text
|
|
34
|
+
key={`bc-${index}`}
|
|
35
|
+
as="li"
|
|
36
|
+
variant="medium"
|
|
37
|
+
size="sm"
|
|
38
|
+
onClick={item.onClick}
|
|
39
|
+
color={index === items.length - 1 ? 'accent' : 'default'}
|
|
40
|
+
leading="4"
|
|
41
|
+
className={cn(index < items.length - 1 && 'cursor-pointer')}>
|
|
42
|
+
{item.label}
|
|
43
|
+
</Text>
|
|
44
|
+
))}
|
|
45
|
+
</ol>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { cn } from '@/src/lib/utils';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { IconName } from '../../atoms/Icon/Icon';
|
|
3
4
|
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
4
5
|
|
|
5
|
-
interface DetailsColData {
|
|
6
|
+
export interface DetailsColData {
|
|
6
7
|
icon: IconName;
|
|
7
8
|
value: React.ReactNode;
|
|
8
9
|
}
|
|
@@ -10,15 +11,18 @@ interface DetailsColData {
|
|
|
10
11
|
export interface DetailsColProps {
|
|
11
12
|
data: DetailsColData[];
|
|
12
13
|
index?: number;
|
|
14
|
+
className?: string;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export const DetailsCol: React.FC<DetailsColProps> = (props) => {
|
|
16
|
-
const { data } = props;
|
|
18
|
+
const { data, className } = props;
|
|
17
19
|
|
|
18
20
|
return (
|
|
19
|
-
<div className=
|
|
20
|
-
{data.map((item) => (
|
|
21
|
-
<TextWithIcon icon={item.icon}
|
|
21
|
+
<div className={cn('grid gap-y-1', className)}>
|
|
22
|
+
{data.map((item, index) => (
|
|
23
|
+
<TextWithIcon icon={item.icon} key={`dc-${index}`}>
|
|
24
|
+
{item.value}
|
|
25
|
+
</TextWithIcon>
|
|
22
26
|
))}
|
|
23
27
|
</div>
|
|
24
28
|
);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { cn } from '@/src/lib/utils';
|
|
2
2
|
import Icon, { IconName } from '../../atoms/Icon/Icon';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Text,
|
|
5
|
+
TextColor,
|
|
6
|
+
TextLeading,
|
|
7
|
+
TextVariant,
|
|
8
|
+
} from '../../atoms/Typography/Typography';
|
|
4
9
|
|
|
5
10
|
export interface TextWithIconProps {
|
|
6
11
|
/** Icon to display */
|
|
@@ -34,7 +39,14 @@ export interface TextWithIconProps {
|
|
|
34
39
|
* @returns
|
|
35
40
|
*/
|
|
36
41
|
const TextWithIcon: React.FC<TextWithIconProps> = (props) => {
|
|
37
|
-
const {
|
|
42
|
+
const {
|
|
43
|
+
icon,
|
|
44
|
+
children,
|
|
45
|
+
iconSize = 'sm',
|
|
46
|
+
color = 'default',
|
|
47
|
+
textLeading = '5',
|
|
48
|
+
textVariant = 'medium',
|
|
49
|
+
} = props;
|
|
38
50
|
|
|
39
51
|
return (
|
|
40
52
|
<div
|
|
@@ -43,9 +55,11 @@ const TextWithIcon: React.FC<TextWithIconProps> = (props) => {
|
|
|
43
55
|
color === 'yellow' && 'text-[var(--color-yellow-600)]',
|
|
44
56
|
color === 'accent' && 'text-[var(--color-text-accent)]'
|
|
45
57
|
)}>
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
|
|
58
|
+
{icon && (
|
|
59
|
+
<span>
|
|
60
|
+
<Icon name={icon} size={iconSize} />
|
|
61
|
+
</span>
|
|
62
|
+
)}
|
|
49
63
|
<Text
|
|
50
64
|
variant={textVariant}
|
|
51
65
|
size={iconSize}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
3
|
+
import { DateDisplay } from '../DateDisplay/DateDisplay';
|
|
4
|
+
import { DetailsCol, DetailsColData } from '../TableServiceItem/DetailsCol';
|
|
5
|
+
import { TimelineHeader } from './TimelineHeader';
|
|
6
|
+
|
|
7
|
+
export interface ServiceAccommodationProps {
|
|
8
|
+
hotelName: string;
|
|
9
|
+
details: DetailsColData[];
|
|
10
|
+
dates: string[] | Date[];
|
|
11
|
+
isOnRequest?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const ServiceAccommodation: React.FC<ServiceAccommodationProps> = (props) => {
|
|
15
|
+
const { hotelName, details, dates, isOnRequest } = props;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div className="space-y-3">
|
|
19
|
+
<TimelineHeader icon="accom" title="Accomodation" isOnRequest={isOnRequest} />
|
|
20
|
+
<Text variant="bold" size="sm" leading="5">
|
|
21
|
+
{hotelName}
|
|
22
|
+
</Text>
|
|
23
|
+
<div className="space-y-2">
|
|
24
|
+
<DateDisplay date={dates} />
|
|
25
|
+
<DetailsCol data={details} className="gap-y-2" />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
3
|
+
import { DateDisplay } from '../DateDisplay/DateDisplay';
|
|
4
|
+
import { DetailsCol, DetailsColData } from '../TableServiceItem/DetailsCol';
|
|
5
|
+
import { TimelineHeader } from './TimelineHeader';
|
|
6
|
+
|
|
7
|
+
export interface ServiceExcursionProps {
|
|
8
|
+
name: string;
|
|
9
|
+
details: DetailsColData[];
|
|
10
|
+
date: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ServiceExcursion: React.FC<ServiceExcursionProps> = (props) => {
|
|
14
|
+
const { name, details, date } = props;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div className="space-y-3">
|
|
18
|
+
<TimelineHeader icon="map" title="Excursion" />
|
|
19
|
+
<Text variant="bold" size="sm" leading="5">
|
|
20
|
+
{name}
|
|
21
|
+
</Text>
|
|
22
|
+
<div className="space-y-2">
|
|
23
|
+
<DateDisplay date={[date]} />
|
|
24
|
+
<DetailsCol data={details} className="gap-y-2" />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FromTo from '../FromTo/FromTo';
|
|
3
|
+
import { DetailsCol, DetailsColData } from '../TableServiceItem/DetailsCol';
|
|
4
|
+
import { TimelineHeader } from './TimelineHeader';
|
|
5
|
+
|
|
6
|
+
export interface ServiceTransferProps {
|
|
7
|
+
transferType: string;
|
|
8
|
+
location: {
|
|
9
|
+
from: string;
|
|
10
|
+
to: string;
|
|
11
|
+
};
|
|
12
|
+
details: DetailsColData[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const ServiceTransfer: React.FC<ServiceTransferProps> = (props) => {
|
|
16
|
+
const { transferType, location, details } = props;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="space-y-3">
|
|
20
|
+
<TimelineHeader icon="car" title="Transfer" extraText={transferType} />
|
|
21
|
+
<FromTo from={location.from} to={location.to} />
|
|
22
|
+
<DetailsCol data={details} className="gap-y-2" />
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.timeline-header {
|
|
2
|
+
@apply space-y-2;
|
|
3
|
+
min-width: 307px;
|
|
4
|
+
|
|
5
|
+
&.timeline-header--request {
|
|
6
|
+
.timeline-header__icon-container::after {
|
|
7
|
+
content: '';
|
|
8
|
+
@apply absolute top-1/2 left-10 -translate-y-1/2;
|
|
9
|
+
height: 1px;
|
|
10
|
+
background-color: transparent;
|
|
11
|
+
background-image: repeating-linear-gradient(
|
|
12
|
+
to right,
|
|
13
|
+
var(--color-yellow-600) 0,
|
|
14
|
+
var(--color-yellow-600) 8px,
|
|
15
|
+
transparent 8px,
|
|
16
|
+
transparent 16px
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
.timeline-header__icon {
|
|
20
|
+
border-color: var(--color-yellow-600);
|
|
21
|
+
color: var(--color-yellow-600);
|
|
22
|
+
background-color: var(--color-yellow-50);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.timeline-header__icon-container {
|
|
28
|
+
@apply flex items-center relative;
|
|
29
|
+
&::after {
|
|
30
|
+
content: '';
|
|
31
|
+
@apply absolute top-1/2 left-10 right-0 -translate-y-1/2;
|
|
32
|
+
height: 1px;
|
|
33
|
+
background-color: var(--color-border-accent-secondary);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.timeline-header__icon {
|
|
38
|
+
@apply flex items-center justify-center;
|
|
39
|
+
@apply w-8 h-8 shrink-0 grow-0 basis-8;
|
|
40
|
+
@apply rounded-full;
|
|
41
|
+
border: solid 1px var(--color-border-accent-secondary);
|
|
42
|
+
color: var(--color-border-accent-secondary);
|
|
43
|
+
background-color: var(--color-atoll-green-100);
|
|
44
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cn } from '@/src/lib/utils';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Chip from '../../atoms/Chip/Chip';
|
|
4
|
+
import Icon, { IconName } from '../../atoms/Icon/Icon';
|
|
5
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
6
|
+
import './TimelineHeader.css';
|
|
7
|
+
|
|
8
|
+
export interface TimelineHeaderProps {
|
|
9
|
+
icon: IconName;
|
|
10
|
+
title: string;
|
|
11
|
+
extraText?: string;
|
|
12
|
+
isOnRequest?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const TimelineHeader: React.FC<TimelineHeaderProps> = (props) => {
|
|
16
|
+
const { icon = 'car', title, extraText, isOnRequest = false } = props;
|
|
17
|
+
return (
|
|
18
|
+
<div className={cn('timeline-header', isOnRequest && 'timeline-header--request')}>
|
|
19
|
+
<div className="timeline-header__icon-container">
|
|
20
|
+
<div className="timeline-header__icon">
|
|
21
|
+
<Icon name={icon} />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div className="flex gap-x-2 items-center">
|
|
25
|
+
<Text
|
|
26
|
+
variant="bold"
|
|
27
|
+
size="md"
|
|
28
|
+
color={isOnRequest ? 'yellow' : 'accent'}
|
|
29
|
+
leading="5">
|
|
30
|
+
{title}
|
|
31
|
+
</Text>
|
|
32
|
+
{extraText && (
|
|
33
|
+
<Text variant="medium" size="md" color="accent" className="italic" leading="5">
|
|
34
|
+
{extraText}
|
|
35
|
+
</Text>
|
|
36
|
+
)}
|
|
37
|
+
{isOnRequest && <Chip color="yellow">On request</Chip>}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ServiceAccommodation } from './ServiceAccommodation';
|
|
2
|
+
import { ServiceExcursion } from './ServiceExcursion';
|
|
3
|
+
import { ServiceTransfer } from './ServiceTransfer';
|
|
4
|
+
import './TimelineItem.css';
|
|
5
|
+
|
|
6
|
+
export interface TimelineItemProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function TimelineItem(props: TimelineItemProps) {
|
|
11
|
+
const { children } = props;
|
|
12
|
+
return <div className="timeline-item">{children}</div>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
TimelineItem.Transfer = ServiceTransfer;
|
|
16
|
+
TimelineItem.Accommodation = ServiceAccommodation;
|
|
17
|
+
TimelineItem.Excursion = ServiceExcursion;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
3
|
+
import TextWithIcon from '../../molecules/TextWithIcon/TextWithIcon';
|
|
4
|
+
import { ServiceAccommodationProps } from '../../molecules/TimelineItem/ServiceAccommodation';
|
|
5
|
+
import { ServiceExcursionProps } from '../../molecules/TimelineItem/ServiceExcursion';
|
|
6
|
+
import { ServiceTransferProps } from '../../molecules/TimelineItem/ServiceTransfer';
|
|
7
|
+
import TimelineItem from '../../molecules/TimelineItem/TimelineItem';
|
|
8
|
+
|
|
9
|
+
export interface TimelineServices {
|
|
10
|
+
type: 'transfer' | 'accommodation' | 'excursion';
|
|
11
|
+
data: ServiceTransferProps | ServiceAccommodationProps | ServiceExcursionProps;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TimelineProps {
|
|
15
|
+
arrival: string;
|
|
16
|
+
departure: string;
|
|
17
|
+
services: TimelineServices[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Timeline: React.FC<TimelineProps> = (props) => {
|
|
21
|
+
const { arrival, departure, services } = props;
|
|
22
|
+
return (
|
|
23
|
+
<div className="space-y-10">
|
|
24
|
+
<TextWithIcon icon="arrival" color="accent" iconSize="lg">
|
|
25
|
+
Arrival :{' '}
|
|
26
|
+
<Text variant="regular" size="lg" leading="5" color="default" as="span">
|
|
27
|
+
{arrival}
|
|
28
|
+
</Text>
|
|
29
|
+
</TextWithIcon>
|
|
30
|
+
<div className="overflow-x-auto">
|
|
31
|
+
<div className="flex gap-x-3 pb-8 2xl:pb-0">
|
|
32
|
+
{services.map((service, index) => (
|
|
33
|
+
<TimelineItem key={`tm-${index}`}>
|
|
34
|
+
{service.type === 'transfer' && (
|
|
35
|
+
<TimelineItem.Transfer {...(service.data as ServiceTransferProps)} />
|
|
36
|
+
)}
|
|
37
|
+
{service.type === 'accommodation' && (
|
|
38
|
+
<TimelineItem.Accommodation
|
|
39
|
+
{...(service.data as ServiceAccommodationProps)}
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
{service.type === 'excursion' && (
|
|
43
|
+
<TimelineItem.Excursion {...(service.data as ServiceExcursionProps)} />
|
|
44
|
+
)}
|
|
45
|
+
</TimelineItem>
|
|
46
|
+
))}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<TextWithIcon icon="departure" color="accent" iconSize="lg">
|
|
50
|
+
Departure :{' '}
|
|
51
|
+
<Text variant="regular" size="lg" leading="5" color="default" as="span">
|
|
52
|
+
{departure}
|
|
53
|
+
</Text>
|
|
54
|
+
</TextWithIcon>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
};
|