mautourco-components 0.2.11 → 0.2.13
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/Icon.d.ts +1 -1
- package/dist/components/atoms/Icon/Icon.js +1 -1
- package/dist/components/atoms/Icon/icons/AccomIcon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/AccomIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/ArrowDownOutlineIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/ArrowDownOutlineIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/ArrowRightOutlineIcon.js +1 -1
- package/dist/components/atoms/Icon/icons/BusIcon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/BusIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/Calendar2Icon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/Calendar2Icon.js +36 -0
- package/dist/components/atoms/Icon/icons/MapIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/MapIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/MicroIcon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/MicroIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/MoreVerticalIcon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/MoreVerticalIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/NightIcon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/NightIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/RowExcursion.d.ts +16 -0
- package/dist/components/atoms/Icon/icons/RowExcursion.js +28 -0
- package/dist/components/atoms/Icon/icons/StopWatchIcon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/StopWatchIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/Utensils.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/Utensils.js +36 -0
- package/dist/components/atoms/Icon/icons/WalletIcon.d.ts +12 -0
- package/dist/components/atoms/Icon/icons/WalletIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/registry.d.ts +11 -0
- package/dist/components/atoms/Icon/icons/registry.js +49 -27
- package/dist/components/atoms/Typography/Typography.d.ts +3 -1
- package/dist/components/atoms/Typography/Typography.js +3 -15
- package/dist/components/molecules/ActionDropdown/ActionDropdown.css +2119 -0
- package/dist/components/molecules/ActionDropdown/ActionDropdown.d.ts +21 -0
- package/dist/components/molecules/ActionDropdown/ActionDropdown.js +34 -0
- package/dist/components/molecules/DateDisplay/DateDisplay.d.ts +14 -0
- package/dist/components/molecules/DateDisplay/DateDisplay.js +39 -0
- package/dist/components/molecules/FromTo/FromTo.d.ts +8 -0
- package/dist/components/molecules/FromTo/FromTo.js +24 -0
- package/dist/components/molecules/TableServiceItem/DetailsCol.d.ts +12 -0
- package/dist/components/molecules/TableServiceItem/DetailsCol.js +17 -0
- package/dist/components/molecules/TableServiceItem/ItemCol.d.ts +13 -0
- package/dist/components/molecules/TableServiceItem/ItemCol.js +24 -0
- package/dist/components/molecules/TableServiceItem/RowAccommodation.d.ts +16 -0
- package/dist/components/molecules/TableServiceItem/RowAccommodation.js +37 -0
- package/dist/components/molecules/TableServiceItem/RowExcursion.d.ts +16 -0
- package/dist/components/molecules/TableServiceItem/RowExcursion.js +22 -0
- package/dist/components/molecules/TableServiceItem/RowOtherServices.d.ts +9 -0
- package/dist/components/molecules/TableServiceItem/RowOtherServices.js +34 -0
- package/dist/components/molecules/TableServiceItem/RowTransfer.d.ts +15 -0
- package/dist/components/molecules/TableServiceItem/RowTransfer.js +37 -0
- package/dist/components/molecules/TableServiceItem/index.d.ts +17 -0
- package/dist/components/molecules/TableServiceItem/index.js +15 -0
- package/dist/components/molecules/TextWithIcon/TextWithIcon.d.ts +30 -0
- package/dist/components/molecules/TextWithIcon/TextWithIcon.js +31 -0
- package/dist/components/molecules/TooltipDisplay/TooltipDisplay.d.ts +13 -0
- package/dist/components/molecules/TooltipDisplay/TooltipDisplay.js +18 -0
- package/dist/components/organisms/DateTimePicker/DateTimePicker.d.ts +2 -0
- package/dist/components/organisms/DateTimePicker/DateTimePicker.js +31 -3
- package/dist/components/organisms/RoundTrip/RoundTrip.js +1 -1
- package/dist/components/organisms/Table/Table.css +2280 -0
- package/dist/components/organisms/Table/Table.d.ts +50 -0
- package/dist/components/organisms/Table/Table.js +95 -0
- package/dist/components/organisms/Table/TableCell.d.ts +15 -0
- package/dist/components/organisms/Table/TableCell.js +16 -0
- package/dist/components/organisms/Table/columns/booking-columns.d.ts +7 -0
- package/dist/components/organisms/Table/columns/booking-columns.js +83 -0
- package/dist/components/organisms/Table/columns/detail-resume-columns.d.ts +3 -0
- package/dist/components/organisms/Table/columns/detail-resume-columns.js +178 -0
- package/dist/components/organisms/Table/columns/index.d.ts +12 -0
- package/dist/components/organisms/Table/columns/index.js +9 -0
- package/dist/components/organisms/Table/columns/quotation-columns.d.ts +7 -0
- package/dist/components/organisms/Table/columns/quotation-columns.js +91 -0
- package/dist/components/organisms/Table/constant.d.ts +6 -0
- package/dist/components/organisms/Table/constant.js +24 -0
- package/dist/components/organisms/Table/index.d.ts +2 -0
- package/dist/components/organisms/Table/index.js +2 -0
- package/dist/components/organisms/TransferLine/TransferLine.js +1 -1
- package/dist/components/ui/popover.d.ts +3 -3
- package/dist/components/ui/popover.js +5 -5
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.js +42 -0
- package/dist/index.d.ts +41 -33
- package/dist/index.js +26 -20
- package/dist/styles/components/typography.css +1 -0
- package/dist/types/table/action-dropdown-type.types.d.ts +5 -0
- package/dist/types/table/action-dropdown-type.types.js +6 -0
- package/dist/types/table/booking.types.d.ts +16 -0
- package/dist/types/table/booking.types.js +1 -0
- package/dist/types/table/detail-resume.types.d.ts +155 -0
- package/dist/types/table/detail-resume.types.js +7 -0
- package/dist/types/table/index.d.ts +3 -0
- package/dist/types/table/index.js +3 -0
- package/dist/types/table/quotation.types.d.ts +23 -0
- package/dist/types/table/quotation.types.js +1 -0
- package/package.json +6 -1
- package/src/components/atoms/Icon/Icon.tsx +2 -8
- package/src/components/atoms/Icon/icons/AccomIcon.tsx +45 -0
- package/src/components/atoms/Icon/icons/ArrowDownOutlineIcon.tsx +41 -0
- package/src/components/atoms/Icon/icons/ArrowRightOutlineIcon.tsx +2 -7
- package/src/components/atoms/Icon/icons/BusIcon.tsx +52 -0
- package/src/components/atoms/Icon/icons/Calendar2Icon.tsx +54 -0
- package/src/components/atoms/Icon/icons/MapIcon.tsx +48 -0
- package/src/components/atoms/Icon/icons/MicroIcon.tsx +45 -0
- package/src/components/atoms/Icon/icons/MoreVerticalIcon.tsx +53 -0
- package/src/components/atoms/Icon/icons/NightIcon.tsx +45 -0
- package/src/components/atoms/Icon/icons/RowExcursion.tsx +54 -0
- package/src/components/atoms/Icon/icons/StopWatchIcon.tsx +45 -0
- package/src/components/atoms/Icon/icons/Utensils.tsx +45 -0
- package/src/components/atoms/Icon/icons/WalletIcon.tsx +45 -0
- package/src/components/atoms/Icon/icons/registry.tsx +50 -28
- package/src/components/atoms/Typography/Typography.tsx +22 -30
- package/src/components/molecules/ActionDropdown/ActionDropdown.css +23 -0
- package/src/components/molecules/ActionDropdown/ActionDropdown.tsx +53 -0
- package/src/components/molecules/DateDisplay/DateDisplay.tsx +47 -0
- package/src/components/molecules/FromTo/FromTo.tsx +31 -0
- package/src/components/molecules/TableServiceItem/DetailsCol.tsx +25 -0
- package/src/components/molecules/TableServiceItem/ItemCol.tsx +68 -0
- package/src/components/molecules/TableServiceItem/RowAccommodation.tsx +56 -0
- package/src/components/molecules/TableServiceItem/RowExcursion.tsx +40 -0
- package/src/components/molecules/TableServiceItem/RowOtherServices.tsx +50 -0
- package/src/components/molecules/TableServiceItem/RowTransfer.tsx +60 -0
- package/src/components/molecules/TableServiceItem/index.ts +24 -0
- package/src/components/molecules/TextWithIcon/TextWithIcon.tsx +62 -0
- package/src/components/molecules/TooltipDisplay/TooltipDisplay.tsx +32 -0
- package/src/components/organisms/CarBookingCard/index.ts +2 -0
- package/src/components/organisms/DateTimePicker/DateTimePicker.tsx +33 -2
- package/src/components/organisms/RoundTrip/RoundTrip.tsx +1 -0
- package/src/components/organisms/SearchBarTransfer/index.ts +1 -0
- package/src/components/organisms/Table/Table.css +185 -0
- package/src/components/organisms/Table/Table.tsx +273 -0
- package/src/components/organisms/Table/TableCell.tsx +40 -0
- package/src/components/organisms/Table/columns/booking-columns.tsx +118 -0
- package/src/components/organisms/Table/columns/detail-resume-columns.tsx +226 -0
- package/src/components/organisms/Table/columns/index.ts +11 -0
- package/src/components/organisms/Table/columns/quotation-columns.tsx +150 -0
- package/src/components/organisms/Table/constant.ts +31 -0
- package/src/components/organisms/Table/index.ts +2 -0
- package/src/components/organisms/TransferLine/TransferLine.tsx +1 -0
- package/src/components/ui/popover.tsx +10 -10
- package/src/components/ui/tooltip.tsx +45 -0
- package/src/styles/components/typography.css +4 -0
|
@@ -1,41 +1,52 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import AccomIcon from './AccomIcon';
|
|
4
|
+
import ArrivalIcon from './ArrivalIcon';
|
|
5
|
+
import ArrowDownOutlineIcon from './ArrowDownOutlineIcon';
|
|
6
|
+
import ArrowRightOutlineIcon from './ArrowRightOutlineIcon';
|
|
7
|
+
import Building2OutlineIcon from './Building2OutlineIcon';
|
|
8
|
+
import BuildingIcon from './BuildingIcon';
|
|
9
|
+
import BusIcon from './BusIcon';
|
|
10
|
+
import Calendar2Icon from './Calendar2Icon';
|
|
11
|
+
import CalendarIcon from './CalendarIcon';
|
|
12
|
+
import CalendarOutlineIcon from './CalendarOutlineIcon';
|
|
13
|
+
import CalendarRangeOutlineIcon from './CalendarRangeOutlineIcon';
|
|
14
|
+
import CarIcon from './CarIcon';
|
|
4
15
|
import Check from './Check';
|
|
16
|
+
import CheckCircleIcon from './CheckCircleIcon';
|
|
17
|
+
import Chevron from './Chevron';
|
|
5
18
|
import Close from './Close';
|
|
6
|
-
import Search from './Search';
|
|
7
|
-
import User from './User';
|
|
8
|
-
import UserIcon from './UserIcon';
|
|
9
|
-
import CalendarIcon from './CalendarIcon';
|
|
10
|
-
import ArrivalIcon from './ArrivalIcon';
|
|
11
|
-
import DepartureIcon from './DepartureIcon';
|
|
12
|
-
import MapPinIcon from './MapPinIcon';
|
|
13
19
|
import DeleteIcon from './DeleteIcon';
|
|
20
|
+
import DepartureIcon from './DepartureIcon';
|
|
14
21
|
import EyeIcon from './EyeIcon';
|
|
15
|
-
import InfoIcon from './InfoIcon';
|
|
16
|
-
import CheckCircleIcon from './CheckCircleIcon';
|
|
17
|
-
import StrollerIcon from './StrollerIcon';
|
|
18
|
-
import CarIcon from './CarIcon';
|
|
19
|
-
import MoreIcon from './MoreIcon';
|
|
20
|
-
import Settings from './Settings';
|
|
21
|
-
import MenuIcon from './MenuIcon';
|
|
22
|
-
import MautourcoLogo from './MautoucoLogo';
|
|
23
|
-
import YouTubeIcon from './Youtube';
|
|
24
22
|
import FacebookIcon from './FacebookIcon';
|
|
25
|
-
import
|
|
23
|
+
import HomeIcon from './HomeIcon';
|
|
24
|
+
import InfoIcon from './InfoIcon';
|
|
26
25
|
import LinkedInIcon from './LinkedInIcon';
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import Building2OutlineIcon from './Building2OutlineIcon';
|
|
33
|
-
import PlusIcon from './PlusIcon';
|
|
26
|
+
import MapIcon from './MapIcon';
|
|
27
|
+
import MapPinIcon from './MapPinIcon';
|
|
28
|
+
import MautourcoLogo from './MautoucoLogo';
|
|
29
|
+
import MenuIcon from './MenuIcon';
|
|
30
|
+
import MicroIcon from './MicroIcon';
|
|
34
31
|
import MinusIcon from './MinusIcon';
|
|
35
|
-
import
|
|
32
|
+
import MoreIcon from './MoreIcon';
|
|
33
|
+
import MoreVerticalIcon from './MoreVerticalIcon';
|
|
34
|
+
import NightIcon from './NightIcon';
|
|
36
35
|
import PlaneIcon from './PlaneIcon';
|
|
36
|
+
import PlaneLandingOutlineIcon from './PlaneLandingOutlineIcon';
|
|
37
|
+
import PlaneTakeoffOutlineIcon from './PlaneTakeoffOutlineIcon';
|
|
38
|
+
import PlusIcon from './PlusIcon';
|
|
39
|
+
import Search from './Search';
|
|
40
|
+
import Settings from './Settings';
|
|
37
41
|
import ShipIcon from './ShipIcon';
|
|
38
|
-
import
|
|
42
|
+
import StopWatchIcon from './StopWatchIcon';
|
|
43
|
+
import StrollerIcon from './StrollerIcon';
|
|
44
|
+
import TwitterIcon from './TwitterIcon';
|
|
45
|
+
import User from './User';
|
|
46
|
+
import UserIcon from './UserIcon';
|
|
47
|
+
import UtensilsIcon from './Utensils';
|
|
48
|
+
import WalletIcon from './WalletIcon';
|
|
49
|
+
import YouTubeIcon from './Youtube';
|
|
39
50
|
|
|
40
51
|
export type IconBaseProps = {
|
|
41
52
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -74,6 +85,7 @@ export const ICONS = {
|
|
|
74
85
|
'calendar-outline': CalendarOutlineIcon as unknown as IconComponent,
|
|
75
86
|
'calendar-range-outline': CalendarRangeOutlineIcon as unknown as IconComponent,
|
|
76
87
|
'arrow-right-outline': ArrowRightOutlineIcon as unknown as IconComponent,
|
|
88
|
+
'arrow-down-outline': ArrowDownOutlineIcon as unknown as IconComponent,
|
|
77
89
|
'plane-takeoff-outline': PlaneTakeoffOutlineIcon as unknown as IconComponent,
|
|
78
90
|
'plane-landing-outline': PlaneLandingOutlineIcon as unknown as IconComponent,
|
|
79
91
|
'building-2-outline': Building2OutlineIcon as unknown as IconComponent,
|
|
@@ -100,6 +112,16 @@ export const ICONS = {
|
|
|
100
112
|
plane: PlaneIcon as unknown as IconComponent,
|
|
101
113
|
ship: ShipIcon as unknown as IconComponent,
|
|
102
114
|
building: BuildingIcon as unknown as IconComponent,
|
|
115
|
+
calendar2: Calendar2Icon as unknown as IconComponent,
|
|
116
|
+
'more-vertical': MoreVerticalIcon as unknown as IconComponent,
|
|
117
|
+
accom: AccomIcon as unknown as IconComponent,
|
|
118
|
+
night: NightIcon as unknown as IconComponent,
|
|
119
|
+
utensils: UtensilsIcon as unknown as IconComponent,
|
|
120
|
+
micro: MicroIcon as unknown as IconComponent,
|
|
121
|
+
stopwatch: StopWatchIcon as unknown as IconComponent,
|
|
122
|
+
bus: BusIcon as unknown as IconComponent,
|
|
123
|
+
map: MapIcon as unknown as IconComponent,
|
|
124
|
+
wallet: WalletIcon as unknown as IconComponent,
|
|
103
125
|
} as const satisfies Record<string, IconComponent>;
|
|
104
126
|
|
|
105
|
-
export type IconName = keyof typeof ICONS;
|
|
127
|
+
export type IconName = keyof typeof ICONS;
|
|
@@ -5,19 +5,23 @@ type BodySizeInput = BodyTokenSize | 'base' | 'xl';
|
|
|
5
5
|
type Variant = 'light' | 'regular' | 'medium' | 'bold' | 'black';
|
|
6
6
|
type Leading = 'none' | '4' | '5' | '6' | '7';
|
|
7
7
|
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
8
|
-
type TextColor =
|
|
9
|
-
| 'default'
|
|
10
|
-
| 'accent'
|
|
11
|
-
| 'subtle'
|
|
12
|
-
| 'light'
|
|
13
|
-
| 'brand'
|
|
8
|
+
export type TextColor =
|
|
9
|
+
| 'default'
|
|
10
|
+
| 'accent'
|
|
11
|
+
| 'subtle'
|
|
12
|
+
| 'light'
|
|
13
|
+
| 'brand'
|
|
14
14
|
| 'inverted'
|
|
15
15
|
| 'state-default'
|
|
16
16
|
| 'state-hover'
|
|
17
17
|
| 'state-filled'
|
|
18
18
|
| 'state-disabled'
|
|
19
19
|
| 'state-error'
|
|
20
|
-
| 'state-success'
|
|
20
|
+
| 'state-success'
|
|
21
|
+
| 'yellow';
|
|
22
|
+
|
|
23
|
+
export type TextVariant = Variant;
|
|
24
|
+
export type TextLeading = Leading;
|
|
21
25
|
|
|
22
26
|
interface BaseProps {
|
|
23
27
|
variant?: Variant;
|
|
@@ -71,28 +75,28 @@ const defaultBodyLeading: Record<BodyTokenSize, Leading> = {
|
|
|
71
75
|
lg: '7',
|
|
72
76
|
};
|
|
73
77
|
|
|
74
|
-
const tokenBodyLeadings: Record<
|
|
78
|
+
const tokenBodyLeadings: Record<
|
|
79
|
+
BodyTokenSize,
|
|
80
|
+
Array<'leading-none' | 'leading-4' | 'leading-5' | 'leading-6' | 'leading-7'>
|
|
81
|
+
> = {
|
|
75
82
|
xs: ['leading-5', 'leading-4', 'leading-none'],
|
|
76
83
|
sm: ['leading-6', 'leading-5', 'leading-none'],
|
|
77
84
|
md: ['leading-6', 'leading-7', 'leading-none'],
|
|
78
85
|
lg: ['leading-7', 'leading-6', 'leading-none'],
|
|
79
86
|
};
|
|
80
87
|
|
|
81
|
-
const mapLeadingToToken = (
|
|
88
|
+
const mapLeadingToToken = (
|
|
89
|
+
leading: Leading
|
|
90
|
+
): 'leading-none' | 'leading-4' | 'leading-5' | 'leading-6' | 'leading-7' => {
|
|
82
91
|
if (leading === 'none') return 'leading-none';
|
|
83
92
|
return `leading-${leading}` as 'leading-4' | 'leading-5' | 'leading-6' | 'leading-7';
|
|
84
93
|
};
|
|
85
94
|
|
|
86
|
-
const getBodyClass = (
|
|
87
|
-
size: BodyTokenSize,
|
|
88
|
-
leading?: Leading
|
|
89
|
-
): { className: string; lineHeightHandled: boolean } => {
|
|
95
|
+
const getBodyClass = (size: BodyTokenSize, leading?: Leading): { className: string; lineHeightHandled: boolean } => {
|
|
90
96
|
const availableLeadings = tokenBodyLeadings[size];
|
|
91
97
|
const desiredLeading = leading ? mapLeadingToToken(leading) : mapLeadingToToken(defaultBodyLeading[size]);
|
|
92
98
|
|
|
93
|
-
const resolvedLeading = availableLeadings.includes(desiredLeading)
|
|
94
|
-
? desiredLeading
|
|
95
|
-
: availableLeadings[0];
|
|
99
|
+
const resolvedLeading = availableLeadings.includes(desiredLeading) ? desiredLeading : availableLeadings[0];
|
|
96
100
|
|
|
97
101
|
return {
|
|
98
102
|
className: `body-${size}-${resolvedLeading}`,
|
|
@@ -112,7 +116,6 @@ const getColorStyle = (color?: TextColor): React.CSSProperties => {
|
|
|
112
116
|
};
|
|
113
117
|
};
|
|
114
118
|
|
|
115
|
-
|
|
116
119
|
export const Heading: React.FC<HeadingProps> = ({
|
|
117
120
|
level = 2,
|
|
118
121
|
variant = 'bold',
|
|
@@ -127,12 +130,7 @@ export const Heading: React.FC<HeadingProps> = ({
|
|
|
127
130
|
const baseClass = headingTokenClass[level] ?? headingTokenClass[2];
|
|
128
131
|
const variantClass = buildVariantClass(baseClass, variant);
|
|
129
132
|
|
|
130
|
-
const classes = [
|
|
131
|
-
baseClass,
|
|
132
|
-
variantClass,
|
|
133
|
-
leading ? leadingFallback[leading] : '',
|
|
134
|
-
className,
|
|
135
|
-
]
|
|
133
|
+
const classes = [baseClass, variantClass, leading ? leadingFallback[leading] : '', className]
|
|
136
134
|
.filter(Boolean)
|
|
137
135
|
.join(' ');
|
|
138
136
|
|
|
@@ -145,7 +143,6 @@ export const Heading: React.FC<HeadingProps> = ({
|
|
|
145
143
|
);
|
|
146
144
|
};
|
|
147
145
|
|
|
148
|
-
|
|
149
146
|
export const Text: React.FC<TextProps> = ({
|
|
150
147
|
size = 'md',
|
|
151
148
|
variant = 'regular',
|
|
@@ -161,12 +158,7 @@ export const Text: React.FC<TextProps> = ({
|
|
|
161
158
|
const { className: baseClass, lineHeightHandled } = getBodyClass(normalizedSize, leading);
|
|
162
159
|
const variantClass = buildVariantClass(baseClass, variant);
|
|
163
160
|
|
|
164
|
-
const classes = [
|
|
165
|
-
baseClass,
|
|
166
|
-
variantClass,
|
|
167
|
-
leading && !lineHeightHandled ? leadingFallback[leading] : '',
|
|
168
|
-
className,
|
|
169
|
-
]
|
|
161
|
+
const classes = [baseClass, variantClass, leading && !lineHeightHandled ? leadingFallback[leading] : '', className]
|
|
170
162
|
.filter(Boolean)
|
|
171
163
|
.join(' ');
|
|
172
164
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.action-dropdown {
|
|
2
|
+
@apply relative;
|
|
3
|
+
width: 153px;
|
|
4
|
+
background-color: #fff;
|
|
5
|
+
padding: var(--spacing-padding-px-4);
|
|
6
|
+
border-radius: var(--border-radius-rounded-xl);
|
|
7
|
+
button {
|
|
8
|
+
@apply flex items-center w-full;
|
|
9
|
+
@apply transition-all duration-200;
|
|
10
|
+
height: 36px;
|
|
11
|
+
border-radius: var(--border-radius-rounded-md);
|
|
12
|
+
padding-inline: var(--spacing-padding-px-2);
|
|
13
|
+
&:hover {
|
|
14
|
+
background-color: var(--color-neutral-100);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.action-dropdown-trigger {
|
|
20
|
+
@apply w-8 h-8 flex items-center justify-center;
|
|
21
|
+
border-radius: var(--border-radius-rounded-lg);
|
|
22
|
+
background-color: var(--color-neutral-100);
|
|
23
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import Icon from '../../atoms/Icon/Icon';
|
|
3
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover';
|
|
5
|
+
import './ActionDropdown.css';
|
|
6
|
+
|
|
7
|
+
export interface ActionDropdownItem {
|
|
8
|
+
/** Label for the action dropdown item */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Callback function to be called when the action dropdown item is clicked */
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ActionDropdownProps {
|
|
15
|
+
/** Data for the action dropdown */
|
|
16
|
+
data: ActionDropdownItem[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A dropdown component that displays a list of actions triggered by a more icon button. Uses a Popover for the dropdown menu.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <ActionDropdown data={data} />
|
|
24
|
+
* @param ActionDropdownProps
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export const ActionDropdown: React.FC<ActionDropdownProps> = ({ data }) => {
|
|
28
|
+
const [open, setOpen] = useState(false);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
32
|
+
<PopoverTrigger>
|
|
33
|
+
<button className="action-dropdown-trigger">
|
|
34
|
+
<Icon name="more-vertical" />
|
|
35
|
+
</button>
|
|
36
|
+
</PopoverTrigger>
|
|
37
|
+
<PopoverContent className="action-dropdown" align="end">
|
|
38
|
+
{data.map((item, index) => (
|
|
39
|
+
<button
|
|
40
|
+
key={`ad-${index}`}
|
|
41
|
+
onClick={() => {
|
|
42
|
+
setOpen(false);
|
|
43
|
+
item.onClick?.();
|
|
44
|
+
}}>
|
|
45
|
+
<Text variant="medium" size="sm" as="span">
|
|
46
|
+
{item.label}
|
|
47
|
+
</Text>
|
|
48
|
+
</button>
|
|
49
|
+
))}
|
|
50
|
+
</PopoverContent>
|
|
51
|
+
</Popover>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { format, isValid } from 'date-fns';
|
|
2
|
+
import React, { Fragment, useMemo } from 'react';
|
|
3
|
+
import Icon from '../../atoms/Icon/Icon';
|
|
4
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
5
|
+
|
|
6
|
+
export interface DateDisplayProps {
|
|
7
|
+
/** Dates to display */
|
|
8
|
+
date: string[] | Date[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A component for displaying a list of dates in a readable format.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <DateDisplay date={['2025-01-01', '2025-01-02']} />
|
|
16
|
+
* @param DateDisplayProps
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export const DateDisplay: React.FC<DateDisplayProps> = ({ date }) => {
|
|
20
|
+
const formattedDate = useMemo(() => {
|
|
21
|
+
return date.map((d) => {
|
|
22
|
+
const dateObj = new Date(d);
|
|
23
|
+
// Check if the date is valid then format it to dd/MM/yyyy format
|
|
24
|
+
if (isValid(dateObj)) {
|
|
25
|
+
return format(dateObj, 'dd/MM/yyyy');
|
|
26
|
+
}
|
|
27
|
+
// If the date is not valid, return the original date
|
|
28
|
+
return d;
|
|
29
|
+
}) as string[];
|
|
30
|
+
}, [date]);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className="flex items-center gap-x-3">
|
|
34
|
+
{formattedDate.map((date, index) => (
|
|
35
|
+
<Fragment key={`dd-${index}`}>
|
|
36
|
+
<span className="flex items-center gap-x-2">
|
|
37
|
+
<Icon name="calendar2" size="sm" />
|
|
38
|
+
<Text variant="medium" size="sm">
|
|
39
|
+
{date}
|
|
40
|
+
</Text>
|
|
41
|
+
</span>
|
|
42
|
+
{formattedDate.length > 1 && index === 0 && <Icon name="arrow-right-outline" size="sm" />}
|
|
43
|
+
</Fragment>
|
|
44
|
+
))}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Icon from '../../atoms/Icon/Icon';
|
|
2
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
3
|
+
|
|
4
|
+
export interface FromToProps {
|
|
5
|
+
from?: string;
|
|
6
|
+
to?: string;
|
|
7
|
+
transferType?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const FromTo: React.FC<Omit<FromToProps, 'transferType'>> = (props) => {
|
|
11
|
+
const { from, to } = props;
|
|
12
|
+
|
|
13
|
+
const getTransferLocationName = (location?: string) => {
|
|
14
|
+
if (!location) return '';
|
|
15
|
+
return location.toLowerCase() === 'airport' ? 'Plaisance Airport' : location;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="grid gap-y-1">
|
|
20
|
+
<Text variant="regular" size="sm" leading="5">
|
|
21
|
+
{getTransferLocationName(from)}
|
|
22
|
+
</Text>
|
|
23
|
+
<Icon name="arrow-down-outline" size="sm" />
|
|
24
|
+
<Text variant="regular" size="sm" leading="5">
|
|
25
|
+
{getTransferLocationName(to)}
|
|
26
|
+
</Text>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default FromTo;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconName } from '../../atoms/Icon/Icon';
|
|
3
|
+
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
4
|
+
|
|
5
|
+
interface DetailsColData {
|
|
6
|
+
icon: IconName;
|
|
7
|
+
value: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface DetailsColProps {
|
|
11
|
+
data: DetailsColData[];
|
|
12
|
+
index?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const DetailsCol: React.FC<DetailsColProps> = (props) => {
|
|
16
|
+
const { data } = props;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="grid gap-y-1">
|
|
20
|
+
{data.map((item) => (
|
|
21
|
+
<TextWithIcon icon={item.icon}>{item.value}</TextWithIcon>
|
|
22
|
+
))}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Text } from '@/src/components/atoms/Typography/Typography';
|
|
2
|
+
import { cn } from '@/src/lib/utils';
|
|
3
|
+
import Chip from '../../atoms/Chip/Chip';
|
|
4
|
+
import { IconName } from '../../atoms/Icon/Icon';
|
|
5
|
+
import TextWithIcon from '../TextWithIcon/TextWithIcon';
|
|
6
|
+
|
|
7
|
+
export interface ItemColProps {
|
|
8
|
+
serviceType: 'Accommodation' | 'Excursion' | 'Transfer' | 'Other Services';
|
|
9
|
+
serviceName?: string;
|
|
10
|
+
extraTitle?: React.ReactNode;
|
|
11
|
+
offers?: any[];
|
|
12
|
+
status?: string;
|
|
13
|
+
iconName?: IconName;
|
|
14
|
+
showName?: boolean;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const ItemCol: React.FC<ItemColProps> = (props) => {
|
|
19
|
+
const {
|
|
20
|
+
serviceType,
|
|
21
|
+
serviceName,
|
|
22
|
+
offers,
|
|
23
|
+
status,
|
|
24
|
+
iconName = 'accom',
|
|
25
|
+
showName = true,
|
|
26
|
+
extraTitle,
|
|
27
|
+
children,
|
|
28
|
+
} = props;
|
|
29
|
+
|
|
30
|
+
const isOnRequest = status?.toLowerCase() === 'on request';
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={cn('grid', offers?.length && 'gap-y-3')}>
|
|
34
|
+
<div>
|
|
35
|
+
{serviceName && (
|
|
36
|
+
<div className="grid gap-y-1">
|
|
37
|
+
<div className="flex items-center gap-x-2">
|
|
38
|
+
<TextWithIcon icon={iconName} color={isOnRequest ? 'yellow' : 'accent'}>
|
|
39
|
+
{serviceType}
|
|
40
|
+
</TextWithIcon>
|
|
41
|
+
{isOnRequest && <Chip color="yellow">{status}</Chip>}
|
|
42
|
+
{extraTitle}
|
|
43
|
+
</div>
|
|
44
|
+
<Text variant="bold" size="sm">
|
|
45
|
+
{showName && serviceName}
|
|
46
|
+
</Text>
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
{children}
|
|
50
|
+
</div>
|
|
51
|
+
{offers && offers.length > 0 && (
|
|
52
|
+
<div>
|
|
53
|
+
<Text variant="bold" size="sm" leading="5">
|
|
54
|
+
Applicable offers:
|
|
55
|
+
</Text>
|
|
56
|
+
<Text variant="regular" size="sm" leading="5">
|
|
57
|
+
{offers.map((o) => {
|
|
58
|
+
const offerValue =
|
|
59
|
+
o.OfferType === 'GIFT' ? o.OfferName : `${o.OfferValue}% offers applied`;
|
|
60
|
+
|
|
61
|
+
return <span>{offerValue}</span>;
|
|
62
|
+
})}
|
|
63
|
+
</Text>
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { differenceInDays } from 'date-fns';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { DetailsCol as DetailsColComponent } from './DetailsCol';
|
|
4
|
+
import { ItemCol, ItemColProps } from './ItemCol';
|
|
5
|
+
|
|
6
|
+
export interface RowAccommodationProps {
|
|
7
|
+
data: {
|
|
8
|
+
RoomName?: string;
|
|
9
|
+
Dates?: string[];
|
|
10
|
+
ClientCategory?: string;
|
|
11
|
+
MealPlan?: string;
|
|
12
|
+
};
|
|
13
|
+
index?: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const clientType: Record<string, string> = {
|
|
17
|
+
standard: 'STD',
|
|
18
|
+
honeymooners: 'HMN',
|
|
19
|
+
vip: 'VIP',
|
|
20
|
+
vvip: 'VVIP',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export function RowAccommodation() {
|
|
24
|
+
return <></>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const DetailsCol: React.FC<RowAccommodationProps> = (props) => {
|
|
28
|
+
const { data, index = 0 } = props;
|
|
29
|
+
|
|
30
|
+
const stay = useMemo(() => {
|
|
31
|
+
if (data.Dates?.length) {
|
|
32
|
+
return differenceInDays(data.Dates[1], data.Dates[0]);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return 0;
|
|
36
|
+
}, [data]);
|
|
37
|
+
return (
|
|
38
|
+
<DetailsColComponent
|
|
39
|
+
data={[
|
|
40
|
+
{ icon: 'calendar2', value: `Room ${index + 1} : ${data.RoomName}` },
|
|
41
|
+
{ icon: 'night', value: `${stay} Nights` },
|
|
42
|
+
{ icon: 'user', value: `Client type : ${clientType[data.ClientCategory?.toLowerCase() as string]}` },
|
|
43
|
+
{ icon: 'utensils', value: `Meal plan : ${data.MealPlan}` },
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const FirstCol: React.FC<Omit<ItemColProps, 'serviceType'>> = (props) => {
|
|
50
|
+
const { serviceName, offers, status } = props;
|
|
51
|
+
|
|
52
|
+
return <ItemCol serviceType="Accommodation" serviceName={serviceName} offers={offers} status={status} />;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
RowAccommodation.FirstCol = FirstCol;
|
|
56
|
+
RowAccommodation.DetailsCol = DetailsCol;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DetailsCol as DetailsColComponent } from './DetailsCol';
|
|
3
|
+
import { ItemCol, ItemColProps } from './ItemCol';
|
|
4
|
+
|
|
5
|
+
export interface RowExcursionProps {
|
|
6
|
+
data: {
|
|
7
|
+
languages?: string[];
|
|
8
|
+
duration?: string;
|
|
9
|
+
accessibility?: string;
|
|
10
|
+
transferType?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function RowExcursion() {
|
|
15
|
+
return <></>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const DetailsCol: React.FC<RowExcursionProps> = (props) => {
|
|
19
|
+
const { data } = props;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<DetailsColComponent
|
|
23
|
+
data={[
|
|
24
|
+
{ icon: 'micro', value: `Languages: ${data.languages?.join(' and ')}` },
|
|
25
|
+
{ icon: 'stopwatch', value: `Duration: ${data.duration}` },
|
|
26
|
+
{ icon: 'user', value: `Difficulty: ${data.accessibility}` },
|
|
27
|
+
{ icon: 'bus', value: `Type: ${data.transferType}` },
|
|
28
|
+
]}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const FirstCol: React.FC<Omit<ItemColProps, 'serviceType' | 'status'>> = (props) => {
|
|
34
|
+
const { serviceName, offers } = props;
|
|
35
|
+
|
|
36
|
+
return <ItemCol serviceType="Excursion" serviceName={serviceName} offers={offers} iconName="map" />;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
RowExcursion.FirstCol = FirstCol;
|
|
40
|
+
RowExcursion.DetailsCol = DetailsCol;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import '@/src/index.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '../../atoms/Icon/Icon';
|
|
4
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
5
|
+
import { TooltipDisplay } from '../TooltipDisplay/TooltipDisplay';
|
|
6
|
+
import { DetailsCol as DetailsColComponent } from './DetailsCol';
|
|
7
|
+
import { ItemCol, ItemColProps } from './ItemCol';
|
|
8
|
+
|
|
9
|
+
export function RowOtherServices() {
|
|
10
|
+
return <></>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const DetailsCol = () => {
|
|
14
|
+
return (
|
|
15
|
+
<DetailsColComponent
|
|
16
|
+
data={[
|
|
17
|
+
{
|
|
18
|
+
icon: 'wallet',
|
|
19
|
+
value: (
|
|
20
|
+
<Text
|
|
21
|
+
variant="medium"
|
|
22
|
+
size="sm"
|
|
23
|
+
leading="5"
|
|
24
|
+
as="div"
|
|
25
|
+
className="flex items-center gap-x-2">
|
|
26
|
+
Handling Fee
|
|
27
|
+
<TooltipDisplay content="Handling fee varies and is determined by the final number of people during booking. ">
|
|
28
|
+
<Icon name="info" size="sm" />
|
|
29
|
+
</TooltipDisplay>
|
|
30
|
+
</Text>
|
|
31
|
+
),
|
|
32
|
+
},
|
|
33
|
+
]}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const FirstCol: React.FC<Omit<ItemColProps, 'serviceType' | 'status'>> = (props) => {
|
|
39
|
+
return (
|
|
40
|
+
<ItemCol
|
|
41
|
+
serviceType="Other Services"
|
|
42
|
+
iconName="more"
|
|
43
|
+
serviceName="Handling Fee"
|
|
44
|
+
showName={false}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
RowOtherServices.FirstCol = FirstCol;
|
|
50
|
+
RowOtherServices.DetailsCol = DetailsCol;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
3
|
+
import FromTo, { FromToProps } from '../FromTo/FromTo';
|
|
4
|
+
import { DetailsCol as DetailsColComponent } from './DetailsCol';
|
|
5
|
+
import { ItemCol, ItemColProps } from './ItemCol';
|
|
6
|
+
|
|
7
|
+
export interface RowTransferProps {
|
|
8
|
+
data: {
|
|
9
|
+
carType?: string;
|
|
10
|
+
clientType?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const transferTypeMap: Record<string, string> = {
|
|
15
|
+
ARV: 'Arrival',
|
|
16
|
+
DEP: 'Departure',
|
|
17
|
+
INH: 'Inter-Hotel',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function RowTransfer() {
|
|
21
|
+
return <></>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const DetailsCol: React.FC<RowTransferProps> = (props) => {
|
|
25
|
+
const { data } = props;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<DetailsColComponent
|
|
29
|
+
data={[
|
|
30
|
+
{ icon: 'car', value: data.carType },
|
|
31
|
+
{ icon: 'user', value: `Client type: ${data.clientType}` },
|
|
32
|
+
]}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const FirstCol: React.FC<Omit<ItemColProps, 'serviceType' | 'status'> & FromToProps> = (
|
|
38
|
+
props
|
|
39
|
+
) => {
|
|
40
|
+
const { serviceName, offers, transferType, from, to } = props;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<ItemCol
|
|
44
|
+
serviceType="Transfer"
|
|
45
|
+
serviceName={serviceName}
|
|
46
|
+
offers={offers}
|
|
47
|
+
iconName="car"
|
|
48
|
+
showName={false}
|
|
49
|
+
extraTitle={
|
|
50
|
+
<Text variant="bold" size="sm" className="italic">
|
|
51
|
+
{transferTypeMap[transferType as string]}
|
|
52
|
+
</Text>
|
|
53
|
+
}>
|
|
54
|
+
<FromTo from={from} to={to} />
|
|
55
|
+
</ItemCol>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
RowTransfer.FirstCol = FirstCol;
|
|
60
|
+
RowTransfer.DetailsCol = DetailsCol;
|