@openameba/spindle-ui 0.25.0 → 0.26.1-alpha.0
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/Button/Button.css +1 -1
- package/Button/Button.mjs +7 -0
- package/Button/index.mjs +1 -0
- package/ButtonGroup/ButtonGroup.mjs +13 -0
- package/ButtonGroup/index.mjs +1 -0
- package/CHANGELOG.md +55 -0
- package/Form/Checkbox.mjs +11 -0
- package/Form/DropDown.mjs +38 -0
- package/Form/InlineDropDown.mjs +30 -0
- package/Form/InputLabel.mjs +5 -0
- package/Form/InvalidMessage.mjs +9 -0
- package/Form/Radio.mjs +11 -0
- package/Form/TextArea.mjs +5 -0
- package/Form/TextField.mjs +9 -0
- package/Form/ToggleSwitch.mjs +8 -0
- package/Form/index.mjs +8 -0
- package/HeroCarousel/HeroCarousel.css +1 -0
- package/HeroCarousel/HeroCarousel.d.ts +8 -0
- package/HeroCarousel/HeroCarousel.d.ts.map +1 -0
- package/HeroCarousel/HeroCarousel.js +35 -0
- package/HeroCarousel/HeroCarousel.js.map +1 -0
- package/HeroCarousel/HeroCarousel.mjs +27 -0
- package/HeroCarousel/HeroCarouselItem.css +1 -0
- package/HeroCarousel/HeroCarouselItem.d.ts +15 -0
- package/HeroCarousel/HeroCarouselItem.d.ts.map +1 -0
- package/HeroCarousel/HeroCarouselItem.js +47 -0
- package/HeroCarousel/HeroCarouselItem.js.map +1 -0
- package/HeroCarousel/HeroCarouselItem.mjs +21 -0
- package/HeroCarousel/hooks/useAutoPlayCarousel.d.ts +27 -0
- package/HeroCarousel/hooks/useAutoPlayCarousel.d.ts.map +1 -0
- package/HeroCarousel/hooks/useAutoPlayCarousel.js +168 -0
- package/HeroCarousel/hooks/useAutoPlayCarousel.js.map +1 -0
- package/HeroCarousel/hooks/useAutoPlayCarousel.mjs +158 -0
- package/HeroCarousel/hooks/useAutoSlide.d.ts +13 -0
- package/HeroCarousel/hooks/useAutoSlide.d.ts.map +1 -0
- package/HeroCarousel/hooks/useAutoSlide.js +46 -0
- package/HeroCarousel/hooks/useAutoSlide.js.map +1 -0
- package/HeroCarousel/hooks/useAutoSlide.mjs +40 -0
- package/HeroCarousel/hooks/useCarouselFocus.d.ts +11 -0
- package/HeroCarousel/hooks/useCarouselFocus.d.ts.map +1 -0
- package/HeroCarousel/hooks/useCarouselFocus.js +28 -0
- package/HeroCarousel/hooks/useCarouselFocus.js.map +1 -0
- package/HeroCarousel/hooks/useCarouselFocus.mjs +22 -0
- package/HeroCarousel/hooks/useSliderMoveEvent.d.ts +10 -0
- package/HeroCarousel/hooks/useSliderMoveEvent.d.ts.map +1 -0
- package/HeroCarousel/hooks/useSliderMoveEvent.js +52 -0
- package/HeroCarousel/hooks/useSliderMoveEvent.js.map +1 -0
- package/HeroCarousel/hooks/useSliderMoveEvent.mjs +47 -0
- package/HeroCarousel/hooks/useSliderTransition.d.ts +20 -0
- package/HeroCarousel/hooks/useSliderTransition.d.ts.map +1 -0
- package/HeroCarousel/hooks/useSliderTransition.js +36 -0
- package/HeroCarousel/hooks/useSliderTransition.js.map +1 -0
- package/HeroCarousel/hooks/useSliderTransition.mjs +30 -0
- package/HeroCarousel/hooks/useValueRef.d.ts +3 -0
- package/HeroCarousel/hooks/useValueRef.d.ts.map +1 -0
- package/HeroCarousel/hooks/useValueRef.js +13 -0
- package/HeroCarousel/hooks/useValueRef.js.map +1 -0
- package/HeroCarousel/hooks/useValueRef.mjs +8 -0
- package/HeroCarousel/index.d.ts +2 -0
- package/HeroCarousel/index.d.ts.map +1 -0
- package/HeroCarousel/index.js +6 -0
- package/HeroCarousel/index.js.map +1 -0
- package/HeroCarousel/index.mjs +1 -0
- package/Icon/755.mjs +6 -0
- package/Icon/Abemakun.mjs +6 -0
- package/Icon/Abematv.mjs +6 -0
- package/Icon/Accesslink.mjs +6 -0
- package/Icon/Accesspage.mjs +6 -0
- package/Icon/AccesspageFill.mjs +6 -0
- package/Icon/AddressbookFill.mjs +6 -0
- package/Icon/AlbumAddFill.mjs +6 -0
- package/Icon/AlbumFill.mjs +6 -0
- package/Icon/AlignCenter.mjs +6 -0
- package/Icon/AlignLeft.mjs +6 -0
- package/Icon/AlignRight.mjs +6 -0
- package/Icon/AllFill.mjs +6 -0
- package/Icon/Amebacoin.mjs +6 -0
- package/Icon/Amebapick.mjs +9 -0
- package/Icon/Amegold.mjs +6 -0
- package/Icon/Amember.mjs +6 -0
- package/Icon/ArrowDown.mjs +6 -0
- package/Icon/ArrowDownBold.mjs +6 -0
- package/Icon/ArrowLeft.mjs +6 -0
- package/Icon/ArrowLeftBold.mjs +6 -0
- package/Icon/ArrowRight.mjs +6 -0
- package/Icon/ArrowRightBold.mjs +6 -0
- package/Icon/ArrowRightCircle.mjs +6 -0
- package/Icon/ArrowRightCircleFill.mjs +6 -0
- package/Icon/ArrowUp.mjs +6 -0
- package/Icon/ArrowUpBold.mjs +6 -0
- package/Icon/ArrowpagingDown.mjs +6 -0
- package/Icon/ArrowpagingDownCircle.mjs +6 -0
- package/Icon/ArrowpagingLeft.mjs +6 -0
- package/Icon/ArrowpagingLeftCircle.mjs +6 -0
- package/Icon/ArrowpagingRight.mjs +6 -0
- package/Icon/ArrowpagingRightCircle.mjs +6 -0
- package/Icon/ArrowpagingUp.mjs +6 -0
- package/Icon/ArrowpagingUpCircle.mjs +6 -0
- package/Icon/Article.mjs +6 -0
- package/Icon/ArticleSlash.mjs +6 -0
- package/Icon/Articledesign.mjs +6 -0
- package/Icon/Astrogy.mjs +6 -0
- package/Icon/AstrogyFill.mjs +6 -0
- package/Icon/Baby.mjs +7 -0
- package/Icon/Bbs.mjs +6 -0
- package/Icon/Beginner.mjs +6 -0
- package/Icon/Bell.mjs +6 -0
- package/Icon/BellFill.mjs +6 -0
- package/Icon/BellFillSlash.mjs +6 -0
- package/Icon/BellSlash.mjs +6 -0
- package/Icon/Blog.mjs +6 -0
- package/Icon/Bold.mjs +6 -0
- package/Icon/Book.mjs +6 -0
- package/Icon/BookFill.mjs +6 -0
- package/Icon/Bookmark.mjs +6 -0
- package/Icon/BookmarkFill.mjs +6 -0
- package/Icon/Bookshelf.mjs +6 -0
- package/Icon/BookshelfFill.mjs +6 -0
- package/Icon/Border.mjs +6 -0
- package/Icon/BottomnavFollowfeedActive.mjs +6 -0
- package/Icon/BottomnavFollowfeedInactive.mjs +6 -0
- package/Icon/BottomnavHomeActive.mjs +6 -0
- package/Icon/BottomnavHomeInactive.mjs +6 -0
- package/Icon/BottomnavMypageActive.mjs +6 -0
- package/Icon/BottomnavSearchActive.mjs +6 -0
- package/Icon/BottomnavSearchInactive.mjs +6 -0
- package/Icon/BottomnvavMypageInactive.mjs +6 -0
- package/Icon/Bullets.mjs +6 -0
- package/Icon/Calendar.mjs +6 -0
- package/Icon/CameraFill.mjs +6 -0
- package/Icon/CautionFill.mjs +6 -0
- package/Icon/Check.mjs +6 -0
- package/Icon/CheckBold.mjs +6 -0
- package/Icon/CheckCircle.mjs +6 -0
- package/Icon/CheckCircleFill.mjs +6 -0
- package/Icon/CheckRectangle.mjs +6 -0
- package/Icon/Checklist.mjs +6 -0
- package/Icon/ChevronDown.mjs +6 -0
- package/Icon/ChevronDownBold.mjs +6 -0
- package/Icon/ChevronLeft.mjs +6 -0
- package/Icon/ChevronLeftBold.mjs +6 -0
- package/Icon/ChevronRight.mjs +6 -0
- package/Icon/ChevronRightBold.mjs +6 -0
- package/Icon/ChevronUp.mjs +6 -0
- package/Icon/ChevronUpBold.mjs +6 -0
- package/Icon/Circle.mjs +6 -0
- package/Icon/CircleBold.mjs +6 -0
- package/Icon/CircleFill.mjs +6 -0
- package/Icon/Clock.mjs +6 -0
- package/Icon/ClockFill.mjs +6 -0
- package/Icon/Coin.mjs +6 -0
- package/Icon/Comment.mjs +6 -0
- package/Icon/CommentFill.mjs +6 -0
- package/Icon/CommentPen.mjs +6 -0
- package/Icon/CommentTwoFill.mjs +6 -0
- package/Icon/CommentTwoSlashFill.mjs +6 -0
- package/Icon/Community.mjs +6 -0
- package/Icon/Compass.mjs +7 -0
- package/Icon/Coupon.mjs +6 -0
- package/Icon/Crop.mjs +6 -0
- package/Icon/CropDin.mjs +6 -0
- package/Icon/CropLandscape.mjs +6 -0
- package/Icon/Cross.mjs +6 -0
- package/Icon/CrossBold.mjs +6 -0
- package/Icon/CrossCircle.mjs +6 -0
- package/Icon/CrossCircleFill.mjs +6 -0
- package/Icon/CrossRectangle.mjs +6 -0
- package/Icon/Cutlery.mjs +6 -0
- package/Icon/DiamondTwo.mjs +11 -0
- package/Icon/Dice.mjs +7 -0
- package/Icon/Dot.mjs +6 -0
- package/Icon/Dotmoney.mjs +6 -0
- package/Icon/Download.mjs +6 -0
- package/Icon/Embed.mjs +6 -0
- package/Icon/EmotionFill.mjs +6 -0
- package/Icon/EntryLost.mjs +6 -0
- package/Icon/Exclamationmark.mjs +6 -0
- package/Icon/ExclamationmarkBalloon.mjs +6 -0
- package/Icon/ExclamationmarkBalloonFill.mjs +6 -0
- package/Icon/ExclamationmarkBold.mjs +6 -0
- package/Icon/ExclamationmarkCircle.mjs +6 -0
- package/Icon/ExclamationmarkCircleFill.mjs +6 -0
- package/Icon/Expand.mjs +6 -0
- package/Icon/ExpandExit.mjs +6 -0
- package/Icon/Facebook.mjs +6 -0
- package/Icon/File.mjs +6 -0
- package/Icon/FileAdd.mjs +6 -0
- package/Icon/FileAddFill.mjs +6 -0
- package/Icon/FileCircle.mjs +6 -0
- package/Icon/FileCircleFill.mjs +6 -0
- package/Icon/FileFill.mjs +6 -0
- package/Icon/Filter.mjs +6 -0
- package/Icon/FilterCheck.mjs +6 -0
- package/Icon/Fit.mjs +6 -0
- package/Icon/FlagFill.mjs +6 -0
- package/Icon/FlagRanking.mjs +6 -0
- package/Icon/FlagRankingTrim.mjs +10 -0
- package/Icon/Flash.mjs +6 -0
- package/Icon/FlashAuto.mjs +6 -0
- package/Icon/FlashOff.mjs +6 -0
- package/Icon/Flowervase.mjs +6 -0
- package/Icon/Folder.mjs +6 -0
- package/Icon/FolderFill.mjs +6 -0
- package/Icon/FolderTwo.mjs +6 -0
- package/Icon/FolderTwoFill.mjs +6 -0
- package/Icon/Font.mjs +6 -0
- package/Icon/Fontstyle.mjs +6 -0
- package/Icon/Game.mjs +6 -0
- package/Icon/GameFill.mjs +6 -0
- package/Icon/GameKantan.mjs +6 -0
- package/Icon/Gear.mjs +6 -0
- package/Icon/GearFill.mjs +6 -0
- package/Icon/Genre.mjs +6 -0
- package/Icon/GenreAdd.mjs +6 -0
- package/Icon/GenreDone.mjs +6 -0
- package/Icon/GraphBar.mjs +6 -0
- package/Icon/Gruppo.mjs +6 -0
- package/Icon/HandWaveFill.mjs +6 -0
- package/Icon/Hatenabookmark.mjs +6 -0
- package/Icon/Heart.mjs +6 -0
- package/Icon/HeartFill.mjs +6 -0
- package/Icon/History.mjs +6 -0
- package/Icon/HomeFill.mjs +6 -0
- package/Icon/Hot.mjs +6 -0
- package/Icon/Htmltag.mjs +6 -0
- package/Icon/ImageAddFill.mjs +6 -0
- package/Icon/ImageBanFill.mjs +6 -0
- package/Icon/ImageFill.mjs +6 -0
- package/Icon/ImageFillSlash.mjs +6 -0
- package/Icon/ImageQuestionFill.mjs +6 -0
- package/Icon/Information.mjs +6 -0
- package/Icon/Instagram.mjs +6 -0
- package/Icon/Italic.mjs +6 -0
- package/Icon/Kaomoji.mjs +6 -0
- package/Icon/Keyboard.mjs +6 -0
- package/Icon/KeyboardDownFill.mjs +6 -0
- package/Icon/KeyboardFill.mjs +6 -0
- package/Icon/Koeblog.mjs +6 -0
- package/Icon/LineCircle.mjs +6 -0
- package/Icon/LineSquare.mjs +6 -0
- package/Icon/Link.mjs +6 -0
- package/Icon/ListBulleted.mjs +6 -0
- package/Icon/ListNumbered.mjs +6 -0
- package/Icon/Loading.mjs +6 -0
- package/Icon/LockFill.mjs +6 -0
- package/Icon/LockOpenFill.mjs +6 -0
- package/Icon/Magicwand.mjs +6 -0
- package/Icon/Mail.mjs +6 -0
- package/Icon/MailCheck.mjs +6 -0
- package/Icon/MailCircle.mjs +6 -0
- package/Icon/MailCircleFill.mjs +6 -0
- package/Icon/MailFill.mjs +6 -0
- package/Icon/Megaphone.mjs +6 -0
- package/Icon/MenuHamburger.mjs +6 -0
- package/Icon/MenuHamburgerBold.mjs +6 -0
- package/Icon/MenuHamburgerFourline.mjs +6 -0
- package/Icon/MenuHorizotal.mjs +6 -0
- package/Icon/MenuVertical.mjs +6 -0
- package/Icon/Messageboard.mjs +6 -0
- package/Icon/Microphone.mjs +6 -0
- package/Icon/MicrophoneFill.mjs +6 -0
- package/Icon/Minus.mjs +6 -0
- package/Icon/MinusBold.mjs +6 -0
- package/Icon/Moon.mjs +6 -0
- package/Icon/MoonFill.mjs +6 -0
- package/Icon/MovieCameraFill.mjs +6 -0
- package/Icon/MoviePlay.mjs +6 -0
- package/Icon/MoviePlayFill.mjs +6 -0
- package/Icon/MovieStop.mjs +6 -0
- package/Icon/MusicFill.mjs +6 -0
- package/Icon/New.mjs +6 -0
- package/Icon/Newbook.mjs +6 -0
- package/Icon/NewbookFill.mjs +6 -0
- package/Icon/News.mjs +6 -0
- package/Icon/Nice.mjs +6 -0
- package/Icon/NiceDone.mjs +6 -0
- package/Icon/Nodate.mjs +6 -0
- package/Icon/Now.mjs +6 -0
- package/Icon/Officialstar.mjs +6 -0
- package/Icon/OfficialstarFill.mjs +6 -0
- package/Icon/OnedariFill.mjs +6 -0
- package/Icon/OpenCl.mjs +6 -0
- package/Icon/Openblank.mjs +6 -0
- package/Icon/OpenblankFill.mjs +6 -0
- package/Icon/Ownd.mjs +6 -0
- package/Icon/PaletteFill.mjs +6 -0
- package/Icon/Pause.mjs +6 -0
- package/Icon/PauseBold.mjs +6 -0
- package/Icon/Pawprint.mjs +6 -0
- package/Icon/Pencil.mjs +6 -0
- package/Icon/PencilAdd.mjs +6 -0
- package/Icon/PencilBold.mjs +6 -0
- package/Icon/Person.mjs +6 -0
- package/Icon/PersonFill.mjs +6 -0
- package/Icon/PersonThreeFill.mjs +6 -0
- package/Icon/PersonTwoAddFill.mjs +6 -0
- package/Icon/PersonTwoDeleteFill.mjs +6 -0
- package/Icon/PersonTwoDoneFill.mjs +6 -0
- package/Icon/PersonTwoFill.mjs +6 -0
- package/Icon/Peta.mjs +6 -0
- package/Icon/Pigg.mjs +6 -0
- package/Icon/PinFill.mjs +6 -0
- package/Icon/PlayCircle.mjs +6 -0
- package/Icon/PlayFill.mjs +6 -0
- package/Icon/Plus.mjs +6 -0
- package/Icon/PlusBold.mjs +6 -0
- package/Icon/PlusCircle.mjs +6 -0
- package/Icon/PlusCircleFill.mjs +6 -0
- package/Icon/PremiumFill.mjs +6 -0
- package/Icon/Present.mjs +6 -0
- package/Icon/Profilecard.mjs +6 -0
- package/Icon/Qr.mjs +6 -0
- package/Icon/Question.mjs +6 -0
- package/Icon/QuestionmarkCircle.mjs +6 -0
- package/Icon/QuestionmarkCircleFill.mjs +6 -0
- package/Icon/RankingCrown.mjs +6 -0
- package/Icon/RankingCrownFill.mjs +6 -0
- package/Icon/RankingPlatformFill.mjs +6 -0
- package/Icon/Reblog.mjs +6 -0
- package/Icon/ReblogSlash.mjs +6 -0
- package/Icon/Redo.mjs +6 -0
- package/Icon/RedoBold.mjs +6 -0
- package/Icon/Refresh.mjs +6 -0
- package/Icon/ReplyCircleFill.mjs +6 -0
- package/Icon/ReplyFill.mjs +6 -0
- package/Icon/Requ.mjs +6 -0
- package/Icon/Sad.mjs +6 -0
- package/Icon/Saveblog.mjs +6 -0
- package/Icon/ScreenFull.mjs +6 -0
- package/Icon/ScreenInline.mjs +6 -0
- package/Icon/Search.mjs +6 -0
- package/Icon/Service.mjs +6 -0
- package/Icon/Share.mjs +6 -0
- package/Icon/ShineFill.mjs +6 -0
- package/Icon/Shirt.mjs +6 -0
- package/Icon/SidefaceClose.mjs +6 -0
- package/Icon/SidefaceOpen.mjs +6 -0
- package/Icon/Smartphone.mjs +6 -0
- package/Icon/SmartphoneFill.mjs +6 -0
- package/Icon/Sort.mjs +6 -0
- package/Icon/SortFeed.mjs +6 -0
- package/Icon/SortTile.mjs +6 -0
- package/Icon/SpeakerOffFill.mjs +6 -0
- package/Icon/SpeakerOnFill.mjs +6 -0
- package/Icon/Sprout.mjs +6 -0
- package/Icon/Stampside.mjs +6 -0
- package/Icon/Star.mjs +6 -0
- package/Icon/StarCircleFill.mjs +6 -0
- package/Icon/StarFaceFill.mjs +6 -0
- package/Icon/StarFill.mjs +6 -0
- package/Icon/StopFill.mjs +6 -0
- package/Icon/Strikethrough.mjs +6 -0
- package/Icon/Sun.mjs +6 -0
- package/Icon/SunFill.mjs +6 -0
- package/Icon/Switching.mjs +6 -0
- package/Icon/SwitchingCamera.mjs +6 -0
- package/Icon/TagFill.mjs +6 -0
- package/Icon/TagOfficialFill.mjs +6 -0
- package/Icon/Thumbsup.mjs +6 -0
- package/Icon/ThumbsupFill.mjs +6 -0
- package/Icon/Title.mjs +6 -0
- package/Icon/TopbloggerRibbon.mjs +6 -0
- package/Icon/TranscriptOff.mjs +6 -0
- package/Icon/TranscriptOn.mjs +6 -0
- package/Icon/Transmission.mjs +6 -0
- package/Icon/Trashcan.mjs +6 -0
- package/Icon/Trend.mjs +6 -0
- package/Icon/TrendFill.mjs +6 -0
- package/Icon/TriangleDown.mjs +6 -0
- package/Icon/TriangleLeft.mjs +6 -0
- package/Icon/TriangleRight.mjs +6 -0
- package/Icon/TriangleUp.mjs +6 -0
- package/Icon/TrianglearrowDown.mjs +6 -0
- package/Icon/TrianglearrowDownright.mjs +6 -0
- package/Icon/TrianglearrowRight.mjs +6 -0
- package/Icon/TrianglearrowUp.mjs +6 -0
- package/Icon/TrianglearrowUpright.mjs +6 -0
- package/Icon/TriangleendLeft.mjs +6 -0
- package/Icon/TriangleendRight.mjs +6 -0
- package/Icon/TrophyFill.mjs +6 -0
- package/Icon/TvFill.mjs +6 -0
- package/Icon/Twitter.mjs +6 -0
- package/Icon/Underline.mjs +6 -0
- package/Icon/Undo.mjs +6 -0
- package/Icon/UndoBold.mjs +6 -0
- package/Icon/Wallet.mjs +6 -0
- package/Icon/Webview.mjs +6 -0
- package/Icon/Youtube.mjs +6 -0
- package/Icon/index.mjs +325 -0
- package/IconButton/IconButton.css +1 -1
- package/IconButton/IconButton.mjs +5 -0
- package/IconButton/index.mjs +1 -0
- package/LinkButton/LinkButton.css +1 -1
- package/LinkButton/LinkButton.mjs +7 -0
- package/LinkButton/index.mjs +1 -0
- package/README.md +3 -1
- package/Toast/Toast.mjs +67 -0
- package/Toast/index.mjs +1 -0
- package/index.css +1 -1
- package/index.d.ts +2 -1
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +10 -0
- package/package.json +13 -5
- package/tsconfig.cjs.json +10 -0
- package/tsconfig.esm.json +8 -0
package/Button/Button.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--Button-tapHighlightColor:var(--gray-5-alpha);--Button-onFocus-boxShadow:0 0 0 1px var(--color-surface-primary),0 0 0 3px var(--color-focus-clarity);--Button--contained-backgroundColor:var(--color-surface-accent-primary);--Button--contained-color:var(--color-text-high-emphasis-inverse);--Button--contained-onActive-backgroundColor:var(--primary-green-100);--Button--contained-onHover-backgroundColor:var(--primary-green-100);--Button--outlined-borderColor:var(--color-
|
|
1
|
+
:root{--Button-tapHighlightColor:var(--gray-5-alpha);--Button-onFocus-boxShadow:0 0 0 1px var(--color-surface-primary),0 0 0 3px var(--color-focus-clarity);--Button--contained-backgroundColor:var(--color-surface-accent-primary);--Button--contained-color:var(--color-text-high-emphasis-inverse);--Button--contained-onActive-backgroundColor:var(--primary-green-100);--Button--contained-onHover-backgroundColor:var(--primary-green-100);--Button--outlined-borderColor:var(--color-border-accent-primary);--Button--outlined-color:var(--color-text-accent-primary);--Button--outlined-onActive-backgroundColor:var(--primary-green-5);--Button--outlined-onHover-backgroundColor:var(--primary-green-5);--Button--lighted-backgroundColor:var(--color-surface-accent-primary-light);--Button--lighted-color:var(--color-text-accent-primary);--Button--lighted-onActive-backgroundColor:var(--primary-green-10);--Button--lighted-onHover-backgroundColor:var(--primary-green-10);--Button--neutral-backgroundColor:var(--color-surface-tertiary);--Button--neutral-color:var(--color-text-medium-emphasis);--Button--neutral-onActive-backgroundColor:var(--gray-20-alpha);--Button--neutral-onHover-backgroundColor:var(--gray-20-alpha);--Button--danger-borderColor:var(--color-border-caution);--Button--danger-color:var(--color-text-caution);--Button--danger-onActive-backgroundColor:var(--caution-red-5-alpha);--Button--danger-onHover-backgroundColor:var(--caution-red-5-alpha)}.spui-Button{align-items:center;box-sizing:border-box;display:inline-flex;font-family:inherit;font-weight:700;justify-content:center;line-height:1.3;margin:0;-webkit-tap-highlight-color:var(--Button-tapHighlightColor);text-align:center;transition:background-color .3s}.spui-Button:disabled{opacity:.3}.spui-Button:focus{box-shadow:var(--Button-onFocus-boxShadow);outline:none}.spui-Button:focus:not(:focus-visible){box-shadow:none}.spui-Button--fullWidth{width:100%}.spui-Button--large{border-radius:3em;font-size:1em;min-height:48px;padding-left:16px;padding-right:16px}.spui-Button--medium{border-radius:2.85714em;font-size:.875em;min-height:40px;padding-left:16px;padding-right:16px}.spui-Button--small{border-radius:2.46154em;font-size:.8125em;min-height:32px;padding-left:10px;padding-right:10px}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.spui-Button--large,.spui-Button--medium,.spui-Button--small{height:1px}}.spui-Button--contained{background-color:var(--Button--contained-backgroundColor);border:none;color:var(--Button--contained-color);padding-bottom:8px;padding-top:8px}.spui-Button--contained:active{background-color:var(--Button--contained-onActive-backgroundColor)}@media (hover:hover){.spui-Button--contained:not([disabled]):hover{background-color:var(--Button--contained-onHover-backgroundColor)}}.spui-Button--outlined{background-color:transparent;border:2px solid var(--Button--outlined-borderColor);color:var(--Button--outlined-color);padding-bottom:6px;padding-top:6px}.spui-Button--outlined:active{background-color:var(--Button--outlined-onActive-backgroundColor)}@media (hover:hover){.spui-Button--outlined:not([disabled]):hover{background-color:var(--Button--outlined-onHover-backgroundColor)}}.spui-Button--lighted{background-color:var(--Button--lighted-backgroundColor);border:none;color:var(--Button--lighted-color);padding-bottom:8px;padding-top:8px}.spui-Button--lighted:active{background-color:var(--Button--lighted-onActive-backgroundColor)}@media (hover:hover){.spui-Button--lighted:not([disabled]):hover{background-color:var(--Button--lighted-onHover-backgroundColor)}}.spui-Button--neutral{background-color:var(--Button--neutral-backgroundColor);border:none;color:var(--Button--neutral-color);padding-bottom:8px;padding-top:8px}.spui-Button--neutral:active{background-color:var(--Button--neutral-onActive-backgroundColor)}@media (hover:hover){.spui-Button--neutral:not([disabled]):hover{background-color:var(--Button--neutral-onHover-backgroundColor)}}.spui-Button--danger{background-color:transparent;border:2px solid var(--Button--danger-borderColor);color:var(--Button--danger-color);padding-bottom:6px;padding-top:6px}.spui-Button--danger:active{background-color:var(--Button--danger-onActive-backgroundColor)}@media (hover:hover){.spui-Button--danger:not([disabled]):hover{background-color:var(--Button--danger-onHover-backgroundColor)}}.spui-Button-icon{line-height:0}.spui-Button-icon--large{font-size:1.375em;margin-right:6px}.spui-Button-icon--medium{font-size:1.429em;margin-right:4px}.spui-Button-icon--small{font-size:1.23em;margin-right:2px}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
const BLOCK_NAME = 'spui-Button';
|
|
3
|
+
export const Button = forwardRef(function Button({ children, layout = 'intrinsic', size = 'large', variant = 'contained', icon, ...rest }, ref) {
|
|
4
|
+
return (React.createElement("button", Object.assign({ className: `${BLOCK_NAME} ${BLOCK_NAME}--${layout} ${BLOCK_NAME}--${size} ${BLOCK_NAME}--${variant}`, ref: ref }, rest), icon ? (React.createElement(React.Fragment, null,
|
|
5
|
+
React.createElement("span", { className: `${BLOCK_NAME}-icon ${BLOCK_NAME}-icon--${size}` }, icon),
|
|
6
|
+
children)) : (children)));
|
|
7
|
+
});
|
package/Button/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './Button';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const BLOCK_NAME = 'spui-ButtonGroup';
|
|
3
|
+
export const ButtonGroup = ({ children, className, direction = 'row', size = 'large', ...rest }) => {
|
|
4
|
+
const classnames = [
|
|
5
|
+
BLOCK_NAME,
|
|
6
|
+
`${BLOCK_NAME}--${direction}`,
|
|
7
|
+
`${BLOCK_NAME}--${size}`,
|
|
8
|
+
className,
|
|
9
|
+
]
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.join(' ');
|
|
12
|
+
return (React.createElement("div", Object.assign({ className: classnames }, rest), children));
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonGroup } from './ButtonGroup';
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.26.1-alpha.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.26.0...@openameba/spindle-ui@0.26.1-alpha.0) (2022-02-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **spindle-ui:** set side effect for css ([5a24128](https://github.com/openameba/spindle/commit/5a241288ba6964c77fabdeb7b498fe4ac62b7328))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [0.26.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.25.1...@openameba/spindle-ui@0.26.0) (2022-02-21)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **spindle-ui:** add HeroCarousel component ([d7e0a53](https://github.com/openameba/spindle/commit/d7e0a5302cfca4d7600188098ef4dd224998e2bb))
|
|
23
|
+
|
|
24
|
+
## [0.25.2-alpha.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.25.1...@openameba/spindle-ui@0.25.2-alpha.0) (2021-12-09)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* **spindle-ui:** set side effect for css ([bdf0c9f](https://github.com/openameba/spindle/commit/bdf0c9ff79a69ad9dd2706dcfe96bd29559b373e))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## [0.25.1](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.25.0...@openameba/spindle-ui@0.25.1) (2021-12-09)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* **spindle-ui:** correct button tokens ([6b88a5f](https://github.com/openameba/spindle/commit/6b88a5fd5fd8677aec82add4fe3552674ace69cc))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
6
46
|
# [0.25.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.24.0...@openameba/spindle-ui@0.25.0) (2021-12-03)
|
|
7
47
|
|
|
8
48
|
|
|
@@ -48,12 +88,19 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
48
88
|
### Features
|
|
49
89
|
|
|
50
90
|
* **spindle-icons:** update icons ([39ce767](https://github.com/openameba/spindle/commit/39ce7673df4556ee3b9a6ea6dc62ad25236a6fc9))
|
|
91
|
+
## [0.22.1-alpha.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.22.0...@openameba/spindle-ui@0.22.1-alpha.0) (2021-09-06)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
### Bug Fixes
|
|
95
|
+
|
|
96
|
+
* **spindle-ui:** set side effect for css ([f26be31](https://github.com/openameba/spindle/commit/f26be31bf53ec73fbe00222773ba691809dae5d5))
|
|
51
97
|
|
|
52
98
|
|
|
53
99
|
|
|
54
100
|
|
|
55
101
|
|
|
56
102
|
# [0.22.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.21.2...@openameba/spindle-ui@0.22.0) (2021-09-06)
|
|
103
|
+
## [0.21.3-alpha.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.21.2...@openameba/spindle-ui@0.21.3-alpha.0) (2021-07-30)
|
|
57
104
|
|
|
58
105
|
|
|
59
106
|
### Bug Fixes
|
|
@@ -75,12 +122,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
75
122
|
### BREAKING CHANGES
|
|
76
123
|
|
|
77
124
|
* **spindle-icons,spindle-ui:** setting icon was renamed to gear
|
|
125
|
+
* **spindle-ui:** set side effect for css ([ec4e8f1](https://github.com/openameba/spindle/commit/ec4e8f143cd6769cc6b3d49534233a46eaf79b2d))
|
|
78
126
|
|
|
79
127
|
|
|
80
128
|
|
|
81
129
|
|
|
82
130
|
|
|
83
131
|
## [0.21.2](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.21.1...@openameba/spindle-ui@0.21.2) (2021-07-30)
|
|
132
|
+
## [0.21.2-alpha.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.21.1...@openameba/spindle-ui@0.21.2-alpha.0) (2021-07-28)
|
|
84
133
|
|
|
85
134
|
**Note:** Version bump only for package @openameba/spindle-ui
|
|
86
135
|
|
|
@@ -141,6 +190,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
141
190
|
### Features
|
|
142
191
|
|
|
143
192
|
* **spindle-icons:** update icons ([ae07c8e](https://github.com/openameba/spindle/commit/ae07c8eca4f33789c45b3c3d6a2e7f8f17c11e81))
|
|
193
|
+
## [0.18.1-alpha.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.18.0...@openameba/spindle-ui@0.18.1-alpha.0) (2021-06-11)
|
|
194
|
+
|
|
195
|
+
**Note:** Version bump only for package @openameba/spindle-ui
|
|
144
196
|
|
|
145
197
|
|
|
146
198
|
|
|
@@ -196,6 +248,9 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
196
248
|
### Bug Fixes
|
|
197
249
|
|
|
198
250
|
* **spindle-ui:** fix CSS variable name ([f76d2ee](https://github.com/openameba/spindle/commit/f76d2ee1840574a1247a20ea1ee212b85d99708e))
|
|
251
|
+
# [0.15.0-alpha.0](https://github.com/openameba/spindle/compare/@openameba/spindle-ui@0.14.0...@openameba/spindle-ui@0.15.0-alpha.0) (2021-03-15)
|
|
252
|
+
|
|
253
|
+
**Note:** Version bump only for package @openameba/spindle-ui
|
|
199
254
|
|
|
200
255
|
|
|
201
256
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { CheckBold } from '../Icon';
|
|
3
|
+
const BLOCK_NAME = 'spui-Checkbox';
|
|
4
|
+
export const Checkbox = forwardRef(function Checkbox({ children, ...rest }, ref) {
|
|
5
|
+
return (React.createElement("label", { className: `${BLOCK_NAME}-label` },
|
|
6
|
+
React.createElement("input", Object.assign({ className: `${BLOCK_NAME}-input`, ref: ref, type: "checkbox" }, rest)),
|
|
7
|
+
React.createElement("span", { className: `${BLOCK_NAME}-icon` },
|
|
8
|
+
React.createElement(CheckBold, { "aria-hidden": "true" })),
|
|
9
|
+
React.createElement("span", { className: `${BLOCK_NAME}-outline` }),
|
|
10
|
+
children && React.createElement("span", { className: `${BLOCK_NAME}-text` }, children)));
|
|
11
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import mergeRefs from 'react-merge-refs';
|
|
3
|
+
import { ChevronDownBold } from '../Icon';
|
|
4
|
+
const BLOCK_NAME = 'spui-DropDown';
|
|
5
|
+
export const DropDown = forwardRef(function DropDown({ children, hasError = false, onChange, ...rest }, ref) {
|
|
6
|
+
const selectEl = useRef(null);
|
|
7
|
+
const [text, setText] = useState('');
|
|
8
|
+
const [disabled, setDisabled] = useState(false);
|
|
9
|
+
const update = () => {
|
|
10
|
+
if (selectEl && selectEl.current) {
|
|
11
|
+
const selectedEl = selectEl.current.options[selectEl.current.selectedIndex];
|
|
12
|
+
const value = selectedEl.text;
|
|
13
|
+
const disabled = selectedEl.disabled;
|
|
14
|
+
setText(value);
|
|
15
|
+
setDisabled(disabled);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const handleChange = (event) => {
|
|
19
|
+
if (typeof onChange === 'function') {
|
|
20
|
+
onChange(event);
|
|
21
|
+
}
|
|
22
|
+
update();
|
|
23
|
+
};
|
|
24
|
+
// Update text once
|
|
25
|
+
useEffect(update, []);
|
|
26
|
+
return (React.createElement("label", { className: [
|
|
27
|
+
`${BLOCK_NAME}-label`,
|
|
28
|
+
!disabled ? 'is-active' : '',
|
|
29
|
+
hasError ? 'is-error' : '',
|
|
30
|
+
]
|
|
31
|
+
.filter(Boolean)
|
|
32
|
+
.join(' ') },
|
|
33
|
+
React.createElement("span", { className: `${BLOCK_NAME}-visual` }, text),
|
|
34
|
+
React.createElement("span", { className: `${BLOCK_NAME}-icon` },
|
|
35
|
+
React.createElement(ChevronDownBold, { "aria-hidden": "true" })),
|
|
36
|
+
React.createElement("select", Object.assign({ className: `${BLOCK_NAME}-select`, ref: mergeRefs([selectEl, ref]), onChange: handleChange }, rest), children),
|
|
37
|
+
React.createElement("span", { className: `${BLOCK_NAME}-outline` })));
|
|
38
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import mergeRefs from 'react-merge-refs';
|
|
3
|
+
import { ChevronDownBold } from '../Icon';
|
|
4
|
+
const BLOCK_NAME = 'spui-InlineDropDown';
|
|
5
|
+
export const InlineDropDown = forwardRef(function InlineDropDown({ children, visualSize = 'medium', onChange, ...rest }, ref) {
|
|
6
|
+
const selectEl = useRef(null);
|
|
7
|
+
const [text, setText] = useState('');
|
|
8
|
+
const update = () => {
|
|
9
|
+
if (selectEl && selectEl.current) {
|
|
10
|
+
const selectedEl = selectEl.current.options[selectEl.current.selectedIndex];
|
|
11
|
+
const value = selectedEl.text;
|
|
12
|
+
setText(value);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const handleChange = (event) => {
|
|
16
|
+
if (typeof onChange === 'function') {
|
|
17
|
+
onChange(event);
|
|
18
|
+
}
|
|
19
|
+
update();
|
|
20
|
+
};
|
|
21
|
+
// Update text once
|
|
22
|
+
useEffect(update, []);
|
|
23
|
+
return (React.createElement("label", { className: [`${BLOCK_NAME}-label`].filter(Boolean).join(' ') },
|
|
24
|
+
React.createElement("span", { className: `${BLOCK_NAME}-visual` },
|
|
25
|
+
React.createElement("span", { className: `${BLOCK_NAME}-text ${BLOCK_NAME}-text--${visualSize}` }, text),
|
|
26
|
+
React.createElement("span", { className: `${BLOCK_NAME}-icon ${BLOCK_NAME}-icon--${visualSize}` },
|
|
27
|
+
React.createElement(ChevronDownBold, { "aria-hidden": "true" }))),
|
|
28
|
+
React.createElement("select", Object.assign({ className: `${BLOCK_NAME}-select ${BLOCK_NAME}-select--${visualSize}`, ref: mergeRefs([selectEl, ref]), onChange: handleChange }, rest), children),
|
|
29
|
+
React.createElement("span", { className: `${BLOCK_NAME}-outline` })));
|
|
30
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExclamationmarkCircleFill } from '../Icon';
|
|
3
|
+
const BLOCK_NAME = 'spui-InvalidMessage';
|
|
4
|
+
export const InvalidMessage = ({ children, visible = false, ...rest }) => {
|
|
5
|
+
return (React.createElement("p", Object.assign({ className: BLOCK_NAME, hidden: !visible }, rest),
|
|
6
|
+
React.createElement("span", { className: `${BLOCK_NAME}-icon` },
|
|
7
|
+
React.createElement(ExclamationmarkCircleFill, { "aria-hidden": "true" })),
|
|
8
|
+
React.createElement("span", { className: `${BLOCK_NAME}-body` }, children)));
|
|
9
|
+
};
|
package/Form/Radio.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { CheckBold } from '../Icon';
|
|
3
|
+
const BLOCK_NAME = 'spui-Radio';
|
|
4
|
+
export const Radio = forwardRef(function Radio({ children, id = '', ...rest }, ref) {
|
|
5
|
+
return (React.createElement("label", { className: `${BLOCK_NAME}-label`, htmlFor: id },
|
|
6
|
+
React.createElement("input", Object.assign({ className: `${BLOCK_NAME}-input`, id: id, ref: ref, type: "radio" }, rest)),
|
|
7
|
+
React.createElement("span", { className: `${BLOCK_NAME}-icon` },
|
|
8
|
+
React.createElement(CheckBold, { "aria-hidden": "true" })),
|
|
9
|
+
React.createElement("span", { className: `${BLOCK_NAME}-outline` }),
|
|
10
|
+
children && React.createElement("span", { className: `${BLOCK_NAME}-text` }, children)));
|
|
11
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
const BLOCK_NAME = 'spui-TextArea';
|
|
3
|
+
export const TextArea = forwardRef(function TextArea({ children, hasError = false, id = '', ...rest }, ref) {
|
|
4
|
+
return (React.createElement("textarea", Object.assign({ className: [`${BLOCK_NAME}`, hasError ? 'is-error' : ''].join(' '), id: id, ref: ref }, rest), children));
|
|
5
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
const BLOCK_NAME = 'spui-TextField';
|
|
3
|
+
export const TextField = forwardRef(function TextField({ hasError = false, id = '', variant = 'medium', ...rest }, ref) {
|
|
4
|
+
return (React.createElement("input", Object.assign({ className: [
|
|
5
|
+
`${BLOCK_NAME}`,
|
|
6
|
+
`${BLOCK_NAME}--${variant}`,
|
|
7
|
+
hasError ? 'is-error' : '',
|
|
8
|
+
].join(' '), id: id, ref: ref }, rest)));
|
|
9
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
const BLOCK_NAME = 'spui-ToggleSwitch';
|
|
3
|
+
export const ToggleSwitch = forwardRef(function ToggleSwitch({ id = '', ...rest }, ref) {
|
|
4
|
+
return (React.createElement("label", { className: BLOCK_NAME },
|
|
5
|
+
React.createElement("input", Object.assign({ className: `${BLOCK_NAME}-input`, id: id, ref: ref, type: "checkbox" }, rest)),
|
|
6
|
+
React.createElement("span", { className: `${BLOCK_NAME}-visual` }),
|
|
7
|
+
React.createElement("span", { className: `${BLOCK_NAME}-outline` })));
|
|
8
|
+
});
|
package/Form/index.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Checkbox } from './Checkbox';
|
|
2
|
+
export { DropDown } from './DropDown';
|
|
3
|
+
export { InputLabel } from './InputLabel';
|
|
4
|
+
export { InvalidMessage } from './InvalidMessage';
|
|
5
|
+
export { Radio } from './Radio';
|
|
6
|
+
export { TextArea } from './TextArea';
|
|
7
|
+
export { TextField } from './TextField';
|
|
8
|
+
export { ToggleSwitch } from './ToggleSwitch';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--HeroCarousel-onFocus-boxShadow:0 0 0 1px var(--color-surface-primary),0 0 0 3px var(--color-focus-clarity)}.spui-HeroCarousel-container{align-items:center;display:flex;height:11.6em;justify-content:center;overflow:hidden;padding:.6rem 0}.spui-HeroCarousel-list{display:flex;margin-right:.88em;padding:0 .44em;transition:transform .5s;width:16.7em}.spui-HeroCarousel-controls{align-items:center;border:1px solid var(--color-border-low-emphasis);border-radius:100px;display:flex;margin:.88em auto 0;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.spui-HeroCarousel-control{align-items:center;background-color:transparent;border:none;display:flex;height:3em;justify-content:center;padding:0;width:3em}.spui-HeroCarousel-control:hover{opacity:.7}.spui-HeroCarousel-control:focus{box-shadow:var(--HeroCarousel-onFocus-boxShadow);outline:none}.spui-HeroCarousel-control:focus:not(:focus-visible){box-shadow:none}.spui-HeroCarousel-control--prev{border-radius:100px 0 0 100px;border-right:1px solid var(--color-border-low-emphasis)}.spui-HeroCarousel-control--next{border-left:1px solid var(--color-border-low-emphasis);border-radius:0 100px 100px 0}@media (prefers-reduced-motion:reduce){.spui-HeroCarousel-list{transition:1ms}}@media screen and (min-width:768px){.spui-HeroCarousel-container{height:13em}.spui-HeroCarousel-list{margin-right:1.5em;padding:0 .75em;width:18.5em}.spui-HeroCarousel-controls{margin-top:1.25em}.spui-HeroCarousel-control{height:3.3em;width:3.3em}}.spui-HeroCarousel-control>svg{color:var(--color-text-low-emphasis);height:1.35em;width:1.35em}@media screen and (min-width:768px){.spui-HeroCarousel-control>svg{height:1.5em;width:1.5em}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeroCarousel.d.ts","sourceRoot":"","sources":["../../src/HeroCarousel/HeroCarousel.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD,aAAK,KAAK,GAAG;IACX,YAAY,EAAE,YAAY,EAAE,CAAC;CAC9B,CAAC;AAKF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,KAAK,CA0FjC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HeroCarousel = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var ChevronLeftBold_1 = __importDefault(require("../Icon/ChevronLeftBold"));
|
|
9
|
+
var ChevronRightBold_1 = __importDefault(require("../Icon/ChevronRightBold"));
|
|
10
|
+
var Pause_1 = __importDefault(require("../Icon/Pause"));
|
|
11
|
+
var PlayFill_1 = __importDefault(require("../Icon/PlayFill"));
|
|
12
|
+
var HeroCarouselItem_1 = __importDefault(require("./HeroCarouselItem"));
|
|
13
|
+
var useAutoPlayCarousel_1 = require("./hooks/useAutoPlayCarousel");
|
|
14
|
+
var BLOCK_NAME = 'spui-HeroCarousel';
|
|
15
|
+
var ITEM_LINK_CLASS_NAME = 'js-auto-play-carousel-item-link';
|
|
16
|
+
exports.HeroCarousel = react_1.default.memo(function HeroCarousel(_a) {
|
|
17
|
+
var carouselList = _a.carouselList;
|
|
18
|
+
if (carouselList.length === 0) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
var _b = useAutoPlayCarousel_1.useAutoPlayCarousel({
|
|
22
|
+
items: carouselList,
|
|
23
|
+
itemLinkClassName: ITEM_LINK_CLASS_NAME,
|
|
24
|
+
}), handleSlideToPrev = _b.handleSlideToPrev, handleSlideToNext = _b.handleSlideToNext, handleMouseEnter = _b.handleMouseEnter, handleMouseDown = _b.handleMouseDown, handleMouseLeave = _b.handleMouseLeave, handleTouchStart = _b.handleTouchStart, handleTransitionEnd = _b.handleTransitionEnd, isAutoPlaying = _b.isAutoPlaying, isLinkClicked = _b.isLinkClicked, itemsToRender = _b.itemsToRender, listRef = _b.listRef, listStyles = _b.listStyles, toggleAutoPlay = _b.toggleAutoPlay, handleFocus = _b.handleFocus, handleBlur = _b.handleBlur;
|
|
25
|
+
return (react_1.default.createElement("div", null,
|
|
26
|
+
react_1.default.createElement("div", { className: BLOCK_NAME + "-container", onBlur: handleBlur, onFocus: handleFocus, onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onTouchStart: handleTouchStart, onTransitionEnd: handleTransitionEnd },
|
|
27
|
+
react_1.default.createElement("ul", { "aria-roledescription": "\u30AB\u30EB\u30FC\u30BB\u30EB", className: BLOCK_NAME + "-list", ref: listRef, role: "group", style: listStyles }, itemsToRender.map(function (item, index) { return (react_1.default.createElement(HeroCarouselItem_1.default, { carouselItem: item, isLinkClicked: isLinkClicked, itemLinkClassName: ITEM_LINK_CLASS_NAME, key: "hero-carousel-" + index })); }))),
|
|
28
|
+
react_1.default.createElement("div", { className: BLOCK_NAME + "-controls" },
|
|
29
|
+
react_1.default.createElement("button", { "aria-label": "1\u3064\u524D\u306E\u30A2\u30A4\u30C6\u30E0\u306B\u79FB\u52D5", className: BLOCK_NAME + "-control " + BLOCK_NAME + "-control--prev", type: "button", onClick: handleSlideToPrev },
|
|
30
|
+
react_1.default.createElement(ChevronLeftBold_1.default, { "aria-hidden": true })),
|
|
31
|
+
react_1.default.createElement("button", { "aria-label": isAutoPlaying ? 'スライドを停止' : 'スライドを再生', className: BLOCK_NAME + "-control", type: "button", onClick: toggleAutoPlay }, isAutoPlaying ? (react_1.default.createElement(Pause_1.default, { "aria-hidden": true })) : (react_1.default.createElement(PlayFill_1.default, { "aria-hidden": true }))),
|
|
32
|
+
react_1.default.createElement("button", { "aria-label": "1\u3064\u5F8C\u308D\u306E\u30A2\u30A4\u30C6\u30E0\u306B\u79FB\u52D5", className: BLOCK_NAME + "-control " + BLOCK_NAME + "-control--next", type: "button", onClick: handleSlideToNext },
|
|
33
|
+
react_1.default.createElement(ChevronRightBold_1.default, { "aria-hidden": true })))));
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=HeroCarousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeroCarousel.js","sourceRoot":"","sources":["../../src/HeroCarousel/HeroCarousel.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAAkC;AAClC,4EAAsD;AACtD,8EAAwD;AACxD,wDAAkC;AAClC,8DAAwC;AAExC,wEAAkD;AAClD,mEAAkE;AAMlE,IAAM,UAAU,GAAG,mBAAmB,CAAC;AACvC,IAAM,oBAAoB,GAAG,iCAAiC,CAAC;AAElD,QAAA,YAAY,GAAc,eAAK,CAAC,IAAI,CAAC,SAAS,YAAY,CAAC,EAEvE;QADC,YAAY,kBAAA;IAEZ,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7B,OAAO,IAAI,CAAC;KACb;IAEK,IAAA,KAgBF,yCAAmB,CAAC;QACtB,KAAK,EAAE,YAAY;QACnB,iBAAiB,EAAE,oBAAoB;KACxC,CAAC,EAlBA,iBAAiB,uBAAA,EACjB,iBAAiB,uBAAA,EACjB,gBAAgB,sBAAA,EAChB,eAAe,qBAAA,EACf,gBAAgB,sBAAA,EAChB,gBAAgB,sBAAA,EAChB,mBAAmB,yBAAA,EACnB,aAAa,mBAAA,EACb,aAAa,mBAAA,EACb,aAAa,mBAAA,EACb,OAAO,aAAA,EACP,UAAU,gBAAA,EACV,cAAc,oBAAA,EACd,WAAW,iBAAA,EACX,UAAU,gBAIV,CAAC;IAEH,OAAO,CACL;QACE,uCACE,SAAS,EAAK,UAAU,eAAY,EACpC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,eAAe,EAC5B,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,eAAe,EAAE,mBAAmB;YAEpC,8DACuB,gCAAO,EAC5B,SAAS,EAAK,UAAU,UAAO,EAC/B,GAAG,EAAE,OAAO,EACZ,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,UAAU,IAEhB,aAAa,CAAC,GAAG,CAAC,UAAC,IAAkB,EAAE,KAAa,IAAK,OAAA,CACxD,8BAAC,0BAAgB,IACf,YAAY,EAAE,IAAI,EAClB,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,oBAAoB,EACvC,GAAG,EAAE,mBAAiB,KAAO,GAC7B,CACH,EAPyD,CAOzD,CAAC,CACC,CACD;QAEN,uCAAK,SAAS,EAAK,UAAU,cAAW;YACtC,wDACa,+DAAa,EACxB,SAAS,EAAK,UAAU,iBAAY,UAAU,mBAAgB,EAC9D,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,iBAAiB;gBAE1B,8BAAC,yBAAe,mBAAc,IAAI,GAAI,CAC/B;YACT,wDACc,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACjD,SAAS,EAAK,UAAU,aAAU,EAClC,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,cAAc,IAEtB,aAAa,CAAC,CAAC,CAAC,CACf,8BAAC,eAAK,mBAAc,IAAI,GAAI,CAC7B,CAAC,CAAC,CAAC,CACF,8BAAC,kBAAQ,mBAAc,IAAI,GAAI,CAChC,CACM;YACT,wDACa,qEAAc,EACzB,SAAS,EAAK,UAAU,iBAAY,UAAU,mBAAgB,EAC9D,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,iBAAiB;gBAE1B,8BAAC,0BAAgB,mBAAc,IAAI,GAAI,CAChC,CACL,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ChevronLeftBold from '../Icon/ChevronLeftBold';
|
|
3
|
+
import ChevronRightBold from '../Icon/ChevronRightBold';
|
|
4
|
+
import Pause from '../Icon/Pause';
|
|
5
|
+
import PlayFill from '../Icon/PlayFill';
|
|
6
|
+
import HeroCarouselItem from './HeroCarouselItem';
|
|
7
|
+
import { useAutoPlayCarousel } from './hooks/useAutoPlayCarousel';
|
|
8
|
+
const BLOCK_NAME = 'spui-HeroCarousel';
|
|
9
|
+
const ITEM_LINK_CLASS_NAME = 'js-auto-play-carousel-item-link';
|
|
10
|
+
export const HeroCarousel = React.memo(function HeroCarousel({ carouselList, }) {
|
|
11
|
+
if (carouselList.length === 0) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const { handleSlideToPrev, handleSlideToNext, handleMouseEnter, handleMouseDown, handleMouseLeave, handleTouchStart, handleTransitionEnd, isAutoPlaying, isLinkClicked, itemsToRender, listRef, listStyles, toggleAutoPlay, handleFocus, handleBlur, } = useAutoPlayCarousel({
|
|
15
|
+
items: carouselList,
|
|
16
|
+
itemLinkClassName: ITEM_LINK_CLASS_NAME,
|
|
17
|
+
});
|
|
18
|
+
return (React.createElement("div", null,
|
|
19
|
+
React.createElement("div", { className: `${BLOCK_NAME}-container`, onBlur: handleBlur, onFocus: handleFocus, onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onTouchStart: handleTouchStart, onTransitionEnd: handleTransitionEnd },
|
|
20
|
+
React.createElement("ul", { "aria-roledescription": "\u30AB\u30EB\u30FC\u30BB\u30EB", className: `${BLOCK_NAME}-list`, ref: listRef, role: "group", style: listStyles }, itemsToRender.map((item, index) => (React.createElement(HeroCarouselItem, { carouselItem: item, isLinkClicked: isLinkClicked, itemLinkClassName: ITEM_LINK_CLASS_NAME, key: `hero-carousel-${index}` }))))),
|
|
21
|
+
React.createElement("div", { className: `${BLOCK_NAME}-controls` },
|
|
22
|
+
React.createElement("button", { "aria-label": "1\u3064\u524D\u306E\u30A2\u30A4\u30C6\u30E0\u306B\u79FB\u52D5", className: `${BLOCK_NAME}-control ${BLOCK_NAME}-control--prev`, type: "button", onClick: handleSlideToPrev },
|
|
23
|
+
React.createElement(ChevronLeftBold, { "aria-hidden": true })),
|
|
24
|
+
React.createElement("button", { "aria-label": isAutoPlaying ? 'スライドを停止' : 'スライドを再生', className: `${BLOCK_NAME}-control`, type: "button", onClick: toggleAutoPlay }, isAutoPlaying ? (React.createElement(Pause, { "aria-hidden": true })) : (React.createElement(PlayFill, { "aria-hidden": true }))),
|
|
25
|
+
React.createElement("button", { "aria-label": "1\u3064\u5F8C\u308D\u306E\u30A2\u30A4\u30C6\u30E0\u306B\u79FB\u52D5", className: `${BLOCK_NAME}-control ${BLOCK_NAME}-control--next`, type: "button", onClick: handleSlideToNext },
|
|
26
|
+
React.createElement(ChevronRightBold, { "aria-hidden": true })))));
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--HeroCarouselItem-onFocus-boxShadow:0 0 0 1px var(--color-surface-primary),0 0 0 3px var(--color-focus-clarity)}.spui-HeroCarouselItem-listItem{list-style:none;padding:0 .44em;width:100%}.spui-HeroCarouselItem-link{border:1px solid var(--color-border-low-emphasis);border-radius:12px;box-sizing:border-box;display:flex;flex-direction:column;height:12em;text-decoration:none}.spui-HeroCarouselItem-link:focus{box-shadow:var(--HeroCarouselItem-onFocus-boxShadow);outline:none}.spui-HeroCarouselItem-link:focus:not(:focus-visible){box-shadow:none}.spui-HeroCarouselItem-imageBlock{align-items:center;border-bottom:1px solid var(--color-border-low-emphasis);border-radius:12px 12px 0 0;display:flex;height:9.5em;justify-content:center;overflow:hidden}.spui-HeroCarouselItem-image{height:100%}.spui-HeroCarouselItem-titleContainer{align-items:center;box-sizing:border-box;display:flex;height:2.89em;justify-content:center;padding:0 .5em}.spui-HeroCarouselItem-title{color:var(--color-text-high-emphasis);font-size:.9375em;font-weight:700;margin:0;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}@media screen and (min-width:768px){.spui-HeroCarouselItem-listItem{padding:0 .75em}.spui-HeroCarouselItem-link{height:13.8em}.spui-HeroCarouselItem-titleContainer{height:3.3em}.spui-HeroCarouselItem-title{font-size:1em}.spui-HeroCarouselItem-imageBlock{height:10.9em}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import './HeroCarouselItem.css';
|
|
3
|
+
export declare type CarouselItem = {
|
|
4
|
+
imageUrl: string;
|
|
5
|
+
link: string;
|
|
6
|
+
title: string;
|
|
7
|
+
};
|
|
8
|
+
declare type Props = {
|
|
9
|
+
carouselItem: CarouselItem;
|
|
10
|
+
isLinkClicked: boolean;
|
|
11
|
+
itemLinkClassName: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const HeroCarouselItem: FC<Props>;
|
|
14
|
+
export default HeroCarouselItem;
|
|
15
|
+
//# sourceMappingURL=HeroCarouselItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeroCarouselItem.d.ts","sourceRoot":"","sources":["../../src/HeroCarousel/HeroCarouselItem.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAe,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,wBAAwB,CAAC;AAEhC,oBAAY,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,aAAK,KAAK,GAAG;IACX,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAIF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,KAAK,CA0CtC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.HeroCarouselItem = void 0;
|
|
23
|
+
var react_1 = __importStar(require("react"));
|
|
24
|
+
require("./HeroCarouselItem.css");
|
|
25
|
+
var BLOCK_NAME = 'spui-HeroCarouselItem';
|
|
26
|
+
exports.HeroCarouselItem = react_1.default.memo(function HeroCarouselItem(_a) {
|
|
27
|
+
var carouselItem = _a.carouselItem, isLinkClicked = _a.isLinkClicked, itemLinkClassName = _a.itemLinkClassName;
|
|
28
|
+
var handleLinkClick = react_1.useCallback(function (e) {
|
|
29
|
+
if (!isLinkClicked) {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
}
|
|
32
|
+
}, [isLinkClicked]);
|
|
33
|
+
return (react_1.default.createElement("li", { className: BLOCK_NAME + "-listItem" },
|
|
34
|
+
react_1.default.createElement("a", { className: itemLinkClassName + " " + BLOCK_NAME + "-link", href: carouselItem.link, onClick: handleLinkClick },
|
|
35
|
+
react_1.default.createElement("span", { className: BLOCK_NAME + "-imageBlock" },
|
|
36
|
+
react_1.default.createElement("img", { alt: "", className: BLOCK_NAME + "-image", src: carouselItem.imageUrl })),
|
|
37
|
+
react_1.default.createElement("div", { className: BLOCK_NAME + "-titleContainer" },
|
|
38
|
+
react_1.default.createElement("p", { className: BLOCK_NAME + "-title" }, carouselItem.title)))));
|
|
39
|
+
}, function (prevProps, nextProps) {
|
|
40
|
+
return prevProps.isLinkClicked === nextProps.isLinkClicked &&
|
|
41
|
+
prevProps.itemLinkClassName === nextProps.itemLinkClassName &&
|
|
42
|
+
prevProps.carouselItem.title === nextProps.carouselItem.title &&
|
|
43
|
+
prevProps.carouselItem.link === nextProps.carouselItem.link &&
|
|
44
|
+
prevProps.carouselItem.imageUrl === nextProps.carouselItem.imageUrl;
|
|
45
|
+
});
|
|
46
|
+
exports.default = exports.HeroCarouselItem;
|
|
47
|
+
//# sourceMappingURL=HeroCarouselItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeroCarouselItem.js","sourceRoot":"","sources":["../../src/HeroCarousel/HeroCarouselItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+C;AAC/C,kCAAgC;AAchC,IAAM,UAAU,GAAG,uBAAuB,CAAC;AAE9B,QAAA,gBAAgB,GAAc,eAAK,CAAC,IAAI,CACnD,SAAS,gBAAgB,CAAC,EAIzB;QAHC,YAAY,kBAAA,EACZ,aAAa,mBAAA,EACb,iBAAiB,uBAAA;IAEjB,IAAM,eAAe,GAAG,mBAAW,CACjC,UAAC,CAAyC;QACxC,IAAI,CAAC,aAAa,EAAE;YAClB,CAAC,CAAC,cAAc,EAAE,CAAC;SACpB;IACH,CAAC,EACD,CAAC,aAAa,CAAC,CAChB,CAAC;IAEF,OAAO,CACL,sCAAI,SAAS,EAAK,UAAU,cAAW;QACrC,qCACE,SAAS,EAAK,iBAAiB,SAAI,UAAU,UAAO,EACpD,IAAI,EAAE,YAAY,CAAC,IAAI,EACvB,OAAO,EAAE,eAAe;YAExB,wCAAM,SAAS,EAAK,UAAU,gBAAa;gBACzC,uCACE,GAAG,EAAC,EAAE,EACN,SAAS,EAAK,UAAU,WAAQ,EAChC,GAAG,EAAE,YAAY,CAAC,QAAQ,GAC1B,CACG;YACP,uCAAK,SAAS,EAAK,UAAU,oBAAiB;gBAC5C,qCAAG,SAAS,EAAK,UAAU,WAAQ,IAAG,YAAY,CAAC,KAAK,CAAK,CACzD,CACJ,CACD,CACN,CAAC;AACJ,CAAC,EACD,UAAC,SAAS,EAAE,SAAS;IACnB,OAAA,SAAS,CAAC,aAAa,KAAK,SAAS,CAAC,aAAa;QACnD,SAAS,CAAC,iBAAiB,KAAK,SAAS,CAAC,iBAAiB;QAC3D,SAAS,CAAC,YAAY,CAAC,KAAK,KAAK,SAAS,CAAC,YAAY,CAAC,KAAK;QAC7D,SAAS,CAAC,YAAY,CAAC,IAAI,KAAK,SAAS,CAAC,YAAY,CAAC,IAAI;QAC3D,SAAS,CAAC,YAAY,CAAC,QAAQ,KAAK,SAAS,CAAC,YAAY,CAAC,QAAQ;AAJnE,CAImE,CACtE,CAAC;AAEF,kBAAe,wBAAgB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import './HeroCarouselItem.css';
|
|
3
|
+
const BLOCK_NAME = 'spui-HeroCarouselItem';
|
|
4
|
+
export const HeroCarouselItem = React.memo(function HeroCarouselItem({ carouselItem, isLinkClicked, itemLinkClassName, }) {
|
|
5
|
+
const handleLinkClick = useCallback((e) => {
|
|
6
|
+
if (!isLinkClicked) {
|
|
7
|
+
e.preventDefault();
|
|
8
|
+
}
|
|
9
|
+
}, [isLinkClicked]);
|
|
10
|
+
return (React.createElement("li", { className: `${BLOCK_NAME}-listItem` },
|
|
11
|
+
React.createElement("a", { className: `${itemLinkClassName} ${BLOCK_NAME}-link`, href: carouselItem.link, onClick: handleLinkClick },
|
|
12
|
+
React.createElement("span", { className: `${BLOCK_NAME}-imageBlock` },
|
|
13
|
+
React.createElement("img", { alt: "", className: `${BLOCK_NAME}-image`, src: carouselItem.imageUrl })),
|
|
14
|
+
React.createElement("div", { className: `${BLOCK_NAME}-titleContainer` },
|
|
15
|
+
React.createElement("p", { className: `${BLOCK_NAME}-title` }, carouselItem.title)))));
|
|
16
|
+
}, (prevProps, nextProps) => prevProps.isLinkClicked === nextProps.isLinkClicked &&
|
|
17
|
+
prevProps.itemLinkClassName === nextProps.itemLinkClassName &&
|
|
18
|
+
prevProps.carouselItem.title === nextProps.carouselItem.title &&
|
|
19
|
+
prevProps.carouselItem.link === nextProps.carouselItem.link &&
|
|
20
|
+
prevProps.carouselItem.imageUrl === nextProps.carouselItem.imageUrl);
|
|
21
|
+
export default HeroCarouselItem;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Payload<Item> = {
|
|
3
|
+
items: Item[];
|
|
4
|
+
itemLinkClassName: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function useAutoPlayCarousel<Item>({ items, itemLinkClassName, }: Payload<Item>): {
|
|
7
|
+
handleSlideToPrev: () => void;
|
|
8
|
+
handleSlideToNext: () => void;
|
|
9
|
+
handleMouseEnter: () => void;
|
|
10
|
+
handleMouseDown: (e: React.MouseEvent) => void;
|
|
11
|
+
handleMouseLeave: () => void;
|
|
12
|
+
handleTouchStart: (e: React.TouchEvent) => void;
|
|
13
|
+
handleTransitionEnd: () => void;
|
|
14
|
+
isAutoPlaying: boolean;
|
|
15
|
+
isLinkClicked: boolean;
|
|
16
|
+
itemsToRender: Item[];
|
|
17
|
+
listRef: import("react").RefObject<HTMLUListElement>;
|
|
18
|
+
listStyles: {
|
|
19
|
+
transition: string;
|
|
20
|
+
transform: string;
|
|
21
|
+
};
|
|
22
|
+
toggleAutoPlay: () => void;
|
|
23
|
+
handleFocus: (e: React.FocusEvent<HTMLDivElement>) => void;
|
|
24
|
+
handleBlur: () => void;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=useAutoPlayCarousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutoPlayCarousel.d.ts","sourceRoot":"","sources":["../../../src/HeroCarousel/hooks/useAutoPlayCarousel.ts"],"names":[],"mappings":";AAOA,aAAK,OAAO,CAAC,IAAI,IAAI;IACnB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAKF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,EACxC,KAAK,EACL,iBAAiB,GAClB,EAAE,OAAO,CAAC,IAAI,CAAC;;;;yBAsFc,gBAAgB;;0BA2Bf,gBAAgB;;;;;;;;;;;qBA4BrB,gBAAgB,CAAC,cAAc,CAAC;;EA0DzD"}
|