@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,178 @@
|
|
|
1
|
+
import { Icon, IconName } from '../../core/Icon';
|
|
2
|
+
import {
|
|
3
|
+
ButtonHTMLAttributes,
|
|
4
|
+
ForwardRefRenderFunction,
|
|
5
|
+
forwardRef,
|
|
6
|
+
} from 'react';
|
|
7
|
+
import { twJoin, twMerge } from 'tailwind-merge';
|
|
8
|
+
import { Slot, Slottable } from '@radix-ui/react-slot';
|
|
9
|
+
import { Skeleton, SkeletonTextLines } from '../../core/Skeleton';
|
|
10
|
+
import { LoadingSpinner } from '../../core/LoadingSpinner';
|
|
11
|
+
import { DataAttributes } from '../../../helpers/types';
|
|
12
|
+
|
|
13
|
+
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &
|
|
14
|
+
DataAttributes & {
|
|
15
|
+
fallback?: boolean;
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
variant?: 'primary' | 'secondary';
|
|
18
|
+
on?: 'white' | 'gray' | 'ocean' | 'image';
|
|
19
|
+
iconRight?: IconName;
|
|
20
|
+
iconLeft?: IconName;
|
|
21
|
+
hasFullWidthOnMobile?: boolean;
|
|
22
|
+
indicating?: boolean;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const ButtonRenderFunction: ForwardRefRenderFunction<
|
|
26
|
+
HTMLButtonElement,
|
|
27
|
+
ButtonProps
|
|
28
|
+
> = (props, ref) => {
|
|
29
|
+
const {
|
|
30
|
+
asChild,
|
|
31
|
+
className,
|
|
32
|
+
variant = 'primary',
|
|
33
|
+
on = 'white',
|
|
34
|
+
iconRight,
|
|
35
|
+
iconLeft,
|
|
36
|
+
fallback,
|
|
37
|
+
children,
|
|
38
|
+
disabled: disabledArg,
|
|
39
|
+
hasFullWidthOnMobile, // @revisit
|
|
40
|
+
indicating,
|
|
41
|
+
...rest
|
|
42
|
+
} = props;
|
|
43
|
+
|
|
44
|
+
let disabled = indicating ? true : disabledArg;
|
|
45
|
+
|
|
46
|
+
const Element = asChild ? Slot : 'button';
|
|
47
|
+
|
|
48
|
+
if (fallback) {
|
|
49
|
+
return (
|
|
50
|
+
<Element
|
|
51
|
+
ref={ref as any}
|
|
52
|
+
disabled
|
|
53
|
+
className={twJoin(
|
|
54
|
+
'inline-flex appearance-none',
|
|
55
|
+
hasFullWidthOnMobile && 'w-full sm:w-auto',
|
|
56
|
+
className?.includes('w-full') && 'w-full',
|
|
57
|
+
)}
|
|
58
|
+
>
|
|
59
|
+
<Skeleton
|
|
60
|
+
className={twJoin(
|
|
61
|
+
'inline-flex h-[2.875rem] items-center px-8',
|
|
62
|
+
hasFullWidthOnMobile && 'w-full sm:w-auto',
|
|
63
|
+
className?.includes('w-full') && 'w-full',
|
|
64
|
+
)}
|
|
65
|
+
>
|
|
66
|
+
<div
|
|
67
|
+
className={twJoin(
|
|
68
|
+
'mx-auto max-w-full',
|
|
69
|
+
hasFullWidthOnMobile ? 'w-full sm:w-[150px]' : 'w-[150px]',
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
<SkeletonTextLines number={1} />
|
|
73
|
+
</div>
|
|
74
|
+
</Skeleton>
|
|
75
|
+
</Element>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const buttonClassNames = twMerge(
|
|
80
|
+
'relative inline-flex appearance-none items-center justify-center gap-2 rounded-md border-none px-7 py-3.5 text-lg font-semibold !leading-normal transition-all md:text-base',
|
|
81
|
+
hasFullWidthOnMobile && 'w-full sm:w-auto',
|
|
82
|
+
|
|
83
|
+
// Variants
|
|
84
|
+
variant === 'primary' && [
|
|
85
|
+
// On white (default)
|
|
86
|
+
'bg-surface-primary-100 text-marine-high-emphasis',
|
|
87
|
+
'hover:bg-surface-primary-120 group-hover/button:bg-surface-primary-120',
|
|
88
|
+
'active:bg-surface-primary-120 group-active/button:bg-surface-primary-120',
|
|
89
|
+
'disabled:bg-surface-secondary-7',
|
|
90
|
+
disabled && 'bg-surface-secondary-7',
|
|
91
|
+
|
|
92
|
+
// On gray
|
|
93
|
+
on === 'gray' && 'disabled:bg-surface-white',
|
|
94
|
+
on === 'gray' && disabled && 'bg-surface-white',
|
|
95
|
+
|
|
96
|
+
// On ocean
|
|
97
|
+
on === 'ocean' && 'bg-surface-secondary-100 text-white',
|
|
98
|
+
on === 'ocean' &&
|
|
99
|
+
'hover:bg-surface-secondary-120 group-hover/button:bg-surface-secondary-120',
|
|
100
|
+
on === 'ocean' &&
|
|
101
|
+
'active:bg-surface-secondary-120 group-active/button:bg-surface-secondary-120',
|
|
102
|
+
on === 'ocean' && 'disabled:bg-surface-secondary-7',
|
|
103
|
+
on === 'ocean' && disabled && 'bg-surface-secondary-7',
|
|
104
|
+
|
|
105
|
+
// On image
|
|
106
|
+
on === 'image' && 'bg-surface-white',
|
|
107
|
+
on === 'image' &&
|
|
108
|
+
'hover:bg-surface-secondary-7 group-hover/button:bg-surface-secondary-7',
|
|
109
|
+
on === 'image' &&
|
|
110
|
+
'active:bg-surface-secondary-7 group-active/button:bg-surface-secondary-7',
|
|
111
|
+
on === 'image' && 'disabled:bg-surface-secondary-7',
|
|
112
|
+
on === 'image' && disabled && 'bg-surface-secondary-7',
|
|
113
|
+
],
|
|
114
|
+
|
|
115
|
+
variant === 'secondary' && [
|
|
116
|
+
'bg-transparent',
|
|
117
|
+
|
|
118
|
+
// On white (default)
|
|
119
|
+
'text-marine-high-emphasis shadow-[inset_0_0_0_2px_theme(colors.stroke.primary-100)]',
|
|
120
|
+
'hover:shadow-[inset_0_0_0_4px_theme(colors.stroke.primary-100)] group-hover/button:shadow-[inset_0_0_0_4px_theme(colors.stroke.primary-100)]',
|
|
121
|
+
'active:shadow-[inset_0_0_0_4px_theme(colors.stroke.primary-100)] group-active:shadow-[inset_0_0_0_4px_theme(colors.stroke.primary-100)]',
|
|
122
|
+
'disabled:shadow-[inset_0_0_0_2px_theme(colors.stroke.secondary-7)]',
|
|
123
|
+
disabled && 'shadow-[inset_0_0_0_2px_theme(colors.stroke.secondary-7)]',
|
|
124
|
+
|
|
125
|
+
// On gray
|
|
126
|
+
on === 'gray' &&
|
|
127
|
+
'disabled:shadow-[inset_0_0_0_2px_theme(colors.stroke.white)]',
|
|
128
|
+
on === 'gray' &&
|
|
129
|
+
disabled &&
|
|
130
|
+
'shadow-[inset_0_0_0_2px_theme(colors.stroke.white)]',
|
|
131
|
+
|
|
132
|
+
// On ocean
|
|
133
|
+
on === 'ocean' && 'shadow-[inset_0_0_0_2px_theme(colors.stroke.white)]',
|
|
134
|
+
on === 'ocean' &&
|
|
135
|
+
'hover:shadow-[inset_0_0_0_4px_theme(colors.stroke.white)] group-hover/button:shadow-[inset_0_0_0_4px_theme(colors.stroke.white)]',
|
|
136
|
+
on === 'ocean' &&
|
|
137
|
+
'active:shadow-[inset_0_0_0_4px_theme(colors.stroke.white)] group-active:shadow-[inset_0_0_0_4px_theme(colors.stroke.white)]',
|
|
138
|
+
on === 'ocean' &&
|
|
139
|
+
'disabled:shadow-[inset_0_0_0_2px_theme(colors.stroke.secondary-7)]',
|
|
140
|
+
on === 'ocean' &&
|
|
141
|
+
disabled &&
|
|
142
|
+
'shadow-[inset_0_0_0_2px_theme(colors.stroke.secondary-7)]',
|
|
143
|
+
],
|
|
144
|
+
|
|
145
|
+
// States
|
|
146
|
+
'active:transition-none',
|
|
147
|
+
'group-active/button:transition-none',
|
|
148
|
+
'focus:outline-none focus-visible:shadow-focus-state',
|
|
149
|
+
'disabled:!pointer-events-none disabled:text-secondary-marine-48',
|
|
150
|
+
disabled && '!pointer-events-none text-secondary-marine-48',
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<Element
|
|
155
|
+
className={twJoin(buttonClassNames, className)}
|
|
156
|
+
ref={ref}
|
|
157
|
+
{...rest}
|
|
158
|
+
>
|
|
159
|
+
{iconLeft && <Icon name={iconLeft} size="xs" />}
|
|
160
|
+
<Slottable>{children ?? ' '}</Slottable>
|
|
161
|
+
{!iconLeft && iconRight && <Icon name={iconRight} size="xs" />}
|
|
162
|
+
|
|
163
|
+
{indicating && (
|
|
164
|
+
<div
|
|
165
|
+
className={twJoin(
|
|
166
|
+
'absolute inset-0 flex items-center justify-center',
|
|
167
|
+
)}
|
|
168
|
+
>
|
|
169
|
+
<LoadingSpinner size="md" />
|
|
170
|
+
</div>
|
|
171
|
+
)}
|
|
172
|
+
</Element>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
177
|
+
ButtonRenderFunction,
|
|
178
|
+
) as typeof ButtonRenderFunction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { forwardRef, ForwardRefRenderFunction, HTMLAttributes } from 'react';
|
|
2
|
+
import { twJoin } from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Properties for the `ButtonGroup` component.
|
|
6
|
+
*
|
|
7
|
+
* @property {string} [className] - Additional CSS classes for custom styling.
|
|
8
|
+
* @property {'horizontal' | 'vertical' | 'horizontal-end' | 'horizontal-center'} [orientation='horizontal']
|
|
9
|
+
* - Layout orientation of the button group.
|
|
10
|
+
* @property {boolean} [disabled] - If true, disables all buttons within the group.
|
|
11
|
+
*/
|
|
12
|
+
export type ButtonGroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
13
|
+
className?: string;
|
|
14
|
+
orientation?:
|
|
15
|
+
| 'horizontal'
|
|
16
|
+
| 'vertical'
|
|
17
|
+
| 'horizontal-end'
|
|
18
|
+
| 'horizontal-center';
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const ButtonGroupRenderFunction: ForwardRefRenderFunction<
|
|
23
|
+
HTMLDivElement,
|
|
24
|
+
ButtonGroupProps
|
|
25
|
+
> = (props, ref) => {
|
|
26
|
+
let {
|
|
27
|
+
className,
|
|
28
|
+
orientation = 'horizontal',
|
|
29
|
+
disabled,
|
|
30
|
+
children,
|
|
31
|
+
...rest
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
{...rest}
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={twJoin(
|
|
39
|
+
'flex flex-col gap-4 sm:items-center',
|
|
40
|
+
orientation === 'vertical' ? '' : 'gap-6 sm:flex-row',
|
|
41
|
+
orientation === 'horizontal-end' && 'justify-end gap-6 sm:flex-row',
|
|
42
|
+
orientation === 'horizontal-center' &&
|
|
43
|
+
'justify-center gap-6 sm:flex-row',
|
|
44
|
+
className,
|
|
45
|
+
disabled && 'pointer-events-none',
|
|
46
|
+
)}
|
|
47
|
+
>
|
|
48
|
+
{children}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* `ButtonGroup` component for grouping multiple buttons with customizable orientation and styling.
|
|
55
|
+
*
|
|
56
|
+
* This component provides a flexible layout for organizing buttons in a horizontal, vertical, end-aligned, or center-aligned manner.
|
|
57
|
+
*
|
|
58
|
+
* - Default orientation: `horizontal`.
|
|
59
|
+
* - Disabled state applies to all child buttons, preventing user interaction.
|
|
60
|
+
*
|
|
61
|
+
* @param {ButtonGroupProps} props - Properties to configure the `ButtonGroup`.
|
|
62
|
+
* @param {React.Ref<HTMLDivElement>} ref - Reference to the button group container.
|
|
63
|
+
* @returns {JSX.Element} The rendered button group.
|
|
64
|
+
*/
|
|
65
|
+
const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
|
|
66
|
+
ButtonGroupRenderFunction,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
ButtonGroup.displayName = 'ButtonGroup';
|
|
70
|
+
|
|
71
|
+
export { ButtonGroup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ButtonGroup';
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
|
+
import { DayPicker, Matcher } from 'react-day-picker';
|
|
6
|
+
import { de, enGB } from 'date-fns/locale';
|
|
7
|
+
|
|
8
|
+
import { twJoin } from 'tailwind-merge';
|
|
9
|
+
import { Icon } from '../../core/Icon';
|
|
10
|
+
import { Locale as I18nLocale } from '@tuic/i18n';
|
|
11
|
+
import { TextButton } from '../../core/TextButton';
|
|
12
|
+
import { differenceInMonths } from 'date-fns';
|
|
13
|
+
|
|
14
|
+
export type CalendarProps = Omit<
|
|
15
|
+
React.ComponentProps<typeof DayPicker>,
|
|
16
|
+
'locale' | 'fromDate'
|
|
17
|
+
> & {
|
|
18
|
+
localeCode?: I18nLocale;
|
|
19
|
+
useShowMoreButtonOnMobile?: boolean;
|
|
20
|
+
showPrevMonthsButtonLabel?: string;
|
|
21
|
+
showNextMonthsButtonLabel?: string;
|
|
22
|
+
numberOfMonthsToShowMore?: number;
|
|
23
|
+
pastIsPickable?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const DEFAULT_LOCALE: I18nLocale = 'de';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Calendar integration
|
|
30
|
+
* Based on:
|
|
31
|
+
* - https://ui.shadcn.com/docs/components/calendar
|
|
32
|
+
* - https://ui.shadcn.com/docs/components/date-picker
|
|
33
|
+
* - https://react-day-picker.js.org/basics/localization
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
function Calendar({
|
|
37
|
+
className,
|
|
38
|
+
classNames,
|
|
39
|
+
showOutsideDays = true,
|
|
40
|
+
localeCode = DEFAULT_LOCALE,
|
|
41
|
+
useShowMoreButtonOnMobile = false,
|
|
42
|
+
showPrevMonthsButtonLabel,
|
|
43
|
+
showNextMonthsButtonLabel,
|
|
44
|
+
numberOfMonthsToShowMore = 12,
|
|
45
|
+
numberOfMonths,
|
|
46
|
+
month,
|
|
47
|
+
defaultMonth,
|
|
48
|
+
fromMonth,
|
|
49
|
+
pastIsPickable = false,
|
|
50
|
+
toMonth,
|
|
51
|
+
...props
|
|
52
|
+
}: CalendarProps) {
|
|
53
|
+
const [usedLocale, setUsedLocale] = useState<Locale | undefined>(undefined);
|
|
54
|
+
const [currentMonth, setCurrentMonth] = useState<Date | undefined>(
|
|
55
|
+
useShowMoreButtonOnMobile ? (month ?? defaultMonth) : undefined,
|
|
56
|
+
);
|
|
57
|
+
const [currentNumberOfMonths, setCurrentNumberOfMonths] = useState<
|
|
58
|
+
number | undefined
|
|
59
|
+
>(numberOfMonths);
|
|
60
|
+
const [noMoreMonthsToAddBefore, setNoMoreMonthsToAddBefore] =
|
|
61
|
+
useState<boolean>(true);
|
|
62
|
+
const [noMoreMonthsToAddNext, setNoMoreMonthsToAddNext] =
|
|
63
|
+
useState<boolean>(true);
|
|
64
|
+
|
|
65
|
+
// @todo: Refactor "show more" logic for previous and next months...
|
|
66
|
+
|
|
67
|
+
const getAmountOfPreviousMonthsToLoad = (): number => {
|
|
68
|
+
if (
|
|
69
|
+
typeof currentMonth !== 'undefined' &&
|
|
70
|
+
typeof fromMonth !== 'undefined'
|
|
71
|
+
) {
|
|
72
|
+
const startDate = new Date('2000-01-01');
|
|
73
|
+
startDate.setFullYear(fromMonth.getFullYear());
|
|
74
|
+
startDate.setMonth(fromMonth.getMonth());
|
|
75
|
+
|
|
76
|
+
const endDate = new Date('2000-01-01');
|
|
77
|
+
endDate.setFullYear(currentMonth.getFullYear());
|
|
78
|
+
endDate.setMonth(currentMonth.getMonth());
|
|
79
|
+
|
|
80
|
+
return differenceInMonths(endDate, startDate);
|
|
81
|
+
}
|
|
82
|
+
return 0;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const showPrevMonths = () => {
|
|
86
|
+
if (noMoreMonthsToAddBefore) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (typeof currentNumberOfMonths !== 'undefined') {
|
|
91
|
+
const diff = getAmountOfPreviousMonthsToLoad();
|
|
92
|
+
if (diff < 0) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
setCurrentMonth(fromMonth);
|
|
97
|
+
setCurrentNumberOfMonths(currentNumberOfMonths + diff);
|
|
98
|
+
setNoMoreMonthsToAddBefore(true);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const getAmountOfNextMonthsToLoad = (): number => {
|
|
103
|
+
if (typeof currentMonth !== 'undefined' && typeof toMonth !== 'undefined') {
|
|
104
|
+
const startDate = new Date('2000-01-01');
|
|
105
|
+
startDate.setFullYear(currentMonth.getFullYear());
|
|
106
|
+
startDate.setMonth(currentMonth.getMonth());
|
|
107
|
+
|
|
108
|
+
const endDate = new Date('2000-01-01');
|
|
109
|
+
endDate.setFullYear(toMonth.getFullYear());
|
|
110
|
+
endDate.setMonth(toMonth.getMonth());
|
|
111
|
+
|
|
112
|
+
return differenceInMonths(endDate, startDate) + 1;
|
|
113
|
+
}
|
|
114
|
+
return 0;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const showNextMonths = () => {
|
|
118
|
+
if (noMoreMonthsToAddNext) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (typeof currentNumberOfMonths !== 'undefined') {
|
|
123
|
+
const diff = getAmountOfNextMonthsToLoad();
|
|
124
|
+
if (diff < 0) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let monthsToAdd = numberOfMonthsToShowMore;
|
|
129
|
+
while (currentNumberOfMonths + monthsToAdd > diff && monthsToAdd > 0) {
|
|
130
|
+
monthsToAdd--;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
setCurrentNumberOfMonths(currentNumberOfMonths + monthsToAdd);
|
|
134
|
+
|
|
135
|
+
if (
|
|
136
|
+
currentNumberOfMonths + monthsToAdd >= getAmountOfNextMonthsToLoad() ||
|
|
137
|
+
monthsToAdd === 0 ||
|
|
138
|
+
monthsToAdd < numberOfMonthsToShowMore
|
|
139
|
+
) {
|
|
140
|
+
setNoMoreMonthsToAddNext(true);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (month !== undefined) {
|
|
147
|
+
setCurrentMonth(month);
|
|
148
|
+
}
|
|
149
|
+
}, [month]);
|
|
150
|
+
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
switch (localeCode) {
|
|
153
|
+
case 'en':
|
|
154
|
+
setUsedLocale(enGB);
|
|
155
|
+
break;
|
|
156
|
+
case 'de':
|
|
157
|
+
default:
|
|
158
|
+
setUsedLocale(de);
|
|
159
|
+
}
|
|
160
|
+
}, [localeCode]);
|
|
161
|
+
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
if (useShowMoreButtonOnMobile) {
|
|
164
|
+
if (getAmountOfPreviousMonthsToLoad() > 0) {
|
|
165
|
+
setNoMoreMonthsToAddBefore(false);
|
|
166
|
+
}
|
|
167
|
+
if (getAmountOfNextMonthsToLoad() > 0) {
|
|
168
|
+
setNoMoreMonthsToAddNext(false);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}, [useShowMoreButtonOnMobile]);
|
|
172
|
+
|
|
173
|
+
const disabledMatchers: Matcher[] = [];
|
|
174
|
+
const today = new Date();
|
|
175
|
+
if (currentMonth && !pastIsPickable) {
|
|
176
|
+
const firstDayOfMonth = new Date(
|
|
177
|
+
currentMonth.getFullYear(),
|
|
178
|
+
currentMonth.getMonth(),
|
|
179
|
+
1,
|
|
180
|
+
);
|
|
181
|
+
const yesterday = new Date(
|
|
182
|
+
today.getFullYear(),
|
|
183
|
+
today.getMonth(),
|
|
184
|
+
today.getDate(),
|
|
185
|
+
);
|
|
186
|
+
let currentDate = new Date(firstDayOfMonth);
|
|
187
|
+
while (currentDate < yesterday) {
|
|
188
|
+
disabledMatchers.push(new Date(currentDate));
|
|
189
|
+
currentDate.setDate(currentDate.getDate() + 1);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (props.disabled) {
|
|
194
|
+
const disabledNormalized = Array.isArray(props.disabled)
|
|
195
|
+
? props.disabled
|
|
196
|
+
: [props.disabled];
|
|
197
|
+
disabledMatchers.push(...disabledNormalized);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<>
|
|
202
|
+
{useShowMoreButtonOnMobile && !noMoreMonthsToAddBefore && (
|
|
203
|
+
<div className="py-4 text-center duration-300 animate-in fade-in lg:hidden">
|
|
204
|
+
<TextButton onClick={showPrevMonths}>
|
|
205
|
+
{showPrevMonthsButtonLabel ?? 'Show previous'}
|
|
206
|
+
</TextButton>
|
|
207
|
+
</div>
|
|
208
|
+
)}
|
|
209
|
+
|
|
210
|
+
<DayPicker
|
|
211
|
+
month={currentMonth}
|
|
212
|
+
toMonth={toMonth}
|
|
213
|
+
numberOfMonths={currentNumberOfMonths}
|
|
214
|
+
showOutsideDays={showOutsideDays}
|
|
215
|
+
className={twJoin('w-full pb-3 pt-3', className)}
|
|
216
|
+
fromDate={fromMonth}
|
|
217
|
+
disabled={disabledMatchers}
|
|
218
|
+
classNames={{
|
|
219
|
+
months: 'flex flex-col lg:flex-row lg:flex-nowrap gap-8 lg:gap-4',
|
|
220
|
+
month: 'space-y-4 lg:w-1/2',
|
|
221
|
+
caption: 'flex justify-center pt-1 relative items-center',
|
|
222
|
+
caption_label: 'label-md',
|
|
223
|
+
nav: 'space-x-1 flex items-center',
|
|
224
|
+
nav_button: twJoin(
|
|
225
|
+
'flex h-11 w-1/7 flex-row items-center justify-center bg-transparent p-0 opacity-50',
|
|
226
|
+
'disabled:opacity-10',
|
|
227
|
+
'hover:opacity-100',
|
|
228
|
+
'focus:outline-none focus-visible:shadow-focus-state',
|
|
229
|
+
),
|
|
230
|
+
nav_button_previous: twJoin(
|
|
231
|
+
'absolute left-0 pl-4',
|
|
232
|
+
useShowMoreButtonOnMobile ? 'hidden lg:block' : '!block',
|
|
233
|
+
),
|
|
234
|
+
nav_button_next: twJoin(
|
|
235
|
+
'absolute right-0 pr-4',
|
|
236
|
+
useShowMoreButtonOnMobile ? 'hidden lg:block' : '!block',
|
|
237
|
+
),
|
|
238
|
+
table: 'w-full border-collapse space-y-1',
|
|
239
|
+
head_row: 'flex flex-row nowrap gap-x-0.5',
|
|
240
|
+
head_cell:
|
|
241
|
+
'flex justify-center items-center w-1/7 h-11 text-marine-high-emphasis font-normal text-xs rounded-sm',
|
|
242
|
+
row: 'flex flex-row nowrap gap-x-0.5 w-full mt-0.5',
|
|
243
|
+
cell: twJoin(
|
|
244
|
+
'relative w-1/7 p-0 text-center text-xs focus-within:relative focus-within:z-20' +
|
|
245
|
+
'[&:has([aria-selected].day-range-end)]:rounded-r-lg [&:has([aria-selected])]:bg-surface-secondary-7 [&:has([aria-selected].day-outside)]:bg-surface-secondary-7',
|
|
246
|
+
props.mode === 'range'
|
|
247
|
+
? '[&:has(>.day-range-end)]:rounded-r-lg [&:has(>.day-range-start)]:rounded-l-lg first:[&:has([aria-selected])]:rounded-l-lg last:[&:has([aria-selected])]:rounded-r-lg'
|
|
248
|
+
: '[&:has([aria-selected])]:rounded-sm',
|
|
249
|
+
),
|
|
250
|
+
day: twJoin(
|
|
251
|
+
'h-11 w-full rounded-sm p-0 font-normal text-marine-high-emphasis aria-selected:opacity-100',
|
|
252
|
+
'hover:border-stroke-primary-100 hover:bg-surface-primary-60 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-secondary-marine-48',
|
|
253
|
+
'active:border-stroke-primary-100 active:bg-surface-primary-60',
|
|
254
|
+
'focus:outline-none focus-visible:shadow-focus-state',
|
|
255
|
+
),
|
|
256
|
+
day_range_start:
|
|
257
|
+
'day-range-start bg-surface-primary-100 hover:bg-surface-primary-120 active:bg-surface-primary-120 focus:bg-surface-primary-100 text-marine-high-emphasis rounded-l-lg rounded-r-none',
|
|
258
|
+
day_range_end:
|
|
259
|
+
'day-range-end bg-surface-primary-100 hover:bg-surface-primary-120 active:bg-surface-primary-120 focus:bg-surface-primary-100 text-marine-high-emphasis rounded-r-lg',
|
|
260
|
+
day_range_middle:
|
|
261
|
+
'aria-selected:bg-surface-primary-60 aria-selected:text-marine-high-emphasis',
|
|
262
|
+
day_selected: twJoin(
|
|
263
|
+
'rounded-none bg-surface-primary-100 text-marine-high-emphasis',
|
|
264
|
+
'hover:bg-surface-primary-120 hover:text-marine-high-emphasis',
|
|
265
|
+
'active:bg-surface-primary-120 active:text-marine-high-emphasis',
|
|
266
|
+
'focus:bg-surface-primary-120 focus:text-marine-high-emphasis',
|
|
267
|
+
),
|
|
268
|
+
day_outside:
|
|
269
|
+
'day-outside text-secondary-marine-48 aria-selected:bg-surface-secondary-7 relative aria-selected:text-secondary-marine-48',
|
|
270
|
+
day_disabled: 'text-secondary-marine-48',
|
|
271
|
+
day_hidden: 'invisible',
|
|
272
|
+
...classNames,
|
|
273
|
+
}}
|
|
274
|
+
components={{
|
|
275
|
+
IconLeft: ({ ...props }) => (
|
|
276
|
+
<Icon className="-ml-2 h-5 w-5" name="nav-arrow-left" size="lg" />
|
|
277
|
+
),
|
|
278
|
+
IconRight: ({ ...props }) => (
|
|
279
|
+
<Icon
|
|
280
|
+
className="-mr-2 ml-auto h-5 w-5"
|
|
281
|
+
name="nav-arrow-right"
|
|
282
|
+
size="lg"
|
|
283
|
+
/>
|
|
284
|
+
),
|
|
285
|
+
}}
|
|
286
|
+
locale={usedLocale}
|
|
287
|
+
{...props}
|
|
288
|
+
/>
|
|
289
|
+
|
|
290
|
+
{useShowMoreButtonOnMobile && !noMoreMonthsToAddNext && (
|
|
291
|
+
<div className="py-4 text-center duration-300 animate-in fade-in lg:hidden">
|
|
292
|
+
<TextButton onClick={showNextMonths}>
|
|
293
|
+
{showNextMonthsButtonLabel ?? 'Show more'}
|
|
294
|
+
</TextButton>
|
|
295
|
+
</div>
|
|
296
|
+
)}
|
|
297
|
+
</>
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
Calendar.displayName = 'Calendar';
|
|
302
|
+
|
|
303
|
+
export { Calendar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Calendar';
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { ForwardRefRenderFunction, InputHTMLAttributes } from 'react';
|
|
4
|
+
import { Icon } from '../../core/Icon';
|
|
5
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
|
6
|
+
import { twJoin } from 'tailwind-merge';
|
|
7
|
+
|
|
8
|
+
type BaseProps = {
|
|
9
|
+
checked?: boolean | 'indeterminate';
|
|
10
|
+
defaultChecked?: boolean | 'indeterminate';
|
|
11
|
+
invalid?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type CheckboxProps = BaseProps &
|
|
15
|
+
Omit<InputHTMLAttributes<HTMLInputElement>, keyof BaseProps | 'type'>;
|
|
16
|
+
|
|
17
|
+
const CheckboxRenderFunction: ForwardRefRenderFunction<
|
|
18
|
+
HTMLInputElement | null,
|
|
19
|
+
CheckboxProps
|
|
20
|
+
> = ({ checked, defaultChecked, invalid, ...rest }, forwardedRef) => {
|
|
21
|
+
const ref = useRef<HTMLInputElement | null>(null);
|
|
22
|
+
const checkedProp = checked === 'indeterminate' ? false : checked;
|
|
23
|
+
const defaultCheckedProp =
|
|
24
|
+
defaultChecked === 'indeterminate' ? false : defaultChecked;
|
|
25
|
+
|
|
26
|
+
const comparableChecked =
|
|
27
|
+
typeof checked !== 'undefined' ? checked : defaultChecked;
|
|
28
|
+
|
|
29
|
+
useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(
|
|
30
|
+
forwardedRef,
|
|
31
|
+
() => ref.current,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (comparableChecked !== 'indeterminate') {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!ref || !('current' in ref) || !ref.current) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ref.current.indeterminate = true;
|
|
44
|
+
}, [ref, comparableChecked]);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
ref.current?.setCustomValidity(invalid ?? '');
|
|
48
|
+
}, [ref, invalid]);
|
|
49
|
+
|
|
50
|
+
const iconWrapperClassName = 'hidden absolute inset-0 pointer-events-none';
|
|
51
|
+
const iconClassName = 'w-full h-full';
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<span className="relative inline-block h-8 w-8 flex-shrink-0 md:h-6 md:w-6">
|
|
55
|
+
<input
|
|
56
|
+
{...rest}
|
|
57
|
+
className={twJoin(
|
|
58
|
+
'peer absolute inset-0 h-8 w-8 appearance-none rounded-sm md:h-6 md:w-6',
|
|
59
|
+
'before:absolute before:inset-0 before:rounded-sm before:border before:border-stroke-primary-100',
|
|
60
|
+
'checked:before:border-transparent checked:before:bg-surface-primary-100',
|
|
61
|
+
'indeterminate:before:border-transparent indeterminate:before:bg-surface-primary-100',
|
|
62
|
+
'invalid:before:border-stroke-error-100',
|
|
63
|
+
'hover:cursor-pointer hover:bg-surface-secondary-7',
|
|
64
|
+
'focus:outline-none focus-visible:shadow-focus-state',
|
|
65
|
+
'disabled:before:border-stroke-secondary-40 disabled:hover:cursor-not-allowed disabled:hover:bg-transparent',
|
|
66
|
+
)}
|
|
67
|
+
type="checkbox"
|
|
68
|
+
defaultChecked={defaultCheckedProp}
|
|
69
|
+
checked={checkedProp}
|
|
70
|
+
ref={ref}
|
|
71
|
+
/>
|
|
72
|
+
<span
|
|
73
|
+
className={`${iconWrapperClassName} text-white peer-indeterminate:inline-block`}
|
|
74
|
+
>
|
|
75
|
+
<Icon name="minus" size="md" className={iconClassName} />
|
|
76
|
+
</span>
|
|
77
|
+
<span
|
|
78
|
+
className={`${iconWrapperClassName} text-marine-high-emphasis peer-checked:inline-block`}
|
|
79
|
+
>
|
|
80
|
+
<Icon name="check" size="md" className={iconClassName} />
|
|
81
|
+
</span>
|
|
82
|
+
</span>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Checkboxes let users select one or more items from a list, or turn an item on or off.
|
|
88
|
+
*
|
|
89
|
+
* ## Indeterminate (Partial) Checkboxes
|
|
90
|
+
*
|
|
91
|
+
* To set a checkbox to an indeterminate state, provide `indeterminate` as the value of `defaultChecked` or `checked`. Keep in mind, that technically the checkbox is unchecked while `indeterminate`.
|
|
92
|
+
*
|
|
93
|
+
* ```tsx
|
|
94
|
+
* <Checkbox defaultChecked="indeterminate" />
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* ## Invalid Checkboxes (Checkboxes with Errors)
|
|
98
|
+
*
|
|
99
|
+
* Provide an error message in the `invalid` attribute to mark the checkbox as errored.
|
|
100
|
+
*
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <Checkbox invalid="You need to accept our ToS." />
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export const Checkbox = forwardRef<HTMLInputElement | null, CheckboxProps>(
|
|
106
|
+
CheckboxRenderFunction,
|
|
107
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Checkbox';
|