@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,190 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
/** The hook internal state. */
|
|
5
|
+
type State = {
|
|
6
|
+
/** A boolean indicating if the element is intersecting. */
|
|
7
|
+
isIntersecting: boolean;
|
|
8
|
+
/** The intersection observer entry. */
|
|
9
|
+
entry?: IntersectionObserverEntry;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** Represents the options for configuring the Intersection Observer. */
|
|
13
|
+
type UseIntersectionObserverOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* The element that is used as the viewport for checking visibility of the target.
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
root?: Element | Document | null;
|
|
19
|
+
/**
|
|
20
|
+
* A margin around the root.
|
|
21
|
+
* @default '0%'
|
|
22
|
+
*/
|
|
23
|
+
rootMargin?: string;
|
|
24
|
+
/**
|
|
25
|
+
* A threshold indicating the percentage of the target's visibility needed to trigger the callback.
|
|
26
|
+
* @default 0
|
|
27
|
+
*/
|
|
28
|
+
threshold?: number | number[];
|
|
29
|
+
/**
|
|
30
|
+
* If true, freezes the intersection state once the element becomes visible.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
freezeOnceVisible?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* A callback function to be invoked when the intersection state changes.
|
|
36
|
+
* @param {boolean} isIntersecting - A boolean indicating if the element is intersecting.
|
|
37
|
+
* @param {IntersectionObserverEntry} entry - The intersection observer Entry.
|
|
38
|
+
* @default undefined
|
|
39
|
+
*/
|
|
40
|
+
onChange?: (
|
|
41
|
+
isIntersecting: boolean,
|
|
42
|
+
entry: IntersectionObserverEntry,
|
|
43
|
+
) => void;
|
|
44
|
+
/**
|
|
45
|
+
* The initial state of the intersection.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
initialIsIntersecting?: boolean;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The return type of the useIntersectionObserver hook.
|
|
53
|
+
*
|
|
54
|
+
* Supports both tuple and object destructing.
|
|
55
|
+
* @param {(node: Element | null) => void} ref - The ref callback function.
|
|
56
|
+
* @param {boolean} isIntersecting - A boolean indicating if the element is intersecting.
|
|
57
|
+
* @param {IntersectionObserverEntry | undefined} entry - The intersection observer Entry.
|
|
58
|
+
*/
|
|
59
|
+
type IntersectionReturn = [
|
|
60
|
+
(node?: Element | null) => void,
|
|
61
|
+
boolean,
|
|
62
|
+
IntersectionObserverEntry | undefined,
|
|
63
|
+
] & {
|
|
64
|
+
ref: (node?: Element | null) => void;
|
|
65
|
+
isIntersecting: boolean;
|
|
66
|
+
entry?: IntersectionObserverEntry;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Custom hook that tracks the intersection of a DOM element with its containing element or the viewport using the [`Intersection Observer API`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
|
|
71
|
+
* @param {UseIntersectionObserverOptions} options - The options for the Intersection Observer.
|
|
72
|
+
* @returns {IntersectionReturn} The ref callback, a boolean indicating if the element is intersecting and the intersection observer entry.
|
|
73
|
+
* @public
|
|
74
|
+
* @see [Documentation](https://usehooks-ts.com/react-hook/use-intersection-observer)
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* // Example 1
|
|
78
|
+
* const [ref, isIntersecting, entry] = useIntersectionObserver({ threshold: 0.5 });
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* ```tsx
|
|
82
|
+
* // Example 2
|
|
83
|
+
* const { ref, isIntersecting, entry } = useIntersectionObserver({ threshold: 0.5 });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export function useIntersectionObserver({
|
|
87
|
+
threshold = 0,
|
|
88
|
+
root = null,
|
|
89
|
+
rootMargin = '0%',
|
|
90
|
+
freezeOnceVisible = false,
|
|
91
|
+
initialIsIntersecting = false,
|
|
92
|
+
onChange,
|
|
93
|
+
}: UseIntersectionObserverOptions = {}): IntersectionReturn {
|
|
94
|
+
const [ref, setRef] = useState<Element | null>(null);
|
|
95
|
+
|
|
96
|
+
const [state, setState] = useState<State>(() => ({
|
|
97
|
+
isIntersecting: initialIsIntersecting,
|
|
98
|
+
entry: undefined,
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
const callbackRef = useRef<UseIntersectionObserverOptions['onChange']>();
|
|
102
|
+
|
|
103
|
+
callbackRef.current = onChange;
|
|
104
|
+
|
|
105
|
+
const frozen = state.entry?.isIntersecting && freezeOnceVisible;
|
|
106
|
+
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
// Ensure we have a ref to observe
|
|
109
|
+
if (!ref) return;
|
|
110
|
+
|
|
111
|
+
// Ensure the browser supports the Intersection Observer API
|
|
112
|
+
if (!('IntersectionObserver' in window)) return;
|
|
113
|
+
|
|
114
|
+
// Skip if frozen
|
|
115
|
+
if (frozen) return;
|
|
116
|
+
|
|
117
|
+
let unobserve: (() => void) | undefined;
|
|
118
|
+
|
|
119
|
+
const observer = new IntersectionObserver(
|
|
120
|
+
(entries: IntersectionObserverEntry[]): void => {
|
|
121
|
+
const thresholds = Array.isArray(observer.thresholds)
|
|
122
|
+
? observer.thresholds
|
|
123
|
+
: [observer.thresholds];
|
|
124
|
+
|
|
125
|
+
entries.forEach(entry => {
|
|
126
|
+
const isIntersecting =
|
|
127
|
+
entry.isIntersecting &&
|
|
128
|
+
thresholds.some(threshold => entry.intersectionRatio >= threshold);
|
|
129
|
+
|
|
130
|
+
setState({ isIntersecting, entry });
|
|
131
|
+
|
|
132
|
+
if (callbackRef.current) {
|
|
133
|
+
callbackRef.current(isIntersecting, entry);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (isIntersecting && freezeOnceVisible && unobserve) {
|
|
137
|
+
unobserve();
|
|
138
|
+
unobserve = undefined;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
{ threshold, root, rootMargin },
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
observer.observe(ref);
|
|
146
|
+
|
|
147
|
+
return () => {
|
|
148
|
+
observer.disconnect();
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
152
|
+
}, [
|
|
153
|
+
ref,
|
|
154
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
155
|
+
JSON.stringify(threshold),
|
|
156
|
+
root,
|
|
157
|
+
rootMargin,
|
|
158
|
+
frozen,
|
|
159
|
+
freezeOnceVisible,
|
|
160
|
+
]);
|
|
161
|
+
|
|
162
|
+
// ensures that if the observed element changes, the intersection observer is reinitialized
|
|
163
|
+
const prevRef = useRef<Element | null>(null);
|
|
164
|
+
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (
|
|
167
|
+
!ref &&
|
|
168
|
+
state.entry?.target &&
|
|
169
|
+
!freezeOnceVisible &&
|
|
170
|
+
!frozen &&
|
|
171
|
+
prevRef.current !== state.entry.target
|
|
172
|
+
) {
|
|
173
|
+
prevRef.current = state.entry.target;
|
|
174
|
+
setState({ isIntersecting: initialIsIntersecting, entry: undefined });
|
|
175
|
+
}
|
|
176
|
+
}, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);
|
|
177
|
+
|
|
178
|
+
const result = [
|
|
179
|
+
setRef,
|
|
180
|
+
!!state.isIntersecting,
|
|
181
|
+
state.entry,
|
|
182
|
+
] as IntersectionReturn;
|
|
183
|
+
|
|
184
|
+
// Support object destructuring, by adding the specific values.
|
|
185
|
+
result.ref = result[0];
|
|
186
|
+
result.isIntersecting = result[1];
|
|
187
|
+
result.entry = result[2];
|
|
188
|
+
|
|
189
|
+
return result;
|
|
190
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useScreenName } from './use-screen-name';
|
|
2
|
+
import { ScreenName } from '../helpers/screen';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Returns true if the width of current screen name matches at least the width of the given screen name.
|
|
6
|
+
* Supply an optional `ssrScreenName` for initial rendering.
|
|
7
|
+
*
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const isAtLeastMd = useScreenNameAtLeast('md');
|
|
10
|
+
*
|
|
11
|
+
* if (isAtLeastMd) {
|
|
12
|
+
* ...
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const useScreenNameAtLeast = (
|
|
17
|
+
screenName?: ScreenName,
|
|
18
|
+
ssrScreenName?: ScreenName,
|
|
19
|
+
): boolean => {
|
|
20
|
+
const current = useScreenName(ssrScreenName);
|
|
21
|
+
|
|
22
|
+
if (screenName === current) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const order: ScreenName[] = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
|
27
|
+
|
|
28
|
+
const currIdx = order.findIndex(name => name === current);
|
|
29
|
+
const desiredIdx = order.findIndex(name => name === screenName);
|
|
30
|
+
|
|
31
|
+
return currIdx >= desiredIdx;
|
|
32
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useActiveScreenNames } from './use-active-screen-names';
|
|
2
|
+
import { ScreenName } from '../helpers/screen';
|
|
3
|
+
|
|
4
|
+
type OptionalScreenName = ScreenName | undefined;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns the current screen name.
|
|
8
|
+
* Supply an optional SSR screen name if desired.
|
|
9
|
+
*
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const currentScreenName = useScreenName();
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export const useScreenName = (
|
|
15
|
+
ssrScreenName?: ScreenName,
|
|
16
|
+
): OptionalScreenName => {
|
|
17
|
+
const defaults = {
|
|
18
|
+
xs: false,
|
|
19
|
+
sm: false,
|
|
20
|
+
md: false,
|
|
21
|
+
lg: false,
|
|
22
|
+
xl: false,
|
|
23
|
+
xxl: false,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
if (ssrScreenName) {
|
|
27
|
+
defaults[ssrScreenName] = true;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const active = useActiveScreenNames(defaults);
|
|
31
|
+
const names = Object.keys(active) as ScreenName[];
|
|
32
|
+
|
|
33
|
+
return names.filter(name => active[name]).reverse()[0];
|
|
34
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { Store } from '../helpers/store';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
|
|
6
|
+
type ValueFromStore<S extends Store> = ReturnType<S['get']>;
|
|
7
|
+
type UseSharedStoreReturnValue<S extends Store> = [ValueFromStore<S>, S['set']];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Use a Store.
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { myCountStore } from './../stores';
|
|
14
|
+
*
|
|
15
|
+
* const MyComponent = () => {
|
|
16
|
+
* const [count, setCount] = useStore(myCountStore);
|
|
17
|
+
*
|
|
18
|
+
* return (
|
|
19
|
+
* <div>
|
|
20
|
+
* Value: { count }
|
|
21
|
+
* <br />
|
|
22
|
+
* <button onClick={() => setCount(prev => prev + 1)}>
|
|
23
|
+
* Increase Count
|
|
24
|
+
* </button>
|
|
25
|
+
* <br />
|
|
26
|
+
* <button onClick={() => setCount(0)}>
|
|
27
|
+
* Reset Count
|
|
28
|
+
* </button>
|
|
29
|
+
* </div>
|
|
30
|
+
* );
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export const useStore = <S extends Store<any>>(
|
|
35
|
+
store: S,
|
|
36
|
+
initial?: ValueFromStore<S>,
|
|
37
|
+
): UseSharedStoreReturnValue<S> => {
|
|
38
|
+
const [value, setValue] = useState<ValueFromStore<S>>(initial ?? store.get());
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
return store.onChange(value => setValue(value));
|
|
42
|
+
}, [store]);
|
|
43
|
+
|
|
44
|
+
return [value, store.set];
|
|
45
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import { ToastInStore, toastsStore } from '../stores/toasts-store';
|
|
5
|
+
import { useStore } from './use-store';
|
|
6
|
+
|
|
7
|
+
type PushOptions = {
|
|
8
|
+
title: string;
|
|
9
|
+
text?: ReactNode;
|
|
10
|
+
duration?: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type PushOptionsOrMessage = PushOptions | string;
|
|
14
|
+
|
|
15
|
+
type PushHandler = (options: PushOptionsOrMessage) => ToastRemoveHandler;
|
|
16
|
+
|
|
17
|
+
type UseToastsReturnValue = {
|
|
18
|
+
push: PushHandler;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ToastRemoveHandler = () => void;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Transforms {@link PushOptionsOrMessage} to a {@link ToastInStore}.
|
|
25
|
+
*/
|
|
26
|
+
const pushOptionsToToast = (options: PushOptionsOrMessage): ToastInStore => {
|
|
27
|
+
// Transform a string to the simplest possible PushOptions object.
|
|
28
|
+
if (typeof options === 'string') {
|
|
29
|
+
options = {
|
|
30
|
+
title: options,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Destruct the options and assign default values.
|
|
35
|
+
const { text, title, duration = 3000 } = options;
|
|
36
|
+
|
|
37
|
+
// Let's try to create a somewhat unique ID.
|
|
38
|
+
const id = Date.now() + Math.round(Math.random() * 999);
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
id,
|
|
42
|
+
text,
|
|
43
|
+
title,
|
|
44
|
+
duration,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns helpers for managing toast messages in the toast store.
|
|
50
|
+
*
|
|
51
|
+
* ### Push a Message
|
|
52
|
+
*
|
|
53
|
+
* In order to push a message invoke the returned `push()` function.
|
|
54
|
+
*
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const { push } = useToasts();
|
|
57
|
+
*
|
|
58
|
+
* // The most basic example -- pushes only a toast with a title.
|
|
59
|
+
* push('Please verify your email address before you attempt to sign in.');
|
|
60
|
+
*
|
|
61
|
+
* push({
|
|
62
|
+
* title: 'Your account has been created',
|
|
63
|
+
* text: 'Please verify your email address before you attempt to sign in.',
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* // This toast message disappears after 10 seconds.
|
|
67
|
+
* push({
|
|
68
|
+
* title: 'Your account has been created',
|
|
69
|
+
* text: 'Please verify your email address before you attempt to sign in.',
|
|
70
|
+
* duration: 10000,
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* ### Remove a Pushed Message
|
|
75
|
+
*
|
|
76
|
+
* You can remove a pushed message by invoking the return value of the `push()` function.
|
|
77
|
+
*
|
|
78
|
+
* ```tsx
|
|
79
|
+
* // This toast message stays visible until removed.
|
|
80
|
+
*
|
|
81
|
+
* const removeMessage = push({
|
|
82
|
+
* title: 'Your account has been created',
|
|
83
|
+
* text: 'Please verify your email address before you attempt to sign in.',
|
|
84
|
+
* duration: Infinity,
|
|
85
|
+
* });
|
|
86
|
+
*
|
|
87
|
+
* // Let's remove it manually after 5 seconds.
|
|
88
|
+
* setTimeout(() => {
|
|
89
|
+
* removeMessage();
|
|
90
|
+
* }, 5000);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export const useToasts = (): UseToastsReturnValue => {
|
|
94
|
+
// Get the current toasts & the SetToastsAction
|
|
95
|
+
const [, setToasts] = useStore(toastsStore);
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
push: options => {
|
|
99
|
+
// Get a Toast from the options
|
|
100
|
+
const toast = pushOptionsToToast(options);
|
|
101
|
+
|
|
102
|
+
// Push the toast to the current stack of toasts.
|
|
103
|
+
setToasts(prev => [...prev, toast]);
|
|
104
|
+
|
|
105
|
+
// Return the function to remove the toast.
|
|
106
|
+
return () => {
|
|
107
|
+
setToasts(prev => prev.filter(({ id }) => id !== toast.id));
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { createStore } from '../helpers/store';
|
|
3
|
+
|
|
4
|
+
export type ToastInStore = {
|
|
5
|
+
id: number;
|
|
6
|
+
title: string;
|
|
7
|
+
text?: ReactNode;
|
|
8
|
+
duration: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const toastsStore = createStore<ToastInStore[]>([]);
|