mautourco-components 0.2.8 → 0.2.10
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/Button/Button.css +28 -0
- package/dist/components/atoms/Button/Button.d.ts +1 -1
- package/dist/components/atoms/Button/Button.js +2 -1
- package/dist/components/atoms/Chip/Chip.css +2238 -0
- package/dist/components/atoms/Chip/Chip.d.ts +27 -0
- package/dist/components/atoms/Chip/Chip.js +37 -0
- package/dist/components/atoms/Divider/Divider.css +2135 -0
- package/dist/components/atoms/Divider/Divider.d.ts +14 -0
- package/dist/components/atoms/Divider/Divider.js +16 -0
- package/dist/components/atoms/Icon/Icon.d.ts +5 -3
- package/dist/components/atoms/Icon/Icon.js +4 -119
- 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.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/ArrowRightOutlineIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/Building2OutlineIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/Building2OutlineIcon.js +36 -0
- 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/CalendarRangeOutlineIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/CalendarRangeOutlineIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/Chevron.d.ts +2 -0
- package/dist/components/atoms/Icon/icons/Chevron.js +10 -10
- 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/PlaneLandingOutlineIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/PlaneLandingOutlineIcon.js +36 -0
- package/dist/components/atoms/Icon/icons/PlaneTakeoffOutlineIcon.d.ts +8 -0
- package/dist/components/atoms/Icon/icons/PlaneTakeoffOutlineIcon.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 +66 -0
- package/dist/components/atoms/Icon/icons/registry.js +121 -0
- 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/FeatureRow/FeatureRow.css +2130 -0
- package/dist/components/molecules/FeatureRow/FeatureRow.d.ts +17 -0
- package/dist/components/molecules/FeatureRow/FeatureRow.js +22 -0
- package/dist/components/molecules/FromTo/FromTo.d.ts +8 -0
- package/dist/components/molecules/FromTo/FromTo.js +24 -0
- package/dist/components/molecules/LocationDropdown/LocationDropdown.d.ts +1 -0
- package/dist/components/molecules/LocationDropdown/LocationDropdown.js +17 -4
- package/dist/components/molecules/Pagination/Pagination.css +2168 -0
- package/dist/components/molecules/Pagination/Pagination.d.ts +16 -0
- package/dist/components/molecules/Pagination/Pagination.js +90 -0
- package/dist/components/molecules/SectionTitle/SectionTitle.css +2112 -0
- package/dist/components/molecules/SectionTitle/SectionTitle.d.ts +16 -0
- package/dist/components/molecules/SectionTitle/SectionTitle.js +21 -0
- package/dist/components/molecules/ServiceSelector/ServiceSelector.d.ts +22 -0
- package/dist/components/molecules/ServiceSelector/ServiceSelector.js +85 -0
- package/dist/components/molecules/ServiceSelector/index.d.ts +2 -0
- package/dist/components/molecules/ServiceSelector/index.js +1 -0
- package/dist/components/molecules/Stepper/Stepper.css +2144 -0
- package/dist/components/molecules/Stepper/Stepper.d.ts +18 -0
- package/dist/components/molecules/Stepper/Stepper.js +33 -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/CarBookingCard/CarBookingCard.css +2313 -0
- package/dist/components/organisms/CarBookingCard/CarBookingCard.d.ts +51 -0
- package/dist/components/organisms/CarBookingCard/CarBookingCard.js +39 -0
- package/dist/components/organisms/CarBookingCard/index.d.ts +2 -0
- package/dist/components/organisms/CarBookingCard/index.js +1 -0
- 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/ui/button.d.ts +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 +47 -25
- package/dist/index.js +30 -16
- package/dist/styles/components/molecule/location-dropdown.css +38 -0
- package/dist/styles/components/molecule/service-selector.css +2310 -0
- 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/Button/Button.css +28 -0
- package/src/components/atoms/Button/Button.tsx +3 -2
- package/src/components/atoms/Chip/Chip.css +161 -0
- package/src/components/atoms/Chip/Chip.tsx +79 -0
- package/src/components/atoms/Divider/Divider.css +58 -0
- package/src/components/atoms/Divider/Divider.tsx +36 -0
- package/src/components/atoms/Icon/Icon.tsx +8 -153
- 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 +50 -0
- package/src/components/atoms/Icon/icons/Building2OutlineIcon.tsx +52 -0
- 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/CalendarRangeOutlineIcon.tsx +55 -0
- package/src/components/atoms/Icon/icons/Chevron.tsx +30 -11
- 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/PlaneLandingOutlineIcon.tsx +56 -0
- package/src/components/atoms/Icon/icons/PlaneTakeoffOutlineIcon.tsx +52 -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 +127 -0
- 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/FeatureRow/FeatureRow.css +53 -0
- package/src/components/molecules/FeatureRow/FeatureRow.tsx +46 -0
- package/src/components/molecules/FromTo/FromTo.tsx +31 -0
- package/src/components/molecules/LocationDropdown/LocationDropdown.tsx +67 -38
- package/src/components/molecules/Pagination/Pagination.css +90 -0
- package/src/components/molecules/Pagination/Pagination.tsx +149 -0
- package/src/components/molecules/SectionTitle/SectionTitle.css +35 -0
- package/src/components/molecules/SectionTitle/SectionTitle.tsx +43 -0
- package/src/components/molecules/ServiceSelector/ServiceSelector.tsx +179 -0
- package/src/components/molecules/ServiceSelector/index.ts +3 -0
- package/src/components/molecules/Stepper/Stepper.css +67 -0
- package/src/components/molecules/Stepper/Stepper.tsx +74 -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/CarBookingCard.css +236 -0
- package/src/components/organisms/CarBookingCard/CarBookingCard.tsx +238 -0
- package/src/components/organisms/CarBookingCard/index.ts +12 -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/ui/popover.tsx +10 -10
- package/src/components/ui/tooltip.tsx +45 -0
- package/src/styles/components/molecule/location-dropdown.css +29 -0
- package/src/styles/components/molecule/service-selector.css +228 -0
- package/src/styles/components/typography.css +4 -0
- package/src/components/atoms/Icon/icons/ChevronDownIcon.tsx +0 -46
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Icon from '../../atoms/Icon/Icon';
|
|
3
|
+
import './Pagination.css';
|
|
4
|
+
|
|
5
|
+
export interface PaginationProps {
|
|
6
|
+
/** Current page (1-indexed) */
|
|
7
|
+
currentPage: number;
|
|
8
|
+
/** Total number of pages */
|
|
9
|
+
totalPages: number;
|
|
10
|
+
/** Handler called when page changes */
|
|
11
|
+
onPageChange: (page: number) => void;
|
|
12
|
+
/** Number of pages to display on each side of the current page */
|
|
13
|
+
siblingCount?: number;
|
|
14
|
+
/** Additional CSS classes */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Pagination: React.FC<PaginationProps> = ({
|
|
19
|
+
currentPage,
|
|
20
|
+
totalPages,
|
|
21
|
+
onPageChange,
|
|
22
|
+
siblingCount = 1,
|
|
23
|
+
className = '',
|
|
24
|
+
}) => {
|
|
25
|
+
const handlePrevious = () => {
|
|
26
|
+
if (currentPage > 1) {
|
|
27
|
+
onPageChange(currentPage - 1);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const handleNext = () => {
|
|
32
|
+
if (currentPage < totalPages) {
|
|
33
|
+
onPageChange(currentPage + 1);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const handlePageClick = (page: number) => {
|
|
38
|
+
if (page >= 1 && page <= totalPages && page !== currentPage) {
|
|
39
|
+
onPageChange(page);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Generate page numbers to display
|
|
44
|
+
const getPageNumbers = (): (number | 'ellipsis')[] => {
|
|
45
|
+
const pages: (number | 'ellipsis')[] = [];
|
|
46
|
+
const totalNumbers = siblingCount * 2 + 5;
|
|
47
|
+
const totalBlocks = totalNumbers + 2;
|
|
48
|
+
|
|
49
|
+
if (totalPages <= totalBlocks) {
|
|
50
|
+
// Display all pages if total is small
|
|
51
|
+
for (let i = 1; i <= totalPages; i++) {
|
|
52
|
+
pages.push(i);
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
56
|
+
const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);
|
|
57
|
+
|
|
58
|
+
const shouldShowLeftEllipsis = leftSiblingIndex > 2;
|
|
59
|
+
const shouldShowRightEllipsis = rightSiblingIndex < totalPages - 1;
|
|
60
|
+
|
|
61
|
+
if (!shouldShowLeftEllipsis && shouldShowRightEllipsis) {
|
|
62
|
+
// Case: [1] [2] [3] [4] ... [10]
|
|
63
|
+
const leftItemCount = 3 + 2 * siblingCount;
|
|
64
|
+
for (let i = 1; i <= leftItemCount; i++) {
|
|
65
|
+
pages.push(i);
|
|
66
|
+
}
|
|
67
|
+
pages.push('ellipsis');
|
|
68
|
+
pages.push(totalPages);
|
|
69
|
+
} else if (shouldShowLeftEllipsis && !shouldShowRightEllipsis) {
|
|
70
|
+
// Case: [1] ... [7] [8] [9] [10]
|
|
71
|
+
pages.push(1);
|
|
72
|
+
pages.push('ellipsis');
|
|
73
|
+
const rightItemCount = 3 + 2 * siblingCount;
|
|
74
|
+
for (let i = totalPages - rightItemCount + 1; i <= totalPages; i++) {
|
|
75
|
+
pages.push(i);
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
// Case: [1] ... [4] [5] [6] ... [10]
|
|
79
|
+
pages.push(1);
|
|
80
|
+
pages.push('ellipsis');
|
|
81
|
+
for (let i = leftSiblingIndex; i <= rightSiblingIndex; i++) {
|
|
82
|
+
pages.push(i);
|
|
83
|
+
}
|
|
84
|
+
pages.push('ellipsis');
|
|
85
|
+
pages.push(totalPages);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return pages;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const pageNumbers = getPageNumbers();
|
|
93
|
+
const isPreviousDisabled = currentPage <= 1;
|
|
94
|
+
const isNextDisabled = currentPage >= totalPages;
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<div className={`pagination ${className}`}>
|
|
98
|
+
<button
|
|
99
|
+
type="button"
|
|
100
|
+
className="pagination__button pagination__button--prev"
|
|
101
|
+
onClick={handlePrevious}
|
|
102
|
+
disabled={isPreviousDisabled}
|
|
103
|
+
aria-label="Previous page"
|
|
104
|
+
>
|
|
105
|
+
<Icon name="chevron-left" size="sm" />
|
|
106
|
+
</button>
|
|
107
|
+
|
|
108
|
+
<div className="pagination__numbers">
|
|
109
|
+
{pageNumbers.map((page, index) => {
|
|
110
|
+
if (page === 'ellipsis') {
|
|
111
|
+
return (
|
|
112
|
+
<span key={`ellipsis-${index}`} className="pagination__ellipsis">
|
|
113
|
+
...
|
|
114
|
+
</span>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const isSelected = page === currentPage;
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<button
|
|
122
|
+
key={page}
|
|
123
|
+
type="button"
|
|
124
|
+
className={`pagination__number ${isSelected ? 'pagination__number--selected' : ''}`}
|
|
125
|
+
onClick={() => handlePageClick(page)}
|
|
126
|
+
aria-label={`Page ${page}`}
|
|
127
|
+
aria-current={isSelected ? 'page' : undefined}
|
|
128
|
+
>
|
|
129
|
+
{page}
|
|
130
|
+
</button>
|
|
131
|
+
);
|
|
132
|
+
})}
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<button
|
|
136
|
+
type="button"
|
|
137
|
+
className="pagination__button pagination__button--next"
|
|
138
|
+
onClick={handleNext}
|
|
139
|
+
disabled={isNextDisabled}
|
|
140
|
+
aria-label="Next page"
|
|
141
|
+
>
|
|
142
|
+
<Icon name="chevron-right" size="sm" />
|
|
143
|
+
</button>
|
|
144
|
+
</div>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export default Pagination;
|
|
149
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.section-title {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: var(--spacing-gap-gap-2, 8px);
|
|
6
|
+
padding: var(--spacing-padding-py-0, 0px) var(--spacing-padding-px-0, 0px);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.section-title__left {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: var(--spacing-gap-gap-2, 8px);
|
|
13
|
+
min-width: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.section-title__marker {
|
|
17
|
+
width: var(--dimension-width-w-1, 4px);
|
|
18
|
+
height: var(--spacing-padding-py-8, 32px);
|
|
19
|
+
background-color: var(--color-elevation-brand-subtle, #fe8839);
|
|
20
|
+
border-radius: var(--border-radius-rounded-none, 0px);
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.section-title__text {
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.section-title__trailing {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: var(--spacing-gap-gap-2, 8px);
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Heading } from '../../atoms/Typography/Typography';
|
|
3
|
+
import './SectionTitle.css';
|
|
4
|
+
|
|
5
|
+
export interface SectionTitleProps {
|
|
6
|
+
/** Main title text */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Visual style of the title */
|
|
9
|
+
variant?: 'accent' | 'default';
|
|
10
|
+
/** Optional left color bar */
|
|
11
|
+
showMarker?: boolean;
|
|
12
|
+
/** Additional content displayed on the right side (e.g. actions, badges) */
|
|
13
|
+
trailing?: React.ReactNode;
|
|
14
|
+
/** Additional CSS classes */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const SectionTitle: React.FC<SectionTitleProps> = ({
|
|
19
|
+
title,
|
|
20
|
+
variant = 'accent',
|
|
21
|
+
showMarker = true,
|
|
22
|
+
trailing,
|
|
23
|
+
className = '',
|
|
24
|
+
}) => {
|
|
25
|
+
const baseClass = 'section-title';
|
|
26
|
+
const classes = [baseClass, `${baseClass}--${variant}`, className].filter(Boolean).join(' ');
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className={classes}>
|
|
30
|
+
<div className="section-title__left">
|
|
31
|
+
{showMarker && <span className="section-title__marker" aria-hidden="true" />}
|
|
32
|
+
<Heading level={3} variant="bold" color={variant === 'accent' ? 'accent' : 'default'} className="section-title__text">
|
|
33
|
+
{title}
|
|
34
|
+
</Heading>
|
|
35
|
+
</div>
|
|
36
|
+
{trailing && <div className="section-title__trailing">{trailing}</div>}
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default SectionTitle;
|
|
42
|
+
|
|
43
|
+
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import Icon from '../../atoms/Icon/Icon';
|
|
3
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
4
|
+
import '../../../styles/components/molecule/service-selector.css';
|
|
5
|
+
|
|
6
|
+
export type ServiceType = 'transfer' | 'accommodation' | 'excursion';
|
|
7
|
+
|
|
8
|
+
export interface ServiceOption {
|
|
9
|
+
value: ServiceType;
|
|
10
|
+
label: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
badge?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ServiceSelectorProps {
|
|
17
|
+
/** Selected service */
|
|
18
|
+
value?: ServiceType;
|
|
19
|
+
/** Change handler */
|
|
20
|
+
onChange: (value: ServiceType) => void;
|
|
21
|
+
/** Disabled state */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Additional CSS classes */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const DEFAULT_OPTIONS: ServiceOption[] = [
|
|
28
|
+
{
|
|
29
|
+
value: 'accommodation',
|
|
30
|
+
label: 'Accommodation',
|
|
31
|
+
icon: 'building',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: 'transfer',
|
|
35
|
+
label: 'Transfer',
|
|
36
|
+
icon: 'car',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: 'excursion',
|
|
40
|
+
label: 'Excursion',
|
|
41
|
+
icon: 'map-pin',
|
|
42
|
+
disabled: true,
|
|
43
|
+
badge: 'Coming soon',
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const ServiceSelector: React.FC<ServiceSelectorProps> = ({
|
|
48
|
+
value,
|
|
49
|
+
onChange,
|
|
50
|
+
disabled = false,
|
|
51
|
+
className = '',
|
|
52
|
+
}) => {
|
|
53
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
54
|
+
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
55
|
+
|
|
56
|
+
// Close dropdown when clicking outside
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
59
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
|
|
60
|
+
setIsOpen(false);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
65
|
+
return () => {
|
|
66
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
67
|
+
};
|
|
68
|
+
}, []);
|
|
69
|
+
|
|
70
|
+
const handleToggleDropdown = () => {
|
|
71
|
+
if (!disabled) {
|
|
72
|
+
setIsOpen(!isOpen);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const handleOptionSelect = (option: ServiceOption) => {
|
|
77
|
+
if (disabled || option.disabled) return;
|
|
78
|
+
onChange(option.value);
|
|
79
|
+
setIsOpen(false);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const getDropdownState = () => {
|
|
83
|
+
if (disabled) return 'disabled';
|
|
84
|
+
// If a service is selected, always show selected state (even if open)
|
|
85
|
+
if (value) return 'selected';
|
|
86
|
+
if (isOpen) return 'open';
|
|
87
|
+
return 'default';
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const selectedOption = value ? DEFAULT_OPTIONS.find(opt => opt.value === value) : null;
|
|
91
|
+
const displayText = selectedOption ? selectedOption.label : 'Select a service';
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div ref={dropdownRef} className={`service-selector ${className}`}>
|
|
95
|
+
<button
|
|
96
|
+
type="button"
|
|
97
|
+
className={`service-selector__trigger service-selector__trigger--${getDropdownState()}`}
|
|
98
|
+
onClick={handleToggleDropdown}
|
|
99
|
+
disabled={disabled}
|
|
100
|
+
aria-expanded={isOpen}
|
|
101
|
+
aria-haspopup="listbox"
|
|
102
|
+
>
|
|
103
|
+
<div className="service-selector__trigger-content">
|
|
104
|
+
{selectedOption && (
|
|
105
|
+
<Icon
|
|
106
|
+
name={selectedOption.icon as any}
|
|
107
|
+
size="md"
|
|
108
|
+
className="service-selector__trigger-icon"
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
111
|
+
<Text
|
|
112
|
+
size="base"
|
|
113
|
+
variant="bold"
|
|
114
|
+
className="service-selector__trigger-text"
|
|
115
|
+
>
|
|
116
|
+
{displayText}
|
|
117
|
+
</Text>
|
|
118
|
+
</div>
|
|
119
|
+
<Icon
|
|
120
|
+
name="chevron-down-new"
|
|
121
|
+
size="sm"
|
|
122
|
+
className="service-selector__trigger-chevron"
|
|
123
|
+
style={{
|
|
124
|
+
transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
125
|
+
transition: 'transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
|
|
126
|
+
transformOrigin: 'center'
|
|
127
|
+
}}
|
|
128
|
+
/>
|
|
129
|
+
</button>
|
|
130
|
+
|
|
131
|
+
{isOpen && (
|
|
132
|
+
<div className="service-selector__panel" role="listbox">
|
|
133
|
+
<div className="service-selector__content">
|
|
134
|
+
<div className="service-selector__options-wrapper">
|
|
135
|
+
{DEFAULT_OPTIONS.map((option) => {
|
|
136
|
+
const isSelected = value === option.value;
|
|
137
|
+
const isDisabled = option.disabled || disabled;
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<button
|
|
141
|
+
key={option.value}
|
|
142
|
+
type="button"
|
|
143
|
+
className={`service-selector__option ${isSelected ? 'service-selector__option--selected' : ''} ${isDisabled ? 'service-selector__option--disabled' : ''}`}
|
|
144
|
+
onClick={() => handleOptionSelect(option)}
|
|
145
|
+
disabled={isDisabled}
|
|
146
|
+
role="option"
|
|
147
|
+
aria-selected={isSelected}
|
|
148
|
+
>
|
|
149
|
+
<Icon
|
|
150
|
+
name={option.icon as any}
|
|
151
|
+
size="md"
|
|
152
|
+
className={`service-selector__option-icon ${isSelected ? 'service-selector__option-icon--selected' : ''}`}
|
|
153
|
+
/>
|
|
154
|
+
<Text
|
|
155
|
+
size="base"
|
|
156
|
+
variant="bold"
|
|
157
|
+
color={isSelected ? 'inverted' : 'default'}
|
|
158
|
+
className="service-selector__option-text"
|
|
159
|
+
>
|
|
160
|
+
{option.label}
|
|
161
|
+
</Text>
|
|
162
|
+
{option.badge && (
|
|
163
|
+
<span className="service-selector__option-badge">
|
|
164
|
+
{option.badge}
|
|
165
|
+
</span>
|
|
166
|
+
)}
|
|
167
|
+
</button>
|
|
168
|
+
);
|
|
169
|
+
})}
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export default ServiceSelector;
|
|
179
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.stepper {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: var(--stepper-spacing-controller-gap, 8px);
|
|
6
|
+
padding: var(--stepper-spacing-controller-padding-y, 0px) var(--stepper-spacing-controller-padding-x, 0px);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.stepper__button {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
width: var(--stepper-dimension-cta-width, 32px);
|
|
14
|
+
height: var(--stepper-dimension-cta-height, 32px);
|
|
15
|
+
padding: var(--stepper-spacing-cta-padding-y, 0px) var(--stepper-spacing-cta-padding-x, 0px);
|
|
16
|
+
border: none;
|
|
17
|
+
border-radius: var(--stepper-border-radius-cta, 9999px);
|
|
18
|
+
background-color: var(--stepper-color-cta-background-default, #ffffff);
|
|
19
|
+
color: var(--stepper-color-cta-foreground-default, #000000);
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
box-shadow: var(--spacing-base-0, 0px) var(--spacing-base-px, 1px) var(--backdrop-blur-backdrop-blur, 8px) var(--spacing-base-0, 0px) rgba(48, 54, 66, 0.11),
|
|
22
|
+
var(--spacing-base-0, 0px) var(--spacing-base-1, 4px) var(--backdrop-blur-backdrop-blur, 8px) var(--spacing-base-0, 0px) rgba(48, 54, 66, 0.1);
|
|
23
|
+
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.stepper__button:hover:not(:disabled) {
|
|
27
|
+
background-color: var(--stepper-color-cta-background-hover, #115b5e);
|
|
28
|
+
color: var(--stepper-color-cta-foreground-hover, #ffffff);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.stepper__button:active:not(:disabled) {
|
|
32
|
+
background-color: var(--stepper-color-cta-background-pressed, #042c2f);
|
|
33
|
+
color: var(--stepper-color-cta-foreground-pressed, #ffffff);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.stepper__button:disabled {
|
|
37
|
+
background-color: var(--stepper-color-cta-background-disabled, #fbfbfb);
|
|
38
|
+
color: var(--stepper-color-cta-foreground-disabled, #aaaeb8);
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.stepper__button:focus-visible {
|
|
43
|
+
outline: var(--border-width-focus, 2px) solid var(--color-border-active-default, #0f7173);
|
|
44
|
+
outline-offset: var(--spacing-base-0-5, 2px);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.stepper__counter {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
min-width: var(--stepper-dimension-counter-width, 72px);
|
|
52
|
+
padding: var(--stepper-spacing-counter-padding-y, 4px) var(--spacing-padding-px-6, 24px);
|
|
53
|
+
background-color: var(--stepper-color-counter, #ffffff);
|
|
54
|
+
border-radius: var(--stepper-border-radius-counter, 8px);
|
|
55
|
+
box-shadow: var(--spacing-base-0, 0px) var(--spacing-base-0, 0px) var(--backdrop-blur-backdrop-blur-sm, 4px) var(--spacing-base-0, 0px) rgba(48, 54, 66, 0.11),
|
|
56
|
+
var(--spacing-base-0, 0px) var(--spacing-base-0-5, 2px) var(--spacing-base-0-5, 2px) var(--spacing-base-0, 0px) rgba(48, 54, 66, 0.1);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.stepper__counter-value {
|
|
60
|
+
font-family: var(--font-font-family-body, "Satoshi"), "Satoshi", "Inter", "Segoe UI", "system-ui", sans-serif;
|
|
61
|
+
font-weight: var(--font-weight-font-bold, 700);
|
|
62
|
+
font-size: var(--font-size-text-lg, 18px);
|
|
63
|
+
line-height: calc(var(--font-leading-leading-md, 24) * 1px);
|
|
64
|
+
color: var(--color-text-default, #262626);
|
|
65
|
+
text-align: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Icon from '../../atoms/Icon/Icon';
|
|
3
|
+
import './Stepper.css';
|
|
4
|
+
|
|
5
|
+
export interface StepperProps {
|
|
6
|
+
/** Current value */
|
|
7
|
+
value: number;
|
|
8
|
+
/** Minimum value */
|
|
9
|
+
min?: number;
|
|
10
|
+
/** Maximum value */
|
|
11
|
+
max?: number;
|
|
12
|
+
/** Handler called when value changes */
|
|
13
|
+
onChange: (value: number) => void;
|
|
14
|
+
/** Disable the stepper */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Additional CSS classes */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const Stepper: React.FC<StepperProps> = ({
|
|
21
|
+
value,
|
|
22
|
+
min = 0,
|
|
23
|
+
max = 99,
|
|
24
|
+
onChange,
|
|
25
|
+
disabled = false,
|
|
26
|
+
className = '',
|
|
27
|
+
}) => {
|
|
28
|
+
const handleDecrement = () => {
|
|
29
|
+
if (!disabled && value > min) {
|
|
30
|
+
onChange(value - 1);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const handleIncrement = () => {
|
|
35
|
+
if (!disabled && value < max) {
|
|
36
|
+
onChange(value + 1);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const isDecrementDisabled = disabled || value <= min;
|
|
41
|
+
const isIncrementDisabled = disabled || value >= max;
|
|
42
|
+
|
|
43
|
+
const baseClass = 'stepper';
|
|
44
|
+
const classes = [baseClass, className].filter(Boolean).join(' ');
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div className={classes}>
|
|
48
|
+
<button
|
|
49
|
+
type="button"
|
|
50
|
+
className="stepper__button stepper__button--decrement"
|
|
51
|
+
onClick={handleDecrement}
|
|
52
|
+
disabled={isDecrementDisabled}
|
|
53
|
+
aria-label="Decrease value"
|
|
54
|
+
>
|
|
55
|
+
<Icon name="minus" size="sm" />
|
|
56
|
+
</button>
|
|
57
|
+
<div className="stepper__counter">
|
|
58
|
+
<span className="stepper__counter-value">{value}</span>
|
|
59
|
+
</div>
|
|
60
|
+
<button
|
|
61
|
+
type="button"
|
|
62
|
+
className="stepper__button stepper__button--increment"
|
|
63
|
+
onClick={handleIncrement}
|
|
64
|
+
disabled={isIncrementDisabled}
|
|
65
|
+
aria-label="Increase value"
|
|
66
|
+
>
|
|
67
|
+
<Icon name="plus" size="sm" />
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default Stepper;
|
|
74
|
+
|
|
@@ -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
|
+
};
|