@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,197 @@
|
|
|
1
|
+
import template from 'lodash/template';
|
|
2
|
+
import {
|
|
3
|
+
ComponentPropsWithoutRef,
|
|
4
|
+
ComponentType,
|
|
5
|
+
createElement,
|
|
6
|
+
JSX,
|
|
7
|
+
} from 'react';
|
|
8
|
+
// import * as DOMPurify from 'dompurify';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A type to create i18n objects used in component props.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
*
|
|
15
|
+
* type Props = {
|
|
16
|
+
* ...
|
|
17
|
+
* i18n?: I18NInterface<'title' | 'description'>;
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* // Equivalent to
|
|
21
|
+
* type Props = {
|
|
22
|
+
* ...
|
|
23
|
+
* i18n?: {
|
|
24
|
+
* title?: string;
|
|
25
|
+
* description?: string;
|
|
26
|
+
* };
|
|
27
|
+
* };
|
|
28
|
+
*
|
|
29
|
+
* const MyComponent = ({ i18n }: Props) => {
|
|
30
|
+
* return (
|
|
31
|
+
* <h1>{i18n?.title ?? 'Default Title'}</h1>
|
|
32
|
+
* <p>{i18n?.description ?? 'Default Description'}</p>
|
|
33
|
+
* ...
|
|
34
|
+
* );
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export type I18NInterface<Name extends string, Type extends any = string> = {
|
|
39
|
+
[key in Name]: Type;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A type to extract the i18n object from a component's props.
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* Props = {
|
|
47
|
+
* ...
|
|
48
|
+
* i18n?: I18NFromComponent<typeof SomeOtherComponent>;
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* You can also use it to compose i18n objects:
|
|
53
|
+
*
|
|
54
|
+
* ```ts
|
|
55
|
+
* type I18N = I18NFromComponent<typeof SomeOtherComponent> & I18NInterface<'title' | 'description'>;
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* See {@link I18NInterface} for more details about the usage of i18n objects.
|
|
59
|
+
*/
|
|
60
|
+
export type I18NFromComponent<Component extends ComponentType<any>> =
|
|
61
|
+
ComponentPropsWithoutRef<Component>['i18n'];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Expands given message with given parameters. Uses given fallback if the message is undefined.
|
|
65
|
+
*
|
|
66
|
+
* ```ts
|
|
67
|
+
* const expanded = expand('Hello {{name}}!', 'Hello World!', { name: 'John'});
|
|
68
|
+
* // Returns 'Hello John!'
|
|
69
|
+
*
|
|
70
|
+
* const expanded = expand(undefined, 'Hello World!', { name: 'John'});
|
|
71
|
+
* // Returns 'Hello World!'
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* It's intended to be used with i18n objects:
|
|
75
|
+
*
|
|
76
|
+
* ```tsx
|
|
77
|
+
* type Props = {
|
|
78
|
+
* userName: string;
|
|
79
|
+
* i18n?: I18NInterface<'welcomeMessage'>;
|
|
80
|
+
* };
|
|
81
|
+
*
|
|
82
|
+
* const MyComponent = ({ userName, i18n }: Props) => {
|
|
83
|
+
* const message = expand(i18n?.welcomeMessage, 'Hello {{name}}!', { name: userName});
|
|
84
|
+
*
|
|
85
|
+
* return (
|
|
86
|
+
* <h1>{message}</h1>
|
|
87
|
+
* );
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export const expandStringWithFallback = (
|
|
92
|
+
message: string | undefined,
|
|
93
|
+
fallback: string,
|
|
94
|
+
params?: Record<string, any>,
|
|
95
|
+
): string => {
|
|
96
|
+
return expandString(message ?? fallback, params) ?? fallback;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export function expandString(
|
|
100
|
+
message: undefined,
|
|
101
|
+
params?: Record<string, any>,
|
|
102
|
+
): undefined;
|
|
103
|
+
export function expandString(
|
|
104
|
+
message: string,
|
|
105
|
+
params?: Record<string, any>,
|
|
106
|
+
): string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Expands given message with given parameters.
|
|
110
|
+
*
|
|
111
|
+
* ```ts
|
|
112
|
+
* const expanded = expand('Hello {{name}}!', { name: 'John'});
|
|
113
|
+
* // Returns 'Hello John!'
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export function expandString(
|
|
117
|
+
message: string | undefined,
|
|
118
|
+
params?: Record<string, any>,
|
|
119
|
+
): string | undefined {
|
|
120
|
+
if (typeof message === 'undefined') {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (typeof params === 'undefined') {
|
|
125
|
+
return message;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const compiled = template(message, {
|
|
129
|
+
interpolate: /{{([\s\S]+?)}}/g,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
return compiled(params);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Parses given html expression to react elements wrapped by given `as`.
|
|
137
|
+
* It's intended to be used with i18n objects. Avoid using it for other purposes.
|
|
138
|
+
* The html expression is sanitized and wrapped in a span element to avoid usage of additional third party libraries.
|
|
139
|
+
*
|
|
140
|
+
* ```tsx
|
|
141
|
+
* type Props = {
|
|
142
|
+
* userName: string;
|
|
143
|
+
* i18n?: I18NInterface<'welcomeMessage'>;
|
|
144
|
+
* };
|
|
145
|
+
*
|
|
146
|
+
* const MyComponent = ({ userName, i18n }: Props) => {
|
|
147
|
+
* const message = expand(i18n?.welcomeMessage, 'Hello {{name}}!', {
|
|
148
|
+
* name: `<strong>${userName}</strong>`,
|
|
149
|
+
* });
|
|
150
|
+
*
|
|
151
|
+
* return (
|
|
152
|
+
* <h1>{parse(message)}</h1>
|
|
153
|
+
* );
|
|
154
|
+
*
|
|
155
|
+
* // Results in `<h1>Hello <span><strong>Jane</strong></span></h1>`.
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* If you need to modify the wrapping element, provide the element's name in the `as` argument.
|
|
160
|
+
*
|
|
161
|
+
* ```tsx
|
|
162
|
+
* type Props = {
|
|
163
|
+
* userName: string;
|
|
164
|
+
* i18n?: I18NInterface<'welcomeMessage'>;
|
|
165
|
+
* };
|
|
166
|
+
*
|
|
167
|
+
* const MyComponent = ({ userName, i18n }: Props) => {
|
|
168
|
+
* const message = expand(i18n?.welcomeMessage, 'Hello {{name}}!', {
|
|
169
|
+
* name: `<strong>${userName}</strong>`,
|
|
170
|
+
* });
|
|
171
|
+
*
|
|
172
|
+
* return (
|
|
173
|
+
* <h1>{parse(message, 'div')}</h1>
|
|
174
|
+
* );
|
|
175
|
+
*
|
|
176
|
+
* // Results in `<h1>Hello <div><strong>Jane</strong></div></h1>`.
|
|
177
|
+
* }
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
export const parse = (
|
|
181
|
+
htmlExpression: string,
|
|
182
|
+
as: keyof JSX.IntrinsicElements = 'span',
|
|
183
|
+
) => {
|
|
184
|
+
//TODO: Re-Implement sanitation wich works on server & client components.
|
|
185
|
+
// One possible lib is: https://www.npmjs.com/package/isomorphic-dompurify
|
|
186
|
+
// But there is an issue which needs to be resolved: https://github.com/kkomelin/isomorphic-dompurify/issues/54
|
|
187
|
+
// There is a proposed solution in the GitHub issue thread which can be applied.
|
|
188
|
+
|
|
189
|
+
// const sanitized = DOMPurify.sanitize(htmlExpression);
|
|
190
|
+
const sanitized = htmlExpression;
|
|
191
|
+
|
|
192
|
+
return createElement(as, {
|
|
193
|
+
dangerouslySetInnerHTML: {
|
|
194
|
+
__html: sanitized,
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Locale } from '@tuic/i18n';
|
|
2
|
+
|
|
3
|
+
export type Price = Intl.NumberFormatOptions & {
|
|
4
|
+
price: number;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Formats a price based on given locale.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* const priceExpression = formatPrice('de', {
|
|
12
|
+
* currency: 'EUR',
|
|
13
|
+
* price: 1234,
|
|
14
|
+
* maximumFractionDigits: 0,
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export const formatPrice = (locale: Locale, details: Price) => {
|
|
19
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
20
|
+
currencyDisplay: 'narrowSymbol',
|
|
21
|
+
...(details ?? {}),
|
|
22
|
+
style: 'currency',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return formatter.format(details.price);
|
|
26
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { ScreenName } from './screen';
|
|
2
|
+
|
|
3
|
+
//TODO: Create a documentation page in storybook for these things.
|
|
4
|
+
|
|
5
|
+
export type ResponsiveValue<T> = T | [T, ScreenNameIndexedValues<T>?];
|
|
6
|
+
|
|
7
|
+
type ScreenNameIndexedValues<T> = {
|
|
8
|
+
[screenName in ScreenName]?: T;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type ScreenNameIndexedValuesWithInitial<T> = {
|
|
12
|
+
[screenName in ScreenName | 'initial']?: T;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Resolves given responsive property value to screen name indexed values including an initial key for the initial screen.
|
|
17
|
+
*/
|
|
18
|
+
export const getScreenIndexedResponsiveValue = <T extends any = any>(
|
|
19
|
+
propValue: ResponsiveValue<T> | undefined,
|
|
20
|
+
defaultValue: T,
|
|
21
|
+
): ScreenNameIndexedValuesWithInitial<T> => {
|
|
22
|
+
if (typeof propValue === 'undefined' || !Array.isArray(propValue)) {
|
|
23
|
+
return {
|
|
24
|
+
initial: propValue ?? defaultValue,
|
|
25
|
+
xs: undefined,
|
|
26
|
+
sm: undefined,
|
|
27
|
+
md: undefined,
|
|
28
|
+
lg: undefined,
|
|
29
|
+
xl: undefined,
|
|
30
|
+
xxl: undefined,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const [initial, screenNameIndexedValues] = propValue;
|
|
35
|
+
|
|
36
|
+
if (typeof screenNameIndexedValues === 'undefined') {
|
|
37
|
+
return {
|
|
38
|
+
initial,
|
|
39
|
+
xs: undefined,
|
|
40
|
+
sm: undefined,
|
|
41
|
+
md: undefined,
|
|
42
|
+
lg: undefined,
|
|
43
|
+
xl: undefined,
|
|
44
|
+
xxl: undefined,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
initial,
|
|
50
|
+
xs: screenNameIndexedValues.xs ?? undefined,
|
|
51
|
+
sm: screenNameIndexedValues.sm ?? undefined,
|
|
52
|
+
md: screenNameIndexedValues.md ?? undefined,
|
|
53
|
+
lg: screenNameIndexedValues.lg ?? undefined,
|
|
54
|
+
xl: screenNameIndexedValues.xl ?? undefined,
|
|
55
|
+
xxl: screenNameIndexedValues.xxl ?? undefined,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Resolves given responsive property value to screen name indexed values.
|
|
61
|
+
*/
|
|
62
|
+
export const getScreenIndexedResponsiveValueForEachScreen = <
|
|
63
|
+
T extends any = any,
|
|
64
|
+
>(
|
|
65
|
+
propValue: ResponsiveValue<T> | undefined,
|
|
66
|
+
defaultValue: T,
|
|
67
|
+
): ScreenNameIndexedValues<T> => {
|
|
68
|
+
const screenNameIndexedValues = getScreenIndexedResponsiveValue(
|
|
69
|
+
propValue,
|
|
70
|
+
defaultValue,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const screens: Record<ScreenName, T | undefined> = {
|
|
74
|
+
xs: screenNameIndexedValues.xs,
|
|
75
|
+
sm: screenNameIndexedValues.sm,
|
|
76
|
+
md: screenNameIndexedValues.md,
|
|
77
|
+
lg: screenNameIndexedValues.lg,
|
|
78
|
+
xl: screenNameIndexedValues.xl,
|
|
79
|
+
xxl: screenNameIndexedValues.xxl,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
screens.xs = screens.xs ?? screenNameIndexedValues.initial;
|
|
83
|
+
screens.sm = screens.sm ?? screens.xs;
|
|
84
|
+
screens.md = screens.md ?? screens.sm;
|
|
85
|
+
screens.lg = screens.lg ?? screens.md;
|
|
86
|
+
screens.xl = screens.xl ?? screens.lg;
|
|
87
|
+
screens.xxl = screens.xxl ?? screens.xl;
|
|
88
|
+
|
|
89
|
+
return screens;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Get responsive value from prop value.
|
|
94
|
+
*/
|
|
95
|
+
export const getResponsiveValue = <T extends any = any>(
|
|
96
|
+
propValue: ResponsiveValue<T> | undefined,
|
|
97
|
+
defaultValue: T,
|
|
98
|
+
screen?: ScreenName,
|
|
99
|
+
): T => {
|
|
100
|
+
if (typeof screen !== 'undefined') {
|
|
101
|
+
const screens = getScreenIndexedResponsiveValueForEachScreen(
|
|
102
|
+
propValue,
|
|
103
|
+
defaultValue,
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
return screens[screen] ?? defaultValue;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (typeof propValue === 'undefined') {
|
|
110
|
+
return defaultValue;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (!Array.isArray(propValue)) {
|
|
114
|
+
return propValue;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return propValue[0];
|
|
118
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Children, cloneElement, isValidElement, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Dynamically wraps the children intended for a Radix UI `Slot` with a specified wrapper element or component.
|
|
5
|
+
* This utility function is particularly useful when working with Radix UI's slotting mechanism, enabling the conditional
|
|
6
|
+
* application of additional styling or structure around slotted children based on the `asChild` prop.
|
|
7
|
+
*
|
|
8
|
+
* The function checks the `asChild` prop: if it's true, indicating that the children are being directly passed
|
|
9
|
+
* to a `Slot` component, it attempts to wrap only the slottable children with the provided wrapper. This is required
|
|
10
|
+
* for cases where the default rendering needs to be overridden or augmented for specific design requirements.
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Usage in a component to conditionally wrap its children with additional styling:
|
|
14
|
+
*
|
|
15
|
+
* const MyComponent = ({asChild, children}) => {
|
|
16
|
+
* const Comp = asChild ? Slot : 'button';
|
|
17
|
+
*
|
|
18
|
+
* return (
|
|
19
|
+
* <Comp>
|
|
20
|
+
* <Icon />
|
|
21
|
+
* <Slottable>
|
|
22
|
+
* {wrapSlottableChildren(asChild, children, (children) => (
|
|
23
|
+
* <span className="underline">{children}</span>
|
|
24
|
+
* ))}
|
|
25
|
+
* </Slottable>
|
|
26
|
+
* </Comp>
|
|
27
|
+
* );
|
|
28
|
+
* };
|
|
29
|
+
*
|
|
30
|
+
* // Example usage:
|
|
31
|
+
* <MyComponent asChild>
|
|
32
|
+
* <a href="#">Click Me!</a>
|
|
33
|
+
* </MyComponent>
|
|
34
|
+
*
|
|
35
|
+
* // This results in the following rendering when `asChild` is true:
|
|
36
|
+
* // <a href="#">
|
|
37
|
+
* // <div className="icon" ... />
|
|
38
|
+
* // <span className="underline">Click Me!</span>
|
|
39
|
+
* // </a>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export const wrapSlottableChildren = (
|
|
43
|
+
asChild: boolean | undefined,
|
|
44
|
+
children: ReactNode,
|
|
45
|
+
wrapper: (children: ReactNode) => ReactNode,
|
|
46
|
+
) => {
|
|
47
|
+
if (!children) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (!asChild) {
|
|
52
|
+
return wrapper(children);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const childrenAsArray = Children.toArray(children);
|
|
56
|
+
|
|
57
|
+
if (childrenAsArray.length !== 1) {
|
|
58
|
+
return wrapper(children);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const child = childrenAsArray[0];
|
|
62
|
+
|
|
63
|
+
if (!isValidElement(child)) {
|
|
64
|
+
return wrapper(children);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return cloneElement(child, undefined, wrapper(child.props.children));
|
|
68
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export type Store<T extends any = unknown> = {
|
|
2
|
+
/**
|
|
3
|
+
* Returns the value from the store.
|
|
4
|
+
*/
|
|
5
|
+
get: () => T;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Sets a new value in the store.
|
|
9
|
+
*/
|
|
10
|
+
set: (value: SetValueType<T>) => void;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Adds a change listener to the store.
|
|
14
|
+
*/
|
|
15
|
+
onChange: (handleChange: ChangeListener<T>) => () => void;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type ChangeListener<T> = (value: T) => void;
|
|
19
|
+
|
|
20
|
+
type SetValueType<T> = T | ((prev: T) => T);
|
|
21
|
+
|
|
22
|
+
function valueIsClosure<T>(value: SetValueType<T>): value is (prev: T) => T {
|
|
23
|
+
return typeof value === 'function';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function createStore<T>(initialValue: T): Store<T>;
|
|
27
|
+
export function createStore<T extends any = undefined>(): Store<T | undefined>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Creates a store. You can utilize the store for simple shared state.
|
|
31
|
+
*
|
|
32
|
+
* ### Create a Store
|
|
33
|
+
*
|
|
34
|
+
* Make sure to create your store only once and save it in a dedicated file.
|
|
35
|
+
*
|
|
36
|
+
* ```tsx
|
|
37
|
+
* // my-count-store.ts
|
|
38
|
+
*
|
|
39
|
+
* export const myCountStore = createStore<number>(0);
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* ### Hook
|
|
43
|
+
*
|
|
44
|
+
* Usually you would pair the store with the usage of the {@link useStore} hook -- head over to learn how to use a created store in your components.
|
|
45
|
+
*
|
|
46
|
+
* The hook abstracts all the React related boilerplate away, so you can use the store like a simple `useState()`.
|
|
47
|
+
*/
|
|
48
|
+
export function createStore<T = undefined>(
|
|
49
|
+
initialValue?: T,
|
|
50
|
+
): Store<T | undefined> {
|
|
51
|
+
let value = initialValue;
|
|
52
|
+
|
|
53
|
+
const listeners: ChangeListener<T | undefined>[] = [];
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
get: () => value,
|
|
57
|
+
set: newValue => {
|
|
58
|
+
if (valueIsClosure(newValue)) {
|
|
59
|
+
value = newValue(value);
|
|
60
|
+
} else {
|
|
61
|
+
value = newValue;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
listeners.forEach(listener => listener(value));
|
|
65
|
+
},
|
|
66
|
+
onChange: handleChange => {
|
|
67
|
+
listeners.push(handleChange);
|
|
68
|
+
const idx = listeners.length - 1;
|
|
69
|
+
|
|
70
|
+
return () => {
|
|
71
|
+
listeners.splice(idx, 1);
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
EventClickArea,
|
|
3
|
+
EventClickAttributes,
|
|
4
|
+
EventClickElement,
|
|
5
|
+
FormAttributionAttributes,
|
|
6
|
+
} from '@tuic/tracking/src/types';
|
|
7
|
+
|
|
8
|
+
export type DataAttributes = {
|
|
9
|
+
[EventClickAttributes.Area]?: EventClickArea | undefined;
|
|
10
|
+
[EventClickAttributes.Element]?: EventClickElement | undefined;
|
|
11
|
+
[EventClickAttributes.Category]?: string | undefined;
|
|
12
|
+
[EventClickAttributes.Label]?: string | undefined;
|
|
13
|
+
[EventClickAttributes.Module]?: string | undefined;
|
|
14
|
+
[EventClickAttributes.Dialog]?: string | undefined;
|
|
15
|
+
[FormAttributionAttributes.FieldName]?: string | undefined;
|
|
16
|
+
[FormAttributionAttributes.FormName]?: string | undefined;
|
|
17
|
+
[key: `data-${string}`]: string | undefined;
|
|
18
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Dispatch, SetStateAction, useEffect, useState } from 'react';
|
|
4
|
+
import { ScreenName, screens } from '../helpers/screen';
|
|
5
|
+
|
|
6
|
+
type ActiveScreens = {
|
|
7
|
+
[name in ScreenName]: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type ActiveScreensQueryLists = {
|
|
11
|
+
[name in ScreenName]: MediaQueryList;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const listsToState = (lists: ActiveScreensQueryLists): ActiveScreens => ({
|
|
15
|
+
xs: lists.xs.matches,
|
|
16
|
+
sm: lists.sm.matches,
|
|
17
|
+
md: lists.md.matches,
|
|
18
|
+
lg: lists.lg.matches,
|
|
19
|
+
xl: lists.xl.matches,
|
|
20
|
+
xxl: lists.xxl.matches,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const createChangeHandler = (
|
|
24
|
+
name: ScreenName,
|
|
25
|
+
setScreenState: Dispatch<SetStateAction<ActiveScreens>>,
|
|
26
|
+
) => {
|
|
27
|
+
return ({ matches }: MediaQueryListEvent) => {
|
|
28
|
+
setScreenState(prev => ({
|
|
29
|
+
...prev,
|
|
30
|
+
[name]: matches,
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns all active screen names.
|
|
37
|
+
* The returned object's keys are the {@link ScreenName}s and the values indicates
|
|
38
|
+
* if the screen name is currently active (matches the underlying media query).
|
|
39
|
+
*
|
|
40
|
+
* ```tsx
|
|
41
|
+
* const activeScreens = useActiveScreenNames();
|
|
42
|
+
*
|
|
43
|
+
* if (activeScreens.md) {
|
|
44
|
+
* ...
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* This is a hook which keeps track of all the available screen names.
|
|
49
|
+
* Normally you'd be better off using {@link useScreenName} or {@link useScreenNameAtLeast}.
|
|
50
|
+
*/
|
|
51
|
+
export const useActiveScreenNames = (
|
|
52
|
+
ssrValues: ActiveScreens = {
|
|
53
|
+
xs: false,
|
|
54
|
+
sm: false,
|
|
55
|
+
md: false,
|
|
56
|
+
lg: false,
|
|
57
|
+
xl: false,
|
|
58
|
+
xxl: false,
|
|
59
|
+
},
|
|
60
|
+
): ActiveScreens => {
|
|
61
|
+
const [screenState, setScreenState] = useState<ActiveScreens>(ssrValues);
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
const lists = {
|
|
65
|
+
xs: window.matchMedia(`(min-width: ${screens.xs}px)`),
|
|
66
|
+
sm: window.matchMedia(`(min-width: ${screens.sm}px)`),
|
|
67
|
+
md: window.matchMedia(`(min-width: ${screens.md}px)`),
|
|
68
|
+
lg: window.matchMedia(`(min-width: ${screens.lg}px)`),
|
|
69
|
+
xl: window.matchMedia(`(min-width: ${screens.xl}px)`),
|
|
70
|
+
xxl: window.matchMedia(`(min-width: ${screens.xxl}px)`),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
setScreenState(listsToState(lists));
|
|
74
|
+
|
|
75
|
+
const handleXsChange = createChangeHandler('xs', setScreenState);
|
|
76
|
+
const handleSmChange = createChangeHandler('sm', setScreenState);
|
|
77
|
+
const handleMdChange = createChangeHandler('md', setScreenState);
|
|
78
|
+
const handleLgChange = createChangeHandler('lg', setScreenState);
|
|
79
|
+
const handleXlChange = createChangeHandler('xl', setScreenState);
|
|
80
|
+
const handleXxlChange = createChangeHandler('xxl', setScreenState);
|
|
81
|
+
|
|
82
|
+
lists.xs.addEventListener('change', handleXsChange);
|
|
83
|
+
lists.sm.addEventListener('change', handleSmChange);
|
|
84
|
+
lists.md.addEventListener('change', handleMdChange);
|
|
85
|
+
lists.lg.addEventListener('change', handleLgChange);
|
|
86
|
+
lists.xl.addEventListener('change', handleXlChange);
|
|
87
|
+
lists.xxl.addEventListener('change', handleXxlChange);
|
|
88
|
+
|
|
89
|
+
return () => {
|
|
90
|
+
lists.xs.removeEventListener('change', handleXsChange);
|
|
91
|
+
lists.sm.removeEventListener('change', handleSmChange);
|
|
92
|
+
lists.md.removeEventListener('change', handleMdChange);
|
|
93
|
+
lists.lg.removeEventListener('change', handleLgChange);
|
|
94
|
+
lists.xl.removeEventListener('change', handleXlChange);
|
|
95
|
+
lists.xxl.removeEventListener('change', handleXxlChange);
|
|
96
|
+
};
|
|
97
|
+
}, []);
|
|
98
|
+
|
|
99
|
+
return screenState;
|
|
100
|
+
};
|