mautourco-components 0.2.164 → 0.2.166
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/CardServiceAccom/CardServiceAccom.css +8 -8
- package/dist/components/atoms/Radio/Radio.css +52 -0
- package/dist/components/atoms/Radio/Radio.d.ts +7 -0
- package/dist/components/atoms/Radio/Radio.js +8 -0
- package/dist/components/molecules/ActionDropdown/ActionDropdown.css +12 -21
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +2 -6
- package/dist/components/molecules/BookingResume/BookingResumeLayout/BookingResumeLayout.css +13 -7
- package/dist/components/molecules/BookingResume/ResumeAccom/ResumeAccom.css +11 -15
- package/dist/components/molecules/BookingResume/ResumeExcursion/ResumeExcursion.css +2 -4
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.css +10 -14
- package/dist/components/molecules/DetailsInfo/DetailsClient/DetailsClient.css +5 -17
- package/dist/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.css +18 -39
- package/dist/components/molecules/FeatureRow/FeatureRow.css +14 -6
- package/dist/components/molecules/LanguageSelector/LanguageSelector.css +7 -8
- package/dist/components/molecules/PaxDisplay/PaxDisplay.css +8 -13
- package/dist/components/molecules/ServiceInfo/ServiceInfo.css +7 -5
- package/dist/components/molecules/ServiceTitle/ServiceTitle.css +4 -7
- package/dist/components/molecules/StepperTimeline/StepperTimeline.css +4 -7
- package/dist/components/molecules/TextWithBorderBottom/TextWithBorderBottom.css +4 -15
- package/dist/components/molecules/TimelineItem/TimelineHeader.css +7 -29
- package/dist/components/molecules/TimelineItem/TimelineItem.css +2 -6
- package/dist/components/organisms/Booking/BookingDocket/BookingDocket.css +28 -15
- package/dist/components/organisms/Booking/BookingStep/BookingStep.css +6 -5
- package/dist/components/organisms/CarBookingCard/CarBookingCard.css +9 -4
- package/dist/components/organisms/DialogBookNow/DialogBookNow.css +55 -0
- package/dist/components/organisms/DialogBookNow/DialogBookNow.d.ts +17 -0
- package/dist/components/organisms/DialogBookNow/DialogBookNow.js +22 -0
- package/dist/components/organisms/DialogCancelService/CancelBooking/CancelBooking.css +3 -2
- package/dist/components/organisms/DialogCancelService/ConfirmDelete/ConfirmDelete.css +4 -3
- package/dist/components/organisms/DialogComparison/DialogComparison.css +3 -2
- package/dist/components/organisms/DialogDeleteConfirm/DialogDeleteConfirmMultiple/DialogDeleteConfirmMultiple.css +10 -13
- package/dist/components/organisms/QuoteHeader/QuoteHeader.css +27 -62
- package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +8 -6
- package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicyLayout/TabCancellationPolicyLayout.css +16 -21
- package/dist/components/organisms/TabServiceDetails/TabServiceDetailsLayout/TabServiceDetailsLayout.css +38 -20
- package/dist/components/organisms/Table/Table.css +75 -92
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
- package/src/components/atoms/Radio/Radio.css +38 -0
- package/src/components/atoms/Radio/Radio.tsx +27 -0
- package/src/components/organisms/DialogBookNow/DialogBookNow.css +29 -0
- package/src/components/organisms/DialogBookNow/DialogBookNow.tsx +83 -0
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
overflow-y: hidden;
|
|
7
7
|
overflow-x: auto;
|
|
8
8
|
max-width: 1680px;
|
|
9
|
-
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.table-container.table-container--no-total {
|
|
10
12
|
padding-bottom: var(--spacing-padding-px-4);
|
|
11
13
|
}
|
|
12
|
-
}
|
|
13
14
|
|
|
14
15
|
.text--highlight {
|
|
15
16
|
background-color: var(--color-amber-100);
|
|
@@ -20,108 +21,86 @@
|
|
|
20
21
|
width: 100%;
|
|
21
22
|
border-collapse: collapse;
|
|
22
23
|
border-spacing: 0;
|
|
23
|
-
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.table.table-layout-fixed {
|
|
24
27
|
table-layout: fixed;
|
|
25
|
-
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.table.table-layout-fixed .table {
|
|
26
31
|
table-layout: fixed;
|
|
27
32
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
td {
|
|
33
|
+
|
|
34
|
+
.table th,
|
|
35
|
+
.table td {
|
|
31
36
|
padding-inline: var(--spacing-padding-px-4);
|
|
32
37
|
}
|
|
33
|
-
|
|
38
|
+
|
|
39
|
+
.table .table__cell-highlighted {
|
|
34
40
|
padding: 0;
|
|
35
41
|
}
|
|
36
|
-
|
|
37
|
-
.
|
|
38
|
-
|
|
39
|
-
height: 2.75rem;
|
|
40
|
-
}
|
|
41
|
-
th {
|
|
42
|
-
text-align: left;
|
|
43
|
-
}
|
|
44
|
-
th {
|
|
42
|
+
.table__header th {
|
|
43
|
+
height: 2.75rem;
|
|
44
|
+
text-align: left;
|
|
45
45
|
background-color: var(--color-elevation-level-2);
|
|
46
|
-
}
|
|
47
46
|
}
|
|
48
|
-
.table__body {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
transition-duration: 150ms;
|
|
53
|
-
}
|
|
54
|
-
> tr {
|
|
55
|
-
transition-duration: 200ms;
|
|
56
|
-
}
|
|
57
|
-
> tr {
|
|
47
|
+
.table__body > tr {
|
|
48
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
49
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
50
|
+
transition-duration: 200ms;
|
|
58
51
|
border-top: solid 1px var(--color-surface-300);
|
|
59
|
-
|
|
52
|
+
}
|
|
53
|
+
.table__body > tr:hover:not(.table__row-with-children) {
|
|
60
54
|
background-color: var(--color-elevation-state-hover-subtle);
|
|
61
55
|
}
|
|
62
|
-
|
|
63
|
-
.table__row-div-highlighted {
|
|
56
|
+
.table__body > tr.table__row-highlighted:hover .table__row-div-highlighted {
|
|
64
57
|
background-color: var(--color-yellow-100);
|
|
65
58
|
}
|
|
66
|
-
|
|
67
|
-
&.table__row-div-highlighted {
|
|
68
|
-
div.table__nested-wrapper table tr {
|
|
59
|
+
.table__body > tr.table__row-div-highlighted div.table__nested-wrapper table tr {
|
|
69
60
|
background-color: var(--color-yellow-50);
|
|
70
|
-
|
|
61
|
+
}
|
|
62
|
+
.table__body > tr.table__row-div-highlighted div.table__nested-wrapper table tr:hover {
|
|
71
63
|
background-color: var(--color-yellow-100);
|
|
72
64
|
}
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
&.table__row-with-children {
|
|
76
|
-
tr:hover {
|
|
65
|
+
.table__body > tr.table__row-with-children tr:hover {
|
|
77
66
|
background-color: var(--color-elevation-state-hover-subtle);
|
|
78
67
|
}
|
|
79
|
-
|
|
80
|
-
&:first-child {
|
|
68
|
+
.table__body > tr:first-child {
|
|
81
69
|
border-top: none;
|
|
82
70
|
}
|
|
83
|
-
|
|
71
|
+
.table__body > tr.table__row-border-0 {
|
|
84
72
|
border-top: none;
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
}
|
|
74
|
+
.table__body > tr.table__row-border-0:not(:nth-of-type(1)) td {
|
|
87
75
|
vertical-align: top;
|
|
88
76
|
}
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
td {
|
|
77
|
+
.table__body td {
|
|
93
78
|
padding-block: var(--spacing-padding-px-4);
|
|
94
|
-
|
|
79
|
+
}
|
|
80
|
+
.table__body td.table__cell-nested {
|
|
95
81
|
padding: 0;
|
|
96
82
|
overflow: hidden;
|
|
97
|
-
|
|
83
|
+
}
|
|
84
|
+
.table__body td.table__cell-nested tr:last-child {
|
|
98
85
|
border-bottom: none;
|
|
99
86
|
}
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
.table__nested-wrapper {
|
|
87
|
+
.table__body .table__nested-wrapper {
|
|
103
88
|
overflow: hidden;
|
|
104
89
|
display: block;
|
|
105
90
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
.button__icon {
|
|
112
|
-
transition-duration: 200ms;
|
|
113
|
-
}
|
|
91
|
+
.table__body .button__icon {
|
|
92
|
+
transition-property: transform;
|
|
93
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
94
|
+
transition-duration: 200ms;
|
|
114
95
|
}
|
|
115
96
|
|
|
116
97
|
.table__row-nested {
|
|
117
98
|
border-left: solid 4px var(--color-primary-brand);
|
|
118
99
|
}
|
|
119
100
|
|
|
120
|
-
.table__button-expanded {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
124
|
-
}
|
|
101
|
+
.table__button-expanded .button__icon {
|
|
102
|
+
--tw-rotate: 180deg;
|
|
103
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
125
104
|
}
|
|
126
105
|
|
|
127
106
|
.table__row-clickable {
|
|
@@ -132,38 +111,38 @@
|
|
|
132
111
|
width: 136px;
|
|
133
112
|
}
|
|
134
113
|
|
|
135
|
-
.table__row-grouped {
|
|
136
|
-
> td {
|
|
114
|
+
.table__row-grouped > td {
|
|
137
115
|
padding: 0;
|
|
138
116
|
}
|
|
139
|
-
}
|
|
140
117
|
|
|
141
118
|
.table__total-container {
|
|
142
119
|
max-width: 1680px;
|
|
143
120
|
}
|
|
144
121
|
|
|
145
|
-
.table__total {
|
|
146
|
-
tr {
|
|
122
|
+
.table__total tr {
|
|
147
123
|
border: 1px solid var(--divider-color-default);
|
|
148
124
|
border-left: none;
|
|
149
125
|
border-right: none;
|
|
150
126
|
position: relative;
|
|
151
127
|
}
|
|
152
|
-
|
|
128
|
+
|
|
129
|
+
.table__total td {
|
|
153
130
|
padding-block: var(--spacing-padding-px-4);
|
|
154
|
-
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.table__total td:last-child {
|
|
155
134
|
/* width: 160px;*/
|
|
156
135
|
/* @media (min-width: 1680px) {
|
|
157
136
|
} */
|
|
158
137
|
width: var(--last-column-width);
|
|
159
138
|
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
139
|
|
|
163
140
|
.table__total--dashed tr {
|
|
164
141
|
border: 1px solid transparent;
|
|
165
142
|
position: relative;
|
|
166
|
-
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.table__total--dashed tr::after {
|
|
167
146
|
content: '';
|
|
168
147
|
position: absolute;
|
|
169
148
|
inset: -1px;
|
|
@@ -189,33 +168,35 @@
|
|
|
189
168
|
background-position: top, bottom;
|
|
190
169
|
background-repeat: repeat-x, repeat-x;
|
|
191
170
|
}
|
|
192
|
-
}
|
|
193
171
|
|
|
194
|
-
.table__row-with-children {
|
|
195
|
-
> td {
|
|
172
|
+
.table__row-with-children > td {
|
|
196
173
|
padding: 0;
|
|
197
174
|
}
|
|
198
|
-
|
|
175
|
+
|
|
176
|
+
.table__row-with-children .table__row-nested {
|
|
199
177
|
border-top: none;
|
|
200
178
|
}
|
|
201
|
-
|
|
179
|
+
|
|
180
|
+
.table__row-with-children .table .table__nested-wrapper tr {
|
|
202
181
|
border-top: none;
|
|
203
182
|
background-color: #fff;
|
|
204
|
-
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.table__row-with-children .table .table__nested-wrapper tr:last-child {
|
|
205
186
|
border-bottom: solid 1px var(--color-surface-300);
|
|
206
187
|
}
|
|
207
|
-
|
|
188
|
+
|
|
189
|
+
.table__row-with-children .table .table__nested-wrapper tr:hover {
|
|
208
190
|
background-color: var(--color-elevation-state-hover-subtle);
|
|
209
191
|
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
192
|
|
|
213
193
|
.table__row-div-highlighted {
|
|
214
194
|
background-color: var(--color-yellow-50);
|
|
215
195
|
border: 1px solid transparent;
|
|
216
196
|
position: relative;
|
|
197
|
+
}
|
|
217
198
|
|
|
218
|
-
|
|
199
|
+
.table__row-div-highlighted::after {
|
|
219
200
|
content: '';
|
|
220
201
|
position: absolute;
|
|
221
202
|
inset: -1px;
|
|
@@ -257,19 +238,22 @@
|
|
|
257
238
|
background-position: top, bottom, left, right;
|
|
258
239
|
background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
|
|
259
240
|
}
|
|
260
|
-
|
|
241
|
+
|
|
242
|
+
.table__row-div-highlighted:hover {
|
|
261
243
|
background-color: var(--color-yellow-100);
|
|
262
244
|
}
|
|
263
|
-
|
|
245
|
+
|
|
246
|
+
.table__row-div-highlighted + tr {
|
|
264
247
|
border-top: none;
|
|
265
248
|
}
|
|
266
|
-
}
|
|
267
249
|
|
|
268
250
|
.table__children--visible .table__children-wrapper {
|
|
269
251
|
position: relative;
|
|
270
252
|
border: 1px solid transparent;
|
|
271
253
|
border-left: none;
|
|
272
|
-
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.table__children--visible .table__children-wrapper::after {
|
|
273
257
|
content: '';
|
|
274
258
|
position: absolute;
|
|
275
259
|
inset: -1px;
|
|
@@ -311,5 +295,4 @@
|
|
|
311
295
|
1px 100%;
|
|
312
296
|
background-position: top, bottom, left, right;
|
|
313
297
|
background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
298
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as Icon } from './components/atoms/Icon/Icon';
|
|
|
7
7
|
export { default as DropdownInput } from './components/atoms/Inputs/DropdownInput/DropdownInput';
|
|
8
8
|
export { default as Input } from './components/atoms/Inputs/Input/Input';
|
|
9
9
|
export { default as Textarea } from './components/atoms/Inputs/Textarea/Textarea';
|
|
10
|
+
export { default as Radio } from './components/atoms/Radio/Radio';
|
|
10
11
|
export { default as RatingStar } from './components/atoms/RatingStar/RatingStar';
|
|
11
12
|
export { default as SegmentedButton } from './components/atoms/SegmentedButton/SegmentedButton';
|
|
12
13
|
export { default as SelectedValue } from './components/atoms/SelectedValue/SelectedValue';
|
|
@@ -59,6 +60,7 @@ export { default as DateTimePicker } from './components/organisms/DateTimePicker
|
|
|
59
60
|
export { Dialog } from './components/organisms/Dialog/Dialog';
|
|
60
61
|
export * from './components/organisms/DialogBookingAddItem';
|
|
61
62
|
export * from './components/organisms/DialogBookingConfirm';
|
|
63
|
+
export * from './components/organisms/DialogBookNow/DialogBookNow';
|
|
62
64
|
export * from './components/organisms/DialogCancelService';
|
|
63
65
|
export { DialogComparison } from './components/organisms/DialogComparison/DialogComparison';
|
|
64
66
|
export * from './components/organisms/DialogDeleteConfirm';
|
|
@@ -112,6 +114,7 @@ export type { TopNavigationProps } from './components/organisms/TopNavigation/To
|
|
|
112
114
|
export type { TransferLineData, TransferLineProps, TransferType, } from './components/organisms/TransferLine/TransferLine';
|
|
113
115
|
export type { CheckboxProps } from './components/atoms/Checkbox/Checkbox';
|
|
114
116
|
export type { InputProps } from './components/atoms/Inputs/Input/Input';
|
|
117
|
+
export type { RadioProps } from './components/atoms/Radio/Radio';
|
|
115
118
|
export type { AddItemButtonProps } from './components/molecules/AddItemButton/AddItemButton';
|
|
116
119
|
export type { AgeSelectorProps } from './components/molecules/AgeSelector/AgeSelector';
|
|
117
120
|
export type { BreadcrumbsItem, BreadcrumbsProps, } from './components/molecules/Breadcrumbs/Breadcrumbs';
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { default as Icon } from './components/atoms/Icon/Icon';
|
|
|
8
8
|
export { default as DropdownInput } from './components/atoms/Inputs/DropdownInput/DropdownInput';
|
|
9
9
|
export { default as Input } from './components/atoms/Inputs/Input/Input';
|
|
10
10
|
export { default as Textarea } from './components/atoms/Inputs/Textarea/Textarea';
|
|
11
|
+
export { default as Radio } from './components/atoms/Radio/Radio';
|
|
11
12
|
export { default as RatingStar } from './components/atoms/RatingStar/RatingStar';
|
|
12
13
|
export { default as SegmentedButton } from './components/atoms/SegmentedButton/SegmentedButton';
|
|
13
14
|
export { default as SelectedValue } from './components/atoms/SelectedValue/SelectedValue';
|
|
@@ -61,6 +62,7 @@ export { default as DateTimePicker } from './components/organisms/DateTimePicker
|
|
|
61
62
|
export { Dialog } from './components/organisms/Dialog/Dialog';
|
|
62
63
|
export * from './components/organisms/DialogBookingAddItem';
|
|
63
64
|
export * from './components/organisms/DialogBookingConfirm';
|
|
65
|
+
export * from './components/organisms/DialogBookNow/DialogBookNow';
|
|
64
66
|
export * from './components/organisms/DialogCancelService';
|
|
65
67
|
export { DialogComparison } from './components/organisms/DialogComparison/DialogComparison';
|
|
66
68
|
export * from './components/organisms/DialogDeleteConfirm';
|
package/package.json
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.mtc-radio {
|
|
2
|
+
@apply flex gap-x-2 items-center;
|
|
3
|
+
input {
|
|
4
|
+
display: none;
|
|
5
|
+
&:checked + .mtc-radio__btn {
|
|
6
|
+
border-color: var(--radio-button-color-radio-border-selected-default);
|
|
7
|
+
&::after {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.mtc-radio__btn {
|
|
15
|
+
@apply w-5 h-5 inline-block relative cursor-pointer;
|
|
16
|
+
flex: 0 0 20px;
|
|
17
|
+
border: 1px solid var(--radio-button-color-radio-border-default-default);
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
&::after {
|
|
20
|
+
content: '';
|
|
21
|
+
@apply absolute;
|
|
22
|
+
inset: 4px;
|
|
23
|
+
background-color: var(--radio-button-color-radio-selected-default, #0f7173);
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
opacity: 0;
|
|
26
|
+
transition: opacity 0.2s ease;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.mtc-radio__text {
|
|
31
|
+
@apply cursor-pointer;
|
|
32
|
+
font-size: var(--font-size-text-sm, 14px);
|
|
33
|
+
font-weight: var(--font-weight-font-medium, 500);
|
|
34
|
+
line-height: var(--font-leading-leading-sm, 20px);
|
|
35
|
+
font-family:
|
|
36
|
+
var(--font-font-family-body, 'Satoshi'), 'Satoshi', 'Inter', 'Segoe UI', 'system-ui',
|
|
37
|
+
sans-serif;
|
|
38
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useId } from 'react';
|
|
2
|
+
import './Radio.css';
|
|
3
|
+
|
|
4
|
+
export interface RadioProps {
|
|
5
|
+
onChange: (checked: boolean) => void;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function Radio(props: RadioProps) {
|
|
11
|
+
const { checked, label, onChange } = props;
|
|
12
|
+
|
|
13
|
+
const id = useId();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<label htmlFor={id} className="mtc-radio">
|
|
17
|
+
<input
|
|
18
|
+
type="radio"
|
|
19
|
+
id={id}
|
|
20
|
+
checked={checked}
|
|
21
|
+
onChange={(e) => onChange(e.target.checked)}
|
|
22
|
+
/>
|
|
23
|
+
<span className="mtc-radio__btn" />
|
|
24
|
+
{label && <span className="mtc-radio__text">{label}</span>}
|
|
25
|
+
</label>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.book-now-form {
|
|
2
|
+
@apply space-y-9;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.book-now-quote-price {
|
|
6
|
+
@media (width >= 768px) {
|
|
7
|
+
@apply text-right;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.book-now-quotes {
|
|
12
|
+
@apply space-y-6;
|
|
13
|
+
&__list {
|
|
14
|
+
@apply space-y-2;
|
|
15
|
+
}
|
|
16
|
+
li {
|
|
17
|
+
@apply flex flex-col;
|
|
18
|
+
@media (width >= 768px) {
|
|
19
|
+
@apply flex-row justify-between items-center;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.book-now-footer {
|
|
25
|
+
@apply grid grid-cols-1 gap-4;
|
|
26
|
+
@media (width >= 768px) {
|
|
27
|
+
grid-template-columns: 1fr 1fr;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { priceFormatter } from '@/src/lib/price-formatter';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import Button from '../../atoms/Button/Button';
|
|
4
|
+
import Radio from '../../atoms/Radio/Radio';
|
|
5
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
6
|
+
import { DialogBookingConfirm } from '../DialogBookingConfirm';
|
|
7
|
+
import './DialogBookNow.css';
|
|
8
|
+
|
|
9
|
+
export interface BookNowQuotePrice {
|
|
10
|
+
currency: string;
|
|
11
|
+
amount: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface BookNowQuote {
|
|
15
|
+
id: string | number;
|
|
16
|
+
name: string;
|
|
17
|
+
prices: BookNowQuotePrice[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface DialogBookNowProps {
|
|
21
|
+
open: boolean;
|
|
22
|
+
setOpen: (open: boolean) => void;
|
|
23
|
+
proposals: BookNowQuote[];
|
|
24
|
+
onSubmit?: (quoteId: string | number | null) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default function DialogBookNow(props: DialogBookNowProps) {
|
|
28
|
+
const { open, setOpen, proposals, onSubmit } = props;
|
|
29
|
+
|
|
30
|
+
const [selectedQuoteId, setSelectedQuoteId] = useState<string | number | null>(null);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<DialogBookingConfirm
|
|
34
|
+
open={open}
|
|
35
|
+
setOpen={setOpen}
|
|
36
|
+
title="Book quotation"
|
|
37
|
+
className="!max-w-[800px]">
|
|
38
|
+
<div className="book-now-form">
|
|
39
|
+
<div className="book-now-quotes">
|
|
40
|
+
<Text>
|
|
41
|
+
To avoid conflicts, you can only book one quotation at a time. Please select a
|
|
42
|
+
quotation:
|
|
43
|
+
</Text>
|
|
44
|
+
<ul className="book-now-quotes__list">
|
|
45
|
+
{proposals.map((proposal, index) => (
|
|
46
|
+
<li key={`dbc-${index}`}>
|
|
47
|
+
<Radio
|
|
48
|
+
checked={selectedQuoteId === proposal.id}
|
|
49
|
+
onChange={() => {
|
|
50
|
+
if (selectedQuoteId === proposal.id) {
|
|
51
|
+
console.log('unselecting');
|
|
52
|
+
setSelectedQuoteId(null);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
setSelectedQuoteId(proposal.id);
|
|
56
|
+
}}
|
|
57
|
+
label={proposal.name}
|
|
58
|
+
/>
|
|
59
|
+
<Text className="book-now-quote-price" size="sm">
|
|
60
|
+
{proposal.prices
|
|
61
|
+
.map((price) => priceFormatter(price.amount, price.currency))
|
|
62
|
+
.join(' ')}
|
|
63
|
+
</Text>
|
|
64
|
+
</li>
|
|
65
|
+
))}
|
|
66
|
+
</ul>
|
|
67
|
+
</div>
|
|
68
|
+
<div className="book-now-footer">
|
|
69
|
+
<Button variant="outline-secondary" size="sm">
|
|
70
|
+
Cancel
|
|
71
|
+
</Button>
|
|
72
|
+
<Button
|
|
73
|
+
variant="secondary"
|
|
74
|
+
size="sm"
|
|
75
|
+
disabled={!selectedQuoteId}
|
|
76
|
+
onClick={() => onSubmit?.(selectedQuoteId)}>
|
|
77
|
+
Book quotation
|
|
78
|
+
</Button>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</DialogBookingConfirm>
|
|
82
|
+
);
|
|
83
|
+
}
|