@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,294 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AnchorHTMLAttributes,
|
|
5
|
+
ButtonHTMLAttributes,
|
|
6
|
+
Dispatch,
|
|
7
|
+
forwardRef,
|
|
8
|
+
ForwardRefRenderFunction,
|
|
9
|
+
ReactNode,
|
|
10
|
+
SetStateAction,
|
|
11
|
+
useState,
|
|
12
|
+
} from 'react';
|
|
13
|
+
import { twMerge } from 'tailwind-merge';
|
|
14
|
+
import { Icon } from '../../core/Icon';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Handler for click events, expected to manage active state toggling and possibly return a promise for async handling.
|
|
18
|
+
*/
|
|
19
|
+
type OnClickHandler = (
|
|
20
|
+
active: boolean,
|
|
21
|
+
) => void | boolean | Promise<void | boolean>;
|
|
22
|
+
|
|
23
|
+
type CommonProps = {
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The initial 'active' state of the component when it mounts.
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <FavoriteButton defaultActive={true} />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
defaultActive?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A React node or a function that returns a React node.
|
|
36
|
+
*
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <FavoriteButton>
|
|
39
|
+
* <Icon name="eye-off" size="md" />
|
|
40
|
+
* </FavoriteButton>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* The function receives the current `active` state as a parameter,
|
|
44
|
+
* enabling the rendering of different content based on the state.
|
|
45
|
+
*
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <FavoriteButton>
|
|
48
|
+
* {(active) => (
|
|
49
|
+
* <Icon name={active ? 'eye-off' : 'eye-empty'} size="md" />
|
|
50
|
+
* )}
|
|
51
|
+
* </FavoriteButton>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
children?: ReactNode | ((active: boolean) => ReactNode);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type PropsAsButton = CommonProps &
|
|
59
|
+
Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'children'> & {
|
|
60
|
+
as: 'button';
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Callback triggered when the component is clicked.
|
|
64
|
+
*
|
|
65
|
+
* The handler receives a boolean argument indicating the next 'active' state.
|
|
66
|
+
* - If the handler returns a boolean, the component's active state will be set to the returned value.
|
|
67
|
+
* - If a Promise is returned, the component will wait for the Promise to resolve and use the resolved boolean value to update the active state.
|
|
68
|
+
*
|
|
69
|
+
* ```tsx
|
|
70
|
+
* const handleClick = (nextActiveState: boolean) => {
|
|
71
|
+
* // Your handling logic here
|
|
72
|
+
* return !nextActiveState; // Or return a promise that resolves to a boolean
|
|
73
|
+
* };
|
|
74
|
+
*
|
|
75
|
+
* <FavoriteButton onClick={handleClick} />
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
onClick?: OnClickHandler;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
type PropsAsAnchor = CommonProps &
|
|
82
|
+
AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
83
|
+
as: 'a';
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
type Props = PropsAsButton | PropsAsAnchor;
|
|
87
|
+
|
|
88
|
+
const createClickHandler = (
|
|
89
|
+
active: boolean,
|
|
90
|
+
setPending: Dispatch<SetStateAction<boolean | undefined>>,
|
|
91
|
+
setActive: Dispatch<SetStateAction<boolean>>,
|
|
92
|
+
onClick: OnClickHandler | undefined,
|
|
93
|
+
) => {
|
|
94
|
+
return async () => {
|
|
95
|
+
if (!onClick) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
setPending(true);
|
|
100
|
+
|
|
101
|
+
const nextActive = !active;
|
|
102
|
+
|
|
103
|
+
setActive(nextActive);
|
|
104
|
+
|
|
105
|
+
const returnValue = await onClick(nextActive);
|
|
106
|
+
|
|
107
|
+
setPending(false);
|
|
108
|
+
|
|
109
|
+
if (typeof returnValue !== 'boolean') {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
setActive(returnValue);
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const renderDefaultIcon = (active: boolean) => {
|
|
118
|
+
if (active) {
|
|
119
|
+
return (
|
|
120
|
+
<Icon
|
|
121
|
+
name="heart-filled"
|
|
122
|
+
size="md"
|
|
123
|
+
className="fill-surface-primary-100 text-marine-high-emphasis"
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<>
|
|
130
|
+
<Icon name="heart" size="md" className="sm:group-hover:hidden" />
|
|
131
|
+
<Icon
|
|
132
|
+
name="heart-filled"
|
|
133
|
+
size="md"
|
|
134
|
+
className="hidden sm:group-hover:block sm:group-hover:fill-surface-secondary-100"
|
|
135
|
+
/>
|
|
136
|
+
</>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const renderChildren = (
|
|
141
|
+
active: boolean,
|
|
142
|
+
children: Props['children'],
|
|
143
|
+
): ReactNode => {
|
|
144
|
+
if (typeof children === 'undefined') {
|
|
145
|
+
return renderDefaultIcon(active);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (typeof children === 'function') {
|
|
149
|
+
return children(active);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return children;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const FavoriteButtonRenderFunction: ForwardRefRenderFunction<
|
|
156
|
+
HTMLButtonElement | HTMLAnchorElement,
|
|
157
|
+
Props
|
|
158
|
+
> = (props, ref?) => {
|
|
159
|
+
const {
|
|
160
|
+
className,
|
|
161
|
+
as = 'button',
|
|
162
|
+
defaultActive = false,
|
|
163
|
+
onClick,
|
|
164
|
+
children,
|
|
165
|
+
...rest
|
|
166
|
+
} = props;
|
|
167
|
+
|
|
168
|
+
const [active, setActive] = useState(defaultActive);
|
|
169
|
+
const [pending, setPending] = useState<boolean>();
|
|
170
|
+
|
|
171
|
+
const handleClick =
|
|
172
|
+
as === 'a'
|
|
173
|
+
? onClick
|
|
174
|
+
: createClickHandler(
|
|
175
|
+
active,
|
|
176
|
+
setPending,
|
|
177
|
+
setActive,
|
|
178
|
+
onClick as OnClickHandler | undefined,
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
const shouldAnimate = typeof pending !== 'undefined' && as !== 'a';
|
|
182
|
+
const shouldTransition = as !== 'a';
|
|
183
|
+
|
|
184
|
+
const elementClassList = [
|
|
185
|
+
'group inline-flex p-2.5 appearance-none rounded-full',
|
|
186
|
+
'focus:outline-none focus-visible:shadow-focus-state active:bg-surface-primary-40 disabled:pointer-events-none',
|
|
187
|
+
active
|
|
188
|
+
? 'bg-surface-primary-80 text-marine-high-emphasis'
|
|
189
|
+
: 'text-marine-high-emphasis sm:hover:bg-surface-secondary-7 sm:hover:text-marine-high-emphasis',
|
|
190
|
+
];
|
|
191
|
+
|
|
192
|
+
const iconWrapperClassList = [
|
|
193
|
+
shouldTransition && 'group-active:transition-transform',
|
|
194
|
+
shouldAnimate ? 'animate-[favorite-pulse_600ms_ease-in-out]' : '',
|
|
195
|
+
shouldTransition && !active
|
|
196
|
+
? 'group-active:scale-[0.66] group-active:animate-none'
|
|
197
|
+
: '',
|
|
198
|
+
];
|
|
199
|
+
|
|
200
|
+
const Element = as;
|
|
201
|
+
|
|
202
|
+
return (
|
|
203
|
+
<Element
|
|
204
|
+
className={twMerge(elementClassList.join(' '), className)}
|
|
205
|
+
onClick={handleClick}
|
|
206
|
+
disabled={pending}
|
|
207
|
+
ref={ref}
|
|
208
|
+
{...(rest as any)}
|
|
209
|
+
>
|
|
210
|
+
<div className={iconWrapperClassList.join(' ')}>
|
|
211
|
+
{renderChildren(active, children)}
|
|
212
|
+
</div>
|
|
213
|
+
</Element>
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* `FavoriteButton` is a component, for creating interactive buttons, offering various customization options to fit into different use cases such as liking or favoriting items.
|
|
219
|
+
*
|
|
220
|
+
* ```tsx
|
|
221
|
+
* const handleClick = (active) => alert(active ? 'Liked' : 'Unliked');
|
|
222
|
+
* <FavoriteButton onClick={handleClick} />
|
|
223
|
+
* ```
|
|
224
|
+
*
|
|
225
|
+
* With the above code, a `FavoriteButton` is rendered using default icons, and it logs the new active state upon being clicked.
|
|
226
|
+
*
|
|
227
|
+
* ## Available Props
|
|
228
|
+
*
|
|
229
|
+
* | Name | Type | Description |
|
|
230
|
+
* |---|---|--------|
|
|
231
|
+
* | `defaultActive`| `boolean` | Sets the initial active state of the component. |
|
|
232
|
+
* | `onClick` | `OnClickHandler` | Handles click events and state transitions. |
|
|
233
|
+
* | `as` | `"button"` \| `"a"` | Determines the HTML element type. |
|
|
234
|
+
* | `children` | `ReactNode` \| (active: boolean) => ReactNode | Supply your custom icon using children. |
|
|
235
|
+
* | ...rest | | Extra props which are forwarded to the element. |
|
|
236
|
+
*
|
|
237
|
+
* ## Icon Management
|
|
238
|
+
*
|
|
239
|
+
* Iconography within the `FavoriteButton` component is managed dynamically by adopting a strategy that employs render props. This allows you to have absolute control over how icons should appear across distinct states.
|
|
240
|
+
*
|
|
241
|
+
* ### Simple Custom Icon Rendering
|
|
242
|
+
*
|
|
243
|
+
* For simple use cases just provide an icon as the child of the favorite button.
|
|
244
|
+
*
|
|
245
|
+
* ```tsx
|
|
246
|
+
* <FavoriteButton>
|
|
247
|
+
* <Icon name="eye-empty" size="md" />
|
|
248
|
+
* </FavoriteButton>
|
|
249
|
+
* ```
|
|
250
|
+
*
|
|
251
|
+
* ### Advanced Icon Handling and Styling with Render Props
|
|
252
|
+
*
|
|
253
|
+
* Utilize render props for straightforward and effective control over icon presentation and styling across different component states. By employing a function that takes the active state as an argument, you can precisely define icons and apply styles for both the active and inactive states dynamically. The active parameter allows for conditional rendering of icons and the application of styles as per requirements:
|
|
254
|
+
*
|
|
255
|
+
* ```tsx
|
|
256
|
+
* // Icon based on state
|
|
257
|
+
*
|
|
258
|
+
* <FavoriteButton>
|
|
259
|
+
* {active => <Icon name={active ? 'eye-off' : 'eye-empty'} size="md" />}
|
|
260
|
+
* </FavoriteButton>
|
|
261
|
+
*
|
|
262
|
+
* In the presented code snippet, the `FavoriteButton` renders a colored and filled airplane icon when in an active state. On the other hand, during an inactive state, it depicts the same airplane icon, modifying its color upon hover.
|
|
263
|
+
*
|
|
264
|
+
* Using render props in such a manner awards you a significant level of control over the management of icons and their respective styles, fostering subtle visual feedback in response to user interactions with the `FavoriteButton` component. This approach is particularly beneficial in situations that demand comprehensive customization and dynamic styling predicated upon component states, ensuring that your UI remains both dynamic and visually consistent.
|
|
265
|
+
*
|
|
266
|
+
* ## Handling Click Events with `onClick`
|
|
267
|
+
*
|
|
268
|
+
* Manage click events and synchronize the component’s active state with potential asynchronous actions like API calls via `onClick`:
|
|
269
|
+
*
|
|
270
|
+
* ```tsx
|
|
271
|
+
* const handleClick = async (active) => {
|
|
272
|
+
* const serverResponse = await someAsyncAction();
|
|
273
|
+
* return serverResponse.liked;
|
|
274
|
+
* };
|
|
275
|
+
*
|
|
276
|
+
* <FavoriteButton onClick={handleClick} />
|
|
277
|
+
* ```
|
|
278
|
+
*
|
|
279
|
+
* Here, upon a user click, the component instantaneously toggles its state. Then, `someAsyncAction` communicates with a server and once the response is returned from the handler, the component ensures to align and represent this new state in the UI.
|
|
280
|
+
*
|
|
281
|
+
* ## Rendering as Anchor
|
|
282
|
+
*
|
|
283
|
+
* Using `FavoriteButton` as an anchor (`a`) element is straightforward:
|
|
284
|
+
*
|
|
285
|
+
* ```tsx
|
|
286
|
+
* <FavoriteButton as="a" href="#" />
|
|
287
|
+
* ```
|
|
288
|
+
*
|
|
289
|
+
* However, it's pivotal to note that when `FavoriteButton` is rendered as an anchor element (`as="a"`), it operates purely as a navigational link, devoid of internal state management or animations associated with state changes. It exists simply as a stylized link, diverting users to specified URLs without toggling between states or triggering animations on click events.
|
|
290
|
+
*/
|
|
291
|
+
export const FavoriteButton = forwardRef<
|
|
292
|
+
HTMLButtonElement | HTMLAnchorElement,
|
|
293
|
+
Props
|
|
294
|
+
>(FavoriteButtonRenderFunction) as typeof FavoriteButtonRenderFunction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FavoriteButton';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FC,
|
|
3
|
+
PropsWithChildren,
|
|
4
|
+
ReactNode,
|
|
5
|
+
FieldsetHTMLAttributes,
|
|
6
|
+
} from 'react';
|
|
7
|
+
import { twMerge } from '@tui-cruises/mein-schiff-web-tailwind-config';
|
|
8
|
+
|
|
9
|
+
type ElementAttributes = FieldsetHTMLAttributes<HTMLFieldSetElement>;
|
|
10
|
+
|
|
11
|
+
export type FieldsetProps = ElementAttributes &
|
|
12
|
+
PropsWithChildren<{
|
|
13
|
+
headline?: ReactNode;
|
|
14
|
+
copy?: ReactNode;
|
|
15
|
+
}>;
|
|
16
|
+
|
|
17
|
+
export const Fieldset: FC<FieldsetProps> = ({
|
|
18
|
+
children,
|
|
19
|
+
headline,
|
|
20
|
+
copy,
|
|
21
|
+
...attrs
|
|
22
|
+
}) => {
|
|
23
|
+
return (
|
|
24
|
+
<fieldset
|
|
25
|
+
{...attrs}
|
|
26
|
+
className={twMerge(
|
|
27
|
+
attrs.className,
|
|
28
|
+
'space-y-8 text-marine-high-emphasis',
|
|
29
|
+
)}
|
|
30
|
+
>
|
|
31
|
+
{(headline || copy) && (
|
|
32
|
+
<div className="space-y-4">
|
|
33
|
+
{headline && <div className="headline-md">{headline}</div>}
|
|
34
|
+
|
|
35
|
+
{copy && <div>{copy}</div>}
|
|
36
|
+
</div>
|
|
37
|
+
)}
|
|
38
|
+
|
|
39
|
+
{children && <div className="space-y-4">{children}</div>}
|
|
40
|
+
</fieldset>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Fieldset';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
LabelHTMLAttributes,
|
|
4
|
+
ForwardRefRenderFunction,
|
|
5
|
+
} from 'react';
|
|
6
|
+
import { twJoin } from 'tailwind-merge';
|
|
7
|
+
import { Slot, Slottable } from '@radix-ui/react-slot';
|
|
8
|
+
|
|
9
|
+
export type FormLabelProps = LabelHTMLAttributes<HTMLLabelElement> & {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
/** Indicates if the associated field is required. */
|
|
12
|
+
required?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const FormLabelImplementation: ForwardRefRenderFunction<
|
|
16
|
+
HTMLLabelElement,
|
|
17
|
+
FormLabelProps
|
|
18
|
+
> = (props, ref) => {
|
|
19
|
+
const { asChild, className, required, children, ...args } = props;
|
|
20
|
+
|
|
21
|
+
const Component = asChild ? Slot : 'label';
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Component
|
|
25
|
+
{...args}
|
|
26
|
+
ref={ref}
|
|
27
|
+
className={twJoin(
|
|
28
|
+
'block cursor-pointer text-base font-semibold text-marine-high-emphasis data-[invalid]:text-error-100',
|
|
29
|
+
className,
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
<Slottable>{children}</Slottable>
|
|
33
|
+
{required && (
|
|
34
|
+
<abbr
|
|
35
|
+
className="ml-1 text-error-100 no-underline"
|
|
36
|
+
title="Required field"
|
|
37
|
+
>
|
|
38
|
+
*
|
|
39
|
+
</abbr>
|
|
40
|
+
)}
|
|
41
|
+
</Component>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* `FormLabel` is a component for rendering a label in forms.
|
|
47
|
+
*
|
|
48
|
+
* ## Props
|
|
49
|
+
*
|
|
50
|
+
* The `FormLabel` component accepts the following properties:
|
|
51
|
+
*
|
|
52
|
+
* - `children`: The content of the label.
|
|
53
|
+
* - `required`: If set, adds an asterisk (*) to denote that the associated field is required.
|
|
54
|
+
* - `className`: Additional classes for custom styling.
|
|
55
|
+
* - `as`: Optionally specifies the element type to render. Can be 'label', 'span', or 'Form.Label' from Radix UI.
|
|
56
|
+
*
|
|
57
|
+
* ## Usage
|
|
58
|
+
*
|
|
59
|
+
* ```tsx
|
|
60
|
+
* // Simple label
|
|
61
|
+
* <FormLabel>
|
|
62
|
+
* Label
|
|
63
|
+
* </FormLabel>
|
|
64
|
+
*
|
|
65
|
+
* // Label for a required field
|
|
66
|
+
* <FormLabel required>
|
|
67
|
+
* Label
|
|
68
|
+
* </FormLabel>
|
|
69
|
+
*
|
|
70
|
+
* // Label with custom styling
|
|
71
|
+
* <FormLabel required className="custom-class">
|
|
72
|
+
* Label
|
|
73
|
+
* </FormLabel>
|
|
74
|
+
*
|
|
75
|
+
* // Using a different element type
|
|
76
|
+
* <FormLabel as="span">
|
|
77
|
+
* Label
|
|
78
|
+
* </FormLabel>
|
|
79
|
+
*
|
|
80
|
+
* // Using Radix UI Form.Label
|
|
81
|
+
* <FormLabel as={Form.Label}>
|
|
82
|
+
* Label
|
|
83
|
+
* </FormLabel>
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export const FormLabel = forwardRef(
|
|
87
|
+
FormLabelImplementation,
|
|
88
|
+
) as typeof FormLabelImplementation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FormLabel';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { dynamicComponents as dynamicComponentsIcons } from '../../../../icons/icons';
|
|
4
|
+
import type { ComponentType, SVGProps } from 'react';
|
|
5
|
+
import { twJoin } from 'tailwind-merge';
|
|
6
|
+
|
|
7
|
+
// Type for local icons
|
|
8
|
+
type DynamicComponentIconName = keyof typeof dynamicComponentsIcons;
|
|
9
|
+
|
|
10
|
+
// Union of both types to create a comprehensive IconName type
|
|
11
|
+
export type IconName = DynamicComponentIconName;
|
|
12
|
+
|
|
13
|
+
export type IconProps = {
|
|
14
|
+
/**
|
|
15
|
+
* Additional TailwindCSS utilities can be added with this prop.
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The name of the icon.
|
|
20
|
+
*/
|
|
21
|
+
name: IconName;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The size of the icon. Can be a number for a custom size or
|
|
25
|
+
* one of the predefined sizes: 'xs' (16x16), 'sm' (20x20),
|
|
26
|
+
* 'md' (24x24), 'lg' (32x32).
|
|
27
|
+
*
|
|
28
|
+
* @default 'md'
|
|
29
|
+
*/
|
|
30
|
+
size?: number | 'xs' | 'sm' | 'md' | 'lg';
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Component to display an icon, based on the [local icon library](/docs/foundation-icons-pictograms--docs).
|
|
35
|
+
*
|
|
36
|
+
* @component
|
|
37
|
+
* @param {IconProps} props - The props for the Icon component.
|
|
38
|
+
* @returns {JSX.Element | null} The rendered icon component or null if the icon is not found.
|
|
39
|
+
*/
|
|
40
|
+
const Icon = (props: IconProps) => {
|
|
41
|
+
const { className, name, size = 'md' } = props;
|
|
42
|
+
|
|
43
|
+
const IconComponent = getIconComponent(name);
|
|
44
|
+
if (!IconComponent) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const iconSize = getIconSize(size);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<IconComponent
|
|
52
|
+
className={twJoin('pointer-events-none', className)}
|
|
53
|
+
width={iconSize}
|
|
54
|
+
height={iconSize}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Helper function to get the icon size in pixels.
|
|
61
|
+
*
|
|
62
|
+
* @param {NonNullable<IconProps['size']>} size - The size prop, either a number or a predefined size string.
|
|
63
|
+
* @returns {number} The size in pixels.
|
|
64
|
+
*/
|
|
65
|
+
const getIconSize = (size: NonNullable<IconProps['size']>) => {
|
|
66
|
+
if (typeof size === 'number') {
|
|
67
|
+
return size;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
switch (size) {
|
|
71
|
+
case 'xs':
|
|
72
|
+
return 16;
|
|
73
|
+
case 'sm':
|
|
74
|
+
return 20;
|
|
75
|
+
case 'lg':
|
|
76
|
+
return 32;
|
|
77
|
+
default:
|
|
78
|
+
return 24;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Helper function to get the appropriate icon component.
|
|
84
|
+
*
|
|
85
|
+
* @param {IconName} name - The name of the icon to retrieve.
|
|
86
|
+
* @returns {ComponentType<SVGProps<SVGSVGElement>> | null} The icon component or null if not found.
|
|
87
|
+
*/
|
|
88
|
+
const getIconComponent = (
|
|
89
|
+
name: IconName,
|
|
90
|
+
): ComponentType<SVGProps<SVGSVGElement>> | null => {
|
|
91
|
+
// Check if the icon exists in dynamicComponentsIcons (case-sensitive)
|
|
92
|
+
if (dynamicComponentsIcons[name as DynamicComponentIconName]) {
|
|
93
|
+
return dynamicComponentsIcons[
|
|
94
|
+
name as DynamicComponentIconName
|
|
95
|
+
] as ComponentType<SVGProps<SVGSVGElement>>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Icon not found
|
|
99
|
+
return dynamicComponentsIcons[
|
|
100
|
+
'fallback' as DynamicComponentIconName
|
|
101
|
+
] as ComponentType<SVGProps<SVGSVGElement>>;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
Icon.displayName = 'Icon';
|
|
105
|
+
|
|
106
|
+
export { Icon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Icon';
|