mautourco-components 0.2.29 → 0.2.31
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/Avatar/Avatar.js +1 -12
- package/dist/components/atoms/Button/Button.js +1 -12
- package/dist/components/atoms/Checkbox/Checkbox.js +2 -13
- package/dist/components/atoms/Chip/Chip.js +1 -12
- package/dist/components/atoms/Icon/icons/AccomIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/AirIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/ArrivalIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/ArrowDownOutlineIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/ArrowRightOutlineIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/BadgeAlertIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/BikeIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/BookingIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Building2OutlineIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/BuildingIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/BusIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Calendar2Icon.js +1 -12
- package/dist/components/atoms/Icon/icons/CalendarIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/CalendarOutlineIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/CalendarRangeOutlineIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/CarFront.js +1 -12
- package/dist/components/atoms/Icon/icons/CarIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/CatamaranIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Check.js +1 -12
- package/dist/components/atoms/Icon/icons/CheckCircleIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Chevron.js +1 -1
- package/dist/components/atoms/Icon/icons/ClockIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Close.js +1 -12
- package/dist/components/atoms/Icon/icons/CloseCircleIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/DeleteIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/DepartureIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/EyeIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/FacebookIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/HomeIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Info2Icon.d.ts +4 -0
- package/dist/components/atoms/Icon/icons/Info2Icon.js +25 -0
- package/dist/components/atoms/Icon/icons/InfoIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Land.js +1 -12
- package/dist/components/atoms/Icon/icons/LineIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/LinkedInIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/LuggageIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/MapIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/MapPinIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/MautoucoLogo.d.ts +0 -1
- package/dist/components/atoms/Icon/icons/MautoucoLogo.js +1 -12
- package/dist/components/atoms/Icon/icons/MenuIcon.d.ts +0 -1
- package/dist/components/atoms/Icon/icons/MenuIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/MicroIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/MinusIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/MoreIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/MoreVerticalIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/NightIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/PlaneIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/PlaneLandingOutlineIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/PlaneTakeoffOutlineIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/PlusCircleIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/PlusIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/QuotationIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/SeaIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Search.js +1 -12
- package/dist/components/atoms/Icon/icons/Settings.js +1 -12
- package/dist/components/atoms/Icon/icons/ShipIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/StopWatchIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/StrollerIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/TwitterIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/User.js +1 -12
- package/dist/components/atoms/Icon/icons/UserIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Utensils.js +1 -12
- package/dist/components/atoms/Icon/icons/WalletIcon.js +1 -12
- package/dist/components/atoms/Icon/icons/Youtube.js +1 -12
- package/dist/components/atoms/Icon/icons/registry.d.ts +1 -0
- package/dist/components/atoms/Icon/icons/registry.js +2 -0
- package/dist/components/atoms/Illustration/illustrations.js +4 -4
- package/dist/components/atoms/Inputs/DropdownInput/DropdownInput.js +1 -12
- package/dist/components/atoms/Inputs/Input/Input.d.ts +2 -1
- package/dist/components/atoms/Inputs/Input/Input.js +2 -13
- package/dist/components/atoms/Link/Link.js +4 -15
- package/dist/components/atoms/RatingStar/RatingStar.js +2 -13
- package/dist/components/atoms/SegmentedButton/SegmentedButton.js +3 -14
- package/dist/components/atoms/SelectedValue/SelectedValue.js +1 -12
- package/dist/components/atoms/Slider/Slider.js +1 -12
- package/dist/components/atoms/Spinner/Spinner.js +1 -12
- package/dist/components/atoms/Tab/Tab.js +1 -1
- package/dist/components/atoms/Typography/Typography.js +2 -13
- package/dist/components/molecules/AccomodationDocket/AccomodationDocket.js +3 -14
- package/dist/components/molecules/ActionDropdown/ActionDropdown.d.ts +0 -1
- package/dist/components/molecules/ActionDropdown/ActionDropdown.js +5 -16
- package/dist/components/molecules/AddItemButton/AddItemButton.js +1 -12
- package/dist/components/molecules/BookingPax/BookingPaxAccom.js +3 -14
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.d.ts +0 -1
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.js +5 -5
- package/dist/components/molecules/BookingPax/BookingPaxExcursion.js +1 -12
- package/dist/components/molecules/BookingPax/BookingPaxHeader.js +2 -2
- package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.d.ts +0 -1
- package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.js +1 -12
- package/dist/components/molecules/BookingPax/BookingPaxRemarks.js +1 -12
- package/dist/components/molecules/BookingPax/BookingPaxTransfer.js +1 -12
- package/dist/components/molecules/BookingResume/BookingResumeLayout/BookingResumeLayout.js +1 -12
- package/dist/components/molecules/BookingResume/ResumeAccom/ResumeAccom.js +1 -12
- package/dist/components/molecules/BookingResume/ResumeExcursion/ResumeExcursion.js +1 -12
- package/dist/components/molecules/BookingResume/ResumeOtherService.js +1 -12
- package/dist/components/molecules/BookingResume/ResumeTransfer.js +1 -12
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js +1 -12
- package/dist/components/molecules/Calendar/CalendarInput.js +2 -13
- package/dist/components/molecules/Calendar/DateTime.d.ts +9 -9
- package/dist/components/molecules/Calendar/DateTime.js +3 -3
- package/dist/components/molecules/Calendar/TimePicker.js +1 -12
- package/dist/components/molecules/DateDisplay/DateDisplay.d.ts +4 -0
- package/dist/components/molecules/DateDisplay/DateDisplay.js +5 -18
- package/dist/components/molecules/DetailsInfo/DetailsAction.js +2 -13
- package/dist/components/molecules/DetailsInfo/DetailsAgency/DetailsAgency.js +1 -12
- package/dist/components/molecules/DetailsInfo/DetailsClient/DetailsClient.js +1 -12
- package/dist/components/molecules/DetailsInfo/DetailsFile.js +1 -12
- package/dist/components/molecules/DetailsInfo/DetailsInfo.d.ts +0 -1
- package/dist/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.css +50 -0
- package/dist/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.d.ts +2 -0
- package/dist/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.js +3 -13
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationAccom.d.ts +2 -1
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationAccom.js +2 -13
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationExcursion.d.ts +2 -1
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationExcursion.js +2 -13
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.d.ts +3 -2
- package/dist/components/molecules/DialogContentPolicy/DialogCancellationList.js +14 -11
- package/dist/components/molecules/DialogContentPolicy/DialogContentPolicy.js +1 -12
- package/dist/components/molecules/DocketPrices/DocketPrices.js +1 -12
- package/dist/components/molecules/ExcursionDocket/ExcursionDocket.js +1 -12
- package/dist/components/molecules/FeatureRow/FeatureRow.js +1 -12
- package/dist/components/molecules/FromTo/FromTo.d.ts +0 -1
- package/dist/components/molecules/FromTo/FromTo.js +1 -12
- package/dist/components/molecules/GlobalAmenities/GlobalAmenities.js +1 -12
- package/dist/components/molecules/LocationDropdown/LocationDropdown.js +6 -17
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +1 -0
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.js +23 -28
- package/dist/components/molecules/OtherServiceDocket/OtherServiceDocket.js +1 -12
- package/dist/components/molecules/Pagination/Pagination.js +4 -15
- package/dist/components/molecules/PaxChips/PaxChips.d.ts +11 -0
- package/dist/components/molecules/PaxChips/PaxChips.js +9 -0
- package/dist/components/molecules/PaxDisplay/PaxDisplay.d.ts +0 -1
- package/dist/components/molecules/PaxDisplay/PaxDisplay.js +5 -16
- package/dist/components/molecules/PriceDisplay/PriceDisplay.js +1 -12
- package/dist/components/molecules/RatingTab/RatingTab.js +1 -12
- package/dist/components/molecules/SectionTitle/SectionTitle.js +1 -12
- package/dist/components/molecules/ServiceInfo/ServiceInfo.js +2 -13
- package/dist/components/molecules/ServiceLanguages/ServiceLanguages.js +1 -12
- package/dist/components/molecules/ServiceSelector/ServiceSelector.js +4 -15
- package/dist/components/molecules/ServiceTitle/ServiceTitle.js +1 -12
- package/dist/components/molecules/Stepper/Stepper.js +1 -12
- package/dist/components/molecules/StepperTimeline/StepperTimeline.js +6 -17
- package/dist/components/molecules/TabGroup/TabGroup.js +1 -12
- package/dist/components/molecules/TableServiceItem/DetailsCol.js +1 -12
- package/dist/components/molecules/TableServiceItem/ItemCol.d.ts +0 -1
- package/dist/components/molecules/TableServiceItem/ItemCol.js +2 -13
- package/dist/components/molecules/TableServiceItem/RowOtherServices.js +1 -12
- package/dist/components/molecules/TableServiceItem/RowTransfer.js +1 -12
- package/dist/components/molecules/TableServiceItem/index.d.ts +0 -1
- package/dist/components/molecules/TextWithBorderBottom/TextWithBorderBottom.js +1 -1
- package/dist/components/molecules/TextWithIcon/TextWithIcon.d.ts +0 -1
- package/dist/components/molecules/TextWithIcon/TextWithIcon.js +1 -12
- package/dist/components/molecules/TimelineItem/ServiceAccommodation.js +1 -12
- package/dist/components/molecules/TimelineItem/ServiceExcursion.js +1 -12
- package/dist/components/molecules/TimelineItem/ServiceTransfer.js +1 -12
- package/dist/components/molecules/TimelineItem/TimelineHeader.js +1 -12
- package/dist/components/molecules/TimelineItem/TimelineItem.d.ts +0 -1
- package/dist/components/molecules/TimelineItem/TimelineItem.js +1 -12
- package/dist/components/molecules/Toast/Toast.css +2107 -0
- package/dist/components/molecules/Toast/Toast.d.ts +2 -2
- package/dist/components/molecules/Toast/Toast.js +1 -12
- package/dist/components/molecules/TooltipDisplay/TooltipDisplay.js +1 -12
- package/dist/components/molecules/TransferDocket/TransferDocket.js +2 -13
- package/dist/components/molecules/UserCard/UserCard.js +3 -14
- package/dist/components/organisms/Booking/BookingDocket/BookingDocket.d.ts +0 -1
- package/dist/components/organisms/Booking/BookingDocket/BookingDocket.js +1 -1
- package/dist/components/organisms/Booking/BookingHeader.js +1 -12
- package/dist/components/organisms/Booking/BookingStep/BookingStep.js +1 -12
- package/dist/components/organisms/CarBookingCard/CarBookingCard.js +2 -2
- package/dist/components/organisms/CarBookingCard/CarBookingCardSkeleton.js +1 -12
- package/dist/components/organisms/CardContainer/CardContainer.js +1 -12
- package/dist/components/organisms/DateTimePicker/DateTimePicker.js +1 -12
- package/dist/components/organisms/Dialog/Dialog.js +3 -15
- package/dist/components/organisms/DialogBookingAddItem/AddItemNewService.d.ts +16 -0
- package/dist/components/organisms/DialogBookingAddItem/AddItemNewService.js +44 -0
- package/dist/components/organisms/DialogBookingAddItem/AddItemSelector.d.ts +8 -0
- package/dist/components/organisms/DialogBookingAddItem/AddItemSelector.js +12 -0
- package/dist/components/organisms/DialogBookingAddItem/DialogBookingAddItem.d.ts +17 -0
- package/dist/components/organisms/DialogBookingAddItem/DialogBookingAddItem.js +55 -0
- package/dist/components/organisms/DialogBookingAddItem/index.d.ts +3 -0
- package/dist/components/organisms/DialogBookingAddItem/index.js +3 -0
- package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.d.ts +2 -2
- package/dist/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.js +1 -12
- package/dist/components/organisms/DialogBookingConfirm/BookingMailSent.js +1 -12
- package/dist/components/organisms/DialogBookingConfirm/BookingReference.js +1 -12
- package/dist/components/organisms/DialogBookingConfirm/BookingSuccess.js +1 -12
- package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.d.ts +4 -0
- package/dist/components/organisms/DialogBookingConfirm/DialogBookingConfirm.js +2 -13
- package/dist/components/organisms/DialogCancelService/CancelBooking/CancelBooking.css +2117 -0
- package/dist/components/organisms/DialogCancelService/CancelBooking/CancelBooking.d.ts +16 -0
- package/dist/components/organisms/DialogCancelService/CancelBooking/CancelBooking.js +28 -0
- package/dist/components/organisms/DialogCancelService/CancelPolicy.d.ts +29 -0
- package/dist/components/organisms/DialogCancelService/CancelPolicy.js +8 -0
- package/dist/components/organisms/DialogCancelService/ConfirmDelete/ConfirmDelete.css +2143 -0
- package/dist/components/organisms/DialogCancelService/ConfirmDelete/ConfirmDelete.d.ts +14 -0
- package/dist/components/organisms/DialogCancelService/ConfirmDelete/ConfirmDelete.js +24 -0
- package/dist/components/organisms/DialogCancelService/DialogCancelService.d.ts +15 -0
- package/dist/components/organisms/DialogCancelService/DialogCancelService.js +14 -0
- package/dist/components/organisms/DialogCancelService/FromList.d.ts +12 -0
- package/dist/components/organisms/DialogCancelService/FromList.js +18 -0
- package/dist/components/organisms/DialogCancelService/index.d.ts +5 -0
- package/dist/components/organisms/DialogCancelService/index.js +1 -0
- package/dist/components/organisms/DialogComparison/DialogComparison.css +2116 -0
- package/dist/components/organisms/DialogComparison/DialogComparison.d.ts +24 -0
- package/dist/components/organisms/DialogComparison/DialogComparison.js +69 -0
- package/dist/components/organisms/DialogDeleteConfirm/DialogDeleteConfirm.d.ts +14 -0
- package/dist/components/organisms/DialogDeleteConfirm/DialogDeleteConfirm.js +11 -0
- package/dist/components/organisms/DialogSendingMail/DialogSendingMail.d.ts +11 -0
- package/dist/components/organisms/DialogSendingMail/DialogSendingMail.js +8 -0
- package/dist/components/organisms/DialogSendingMail/DialogSendingMailContent.d.ts +15 -0
- package/dist/components/organisms/DialogSendingMail/DialogSendingMailContent.js +49 -0
- package/dist/components/organisms/DialogSendingMail/index.d.ts +4 -0
- package/dist/components/organisms/DialogSendingMail/index.js +2 -0
- package/dist/components/organisms/DialogSendingMail/sending-mail-schema.d.ts +7 -0
- package/dist/components/organisms/DialogSendingMail/sending-mail-schema.js +16 -0
- package/dist/components/organisms/Docket/Docket.js +8 -19
- package/dist/components/organisms/Footer/Footer.js +3 -14
- package/dist/components/organisms/MultipleQuotationDocket/MultipleQuotationDocket.js +2 -13
- package/dist/components/organisms/PaxSelector/PaxSelector.js +22 -22
- package/dist/components/organisms/QuoteHeader/QuoteHeader.js +2 -13
- package/dist/components/organisms/RoundTrip/RoundTrip.js +1 -1
- package/dist/components/organisms/SearchBarTransfer/SearchBarTransfer.js +5 -5
- package/dist/components/organisms/TabCancellationPolicy/CancellationAccom.js +1 -12
- package/dist/components/organisms/TabCancellationPolicy/CancellationExcursion.js +1 -12
- package/dist/components/organisms/TabCancellationPolicy/CancellationHeader.d.ts +0 -1
- package/dist/components/organisms/TabCancellationPolicy/CancellationTransfer.js +1 -12
- package/dist/components/organisms/TabCancellationPolicy/HeaderAccom.js +1 -12
- package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion/HeaderTransfer.js +1 -12
- package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.js +1 -12
- package/dist/components/organisms/TabCancellationPolicy/PolicyExcursion.js +1 -12
- package/dist/components/organisms/TabCancellationPolicy/PolicyTransfer.js +1 -12
- package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicy.d.ts +0 -1
- package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicyLayout/TabCancellationPolicyLayout.js +1 -12
- package/dist/components/organisms/TabServiceDetails/Accommodation.js +1 -1
- package/dist/components/organisms/TabServiceDetails/DetailContentTransfer.js +1 -12
- package/dist/components/organisms/TabServiceDetails/DetailsContentAccom.js +2 -2
- package/dist/components/organisms/TabServiceDetails/DetailsContentExcursion.js +1 -12
- package/dist/components/organisms/TabServiceDetails/Excursion.js +1 -1
- package/dist/components/organisms/TabServiceDetails/TabServiceDetails.d.ts +0 -1
- package/dist/components/organisms/TabServiceDetails/TabServiceDetailsLayout/TabServiceDetailsLayout.js +1 -12
- package/dist/components/organisms/TabServiceDetails/Transfer.js +1 -1
- package/dist/components/organisms/Table/Table.css +48 -32
- package/dist/components/organisms/Table/Table.d.ts +4 -1
- package/dist/components/organisms/Table/Table.js +19 -16
- package/dist/components/organisms/Table/TableCell.d.ts +3 -2
- package/dist/components/organisms/Table/TableCell.js +2 -13
- package/dist/components/organisms/Table/columns/booking-cancel-service-columns.d.ts +5 -0
- package/dist/components/organisms/Table/columns/booking-cancel-service-columns.js +166 -0
- package/dist/components/organisms/Table/columns/booking-columns.js +7 -22
- package/dist/components/organisms/Table/columns/comparison-columns.d.ts +3 -0
- package/dist/components/organisms/Table/columns/comparison-columns.js +97 -0
- package/dist/components/organisms/Table/columns/detail-resume-columns.d.ts +3 -1
- package/dist/components/organisms/Table/columns/detail-resume-columns.js +20 -33
- package/dist/components/organisms/Table/columns/index.d.ts +13 -4
- package/dist/components/organisms/Table/columns/index.js +4 -0
- package/dist/components/organisms/Table/columns/quotation-columns.d.ts +4 -1
- package/dist/components/organisms/Table/columns/quotation-columns.js +10 -19
- package/dist/components/organisms/Timeline/Timeline.js +1 -1
- package/dist/components/organisms/TopNavigation/DesktopNav.d.ts +0 -1
- package/dist/components/organisms/TopNavigation/DesktopNav.js +5 -16
- package/dist/components/organisms/TopNavigation/MobileNav.js +9 -20
- package/dist/components/organisms/TransferLine/TransferLine.js +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/form.d.ts +24 -0
- package/dist/components/ui/form.js +79 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.js +30 -0
- package/dist/hooks/useBookingPax.d.ts +1 -1
- package/dist/index.d.ts +26 -15
- package/dist/index.js +10 -2
- package/dist/lib/price-formatter.d.ts +1 -0
- package/dist/lib/price-formatter.js +13 -0
- package/dist/lib/shared-constant.d.ts +1 -0
- package/dist/lib/shared-constant.js +1 -0
- package/dist/lib/utils.d.ts +1 -2
- package/dist/lib/utils.js +1 -1
- package/dist/styles/tokens/tokens.d.ts +464 -464
- package/package.json +7 -3
- package/src/components/atoms/Icon/icons/Info2Icon.tsx +42 -0
- package/src/components/atoms/Icon/icons/registry.tsx +2 -0
- package/src/components/atoms/Inputs/Input/Input.tsx +4 -2
- package/src/components/molecules/Calendar/DateTime.tsx +6 -4
- package/src/components/molecules/DateDisplay/DateDisplay.tsx +7 -7
- package/src/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.css +27 -0
- package/src/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.tsx +12 -1
- package/src/components/molecules/DialogContentPolicy/DialogCancellationAccom.tsx +9 -2
- package/src/components/molecules/DialogContentPolicy/DialogCancellationExcursion.tsx +10 -2
- package/src/components/molecules/DialogContentPolicy/DialogCancellationList.tsx +22 -15
- package/src/components/molecules/DialogContentPolicy/DialogContentPolicy.tsx +1 -1
- package/src/components/molecules/MultiSelectDropdown/MultiSelectDropdown.tsx +117 -82
- package/src/components/molecules/PaxChips/PaxChips.tsx +30 -0
- package/src/components/molecules/TextWithIcon/TextWithIcon.tsx +2 -2
- package/src/components/molecules/Toast/Toast.css +27 -0
- package/src/components/molecules/Toast/Toast.tsx +9 -9
- package/src/components/organisms/Dialog/Dialog.tsx +85 -64
- package/src/components/organisms/{BookingAddItem → DialogBookingAddItem}/AddItemNewService.tsx +17 -2
- package/src/components/organisms/{BookingAddItem/BookingAddItem.tsx → DialogBookingAddItem/DialogBookingAddItem.tsx} +6 -6
- package/src/components/organisms/{BookingAddItem → DialogBookingAddItem}/index.ts +1 -1
- package/src/components/organisms/DialogBookingConfirm/BookingCancellationPolicy.tsx +2 -2
- package/src/components/organisms/DialogBookingConfirm/DialogBookingConfirm.tsx +14 -2
- package/src/components/organisms/DialogCancelService/CancelBooking/CancelBooking.css +24 -0
- package/src/components/organisms/DialogCancelService/CancelBooking/CancelBooking.tsx +98 -0
- package/src/components/organisms/DialogCancelService/CancelPolicy.tsx +68 -0
- package/src/components/organisms/DialogCancelService/ConfirmDelete/ConfirmDelete.css +56 -0
- package/src/components/organisms/DialogCancelService/ConfirmDelete/ConfirmDelete.tsx +67 -0
- package/src/components/organisms/DialogCancelService/DialogCancelService.tsx +32 -0
- package/src/components/organisms/DialogCancelService/FromList.tsx +50 -0
- package/src/components/organisms/DialogCancelService/index.ts +6 -0
- package/src/components/organisms/DialogComparison/DialogComparison.css +23 -0
- package/src/components/organisms/DialogComparison/DialogComparison.tsx +157 -0
- package/src/components/organisms/DialogDeleteConfirm/DialogDeleteConfirm.tsx +57 -0
- package/src/components/organisms/DialogSendingMail/DialogSendingMail.tsx +27 -0
- package/src/components/organisms/DialogSendingMail/DialogSendingMailContent.tsx +115 -0
- package/src/components/organisms/DialogSendingMail/index.ts +5 -0
- package/src/components/organisms/DialogSendingMail/sending-mail-schema.ts +19 -0
- package/src/components/organisms/Table/Table.css +48 -32
- package/src/components/organisms/Table/Table.tsx +30 -6
- package/src/components/organisms/Table/TableCell.tsx +8 -4
- package/src/components/organisms/Table/columns/booking-cancel-service-columns.tsx +226 -0
- package/src/components/organisms/Table/columns/booking-columns.tsx +2 -19
- package/src/components/organisms/Table/columns/comparison-columns.tsx +140 -0
- package/src/components/organisms/Table/columns/detail-resume-columns.tsx +35 -37
- package/src/components/organisms/Table/columns/index.ts +4 -0
- package/src/components/organisms/Table/columns/quotation-columns.tsx +17 -9
- package/src/components/ui/form.tsx +160 -0
- package/src/components/ui/label.tsx +22 -0
- /package/src/components/organisms/{BookingAddItem → DialogBookingAddItem}/AddItemSelector.tsx +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Button from '@/src/components/atoms/Button/Button';
|
|
2
|
-
import Chip from '@/src/components/atoms/Chip/Chip';
|
|
3
2
|
import { Text } from '@/src/components/atoms/Typography/Typography';
|
|
4
3
|
import { ActionDropdown } from '@/src/components/molecules/ActionDropdown/ActionDropdown';
|
|
5
4
|
import { DateDisplay } from '@/src/components/molecules/DateDisplay/DateDisplay';
|
|
5
|
+
import { PaxChips } from '@/src/components/molecules/PaxChips/PaxChips';
|
|
6
6
|
import { ActionDropdownType } from '@/src/types/table';
|
|
7
7
|
import { BookingListItem } from '@/src/types/table/booking.types';
|
|
8
8
|
import { ColumnType } from '../TableCell';
|
|
@@ -61,24 +61,7 @@ export const bookingColumns: (params: {
|
|
|
61
61
|
const paxDetails = value as BookingListItem['pax_details'];
|
|
62
62
|
const paxDetailsKeys = Object.keys(paxDetails);
|
|
63
63
|
if (paxDetailsKeys.length) {
|
|
64
|
-
return
|
|
65
|
-
<div className="flex flex-wrap gap-2">
|
|
66
|
-
{paxDetailsKeys.map((key) => {
|
|
67
|
-
return (
|
|
68
|
-
<Chip
|
|
69
|
-
label={`${key} ${paxDetails[key as keyof BookingListItem['pax_details']]}`}
|
|
70
|
-
type={
|
|
71
|
-
paxDetails[key as keyof BookingListItem['pax_details']] > 0
|
|
72
|
-
? 'filled'
|
|
73
|
-
: 'outline'
|
|
74
|
-
}
|
|
75
|
-
color="accent"
|
|
76
|
-
size="sm"
|
|
77
|
-
/>
|
|
78
|
-
);
|
|
79
|
-
})}
|
|
80
|
-
</div>
|
|
81
|
-
);
|
|
64
|
+
return <PaxChips pax={paxDetails} />;
|
|
82
65
|
}
|
|
83
66
|
return <></>;
|
|
84
67
|
},
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Text } from '@/src/components/atoms/Typography/Typography';
|
|
2
|
+
import { RowAccommodation } from '@/src/components/molecules/TableServiceItem/RowAccommodation';
|
|
3
|
+
import { RowExcursion } from '@/src/components/molecules/TableServiceItem/RowExcursion';
|
|
4
|
+
import { RowOtherServices } from '@/src/components/molecules/TableServiceItem/RowOtherServices';
|
|
5
|
+
import { RowTransfer } from '@/src/components/molecules/TableServiceItem/RowTransfer';
|
|
6
|
+
import { priceFormatter } from '@/src/lib/price-formatter';
|
|
7
|
+
import { ServiceType } from '@/src/types/table';
|
|
8
|
+
import {
|
|
9
|
+
ComparisonData,
|
|
10
|
+
isComparisonAccommodation,
|
|
11
|
+
isComparisonExcursion,
|
|
12
|
+
isComparisonOtherService,
|
|
13
|
+
isComparisonTransfer,
|
|
14
|
+
} from '../../DialogComparison/DialogComparison';
|
|
15
|
+
import { ColumnType } from '../TableCell';
|
|
16
|
+
|
|
17
|
+
const COLUMNS_WIDTH = 532 / 3;
|
|
18
|
+
|
|
19
|
+
export const comparisonColumns: () => ColumnType<ComparisonData>[] = () => {
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
header: 'Item',
|
|
23
|
+
key: 'Type',
|
|
24
|
+
width: COLUMNS_WIDTH,
|
|
25
|
+
cell: (value, raw) => {
|
|
26
|
+
if (isComparisonAccommodation(raw)) {
|
|
27
|
+
const accom = raw;
|
|
28
|
+
return (
|
|
29
|
+
<RowAccommodation.FirstCol
|
|
30
|
+
serviceName={raw.HotelName as string}
|
|
31
|
+
offers={raw.Offers}
|
|
32
|
+
status={raw.RoomStatus}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
if (isComparisonExcursion(raw)) {
|
|
37
|
+
return <RowExcursion.FirstCol serviceName={raw.ExcursionName as string} />;
|
|
38
|
+
}
|
|
39
|
+
if (isComparisonTransfer(raw)) {
|
|
40
|
+
const transfer = raw;
|
|
41
|
+
return (
|
|
42
|
+
<RowTransfer.FirstCol
|
|
43
|
+
serviceName={transfer.VehicleTypeName as string}
|
|
44
|
+
transferType={transfer.TransferType}
|
|
45
|
+
from={transfer.LocationFromName}
|
|
46
|
+
to={transfer.LocationToName}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (value === ServiceType.OTHER_SERVICE) {
|
|
52
|
+
return <RowOtherServices.FirstCol />;
|
|
53
|
+
}
|
|
54
|
+
return <></>;
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
header: 'Details',
|
|
59
|
+
key: 'Type',
|
|
60
|
+
width: COLUMNS_WIDTH,
|
|
61
|
+
cell: (value, raw, index) => {
|
|
62
|
+
if (isComparisonAccommodation(raw)) {
|
|
63
|
+
return (
|
|
64
|
+
<RowAccommodation.DetailsCol
|
|
65
|
+
data={{
|
|
66
|
+
RoomName: raw.RoomName,
|
|
67
|
+
Dates: raw.Dates,
|
|
68
|
+
ClientCategory: raw.ClientCategory,
|
|
69
|
+
MealPlan: raw.MealPlan,
|
|
70
|
+
}}
|
|
71
|
+
index={(index || 0) + 1}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
if (isComparisonExcursion(raw)) {
|
|
76
|
+
return (
|
|
77
|
+
<RowExcursion.DetailsCol
|
|
78
|
+
data={{
|
|
79
|
+
languages: raw.AvailableLanguages,
|
|
80
|
+
duration: raw.Duration,
|
|
81
|
+
accessibility: raw.Accessibility,
|
|
82
|
+
transferType: raw.TransferType,
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
if (isComparisonTransfer(raw)) {
|
|
88
|
+
return (
|
|
89
|
+
<RowTransfer.DetailsCol
|
|
90
|
+
data={{
|
|
91
|
+
carType: raw.VehicleTypeName,
|
|
92
|
+
clientType: 'STD',
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
if (value === ServiceType.OTHER_SERVICE) {
|
|
98
|
+
return <RowOtherServices.DetailsCol />;
|
|
99
|
+
}
|
|
100
|
+
return <></>;
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
header: 'Price',
|
|
105
|
+
key: 'Type',
|
|
106
|
+
width: COLUMNS_WIDTH,
|
|
107
|
+
cell: (_value, raw) => {
|
|
108
|
+
let total: Record<'currency' | 'total', string | undefined> = {
|
|
109
|
+
currency: undefined,
|
|
110
|
+
total: undefined,
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
if (isComparisonAccommodation(raw)) {
|
|
114
|
+
total.currency = raw.Currency;
|
|
115
|
+
total.total = raw.Total;
|
|
116
|
+
}
|
|
117
|
+
if (isComparisonExcursion(raw)) {
|
|
118
|
+
total.currency = raw.Currency;
|
|
119
|
+
total.total = raw.TotalPrice;
|
|
120
|
+
}
|
|
121
|
+
if (isComparisonTransfer(raw)) {
|
|
122
|
+
total.currency = raw.Currency;
|
|
123
|
+
total.total = raw.TotalPrice;
|
|
124
|
+
}
|
|
125
|
+
if (isComparisonOtherService(raw)) {
|
|
126
|
+
total.currency = raw.currency;
|
|
127
|
+
total.total = raw.total_price;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<div className="flex items-center justify-between">
|
|
132
|
+
<Text size="sm" variant="bold">
|
|
133
|
+
{priceFormatter(total.total, total.currency)}
|
|
134
|
+
</Text>
|
|
135
|
+
</div>
|
|
136
|
+
);
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Button from '@/src/components/atoms/Button/Button';
|
|
2
2
|
import { Text } from '@/src/components/atoms/Typography/Typography';
|
|
3
3
|
import { DateDisplay } from '@/src/components/molecules/DateDisplay/DateDisplay';
|
|
4
|
+
import { PaxChips, PaxCount } from '@/src/components/molecules/PaxChips/PaxChips';
|
|
5
|
+
import { priceFormatter } from '@/src/lib/price-formatter';
|
|
4
6
|
import {
|
|
5
7
|
DetailResumeAccommodation,
|
|
6
8
|
DetailResumeExcursion,
|
|
@@ -15,7 +17,10 @@ import { RowOtherServices } from '../../../molecules/TableServiceItem/RowOtherSe
|
|
|
15
17
|
import { RowTransfer } from '../../../molecules/TableServiceItem/RowTransfer';
|
|
16
18
|
import { ColumnType } from '../TableCell';
|
|
17
19
|
|
|
18
|
-
export const detailResumeColumns: (
|
|
20
|
+
export const detailResumeColumns: (params?: {
|
|
21
|
+
onRemove?: (value: DetailResumeItem, index?: number) => void;
|
|
22
|
+
}) => ColumnType<DetailResumeItem>[] = (params) => {
|
|
23
|
+
const { onRemove } = params || {};
|
|
19
24
|
return [
|
|
20
25
|
{
|
|
21
26
|
header: 'Item',
|
|
@@ -138,11 +143,11 @@ export const detailResumeColumns: () => ColumnType<DetailResumeItem>[] = () => {
|
|
|
138
143
|
key: 'Type',
|
|
139
144
|
width: 396,
|
|
140
145
|
cell: (value, raw) => {
|
|
141
|
-
const pax: Record<'
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
const pax: Record<'adult' | 'teen' | 'infant' | 'child', number | undefined> = {
|
|
147
|
+
adult: 0,
|
|
148
|
+
teen: 0,
|
|
149
|
+
infant: 0,
|
|
150
|
+
child: 0,
|
|
146
151
|
};
|
|
147
152
|
|
|
148
153
|
switch (value) {
|
|
@@ -153,44 +158,27 @@ export const detailResumeColumns: () => ColumnType<DetailResumeItem>[] = () => {
|
|
|
153
158
|
| DetailResumeAccommodation
|
|
154
159
|
| DetailResumeExcursion
|
|
155
160
|
| DetailResumeTransfer;
|
|
156
|
-
pax.
|
|
157
|
-
pax.
|
|
158
|
-
pax.
|
|
159
|
-
pax.
|
|
161
|
+
pax.adult = item.AdultCount;
|
|
162
|
+
pax.teen = item.TeenCount;
|
|
163
|
+
pax.infant = item.InfantCount;
|
|
164
|
+
pax.child = item.ChildCount;
|
|
160
165
|
break;
|
|
161
166
|
case ServiceType.OTHER_SERVICE:
|
|
162
167
|
const otherService = raw as DetailResumeOtherService;
|
|
163
|
-
pax.
|
|
164
|
-
pax.
|
|
165
|
-
pax.
|
|
166
|
-
pax.
|
|
168
|
+
pax.adult = otherService.adult_pax;
|
|
169
|
+
pax.teen = otherService.teen_pax;
|
|
170
|
+
pax.infant = otherService.infant_pax;
|
|
171
|
+
pax.child = otherService.child_pax;
|
|
167
172
|
break;
|
|
168
173
|
}
|
|
169
|
-
return
|
|
170
|
-
<div className="flex items-center gap-x-3">
|
|
171
|
-
{Object.keys(pax).map((k, index) => {
|
|
172
|
-
const count = pax[k as keyof typeof pax] ?? 0;
|
|
173
|
-
const type = count > 0 ? 'filled' : 'outline';
|
|
174
|
-
return (
|
|
175
|
-
<Chip
|
|
176
|
-
key={`pax-${index}`}
|
|
177
|
-
label={`${k} ${count}`}
|
|
178
|
-
size="sm"
|
|
179
|
-
color="accent"
|
|
180
|
-
type={type}
|
|
181
|
-
className="!px-3"
|
|
182
|
-
/>
|
|
183
|
-
);
|
|
184
|
-
})}
|
|
185
|
-
</div>
|
|
186
|
-
);
|
|
174
|
+
return <PaxChips pax={pax as PaxCount} />;
|
|
187
175
|
},
|
|
188
176
|
},
|
|
189
177
|
{
|
|
190
178
|
header: 'Price',
|
|
191
179
|
key: 'Type',
|
|
192
180
|
width: 299,
|
|
193
|
-
cell: (value, raw) => {
|
|
181
|
+
cell: (value, raw, index) => {
|
|
194
182
|
let total: Record<'currency' | 'total', string | undefined> = {
|
|
195
183
|
currency: undefined,
|
|
196
184
|
total: undefined,
|
|
@@ -216,9 +204,19 @@ export const detailResumeColumns: () => ColumnType<DetailResumeItem>[] = () => {
|
|
|
216
204
|
}
|
|
217
205
|
|
|
218
206
|
return (
|
|
219
|
-
<
|
|
220
|
-
|
|
221
|
-
|
|
207
|
+
<div className="flex items-center justify-between">
|
|
208
|
+
<Text size="sm" variant="bold">
|
|
209
|
+
{priceFormatter(total.total, total.currency)}
|
|
210
|
+
</Text>
|
|
211
|
+
{onRemove && (
|
|
212
|
+
<Button
|
|
213
|
+
variant="destructive"
|
|
214
|
+
size="sm"
|
|
215
|
+
onClick={() => onRemove(raw, index)}>
|
|
216
|
+
Remove
|
|
217
|
+
</Button>
|
|
218
|
+
)}
|
|
219
|
+
</div>
|
|
222
220
|
);
|
|
223
221
|
},
|
|
224
222
|
},
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { bookingCancelServiceColumns } from './booking-cancel-service-columns';
|
|
1
2
|
import { bookingColumns } from './booking-columns';
|
|
3
|
+
import { comparisonColumns } from './comparison-columns';
|
|
2
4
|
import { detailResumeColumns } from './detail-resume-columns';
|
|
3
5
|
import { quotationColumns } from './quotation-columns';
|
|
4
6
|
|
|
@@ -6,6 +8,8 @@ const columns = {
|
|
|
6
8
|
quotation: quotationColumns,
|
|
7
9
|
detailResume: detailResumeColumns,
|
|
8
10
|
booking: bookingColumns,
|
|
11
|
+
bookingCancelService: bookingCancelServiceColumns,
|
|
12
|
+
comparison: comparisonColumns,
|
|
9
13
|
};
|
|
10
14
|
|
|
11
15
|
export { columns };
|
|
@@ -11,7 +11,10 @@ import { actionDropdownData, chipVariant, clientTypeMap } from '../constant';
|
|
|
11
11
|
|
|
12
12
|
export const quotationColumns: (params: {
|
|
13
13
|
onExpand: (value?: QuotationListItem) => void;
|
|
14
|
-
onAction: (
|
|
14
|
+
onAction: (data: {
|
|
15
|
+
isChild?: boolean;
|
|
16
|
+
quote: QuotationListItem;
|
|
17
|
+
}) => (action: ActionDropdownType) => void;
|
|
15
18
|
}) => ColumnType<QuotationListItem>[] = ({ onExpand, onAction }) => [
|
|
16
19
|
{
|
|
17
20
|
header: 'Quote nb.',
|
|
@@ -27,11 +30,12 @@ export const quotationColumns: (params: {
|
|
|
27
30
|
header: 'Client name',
|
|
28
31
|
key: 'agency_name',
|
|
29
32
|
width: 150,
|
|
30
|
-
cell: (value) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
cell: (value, _raw, _index, childIndex) =>
|
|
34
|
+
childIndex === undefined && (
|
|
35
|
+
<Text variant="medium" size="sm">
|
|
36
|
+
{value as string}
|
|
37
|
+
</Text>
|
|
38
|
+
),
|
|
35
39
|
},
|
|
36
40
|
{
|
|
37
41
|
header: 'File status',
|
|
@@ -120,7 +124,7 @@ export const quotationColumns: (params: {
|
|
|
120
124
|
header: '',
|
|
121
125
|
key: 'actions',
|
|
122
126
|
width: 232,
|
|
123
|
-
cell: (_value, raw) => {
|
|
127
|
+
cell: (_value, raw, _index, childIndex) => {
|
|
124
128
|
const hasChildren = raw.children && raw.children.length > 0;
|
|
125
129
|
const isExpanded = raw.children?.some((child) => child.visible);
|
|
126
130
|
const buttonLabel = isExpanded ? 'See less' : 'See more';
|
|
@@ -138,14 +142,18 @@ export const quotationColumns: (params: {
|
|
|
138
142
|
{buttonLabel}
|
|
139
143
|
</Button>
|
|
140
144
|
) : (
|
|
141
|
-
<div className="flex
|
|
145
|
+
<div className="flex items-center gap-x-8">
|
|
142
146
|
<Button
|
|
143
147
|
variant={isOnRequest ? 'outline-secondary' : 'secondary'}
|
|
144
148
|
size="sm"
|
|
145
149
|
className="table__button">
|
|
146
150
|
{isOnRequest ? 'Request to book' : 'Book now'}
|
|
147
151
|
</Button>
|
|
148
|
-
<ActionDropdown
|
|
152
|
+
<ActionDropdown
|
|
153
|
+
data={actionDropdownData(
|
|
154
|
+
onAction({ isChild: childIndex !== undefined, quote: raw })
|
|
155
|
+
)}
|
|
156
|
+
/>
|
|
149
157
|
</div>
|
|
150
158
|
)}
|
|
151
159
|
</div>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import {
|
|
7
|
+
Controller,
|
|
8
|
+
FormProvider,
|
|
9
|
+
useFormContext,
|
|
10
|
+
useFormState,
|
|
11
|
+
type ControllerProps,
|
|
12
|
+
type FieldPath,
|
|
13
|
+
type FieldValues,
|
|
14
|
+
} from 'react-hook-form';
|
|
15
|
+
|
|
16
|
+
import { Label } from '@/src/components/ui/label';
|
|
17
|
+
import { cn } from '@/src/lib/utils';
|
|
18
|
+
|
|
19
|
+
const Form = FormProvider;
|
|
20
|
+
|
|
21
|
+
type FormFieldContextValue<
|
|
22
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
23
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
24
|
+
> = {
|
|
25
|
+
name: TName;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const FormFieldContext = React.createContext<FormFieldContextValue>(
|
|
29
|
+
{} as FormFieldContextValue
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const FormField = <
|
|
33
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
34
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
35
|
+
>({
|
|
36
|
+
...props
|
|
37
|
+
}: ControllerProps<TFieldValues, TName>) => {
|
|
38
|
+
return (
|
|
39
|
+
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
40
|
+
<Controller {...props} />
|
|
41
|
+
</FormFieldContext.Provider>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const useFormField = () => {
|
|
46
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
47
|
+
const itemContext = React.useContext(FormItemContext);
|
|
48
|
+
const { getFieldState } = useFormContext();
|
|
49
|
+
const formState = useFormState({ name: fieldContext.name });
|
|
50
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
51
|
+
|
|
52
|
+
if (!fieldContext) {
|
|
53
|
+
throw new Error('useFormField should be used within <FormField>');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const { id } = itemContext;
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
id,
|
|
60
|
+
name: fieldContext.name,
|
|
61
|
+
formItemId: `${id}-form-item`,
|
|
62
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
63
|
+
formMessageId: `${id}-form-item-message`,
|
|
64
|
+
...fieldState,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type FormItemContextValue = {
|
|
69
|
+
id: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const FormItemContext = React.createContext<FormItemContextValue>(
|
|
73
|
+
{} as FormItemContextValue
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
function FormItem({ className, ...props }: React.ComponentProps<'div'>) {
|
|
77
|
+
const id = React.useId();
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<FormItemContext.Provider value={{ id }}>
|
|
81
|
+
<div data-slot="form-item" className={cn('grid gap-2', className)} {...props} />
|
|
82
|
+
</FormItemContext.Provider>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function FormLabel({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
90
|
+
const { error, formItemId } = useFormField();
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<Label
|
|
94
|
+
data-slot="form-label"
|
|
95
|
+
data-error={!!error}
|
|
96
|
+
className={cn('data-[error=true]:text-destructive', className)}
|
|
97
|
+
htmlFor={formItemId}
|
|
98
|
+
{...props}
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
|
|
104
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<Slot
|
|
108
|
+
data-slot="form-control"
|
|
109
|
+
id={formItemId}
|
|
110
|
+
aria-describedby={
|
|
111
|
+
!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`
|
|
112
|
+
}
|
|
113
|
+
aria-invalid={!!error}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function FormDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
120
|
+
const { formDescriptionId } = useFormField();
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<p
|
|
124
|
+
data-slot="form-description"
|
|
125
|
+
id={formDescriptionId}
|
|
126
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
127
|
+
{...props}
|
|
128
|
+
/>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function FormMessage({ className, ...props }: React.ComponentProps<'p'>) {
|
|
133
|
+
const { error, formMessageId } = useFormField();
|
|
134
|
+
const body = error ? String(error?.message ?? '') : props.children;
|
|
135
|
+
|
|
136
|
+
if (!body) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<p
|
|
142
|
+
data-slot="form-message"
|
|
143
|
+
id={formMessageId}
|
|
144
|
+
className={cn('text-[var(--color-text-state-error)] text-sm', className)}
|
|
145
|
+
{...props}>
|
|
146
|
+
{body}
|
|
147
|
+
</p>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export {
|
|
152
|
+
Form,
|
|
153
|
+
FormControl,
|
|
154
|
+
FormDescription,
|
|
155
|
+
FormField,
|
|
156
|
+
FormItem,
|
|
157
|
+
FormLabel,
|
|
158
|
+
FormMessage,
|
|
159
|
+
useFormField,
|
|
160
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/src/lib/utils"
|
|
5
|
+
|
|
6
|
+
function Label({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
10
|
+
return (
|
|
11
|
+
<LabelPrimitive.Root
|
|
12
|
+
data-slot="label"
|
|
13
|
+
className={cn(
|
|
14
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { Label }
|
/package/src/components/organisms/{BookingAddItem → DialogBookingAddItem}/AddItemSelector.tsx
RENAMED
|
File without changes
|