@tui-cruises/mein-schiff-web-react-component-library 2.0.0-rc.1
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/CHANGELOG.md +7 -0
- package/LICENSE +14 -0
- package/README.md +26 -0
- package/custom.d.ts +14 -0
- package/icons/icons/360.tsx +20 -0
- package/icons/icons/add-circle.tsx +26 -0
- package/icons/icons/airplane.tsx +20 -0
- package/icons/icons/anchor.tsx +20 -0
- package/icons/icons/angle-tool.tsx +26 -0
- package/icons/icons/arrow-down.tsx +20 -0
- package/icons/icons/arrow-left.tsx +20 -0
- package/icons/icons/arrow-right.tsx +20 -0
- package/icons/icons/at.tsx +20 -0
- package/icons/icons/baggage.tsx +20 -0
- package/icons/icons/balcony.tsx +20 -0
- package/icons/icons/bathroom.tsx +32 -0
- package/icons/icons/beach.tsx +20 -0
- package/icons/icons/bed.tsx +26 -0
- package/icons/icons/bell.tsx +20 -0
- package/icons/icons/bording.tsx +20 -0
- package/icons/icons/cabins.tsx +20 -0
- package/icons/icons/calendar.tsx +32 -0
- package/icons/icons/cancel.tsx +20 -0
- package/icons/icons/cash.tsx +44 -0
- package/icons/icons/check-circle.tsx +18 -0
- package/icons/icons/check.tsx +20 -0
- package/icons/icons/circle.tsx +20 -0
- package/icons/icons/clear.tsx +24 -0
- package/icons/icons/clock-rotate-right.tsx +20 -0
- package/icons/icons/clock.tsx +26 -0
- package/icons/icons/cloud-sunny.tsx +43 -0
- package/icons/icons/cloud.tsx +20 -0
- package/icons/icons/compass.tsx +26 -0
- package/icons/icons/delete-circle.tsx +26 -0
- package/icons/icons/departure.tsx +20 -0
- package/icons/icons/details.tsx +20 -0
- package/icons/icons/diamond.tsx +20 -0
- package/icons/icons/edit-pencil.tsx +20 -0
- package/icons/icons/excellence.tsx +20 -0
- package/icons/icons/expand.tsx +20 -0
- package/icons/icons/eye-closed.tsx +20 -0
- package/icons/icons/eye-empty.tsx +26 -0
- package/icons/icons/eye-off.tsx +32 -0
- package/icons/icons/eye.tsx +26 -0
- package/icons/icons/fallback.tsx +26 -0
- package/icons/icons/filter.tsx +20 -0
- package/icons/icons/flag.tsx +20 -0
- package/icons/icons/fog.tsx +22 -0
- package/icons/icons/glases.tsx +28 -0
- package/icons/icons/group.tsx +32 -0
- package/icons/icons/heart-filled.tsx +20 -0
- package/icons/icons/heart.tsx +20 -0
- package/icons/icons/help-circle.tsx +24 -0
- package/icons/icons/home.tsx +22 -0
- package/icons/icons/humidity.tsx +30 -0
- package/icons/icons/impressions.tsx +20 -0
- package/icons/icons/inclusive-services.tsx +20 -0
- package/icons/icons/index.ts +141 -0
- package/icons/icons/info-empty.tsx +26 -0
- package/icons/icons/language.tsx +20 -0
- package/icons/icons/lifebuoy.tsx +30 -0
- package/icons/icons/loading.tsx +18 -0
- package/icons/icons/location.tsx +24 -0
- package/icons/icons/log-in.tsx +26 -0
- package/icons/icons/log-out.tsx +26 -0
- package/icons/icons/mail-open.tsx +20 -0
- package/icons/icons/map.tsx +20 -0
- package/icons/icons/maps-arrow-diagonal.tsx +20 -0
- package/icons/icons/media-image-list.tsx +32 -0
- package/icons/icons/menu.tsx +21 -0
- package/icons/icons/metropolis.tsx +20 -0
- package/icons/icons/minus.tsx +20 -0
- package/icons/icons/more-horiz.tsx +35 -0
- package/icons/icons/more-vert.tsx +35 -0
- package/icons/icons/mostly-cloudy-night.tsx +24 -0
- package/icons/icons/ms-ship.tsx +20 -0
- package/icons/icons/music.tsx +20 -0
- package/icons/icons/nav-arrow-down.tsx +20 -0
- package/icons/icons/nav-arrow-left.tsx +20 -0
- package/icons/icons/nav-arrow-right.tsx +20 -0
- package/icons/icons/nav-arrow-up.tsx +20 -0
- package/icons/icons/no-wifi.tsx +18 -0
- package/icons/icons/old-trips.tsx +20 -0
- package/icons/icons/percentage.tsx +20 -0
- package/icons/icons/phone.tsx +20 -0
- package/icons/icons/pin.tsx +20 -0
- package/icons/icons/play.tsx +20 -0
- package/icons/icons/plus-circle.tsx +20 -0
- package/icons/icons/plus.tsx +20 -0
- package/icons/icons/point.tsx +15 -0
- package/icons/icons/rain.tsx +22 -0
- package/icons/icons/receipt.tsx +20 -0
- package/icons/icons/refresh-double.tsx +32 -0
- package/icons/icons/search.tsx +26 -0
- package/icons/icons/security-pass.tsx +26 -0
- package/icons/icons/settings.tsx +20 -0
- package/icons/icons/share-ios.tsx +26 -0
- package/icons/icons/ship-account.tsx +20 -0
- package/icons/icons/ship-info.tsx +20 -0
- package/icons/icons/ship-position.tsx +27 -0
- package/icons/icons/shooting-stars.tsx +28 -0
- package/icons/icons/sleet.tsx +22 -0
- package/icons/icons/snow-flake.tsx +20 -0
- package/icons/icons/snow.tsx +22 -0
- package/icons/icons/sofa.tsx +32 -0
- package/icons/icons/star-dashed.tsx +20 -0
- package/icons/icons/star-filled.tsx +25 -0
- package/icons/icons/star-half-dashed.tsx +26 -0
- package/icons/icons/star.tsx +20 -0
- package/icons/icons/substract.tsx +26 -0
- package/icons/icons/sun-light.tsx +42 -0
- package/icons/icons/temperature-high.tsx +26 -0
- package/icons/icons/thunderstorm.tsx +26 -0
- package/icons/icons/tornado.tsx +18 -0
- package/icons/icons/trash.tsx +20 -0
- package/icons/icons/travel-assistant.tsx +24 -0
- package/icons/icons/tropical-storm.tsx +71 -0
- package/icons/icons/upcoming-trips.tsx +27 -0
- package/icons/icons/user.tsx +26 -0
- package/icons/icons/warning-circle.tsx +26 -0
- package/icons/icons/warning-hexagon.tsx +26 -0
- package/icons/icons/weather.tsx +20 -0
- package/icons/icons/wifi.tsx +20 -0
- package/icons/icons/wind.tsx +22 -0
- package/icons/icons/windrose.tsx +42 -0
- package/icons/icons/windsock.tsx +20 -0
- package/icons/pictograms/24h-meals.tsx +25 -0
- package/icons/pictograms/ad-template.tsx +23 -0
- package/icons/pictograms/add.tsx +25 -0
- package/icons/pictograms/adventure-club-only.tsx +25 -0
- package/icons/pictograms/allergy.tsx +30 -0
- package/icons/pictograms/anchor.tsx +23 -0
- package/icons/pictograms/arrival.tsx +23 -0
- package/icons/pictograms/baby-awake.tsx +20 -0
- package/icons/pictograms/baby-monitor.tsx +20 -0
- package/icons/pictograms/baby-sleep.tsx +20 -0
- package/icons/pictograms/baggage-information.tsx +23 -0
- package/icons/pictograms/baggage.tsx +23 -0
- package/icons/pictograms/bedroom-check.tsx +23 -0
- package/icons/pictograms/bedroom.tsx +23 -0
- package/icons/pictograms/beverages.tsx +28 -0
- package/icons/pictograms/billboard.tsx +23 -0
- package/icons/pictograms/blog.tsx +23 -0
- package/icons/pictograms/brochure.tsx +23 -0
- package/icons/pictograms/calendar-check.tsx +18 -0
- package/icons/pictograms/calendar-default.tsx +18 -0
- package/icons/pictograms/calendar-disabled.tsx +18 -0
- package/icons/pictograms/calendar-focus.tsx +25 -0
- package/icons/pictograms/champagne-glasses.tsx +25 -0
- package/icons/pictograms/check.tsx +25 -0
- package/icons/pictograms/checklist-check.tsx +18 -0
- package/icons/pictograms/checklist.tsx +21 -0
- package/icons/pictograms/checkmark.tsx +23 -0
- package/icons/pictograms/chef-hat.tsx +30 -0
- package/icons/pictograms/chevron-down.tsx +25 -0
- package/icons/pictograms/chevron-up.tsx +25 -0
- package/icons/pictograms/circles.tsx +25 -0
- package/icons/pictograms/cleaning-trolley.tsx +30 -0
- package/icons/pictograms/clock-0-30.tsx +23 -0
- package/icons/pictograms/clock-0.tsx +23 -0
- package/icons/pictograms/clock-1-30.tsx +23 -0
- package/icons/pictograms/clock-1.tsx +23 -0
- package/icons/pictograms/clock-10-30.tsx +23 -0
- package/icons/pictograms/clock-10.tsx +23 -0
- package/icons/pictograms/clock-11-30.tsx +23 -0
- package/icons/pictograms/clock-11.tsx +23 -0
- package/icons/pictograms/clock-2-30.tsx +23 -0
- package/icons/pictograms/clock-2.tsx +23 -0
- package/icons/pictograms/clock-3-30.tsx +23 -0
- package/icons/pictograms/clock-3.tsx +23 -0
- package/icons/pictograms/clock-4-30.tsx +23 -0
- package/icons/pictograms/clock-4.tsx +23 -0
- package/icons/pictograms/clock-5-30.tsx +23 -0
- package/icons/pictograms/clock-5.tsx +23 -0
- package/icons/pictograms/clock-6-30.tsx +23 -0
- package/icons/pictograms/clock-6.tsx +23 -0
- package/icons/pictograms/clock-7-30.tsx +23 -0
- package/icons/pictograms/clock-7.tsx +23 -0
- package/icons/pictograms/clock-8-30.tsx +23 -0
- package/icons/pictograms/clock-8.tsx +23 -0
- package/icons/pictograms/clock-9-30.tsx +23 -0
- package/icons/pictograms/clock-9.tsx +23 -0
- package/icons/pictograms/clock-default.tsx +23 -0
- package/icons/pictograms/close.tsx +25 -0
- package/icons/pictograms/clothing.tsx +23 -0
- package/icons/pictograms/cloud.tsx +23 -0
- package/icons/pictograms/cocktails.tsx +23 -0
- package/icons/pictograms/coffee-machine.tsx +23 -0
- package/icons/pictograms/compass.tsx +23 -0
- package/icons/pictograms/couple.tsx +25 -0
- package/icons/pictograms/crew-love.tsx +28 -0
- package/icons/pictograms/crown.tsx +23 -0
- package/icons/pictograms/dart.tsx +23 -0
- package/icons/pictograms/decoration.tsx +23 -0
- package/icons/pictograms/departure-check.tsx +25 -0
- package/icons/pictograms/departure-germany.tsx +20 -0
- package/icons/pictograms/departure-time.tsx +35 -0
- package/icons/pictograms/departure.tsx +23 -0
- package/icons/pictograms/diamond.tsx +23 -0
- package/icons/pictograms/discount-card.tsx +35 -0
- package/icons/pictograms/discount.tsx +30 -0
- package/icons/pictograms/documents.tsx +23 -0
- package/icons/pictograms/download-document.tsx +23 -0
- package/icons/pictograms/download.tsx +23 -0
- package/icons/pictograms/dripping-dew.tsx +23 -0
- package/icons/pictograms/dumbbell.tsx +25 -0
- package/icons/pictograms/early-bird.tsx +23 -0
- package/icons/pictograms/edit.tsx +23 -0
- package/icons/pictograms/energy-saving.tsx +23 -0
- package/icons/pictograms/enjoyer-club-only.tsx +18 -0
- package/icons/pictograms/environment.tsx +30 -0
- package/icons/pictograms/environmental-officer.tsx +30 -0
- package/icons/pictograms/explorer-club-only.tsx +18 -0
- package/icons/pictograms/family.tsx +25 -0
- package/icons/pictograms/fb-community.tsx +25 -0
- package/icons/pictograms/finance.tsx +25 -0
- package/icons/pictograms/fog.tsx +25 -0
- package/icons/pictograms/food-certificate.tsx +30 -0
- package/icons/pictograms/gastronomy.tsx +25 -0
- package/icons/pictograms/gift.tsx +23 -0
- package/icons/pictograms/globetrotter-club-only.tsx +18 -0
- package/icons/pictograms/hairdresser.tsx +20 -0
- package/icons/pictograms/handbag.tsx +30 -0
- package/icons/pictograms/hands-holding-heart.tsx +30 -0
- package/icons/pictograms/heart-beat.tsx +29 -0
- package/icons/pictograms/heart.tsx +23 -0
- package/icons/pictograms/home.tsx +23 -0
- package/icons/pictograms/hospital-cross.tsx +23 -0
- package/icons/pictograms/hot-dish.tsx +23 -0
- package/icons/pictograms/hot-drink.tsx +25 -0
- package/icons/pictograms/human-heart.tsx +30 -0
- package/icons/pictograms/human-holding-heart.tsx +30 -0
- package/icons/pictograms/human-open-arms.tsx +23 -0
- package/icons/pictograms/human-profile.tsx +23 -0
- package/icons/pictograms/human-swimming.tsx +25 -0
- package/icons/pictograms/ice-cream.tsx +23 -0
- package/icons/pictograms/important.tsx +23 -0
- package/icons/pictograms/index.ts +285 -0
- package/icons/pictograms/information.tsx +30 -0
- package/icons/pictograms/internet.tsx +23 -0
- package/icons/pictograms/jogging.tsx +21 -0
- package/icons/pictograms/kid-playing.tsx +23 -0
- package/icons/pictograms/life-jacket.tsx +21 -0
- package/icons/pictograms/lifebuoy.tsx +20 -0
- package/icons/pictograms/lightbulb.tsx +23 -0
- package/icons/pictograms/lightning.tsx +23 -0
- package/icons/pictograms/location-mark.tsx +30 -0
- package/icons/pictograms/log-in.tsx +23 -0
- package/icons/pictograms/long-term-trips.tsx +20 -0
- package/icons/pictograms/lotte-chatbot.tsx +28 -0
- package/icons/pictograms/lotte-mail.tsx +28 -0
- package/icons/pictograms/mail-at.tsx +23 -0
- package/icons/pictograms/mail-information.tsx +23 -0
- package/icons/pictograms/mailbox.tsx +23 -0
- package/icons/pictograms/many-sea-days.tsx +20 -0
- package/icons/pictograms/medal.tsx +23 -0
- package/icons/pictograms/microphone.tsx +23 -0
- package/icons/pictograms/ms-1.tsx +23 -0
- package/icons/pictograms/ms-2.tsx +30 -0
- package/icons/pictograms/ms-3.tsx +30 -0
- package/icons/pictograms/ms-4.tsx +30 -0
- package/icons/pictograms/ms-5.tsx +30 -0
- package/icons/pictograms/ms-6.tsx +30 -0
- package/icons/pictograms/ms-7-new-eng.tsx +37 -0
- package/icons/pictograms/ms-7-new.tsx +30 -0
- package/icons/pictograms/ms-7.tsx +30 -0
- package/icons/pictograms/ms-default.tsx +30 -0
- package/icons/pictograms/ms-flow-new-eng.tsx +37 -0
- package/icons/pictograms/ms-flow-new.tsx +49 -0
- package/icons/pictograms/ms-flow.tsx +41 -0
- package/icons/pictograms/ms-relax-new-eng.tsx +37 -0
- package/icons/pictograms/ms-relax-new.tsx +36 -0
- package/icons/pictograms/ms-ship.tsx +23 -0
- package/icons/pictograms/music-book.tsx +23 -0
- package/icons/pictograms/my-account.tsx +22 -0
- package/icons/pictograms/my-trips.tsx +29 -0
- package/icons/pictograms/navigation-arrow.tsx +23 -0
- package/icons/pictograms/no-wifi.tsx +21 -0
- package/icons/pictograms/not-available.tsx +23 -0
- package/icons/pictograms/offer.tsx +23 -0
- package/icons/pictograms/offline.tsx +25 -0
- package/icons/pictograms/onboard-announcement.tsx +20 -0
- package/icons/pictograms/package-newspaper.tsx +27 -0
- package/icons/pictograms/paper-news.tsx +23 -0
- package/icons/pictograms/paper-plane.tsx +28 -0
- package/icons/pictograms/payment-check.tsx +32 -0
- package/icons/pictograms/payment.tsx +28 -0
- package/icons/pictograms/people-check.tsx +25 -0
- package/icons/pictograms/people.tsx +25 -0
- package/icons/pictograms/permanent-make-up.tsx +20 -0
- package/icons/pictograms/person-single.tsx +23 -0
- package/icons/pictograms/phone.tsx +20 -0
- package/icons/pictograms/play-button.tsx +20 -0
- package/icons/pictograms/presentation.tsx +23 -0
- package/icons/pictograms/price-tag.tsx +21 -0
- package/icons/pictograms/printer.tsx +23 -0
- package/icons/pictograms/rain.tsx +23 -0
- package/icons/pictograms/receipt.tsx +25 -0
- package/icons/pictograms/remove.tsx +25 -0
- package/icons/pictograms/safety.tsx +23 -0
- package/icons/pictograms/screen.tsx +23 -0
- package/icons/pictograms/search.tsx +23 -0
- package/icons/pictograms/service.tsx +23 -0
- package/icons/pictograms/sewage.tsx +30 -0
- package/icons/pictograms/ship-outstanding.tsx +23 -0
- package/icons/pictograms/ship-transfer.tsx +23 -0
- package/icons/pictograms/shooting-stars.tsx +23 -0
- package/icons/pictograms/shore-excursions-old.tsx +23 -0
- package/icons/pictograms/shore-excursions.tsx +32 -0
- package/icons/pictograms/short-notice-departures.tsx +20 -0
- package/icons/pictograms/short-trips.tsx +21 -0
- package/icons/pictograms/size.tsx +23 -0
- package/icons/pictograms/smartphone.tsx +23 -0
- package/icons/pictograms/smiley.tsx +23 -0
- package/icons/pictograms/social-media.tsx +37 -0
- package/icons/pictograms/spa-balcony-cabin.tsx +43 -0
- package/icons/pictograms/speech-bubble-faq.tsx +23 -0
- package/icons/pictograms/speech-bubble-hello.tsx +23 -0
- package/icons/pictograms/speech-bubble-ok.tsx +30 -0
- package/icons/pictograms/speedboat.tsx +23 -0
- package/icons/pictograms/star-cancel.tsx +23 -0
- package/icons/pictograms/star-check.tsx +23 -0
- package/icons/pictograms/star-plus.tsx +23 -0
- package/icons/pictograms/star.tsx +23 -0
- package/icons/pictograms/sun-cloud.tsx +23 -0
- package/icons/pictograms/sun-lounger.tsx +23 -0
- package/icons/pictograms/sun.tsx +23 -0
- package/icons/pictograms/theater-mask.tsx +35 -0
- package/icons/pictograms/thermometer.tsx +23 -0
- package/icons/pictograms/tickets.tsx +21 -0
- package/icons/pictograms/towels.tsx +23 -0
- package/icons/pictograms/transportation.tsx +30 -0
- package/icons/pictograms/travel-protection-check.tsx +23 -0
- package/icons/pictograms/travel-protection.tsx +23 -0
- package/icons/pictograms/video.tsx +23 -0
- package/icons/pictograms/waste-management.tsx +30 -0
- package/icons/pictograms/webinar.tsx +23 -0
- package/icons/pictograms/wheel-of-fortune.tsx +23 -0
- package/icons/pictograms/wifi.tsx +20 -0
- package/icons/pictograms/wind.tsx +25 -0
- package/index.tsx +73 -0
- package/package.json +119 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/videos/placeholder.mp4 +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_It.ttf +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_It.woff +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_It.woff2 +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_Rg.ttf +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_Rg.woff +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_Rg.woff2 +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_SBd.ttf +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_SBd.woff +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_SBd.woff2 +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_SBdIt.ttf +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_SBdIt.woff +0 -0
- package/src/assets/fonts/mein-schiff-sans-pro/MeinSchiffSansPro_SBdIt.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200.svg +338 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200italic.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200italic.svg +345 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200italic.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200italic.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-200italic.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300.svg +338 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300italic.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300italic.svg +346 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300italic.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300italic.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-300italic.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600.svg +337 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600italic.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600italic.svg +342 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600italic.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600italic.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-600italic.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700.svg +337 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700italic.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700italic.svg +339 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700italic.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700italic.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-700italic.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900.svg +337 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900italic.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900italic.svg +340 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900italic.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900italic.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-900italic.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-italic.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-italic.svg +343 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-italic.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-italic.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-italic.woff2 +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-regular.eot +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-regular.svg +337 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-regular.ttf +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-regular.woff +0 -0
- package/src/assets/fonts/source-sans-pro/source-sans-pro-v21-latin-regular.woff2 +0 -0
- package/src/assets/images/placeholder-blueish.jpg +0 -0
- package/src/assets/images/placeholder-sepia.jpg +0 -0
- package/src/assets/images/placeholder.jpg +0 -0
- package/src/components/core/Accordion/Accordion.tsx +228 -0
- package/src/components/core/Accordion/AccordionItem.tsx +72 -0
- package/src/components/core/Accordion/AccordionTab.tsx +39 -0
- package/src/components/core/Accordion/index.ts +3 -0
- package/src/components/core/Accordion/utils.tsx +13 -0
- package/src/components/core/Alert/Alert.tsx +131 -0
- package/src/components/core/Alert/index.ts +1 -0
- package/src/components/core/AlertDialog/AlertDialog.tsx +288 -0
- package/src/components/core/AlertDialog/index.ts +1 -0
- package/src/components/core/Badge/Badge.tsx +70 -0
- package/src/components/core/Badge/index.ts +1 -0
- package/src/components/core/BirthdateField/BirthdateField.tsx +269 -0
- package/src/components/core/BirthdateField/index.ts +1 -0
- package/src/components/core/Button/Button.tsx +178 -0
- package/src/components/core/Button/index.ts +1 -0
- package/src/components/core/ButtonGroup/ButtonGroup.tsx +71 -0
- package/src/components/core/ButtonGroup/index.ts +1 -0
- package/src/components/core/Calendar/Calendar.tsx +303 -0
- package/src/components/core/Calendar/index.ts +1 -0
- package/src/components/core/Checkbox/Checkbox.tsx +107 -0
- package/src/components/core/Checkbox/index.ts +1 -0
- package/src/components/core/CheckboxField/CheckboxField.tsx +156 -0
- package/src/components/core/CheckboxField/CheckboxFieldError.tsx +14 -0
- package/src/components/core/CheckboxField/CheckboxFieldLabel.tsx +25 -0
- package/src/components/core/CheckboxField/CheckboxFieldNote.tsx +16 -0
- package/src/components/core/CheckboxField/index.ts +1 -0
- package/src/components/core/Countdown/Countdown.tsx +67 -0
- package/src/components/core/Countdown/index.ts +1 -0
- package/src/components/core/DataTable/DataTable.tsx +98 -0
- package/src/components/core/DataTable/index.ts +1 -0
- package/src/components/core/Dialog/Dialog.tsx +443 -0
- package/src/components/core/Dialog/index.ts +1 -0
- package/src/components/core/Divider/Divider.tsx +37 -0
- package/src/components/core/Divider/index.ts +1 -0
- package/src/components/core/FavoriteButton/FavoriteButton.tsx +294 -0
- package/src/components/core/FavoriteButton/index.ts +1 -0
- package/src/components/core/Fieldset/Fieldset.tsx +42 -0
- package/src/components/core/Fieldset/index.ts +1 -0
- package/src/components/core/FormLabel/FormLabel.tsx +88 -0
- package/src/components/core/FormLabel/index.ts +1 -0
- package/src/components/core/Icon/Icon.tsx +106 -0
- package/src/components/core/Icon/index.ts +1 -0
- package/src/components/core/IconButton/IconButton.tsx +169 -0
- package/src/components/core/IconButton/index.ts +1 -0
- package/src/components/core/InputField/InputField.tsx +128 -0
- package/src/components/core/InputField/InputFieldError.tsx +17 -0
- package/src/components/core/InputField/InputFieldInput.tsx +67 -0
- package/src/components/core/InputField/InputFieldLabel.tsx +29 -0
- package/src/components/core/InputField/InputFieldNote.tsx +16 -0
- package/src/components/core/InputField/index.ts +1 -0
- package/src/components/core/LoadingSpinner/LoadingSpinner.tsx +50 -0
- package/src/components/core/LoadingSpinner/index.ts +1 -0
- package/src/components/core/Pagination/Pagination.tsx +191 -0
- package/src/components/core/Pagination/index.ts +1 -0
- package/src/components/core/PasswordField/PasswordField.tsx +187 -0
- package/src/components/core/PasswordField/PasswordFieldRequirementsList.tsx +78 -0
- package/src/components/core/PasswordField/index.ts +1 -0
- package/src/components/core/PhoneNumberInput/PhoneNumberInput.tsx +201 -0
- package/src/components/core/PhoneNumberInput/countries.json +242 -0
- package/src/components/core/PhoneNumberInput/index.ts +1 -0
- package/src/components/core/Pictogram/Pictogram.tsx +67 -0
- package/src/components/core/Pictogram/index.ts +1 -0
- package/src/components/core/Popover/Popover.tsx +61 -0
- package/src/components/core/Popover/index.ts +1 -0
- package/src/components/core/Portlist/Portlist.tsx +28 -0
- package/src/components/core/Portlist/index.ts +1 -0
- package/src/components/core/PriceInput/PriceInput.tsx +100 -0
- package/src/components/core/PriceInput/index.ts +1 -0
- package/src/components/core/QuantityItem/QuantityItem.tsx +37 -0
- package/src/components/core/QuantityItem/index.ts +1 -0
- package/src/components/core/Radio/Radio.tsx +64 -0
- package/src/components/core/Radio/index.ts +1 -0
- package/src/components/core/RadioField/RadioField.tsx +66 -0
- package/src/components/core/RadioField/index.ts +1 -0
- package/src/components/core/RadixRadio/RadixRadio.tsx +56 -0
- package/src/components/core/RadixRadio/index.ts +1 -0
- package/src/components/core/RadixSelect/RadixSelect.tsx +172 -0
- package/src/components/core/RadixSelect/index.ts +1 -0
- package/src/components/core/RangeSlider/RangeSlider.tsx +59 -0
- package/src/components/core/RangeSlider/index.ts +1 -0
- package/src/components/core/Section/Section.tsx +62 -0
- package/src/components/core/Section/index.ts +1 -0
- package/src/components/core/SegmentedControl/SegmentedControl.tsx +65 -0
- package/src/components/core/SegmentedControl/index.ts +1 -0
- package/src/components/core/Select/Select.tsx +171 -0
- package/src/components/core/Select/index.ts +1 -0
- package/src/components/core/SelectField/SelectField.tsx +67 -0
- package/src/components/core/SelectField/index.ts +1 -0
- package/src/components/core/Skeleton/Skeleton.tsx +23 -0
- package/src/components/core/Skeleton/SkeletonTextLines.tsx +37 -0
- package/src/components/core/Skeleton/index.ts +2 -0
- package/src/components/core/Stepper/Stepper.tsx +116 -0
- package/src/components/core/Stepper/index.ts +1 -0
- package/src/components/core/SwitchToggle/SwitchToggle.tsx +46 -0
- package/src/components/core/SwitchToggle/index.ts +1 -0
- package/src/components/core/Tabs/Tabs.tsx +130 -0
- package/src/components/core/Tabs/index.ts +1 -0
- package/src/components/core/Tag/Tag.tsx +61 -0
- package/src/components/core/Tag/index.ts +1 -0
- package/src/components/core/TextButton/TextButton.tsx +108 -0
- package/src/components/core/TextButton/index.ts +1 -0
- package/src/components/core/Toast/Toast.tsx +65 -0
- package/src/components/core/Toast/index.ts +1 -0
- package/src/components/core/Tooltip/Tooltip.tsx +110 -0
- package/src/components/core/Tooltip/index.ts +1 -0
- package/src/components/shared/NextFontMeinSchiffSansPro/NextFontMeinSchiffSansPro.tsx +160 -0
- package/src/components/shared/NextFontMeinSchiffSansPro/index.ts +1 -0
- package/src/components/shared/UniversalCarousel/CarouselContext.ts +61 -0
- package/src/components/shared/UniversalCarousel/CarouselDefaultPagination.tsx +92 -0
- package/src/components/shared/UniversalCarousel/CarouselInterface.tsx +152 -0
- package/src/components/shared/UniversalCarousel/CarouselStage.tsx +235 -0
- package/src/components/shared/UniversalCarousel/UniversalCarousel.tsx +125 -0
- package/src/components/shared/UniversalCarousel/helpers.ts +206 -0
- package/src/components/shared/UniversalCarousel/index.ts +4 -0
- package/src/helpers/children.ts +27 -0
- package/src/helpers/cookies.ts +22 -0
- package/src/helpers/dateFormat.ts +245 -0
- package/src/helpers/dateToYearMonthDay.ts +17 -0
- package/src/helpers/elementVisibility.ts +53 -0
- package/src/helpers/i18n.ts +197 -0
- package/src/helpers/price.ts +26 -0
- package/src/helpers/responsive-property.ts +118 -0
- package/src/helpers/screen.ts +14 -0
- package/src/helpers/sleep.ts +5 -0
- package/src/helpers/slot.tsx +68 -0
- package/src/helpers/ssr.ts +5 -0
- package/src/helpers/store.ts +75 -0
- package/src/helpers/types.ts +18 -0
- package/src/helpers/utils.ts +3 -0
- package/src/hooks/use-active-screen-names.ts +100 -0
- package/src/hooks/use-intersection-observer.ts +190 -0
- package/src/hooks/use-screen-name-at-least.ts +32 -0
- package/src/hooks/use-screen-name.ts +34 -0
- package/src/hooks/use-store.ts +45 -0
- package/src/hooks/use-toasts.ts +111 -0
- package/src/stores/toasts-store.ts +11 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
AnchorHTMLAttributes,
|
|
5
|
+
ButtonHTMLAttributes,
|
|
6
|
+
ComponentProps,
|
|
7
|
+
FC,
|
|
8
|
+
PropsWithChildren,
|
|
9
|
+
ReactNode,
|
|
10
|
+
} from 'react';
|
|
11
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
12
|
+
import { Button } from '../../core/Button';
|
|
13
|
+
import { ButtonGroup } from '../../core/ButtonGroup';
|
|
14
|
+
import { EventClickArea, EventClickElement } from '@tuic/lib/tracking/tealium';
|
|
15
|
+
import { twJoin } from 'tailwind-merge';
|
|
16
|
+
|
|
17
|
+
type ActionBase = {
|
|
18
|
+
/**
|
|
19
|
+
* The title of the action -- this is displayed as a Button's label.
|
|
20
|
+
*/
|
|
21
|
+
title: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Indicates whether the action is of destructive kind. Destructive actions render a emphasized button.
|
|
25
|
+
*/
|
|
26
|
+
primary?: boolean;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type ButtonAction = ActionBase & {
|
|
30
|
+
as?: 'button';
|
|
31
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
32
|
+
type AnchorAction = ActionBase & {
|
|
33
|
+
as: 'a';
|
|
34
|
+
} & AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
35
|
+
|
|
36
|
+
type ButtonOrAnchorAction = ButtonAction | AnchorAction;
|
|
37
|
+
|
|
38
|
+
type ActionCollection =
|
|
39
|
+
| []
|
|
40
|
+
| [ButtonOrAnchorAction]
|
|
41
|
+
| [ButtonAction, ButtonOrAnchorAction]
|
|
42
|
+
| [AnchorAction, ButtonOrAnchorAction];
|
|
43
|
+
|
|
44
|
+
type Props = PropsWithChildren<{
|
|
45
|
+
/**
|
|
46
|
+
* A boolean that determines whether the modal is open or closed. Default is `false` (closed).
|
|
47
|
+
*/
|
|
48
|
+
open?: boolean;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Callback fired when the modal's open state changes.
|
|
52
|
+
*/
|
|
53
|
+
onOpenChange?: ComponentProps<
|
|
54
|
+
typeof AlertDialogPrimitive.Root
|
|
55
|
+
>['onOpenChange'];
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The title displayed at the top of the modal.
|
|
59
|
+
*/
|
|
60
|
+
title?: ReactNode;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Defines the actions that will be displayed at the bottom of the modal. They can be either a button or an anchor action and you can provide up to two actions.
|
|
64
|
+
*/
|
|
65
|
+
actions?: ActionCollection;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Specifies the container in which the modal will render. If not provided, the modal will render as a child of its parent in the DOM tree.
|
|
69
|
+
*/
|
|
70
|
+
container?: ComponentProps<typeof AlertDialogPrimitive.Portal>['container'];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Make the title and Action-Items centered. If not provided, the title will be left-aligned and the Action-Items will be right aligned.
|
|
74
|
+
*/
|
|
75
|
+
centerItems?: boolean;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Styles to be applied to the content div
|
|
79
|
+
*/
|
|
80
|
+
containerClassName?: string;
|
|
81
|
+
}>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Renders a single action, either a button or anchor. If the action is destructive, it wraps the button within `AlertDialog.Action`, otherwise within `AlertDialog.Cancel`.
|
|
85
|
+
*/
|
|
86
|
+
const renderAction = (idx: number, action: ButtonAction | AnchorAction) => {
|
|
87
|
+
const { title, primary, ...attrs } = action;
|
|
88
|
+
|
|
89
|
+
// const buttonInner = attrs.as === 'a' ? <a {...attrs}>{title}</a> :
|
|
90
|
+
|
|
91
|
+
const button = (
|
|
92
|
+
<Button
|
|
93
|
+
data-track-click-label={title}
|
|
94
|
+
data-track-click-element={EventClickElement.Button}
|
|
95
|
+
className="md:min-w-[10rem]"
|
|
96
|
+
variant={primary ? 'primary' : 'secondary'}
|
|
97
|
+
asChild={attrs.as === 'a'}
|
|
98
|
+
{...(attrs.as !== 'a' ? attrs : {})}
|
|
99
|
+
>
|
|
100
|
+
{attrs.as === 'a' ? <a {...attrs}>{title}</a> : title}
|
|
101
|
+
</Button>
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
if (primary) {
|
|
105
|
+
return (
|
|
106
|
+
<AlertDialogPrimitive.Action key={idx} asChild>
|
|
107
|
+
{button}
|
|
108
|
+
</AlertDialogPrimitive.Action>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<AlertDialogPrimitive.Cancel key={idx} asChild>
|
|
114
|
+
{button}
|
|
115
|
+
</AlertDialogPrimitive.Cancel>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Renders the collection of actions. Returns `null` if the collection is empty or not provided.
|
|
121
|
+
*/
|
|
122
|
+
const renderActionCollection = (
|
|
123
|
+
collection?: ActionCollection,
|
|
124
|
+
centerActionCollection?: boolean,
|
|
125
|
+
) => {
|
|
126
|
+
if (!collection || collection.length === 0) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<ButtonGroup
|
|
132
|
+
orientation={centerActionCollection ? 'horizontal-center' : 'horizontal'}
|
|
133
|
+
>
|
|
134
|
+
{collection.map((action, idx) => renderAction(idx, action))}
|
|
135
|
+
</ButtonGroup>
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Renders the main content of the modal, which includes the title and description. Returns `null` if both title and children are not provided.
|
|
141
|
+
*/
|
|
142
|
+
const renderContent = (
|
|
143
|
+
title: ReactNode,
|
|
144
|
+
children: ReactNode,
|
|
145
|
+
centerTitle: boolean,
|
|
146
|
+
) => {
|
|
147
|
+
if (!title && !children) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return (
|
|
152
|
+
<div className="space-y-4">
|
|
153
|
+
{title && (
|
|
154
|
+
<AlertDialogPrimitive.Title
|
|
155
|
+
className={twJoin('headline-md', centerTitle && 'text-center')}
|
|
156
|
+
>
|
|
157
|
+
{title}
|
|
158
|
+
</AlertDialogPrimitive.Title>
|
|
159
|
+
)}
|
|
160
|
+
{children && (
|
|
161
|
+
<AlertDialogPrimitive.Description className="text-lg">
|
|
162
|
+
{children}
|
|
163
|
+
</AlertDialogPrimitive.Description>
|
|
164
|
+
)}
|
|
165
|
+
</div>
|
|
166
|
+
);
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Renders the content either within a specified portal container or as a direct child if no container is provided.
|
|
171
|
+
*/
|
|
172
|
+
const renderOptionalContainer = (
|
|
173
|
+
container: Props['container'],
|
|
174
|
+
content: ReactNode,
|
|
175
|
+
) => {
|
|
176
|
+
if (!container) {
|
|
177
|
+
return content;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return (
|
|
181
|
+
<AlertDialogPrimitive.Portal container={container}>
|
|
182
|
+
{content}
|
|
183
|
+
</AlertDialogPrimitive.Portal>
|
|
184
|
+
);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
* `AlertDialog` is a flexible component for displaying alert modals. It can render as a standalone modal or within a specified portal container and it supports both button and anchor actions. The modal uses [`@radix-ui/react-alert-dialog`](https://www.radix-ui.com/primitives/docs/components/alert-dialog#api-reference) as a foundation, so it provides accessibility and behavior out of the box.
|
|
190
|
+
*
|
|
191
|
+
* ## Usage
|
|
192
|
+
*
|
|
193
|
+
* To use the `AlertDialog`, simply import it and pass in the desired props. You can control the modal by providing the `open` property in conjunction with an `onOpenChange` handlers.
|
|
194
|
+
*
|
|
195
|
+
* ```tsx
|
|
196
|
+
* import { useState } from 'react';
|
|
197
|
+
* import { AlertDialog } from '@tui-cruises/mein-schiff-web-react-component-library';
|
|
198
|
+
*
|
|
199
|
+
* const [open, setOpen] = useState(false);
|
|
200
|
+
*
|
|
201
|
+
* // ...
|
|
202
|
+
*
|
|
203
|
+
* <AlertDialog
|
|
204
|
+
* open={open}
|
|
205
|
+
* onOpenChange={setOpen}
|
|
206
|
+
* title="Are you sure?"
|
|
207
|
+
* actions={[
|
|
208
|
+
* { title: "Cancel" },
|
|
209
|
+
* { title: "Delete", destructive: true, onClick: handleDelete }
|
|
210
|
+
* ]}
|
|
211
|
+
* >
|
|
212
|
+
* Do you really want to delete this item?
|
|
213
|
+
* </AlertDialog>
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* ## Anatomy of an Action
|
|
217
|
+
*
|
|
218
|
+
*
|
|
219
|
+
* In the context of the `AlertDialog`, an action is a crucial element that dictates how users can interact with the modal — be it through buttons or anchor links. Each action you provide must adhere to specific structures: `ButtonAction` or `AnchorAction`, with both sharing a set of common properties and some unique attributes. Here we delve into the anatomy of an action:
|
|
220
|
+
*
|
|
221
|
+
* ### Common Properties
|
|
222
|
+
*
|
|
223
|
+
* - **`title`** (Required): A string specifying the visible label of the action, representing the action text displayed on the button or link.
|
|
224
|
+
* - **`destructive`** (Optional): A boolean indicating whether the action is potentially hazardous, affecting the action's styling to caution users.
|
|
225
|
+
* - **`as`** (Optional for `ButtonAction`, Required for `AnchorAction`): A property to determine the type of action element — `'button'` for button actions and `'a'` for anchor actions.
|
|
226
|
+
*
|
|
227
|
+
* ### Unique Properties
|
|
228
|
+
*
|
|
229
|
+
* - **ButtonAction**: Incorporate any valid HTML button attributes, facilitating functionalities such as disabling the button (`disabled`) or adding a click handler (`onClick`).
|
|
230
|
+
* - **AnchorAction**: Leverage any valid HTML anchor attributes to define the hyperlink specifics, such as the URL to navigate to (`href`) or defining the link’s opening location (`target`).
|
|
231
|
+
*
|
|
232
|
+
* ### Action Examples
|
|
233
|
+
*
|
|
234
|
+
* A button action with a click handler might look like this:
|
|
235
|
+
*
|
|
236
|
+
* ```tsx
|
|
237
|
+
* { title: "Save", as: 'button', onClick: handleSave }
|
|
238
|
+
* ```
|
|
239
|
+
*
|
|
240
|
+
* An anchor action directing to an external page could be structured as:
|
|
241
|
+
*
|
|
242
|
+
* ```tsx
|
|
243
|
+
* { title: "Learn More", as: 'a', href: "#", target: "_blank" }
|
|
244
|
+
* ```
|
|
245
|
+
*
|
|
246
|
+
* Understanding and correctly employing the action's anatomy aids in creating a rich, user-friendly modal experience.
|
|
247
|
+
*/
|
|
248
|
+
export const AlertDialog: FC<Props> = ({
|
|
249
|
+
open,
|
|
250
|
+
onOpenChange,
|
|
251
|
+
children,
|
|
252
|
+
title,
|
|
253
|
+
actions,
|
|
254
|
+
container,
|
|
255
|
+
centerItems = true,
|
|
256
|
+
containerClassName,
|
|
257
|
+
}) => {
|
|
258
|
+
return (
|
|
259
|
+
<AlertDialogPrimitive.Root open={open} onOpenChange={onOpenChange}>
|
|
260
|
+
<AlertDialogPrimitive.Portal container={container || undefined}>
|
|
261
|
+
<AlertDialogPrimitive.Overlay
|
|
262
|
+
className={twJoin(
|
|
263
|
+
'fixed inset-0 z-dialog flex flex-col items-center justify-center bg-overlay backdrop-blur-sm',
|
|
264
|
+
'data-[state=open]:animate-in data-[state=open]:fade-in-0',
|
|
265
|
+
'data-[state=closed]:animate-out data-[state=closed]:fade-out-0',
|
|
266
|
+
)}
|
|
267
|
+
>
|
|
268
|
+
<AlertDialogPrimitive.Content
|
|
269
|
+
data-track-click-area={EventClickArea.Dialog}
|
|
270
|
+
data-track-dialog={`alert-dialog-${title}`}
|
|
271
|
+
className={twJoin(
|
|
272
|
+
'mx-4 flex max-w-[340px] flex-col flex-nowrap rounded-sm bg-surface-white p-8 text-center text-marine-high-emphasis sm:left-1/2 sm:w-[340px] sm:max-w-full md:w-[640px] lg:max-w-screen-sm',
|
|
273
|
+
'data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]',
|
|
274
|
+
'data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',
|
|
275
|
+
containerClassName,
|
|
276
|
+
)}
|
|
277
|
+
>
|
|
278
|
+
<button className="h-0 w-0" name="trap-focus-placeholder" />
|
|
279
|
+
<div className="space-y-8">
|
|
280
|
+
{renderContent(title, children, centerItems)}
|
|
281
|
+
{renderActionCollection(actions, centerItems)}
|
|
282
|
+
</div>
|
|
283
|
+
</AlertDialogPrimitive.Content>
|
|
284
|
+
</AlertDialogPrimitive.Overlay>
|
|
285
|
+
</AlertDialogPrimitive.Portal>
|
|
286
|
+
</AlertDialogPrimitive.Root>
|
|
287
|
+
);
|
|
288
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AlertDialog';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { twJoin } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Badge component.
|
|
6
|
+
*/
|
|
7
|
+
export type BadgeProps = {
|
|
8
|
+
/**
|
|
9
|
+
* The content to be displayed inside the badge.
|
|
10
|
+
* Can be a single ReactNode or an array of ReactNodes.
|
|
11
|
+
*/
|
|
12
|
+
children: ReactNode | ReactNode[];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Additional custom class names to style the badge.
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The visual style of the badge.
|
|
21
|
+
* - `solid`: Solid background with contrasting text.
|
|
22
|
+
* - `outline`: White background with outlined border.
|
|
23
|
+
*/
|
|
24
|
+
variant: 'solid' | 'outline';
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Variant styles for the Badge component.
|
|
29
|
+
*/
|
|
30
|
+
const variants = {
|
|
31
|
+
variant: {
|
|
32
|
+
solid: 'bg-surface-secondary-100 text-white border-transparent',
|
|
33
|
+
outline:
|
|
34
|
+
'bg-surface-white text-marine-high-emphasis border-stroke-primary-100',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A versatile Badge component for displaying small count indicators or labels.
|
|
40
|
+
*
|
|
41
|
+
* @param {BadgeProps} props - The props for the Badge component.
|
|
42
|
+
* @returns {JSX.Element} The rendered Badge component.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <Badge variant="solid" className="custom-class">
|
|
47
|
+
* 99+
|
|
48
|
+
* </Badge>
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
const Badge = (props: BadgeProps) => {
|
|
52
|
+
const { className, variant = 'solid', children } = props;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div
|
|
56
|
+
className={twJoin(
|
|
57
|
+
'leading-none inline-flex items-center justify-center rounded-full border-2 text-xs font-semibold',
|
|
58
|
+
children ? 'min-h-[24px] min-w-[24px]' : 'min-h-[12px] min-w-[12px]',
|
|
59
|
+
variants.variant[variant],
|
|
60
|
+
className,
|
|
61
|
+
)}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
Badge.displayName = 'Badge';
|
|
69
|
+
|
|
70
|
+
export { Badge };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Badge';
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, {
|
|
4
|
+
useState,
|
|
5
|
+
useRef,
|
|
6
|
+
forwardRef,
|
|
7
|
+
useEffect,
|
|
8
|
+
InputHTMLAttributes,
|
|
9
|
+
} from 'react';
|
|
10
|
+
import { twJoin, twMerge } from 'tailwind-merge';
|
|
11
|
+
import { Control as RadixFormControl } from '@radix-ui/react-form';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Defines the properties for the custom input attributes by omitting certain properties from the standard HTML input attributes.
|
|
15
|
+
*/
|
|
16
|
+
type InputAttributes = Omit<
|
|
17
|
+
InputHTMLAttributes<HTMLInputElement>,
|
|
18
|
+
'className' | 'onChange' | 'defaultValue'
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Provides details for formatting date inputs like day, month and year.
|
|
23
|
+
*/
|
|
24
|
+
interface DateFormatDetails {
|
|
25
|
+
maxDecimalPlaces: number;
|
|
26
|
+
placeholder: string;
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Represents the different date formats based on locale.
|
|
32
|
+
*/
|
|
33
|
+
interface Format {
|
|
34
|
+
[key: string]: DateFormatDetails | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Props for the BirthdateField component, with customization options for className, locale handling, value changes, and defaults.
|
|
39
|
+
*/
|
|
40
|
+
export type BirthdateFieldProps = InputAttributes & {
|
|
41
|
+
className?: string;
|
|
42
|
+
locale?: string;
|
|
43
|
+
onChange?: (value: string) => void;
|
|
44
|
+
defaultValue?: string; // YYYY-MM-JJ
|
|
45
|
+
readOnly?: Boolean;
|
|
46
|
+
disabled?: Boolean;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
type SetPartFunction = {
|
|
50
|
+
day: React.Dispatch<React.SetStateAction<string>>;
|
|
51
|
+
month: React.Dispatch<React.SetStateAction<string>>;
|
|
52
|
+
year: React.Dispatch<React.SetStateAction<string>>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
type PartKey = keyof SetPartFunction;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Returns the date format details based on the provided locale.
|
|
59
|
+
* @param {string} locale - The locale code to determine the date format.
|
|
60
|
+
* @returns {Format} The format details for the given locale.
|
|
61
|
+
*/
|
|
62
|
+
const getFormatBasedOnLocale = (locale: string = 'de-DE'): Format => {
|
|
63
|
+
switch (locale) {
|
|
64
|
+
case 'en':
|
|
65
|
+
case 'en-US':
|
|
66
|
+
case 'en-GB':
|
|
67
|
+
return {
|
|
68
|
+
day: { maxDecimalPlaces: 2, placeholder: 'DD', label: 'Day' },
|
|
69
|
+
month: { maxDecimalPlaces: 2, placeholder: 'MM', label: 'Month' },
|
|
70
|
+
year: { maxDecimalPlaces: 4, placeholder: 'YYYY', label: 'Year' },
|
|
71
|
+
};
|
|
72
|
+
default:
|
|
73
|
+
return {
|
|
74
|
+
day: { maxDecimalPlaces: 2, placeholder: 'DD', label: 'Tag' },
|
|
75
|
+
month: { maxDecimalPlaces: 2, placeholder: 'MM', label: 'Monat' },
|
|
76
|
+
year: { maxDecimalPlaces: 4, placeholder: 'JJJJ', label: 'Jahr' },
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Combines individual date components into a single date string in the format YYYY-MM-DD.
|
|
83
|
+
* @param {string} day - Day part of the date.
|
|
84
|
+
* @param {string} month - Month part of the date.
|
|
85
|
+
* @param {string} year - Year part of the date.
|
|
86
|
+
* @returns {string} The combined date string.
|
|
87
|
+
*/
|
|
88
|
+
const createCombinedValue = (day: string, month: string, year: string) => {
|
|
89
|
+
return day && month && year
|
|
90
|
+
? `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
|
91
|
+
: '';
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Parses an initial date value into its component parts.
|
|
96
|
+
* @param {string} value - The initial date value in the format YYYY-MM-DD.
|
|
97
|
+
* @returns {object} An object containing day, month and year as strings.
|
|
98
|
+
*/
|
|
99
|
+
const parseInitialValue = (value: string) => {
|
|
100
|
+
const parts = value.split('-');
|
|
101
|
+
return {
|
|
102
|
+
year: normalizeInitialValueSubPart(parts[0] ?? ''),
|
|
103
|
+
month: normalizeInitialValueSubPart(parts[1] ?? ''),
|
|
104
|
+
day: normalizeInitialValueSubPart(parts[2] ?? ''),
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Normalizes a part of the initial value, ensuring it is a valid number.
|
|
110
|
+
* @param {string} value - The value to normalize.
|
|
111
|
+
* @returns {string} The normalized value, or an empty string if invalid.
|
|
112
|
+
*/
|
|
113
|
+
const normalizeInitialValueSubPart = (value: string) => {
|
|
114
|
+
if (value === '') return value;
|
|
115
|
+
const asNumber = parseInt(value, 10);
|
|
116
|
+
return asNumber < 1 || Number.isNaN(asNumber) ? '' : String(asNumber);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* A component for inputting birthdates with locale-based formatting.
|
|
121
|
+
*
|
|
122
|
+
* ### Configuration
|
|
123
|
+
* - Default locale *static*: `de-DE`
|
|
124
|
+
* - Input *defaultValue* format: `YYYY-MM-DD`
|
|
125
|
+
* - Output format: `YYYY-MM-DD`
|
|
126
|
+
* - Oldest passenger age: `100`
|
|
127
|
+
*/
|
|
128
|
+
const BirthdateField = forwardRef<HTMLInputElement, BirthdateFieldProps>(
|
|
129
|
+
(
|
|
130
|
+
{
|
|
131
|
+
name,
|
|
132
|
+
className,
|
|
133
|
+
locale = 'de-DE',
|
|
134
|
+
onChange,
|
|
135
|
+
defaultValue,
|
|
136
|
+
readOnly,
|
|
137
|
+
disabled,
|
|
138
|
+
...props
|
|
139
|
+
},
|
|
140
|
+
ref,
|
|
141
|
+
) => {
|
|
142
|
+
const format = getFormatBasedOnLocale(locale);
|
|
143
|
+
const defaultValueAsString = defaultValue?.toString() ?? '';
|
|
144
|
+
const initials = parseInitialValue(defaultValueAsString);
|
|
145
|
+
const [day, setDay] = useState(initials.day);
|
|
146
|
+
const [month, setMonth] = useState(initials.month);
|
|
147
|
+
const [year, setYear] = useState(initials.year);
|
|
148
|
+
const [combinedValue, setCombinedValue] = useState(
|
|
149
|
+
createCombinedValue(initials.day, initials.month, initials.year),
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
const prevValue = useRef(defaultValueAsString);
|
|
153
|
+
const dayRef = useRef<HTMLInputElement>(null);
|
|
154
|
+
const monthRef = useRef<HTMLInputElement>(null);
|
|
155
|
+
const yearRef = useRef<HTMLInputElement>(null);
|
|
156
|
+
|
|
157
|
+
const inputClassNames = twMerge(
|
|
158
|
+
'w-full rounded-md border border-stroke-secondary-40 bg-surface-white p-4 text-center text-sm placeholder-secondary-marine-48 outline-none',
|
|
159
|
+
|
|
160
|
+
readOnly || disabled
|
|
161
|
+
? 'text-secondary-marine-48'
|
|
162
|
+
: 'text-marine-high-emphasis focus:outline-none focus-visible:shadow-focus-state data-[invalid]:border-stroke-error-100',
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
const newCombinedValue = createCombinedValue(day, month, year);
|
|
167
|
+
setCombinedValue(newCombinedValue);
|
|
168
|
+
if (newCombinedValue !== prevValue.current && onChange) {
|
|
169
|
+
prevValue.current = newCombinedValue;
|
|
170
|
+
onChange(newCombinedValue);
|
|
171
|
+
}
|
|
172
|
+
}, [day, month, year, onChange]);
|
|
173
|
+
|
|
174
|
+
const handleChange = (
|
|
175
|
+
part: PartKey,
|
|
176
|
+
value: string,
|
|
177
|
+
nextRef?: React.RefObject<HTMLInputElement> | null,
|
|
178
|
+
) => {
|
|
179
|
+
if (readOnly || disabled) return;
|
|
180
|
+
|
|
181
|
+
const setPart: SetPartFunction = {
|
|
182
|
+
day: setDay,
|
|
183
|
+
month: setMonth,
|
|
184
|
+
year: setYear,
|
|
185
|
+
} as const;
|
|
186
|
+
const formatPart = format[part];
|
|
187
|
+
|
|
188
|
+
if (!formatPart) return;
|
|
189
|
+
|
|
190
|
+
value = value.slice(0, formatPart.maxDecimalPlaces);
|
|
191
|
+
|
|
192
|
+
setPart[part](value);
|
|
193
|
+
|
|
194
|
+
if (value.length === formatPart.maxDecimalPlaces && nextRef?.current) {
|
|
195
|
+
nextRef.current.focus();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
// Simple function to generate a "unique" ID by appending a random number
|
|
200
|
+
const uniqueId = (base: string) =>
|
|
201
|
+
`${base}-${Math.floor(Math.random() * 1000)}`;
|
|
202
|
+
|
|
203
|
+
const inputs = [
|
|
204
|
+
{ part: 'day', ref: dayRef, nextRef: monthRef },
|
|
205
|
+
{ part: 'month', ref: monthRef, nextRef: yearRef },
|
|
206
|
+
{ part: 'year', ref: yearRef, nextRef: undefined },
|
|
207
|
+
].map(({ part, ref, nextRef }) => {
|
|
208
|
+
const formatDetail = format[part];
|
|
209
|
+
const id = uniqueId(`birthdate-${part}`);
|
|
210
|
+
if (!formatDetail) return null;
|
|
211
|
+
return (
|
|
212
|
+
<div key={part}>
|
|
213
|
+
<input
|
|
214
|
+
id={id}
|
|
215
|
+
{...props}
|
|
216
|
+
ref={ref}
|
|
217
|
+
type="number"
|
|
218
|
+
maxLength={formatDetail.maxDecimalPlaces}
|
|
219
|
+
placeholder={formatDetail.placeholder}
|
|
220
|
+
className={inputClassNames}
|
|
221
|
+
value={part === 'day' ? day : part === 'month' ? month : year}
|
|
222
|
+
onChange={event =>
|
|
223
|
+
handleChange(
|
|
224
|
+
part as keyof SetPartFunction,
|
|
225
|
+
event.target.value,
|
|
226
|
+
nextRef,
|
|
227
|
+
)
|
|
228
|
+
}
|
|
229
|
+
min={part === 'year' ? new Date().getFullYear() - 100 : 1} // Oldest passenger age: 100
|
|
230
|
+
max={
|
|
231
|
+
part === 'year'
|
|
232
|
+
? new Date().getFullYear()
|
|
233
|
+
: part === 'month'
|
|
234
|
+
? 12
|
|
235
|
+
: 31
|
|
236
|
+
}
|
|
237
|
+
/>
|
|
238
|
+
<label
|
|
239
|
+
htmlFor={id}
|
|
240
|
+
className="mt-1 inline-block cursor-pointer text-sm text-marine-medium-emphasis"
|
|
241
|
+
>
|
|
242
|
+
{formatDetail.label}
|
|
243
|
+
</label>
|
|
244
|
+
</div>
|
|
245
|
+
);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
return (
|
|
249
|
+
<>
|
|
250
|
+
<RadixFormControl asChild>
|
|
251
|
+
<input
|
|
252
|
+
{...props}
|
|
253
|
+
ref={ref}
|
|
254
|
+
type="hidden"
|
|
255
|
+
name={name}
|
|
256
|
+
value={combinedValue}
|
|
257
|
+
/>
|
|
258
|
+
</RadixFormControl>
|
|
259
|
+
<div className={twJoin('grid grid-cols-3 gap-3', className)}>
|
|
260
|
+
{inputs}
|
|
261
|
+
</div>
|
|
262
|
+
</>
|
|
263
|
+
);
|
|
264
|
+
},
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
BirthdateField.displayName = 'BirthdateField';
|
|
268
|
+
|
|
269
|
+
export { BirthdateField };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BirthdateField';
|