@anker-in/headless-ui 1.1.9-temp-120105 → 1.1.9-temp-120801
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/dist/cjs/biz-components/AccordionCards/index.d.ts +1 -1
- package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
- package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/cjs/biz-components/AiuiProvider/index.d.ts +5 -0
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/cjs/biz-components/AplusDesc/index.js +1 -1
- package/dist/cjs/biz-components/AplusDesc/index.js.map +3 -3
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +1 -1
- package/dist/cjs/biz-components/Category/SwiperCategory.d.ts +1 -1
- package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/cjs/biz-components/Category/index.d.ts +1 -1
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Category/index.js.map +3 -3
- package/dist/cjs/biz-components/CreativeModule/index.js +1 -1
- package/dist/cjs/biz-components/CreativeModule/index.js.map +2 -2
- package/dist/cjs/biz-components/DownLoad/index.js +1 -1
- package/dist/cjs/biz-components/DownLoad/index.js.map +3 -3
- package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
- package/dist/cjs/biz-components/Faq/Faq.js +1 -1
- package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
- package/dist/cjs/biz-components/Features/index.js +1 -1
- package/dist/cjs/biz-components/Features/index.js.map +1 -1
- package/dist/cjs/biz-components/FootCharger/index.js +1 -1
- package/dist/cjs/biz-components/FootCharger/index.js.map +3 -3
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +1 -1
- package/dist/cjs/biz-components/FooterNavigation/types.d.ts +1 -1
- package/dist/cjs/biz-components/FooterNavigation/types.js.map +1 -1
- package/dist/cjs/biz-components/GiftBox/index.js +1 -1
- package/dist/cjs/biz-components/GiftBox/index.js.map +3 -3
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
- package/dist/cjs/biz-components/GraphicMore/index.js +1 -1
- package/dist/cjs/biz-components/GraphicMore/index.js.map +3 -3
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +5 -5
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +7 -7
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js.map +3 -3
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +2 -2
- package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +4 -4
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +3 -3
- package/dist/cjs/biz-components/MediaSceneSwitcher/types.d.ts +2 -0
- package/dist/cjs/biz-components/MediaSceneSwitcher/types.js +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/types.js.map +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/cjs/biz-components/ProductCompare/index.js +1 -1
- package/dist/cjs/biz-components/ProductCompare/index.js.map +2 -2
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +2 -2
- package/dist/cjs/biz-components/SelectStore/index.js.map +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/couponType.d.ts +50 -0
- package/dist/cjs/biz-components/ShelfDisplay/couponType.js +2 -0
- package/dist/cjs/biz-components/ShelfDisplay/couponType.js.map +7 -0
- package/dist/cjs/biz-components/ShelfDisplay/couponUtils.d.ts +37 -0
- package/dist/cjs/biz-components/ShelfDisplay/couponUtils.js +2 -0
- package/dist/cjs/biz-components/ShelfDisplay/couponUtils.js.map +7 -0
- package/dist/cjs/biz-components/ShelfDisplay/handleCoupon.d.ts +28 -0
- package/dist/cjs/biz-components/ShelfDisplay/handleCoupon.js +2 -0
- package/dist/cjs/biz-components/ShelfDisplay/handleCoupon.js.map +7 -0
- package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/cjs/biz-components/ShelfDisplay/useUDCGroup.d.ts +0 -0
- package/dist/cjs/biz-components/ShelfDisplay/useUDCGroup.js +2 -0
- package/dist/cjs/biz-components/ShelfDisplay/useUDCGroup.js.map +7 -0
- package/dist/cjs/biz-components/Specs/index.js +1 -1
- package/dist/cjs/biz-components/Specs/index.js.map +1 -1
- package/dist/cjs/biz-components/Subscribe/index.js +2 -2
- package/dist/cjs/biz-components/Subscribe/index.js.map +1 -1
- package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
- package/dist/cjs/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/cjs/biz-components/TextModal/index.js +1 -1
- package/dist/cjs/biz-components/TextModal/index.js.map +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
- package/dist/cjs/components/ExposureDetector.d.ts +3 -3
- package/dist/cjs/components/ExposureDetector.js +1 -1
- package/dist/cjs/components/ExposureDetector.js.map +2 -2
- package/dist/cjs/components/alert.d.ts +5 -0
- package/dist/cjs/components/alert.js.map +2 -2
- package/dist/cjs/components/avatar.d.ts +5 -0
- package/dist/cjs/components/avatar.js.map +2 -2
- package/dist/cjs/components/badge.d.ts +5 -0
- package/dist/cjs/components/badge.js.map +2 -2
- package/dist/cjs/components/board.d.ts +5 -0
- package/dist/cjs/components/board.js +1 -1
- package/dist/cjs/components/board.js.map +2 -2
- package/dist/cjs/components/button.d.ts +5 -0
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/carousel.js +1 -1
- package/dist/cjs/components/carousel.js.map +1 -1
- package/dist/cjs/components/checkbox.d.ts +5 -0
- package/dist/cjs/components/checkbox.js.map +2 -2
- package/dist/cjs/components/color.d.ts +7 -1
- package/dist/cjs/components/color.js +1 -1
- package/dist/cjs/components/color.js.map +2 -2
- package/dist/cjs/components/container.d.ts +5 -0
- package/dist/cjs/components/container.js +1 -1
- package/dist/cjs/components/container.js.map +2 -2
- package/dist/cjs/components/grid.d.ts +22 -0
- package/dist/cjs/components/grid.js +2 -0
- package/dist/cjs/components/grid.js.map +7 -0
- package/dist/cjs/components/heading.d.ts +5 -0
- package/dist/cjs/components/heading.js.map +2 -2
- package/dist/cjs/components/index.d.ts +1 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/components/input-number.d.ts +5 -0
- package/dist/cjs/components/input-number.js.map +2 -2
- package/dist/cjs/components/input.d.ts +5 -0
- package/dist/cjs/components/input.js.map +2 -2
- package/dist/cjs/components/link.d.ts +7 -2
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/components/link.js.map +2 -2
- package/dist/cjs/components/loadingDots.d.ts +5 -0
- package/dist/cjs/components/loadingDots.js.map +2 -2
- package/dist/cjs/components/picture.d.ts +5 -0
- package/dist/cjs/components/picture.js.map +2 -2
- package/dist/cjs/components/radio.d.ts +5 -0
- package/dist/cjs/components/radio.js.map +2 -2
- package/dist/cjs/components/skeleton.d.ts +5 -0
- package/dist/cjs/components/skeleton.js.map +2 -2
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/components/tabs.js.map +1 -1
- package/dist/cjs/components/text.d.ts +5 -0
- package/dist/cjs/components/text.js.map +2 -2
- package/dist/cjs/components/theme.d.ts +4 -3
- package/dist/cjs/components/theme.js.map +2 -2
- package/dist/cjs/helpers/ScrollLoadVideo.d.ts +5 -4
- package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
- package/dist/cjs/helpers/ScrollLoadVideo.js.map +3 -3
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/Styles.js.map +2 -2
- package/dist/cjs/stories/HeroBanner.stories.d.ts +1 -16
- package/dist/cjs/stories/HeroBanner.stories.js +2 -2
- package/dist/cjs/stories/HeroBanner.stories.js.map +3 -3
- package/dist/cjs/stories/accordionCards.stories.d.ts +2 -11
- package/dist/cjs/stories/alert.stories.d.ts +1 -22
- package/dist/cjs/stories/avatar.stories.d.ts +2 -35
- package/dist/cjs/stories/badge.stories.d.ts +2 -26
- package/dist/cjs/stories/brandEquity.stories.d.ts +2 -11
- package/dist/cjs/stories/button.stories.d.ts +1 -44
- package/dist/cjs/stories/card.stories.d.ts +1 -20
- package/dist/cjs/stories/category.stories.d.ts +2 -11
- package/dist/cjs/stories/checkbox.stories.d.ts +1 -30
- package/dist/cjs/stories/container.stories.d.ts +1 -22
- package/dist/cjs/stories/container.stories.js +1 -1
- package/dist/cjs/stories/container.stories.js.map +3 -3
- package/dist/cjs/stories/cpnBanner.stories.d.ts +2 -10
- package/dist/cjs/stories/cpnCountdown.stories.d.ts +2 -8
- package/dist/cjs/stories/cpnNavigation.stories.d.ts +2 -10
- package/dist/cjs/stories/cpnProductcard.stories.d.ts +2 -10
- package/dist/cjs/stories/cpnTitle.stories.d.ts +2 -10
- package/dist/cjs/stories/creativeModule.stories.d.ts +2 -17
- package/dist/cjs/stories/dialog.stories.d.ts +1 -14
- package/dist/cjs/stories/drawer.stories.d.ts +2 -14
- package/dist/cjs/stories/drop-down.stories.d.ts +2 -14
- package/dist/cjs/stories/evaluate.stories.d.ts +2 -11
- package/dist/cjs/stories/faq.stories.d.ts +2 -17
- package/dist/cjs/stories/faq.stories.js.map +2 -2
- package/dist/cjs/stories/graphic.stories.d.ts +2 -59
- package/dist/cjs/stories/graphic.stories.js +1 -1
- package/dist/cjs/stories/graphic.stories.js.map +3 -3
- package/dist/cjs/stories/graphicAttractionBlock.stories.js +1 -1
- package/dist/cjs/stories/graphicAttractionBlock.stories.js.map +3 -3
- package/dist/cjs/stories/grid.stories.d.ts +1 -16
- package/dist/cjs/stories/grid.stories.js +1 -1
- package/dist/cjs/stories/grid.stories.js.map +2 -2
- package/dist/cjs/stories/heading.stories.d.ts +1 -77
- package/dist/cjs/stories/heading.stories.js +4 -2
- package/dist/cjs/stories/heading.stories.js.map +2 -2
- package/dist/cjs/stories/input-number.stories.d.ts +2 -33
- package/dist/cjs/stories/input.stories.d.ts +1 -28
- package/dist/cjs/stories/link.stories.d.ts +2 -63
- package/dist/cjs/stories/link.stories.js +1 -1
- package/dist/cjs/stories/link.stories.js.map +1 -1
- package/dist/cjs/stories/marquee.stories.d.ts +2 -23
- package/dist/cjs/stories/mediaplayerMulti.stories.d.ts +2 -11
- package/dist/cjs/stories/picture.stories.d.ts +2 -13
- package/dist/cjs/stories/popover.stories.d.ts +1 -14
- package/dist/cjs/stories/radio.stories.d.ts +2 -34
- package/dist/cjs/stories/shelfDisplay.stories.d.ts +2 -11
- package/dist/cjs/stories/skeleton.stories.d.ts +1 -13
- package/dist/cjs/stories/slogan.stories.d.ts +2 -11
- package/dist/cjs/stories/specs.stories.d.ts +2 -11
- package/dist/cjs/stories/tabs.stories.d.ts +2 -365
- package/dist/cjs/stories/text.stories.d.ts +1 -78
- package/dist/cjs/stories/text.stories.js +4 -2
- package/dist/cjs/stories/text.stories.js.map +2 -2
- package/dist/cjs/stories/whychoose.stories.d.ts +2 -17
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/biz-components/AccordionCards/index.d.ts +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +5 -0
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/esm/biz-components/AplusDesc/index.js +1 -1
- package/dist/esm/biz-components/AplusDesc/index.js.map +3 -3
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +1 -1
- package/dist/esm/biz-components/Category/SwiperCategory.d.ts +1 -1
- package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/esm/biz-components/Category/index.d.ts +1 -1
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Category/index.js.map +3 -3
- package/dist/esm/biz-components/CreativeModule/index.js +1 -1
- package/dist/esm/biz-components/CreativeModule/index.js.map +1 -1
- package/dist/esm/biz-components/DownLoad/index.js +1 -1
- package/dist/esm/biz-components/DownLoad/index.js.map +2 -2
- package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
- package/dist/esm/biz-components/Faq/Faq.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
- package/dist/esm/biz-components/Features/index.js +1 -1
- package/dist/esm/biz-components/Features/index.js.map +1 -1
- package/dist/esm/biz-components/FootCharger/index.js +1 -1
- package/dist/esm/biz-components/FootCharger/index.js.map +2 -2
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +1 -1
- package/dist/esm/biz-components/FooterNavigation/types.d.ts +1 -1
- package/dist/esm/biz-components/FooterNavigation/types.js.map +1 -1
- package/dist/esm/biz-components/GiftBox/index.js +1 -1
- package/dist/esm/biz-components/GiftBox/index.js.map +3 -3
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js.map +2 -2
- package/dist/esm/biz-components/GraphicMore/index.js +1 -1
- package/dist/esm/biz-components/GraphicMore/index.js.map +2 -2
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +5 -5
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +7 -7
- package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +2 -2
- package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
- package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +3 -3
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +4 -4
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +3 -3
- package/dist/esm/biz-components/MediaSceneSwitcher/types.d.ts +2 -0
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +1 -1
- package/dist/esm/biz-components/ProductCompare/index.js +1 -1
- package/dist/esm/biz-components/ProductCompare/index.js.map +2 -2
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js.map +2 -2
- package/dist/esm/biz-components/SelectStore/index.js.map +1 -1
- package/dist/esm/biz-components/ShelfDisplay/couponType.d.ts +50 -0
- package/dist/esm/biz-components/ShelfDisplay/couponType.js +1 -0
- package/dist/esm/biz-components/ShelfDisplay/couponType.js.map +7 -0
- package/dist/esm/biz-components/ShelfDisplay/couponUtils.d.ts +37 -0
- package/dist/esm/biz-components/ShelfDisplay/couponUtils.js +2 -0
- package/dist/esm/biz-components/ShelfDisplay/couponUtils.js.map +7 -0
- package/dist/esm/biz-components/ShelfDisplay/handleCoupon.d.ts +28 -0
- package/dist/esm/biz-components/ShelfDisplay/handleCoupon.js +2 -0
- package/dist/esm/biz-components/ShelfDisplay/handleCoupon.js.map +7 -0
- package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +5 -5
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/esm/biz-components/ShelfDisplay/useUDCGroup.d.ts +0 -0
- package/dist/esm/biz-components/ShelfDisplay/useUDCGroup.js +2 -0
- package/dist/esm/biz-components/ShelfDisplay/useUDCGroup.js.map +7 -0
- package/dist/esm/biz-components/Specs/index.js +1 -1
- package/dist/esm/biz-components/Specs/index.js.map +1 -1
- package/dist/esm/biz-components/Subscribe/index.js +2 -2
- package/dist/esm/biz-components/Subscribe/index.js.map +1 -1
- package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
- package/dist/esm/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/esm/biz-components/TextModal/index.js +1 -1
- package/dist/esm/biz-components/TextModal/index.js.map +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
- package/dist/esm/components/ExposureDetector.d.ts +3 -3
- package/dist/esm/components/ExposureDetector.js +1 -1
- package/dist/esm/components/ExposureDetector.js.map +2 -2
- package/dist/esm/components/alert.d.ts +5 -0
- package/dist/esm/components/alert.js.map +2 -2
- package/dist/esm/components/avatar.d.ts +5 -0
- package/dist/esm/components/avatar.js.map +2 -2
- package/dist/esm/components/badge.d.ts +5 -0
- package/dist/esm/components/badge.js.map +2 -2
- package/dist/esm/components/board.d.ts +5 -0
- package/dist/esm/components/board.js +1 -1
- package/dist/esm/components/board.js.map +2 -2
- package/dist/esm/components/button.d.ts +5 -0
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/carousel.js +1 -1
- package/dist/esm/components/carousel.js.map +1 -1
- package/dist/esm/components/checkbox.d.ts +5 -0
- package/dist/esm/components/checkbox.js.map +2 -2
- package/dist/esm/components/color.d.ts +7 -1
- package/dist/esm/components/color.js +1 -1
- package/dist/esm/components/color.js.map +2 -2
- package/dist/esm/components/container.d.ts +5 -0
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/container.js.map +2 -2
- package/dist/esm/components/grid.d.ts +22 -0
- package/dist/esm/components/grid.js +2 -0
- package/dist/esm/components/grid.js.map +7 -0
- package/dist/esm/components/heading.d.ts +5 -0
- package/dist/esm/components/heading.js.map +2 -2
- package/dist/esm/components/index.d.ts +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/input-number.d.ts +5 -0
- package/dist/esm/components/input-number.js.map +2 -2
- package/dist/esm/components/input.d.ts +5 -0
- package/dist/esm/components/input.js.map +2 -2
- package/dist/esm/components/link.d.ts +7 -2
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/components/link.js.map +2 -2
- package/dist/esm/components/loadingDots.d.ts +5 -0
- package/dist/esm/components/loadingDots.js.map +2 -2
- package/dist/esm/components/picture.d.ts +5 -0
- package/dist/esm/components/picture.js.map +2 -2
- package/dist/esm/components/radio.d.ts +5 -0
- package/dist/esm/components/radio.js.map +2 -2
- package/dist/esm/components/skeleton.d.ts +5 -0
- package/dist/esm/components/skeleton.js.map +2 -2
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/tabs.js.map +1 -1
- package/dist/esm/components/text.d.ts +5 -0
- package/dist/esm/components/text.js.map +2 -2
- package/dist/esm/components/theme.d.ts +4 -3
- package/dist/esm/components/theme.js.map +2 -2
- package/dist/esm/helpers/ScrollLoadVideo.d.ts +5 -4
- package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
- package/dist/esm/helpers/ScrollLoadVideo.js.map +3 -3
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/Styles.js.map +1 -1
- package/dist/esm/stories/HeroBanner.stories.d.ts +1 -16
- package/dist/esm/stories/HeroBanner.stories.js +2 -2
- package/dist/esm/stories/HeroBanner.stories.js.map +3 -3
- package/dist/esm/stories/accordionCards.stories.d.ts +2 -11
- package/dist/esm/stories/alert.stories.d.ts +1 -22
- package/dist/esm/stories/avatar.stories.d.ts +2 -35
- package/dist/esm/stories/badge.stories.d.ts +2 -26
- package/dist/esm/stories/brandEquity.stories.d.ts +2 -11
- package/dist/esm/stories/button.stories.d.ts +1 -44
- package/dist/esm/stories/card.stories.d.ts +1 -20
- package/dist/esm/stories/category.stories.d.ts +2 -11
- package/dist/esm/stories/checkbox.stories.d.ts +1 -30
- package/dist/esm/stories/container.stories.d.ts +1 -22
- package/dist/esm/stories/container.stories.js +2 -2
- package/dist/esm/stories/container.stories.js.map +2 -2
- package/dist/esm/stories/cpnBanner.stories.d.ts +2 -10
- package/dist/esm/stories/cpnCountdown.stories.d.ts +2 -8
- package/dist/esm/stories/cpnNavigation.stories.d.ts +2 -10
- package/dist/esm/stories/cpnProductcard.stories.d.ts +2 -10
- package/dist/esm/stories/cpnTitle.stories.d.ts +2 -10
- package/dist/esm/stories/creativeModule.stories.d.ts +2 -17
- package/dist/esm/stories/dialog.stories.d.ts +1 -14
- package/dist/esm/stories/drawer.stories.d.ts +2 -14
- package/dist/esm/stories/drop-down.stories.d.ts +2 -14
- package/dist/esm/stories/evaluate.stories.d.ts +2 -11
- package/dist/esm/stories/faq.stories.d.ts +2 -17
- package/dist/esm/stories/faq.stories.js.map +2 -2
- package/dist/esm/stories/graphic.stories.d.ts +2 -59
- package/dist/esm/stories/graphic.stories.js +1 -1
- package/dist/esm/stories/graphic.stories.js.map +2 -2
- package/dist/esm/stories/graphicAttractionBlock.stories.js +1 -1
- package/dist/esm/stories/graphicAttractionBlock.stories.js.map +2 -2
- package/dist/esm/stories/grid.stories.d.ts +1 -16
- package/dist/esm/stories/grid.stories.js +1 -1
- package/dist/esm/stories/grid.stories.js.map +1 -1
- package/dist/esm/stories/heading.stories.d.ts +1 -77
- package/dist/esm/stories/heading.stories.js +4 -2
- package/dist/esm/stories/heading.stories.js.map +3 -3
- package/dist/esm/stories/input-number.stories.d.ts +2 -33
- package/dist/esm/stories/input.stories.d.ts +1 -28
- package/dist/esm/stories/link.stories.d.ts +2 -63
- package/dist/esm/stories/link.stories.js +1 -1
- package/dist/esm/stories/link.stories.js.map +1 -1
- package/dist/esm/stories/marquee.stories.d.ts +2 -23
- package/dist/esm/stories/mediaplayerMulti.stories.d.ts +2 -11
- package/dist/esm/stories/picture.stories.d.ts +2 -13
- package/dist/esm/stories/popover.stories.d.ts +1 -14
- package/dist/esm/stories/radio.stories.d.ts +2 -34
- package/dist/esm/stories/shelfDisplay.stories.d.ts +2 -11
- package/dist/esm/stories/skeleton.stories.d.ts +1 -13
- package/dist/esm/stories/slogan.stories.d.ts +2 -11
- package/dist/esm/stories/specs.stories.d.ts +2 -11
- package/dist/esm/stories/tabs.stories.d.ts +2 -365
- package/dist/esm/stories/text.stories.d.ts +1 -78
- package/dist/esm/stories/text.stories.js +5 -3
- package/dist/esm/stories/text.stories.js.map +3 -3
- package/dist/esm/stories/whychoose.stories.d.ts +2 -17
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/tokens/base.css +51 -86
- package/package.json +6 -7
- package/style.css +14 -68
- package/tailwind.config.js +10 -33
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/carousel.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport type { EmblaCarouselType } from 'embla-carousel'\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'\n\nimport { cn } from '../helpers/index.js'\nimport Button from './button.js'\n\ntype CarouselApi = UseEmblaCarouselType[1]\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\ntype CarouselProps = {\n /**\n * \u662F\u5426\u663E\u793A\u5BFC\u822A\u70B9\n */\n showNavigation?: boolean\n /**\n * \u5BFC\u822A\u70B9\u4F4D\u7F6E default inner\n */\n navigationPosition?: 'inner' | 'outter'\n opts?: CarouselOptions\n plugins?: CarouselPlugin\n orientation?: 'horizontal' | 'vertical'\n setApi?: (api: CarouselApi) => void\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n canScrollPrev: boolean\n canScrollNext: boolean\n} & CarouselProps\n\ntype UseDotButtonType = {\n selectedIndex: number\n scrollSnaps: number[]\n onDotButtonClick: (index: number) => void\n}\n\nconst useDotButton = (\n emblaApi: EmblaCarouselType | undefined,\n onButtonClick?: (emblaApi: EmblaCarouselType) => void\n): UseDotButtonType => {\n const [selectedIndex, setSelectedIndex] = React.useState(0)\n const [scrollSnaps, setScrollSnaps] = React.useState<number[]>([])\n\n const onDotButtonClick = React.useCallback(\n (index: number) => {\n if (!emblaApi) return\n emblaApi.scrollTo(index)\n if (onButtonClick) onButtonClick(emblaApi)\n },\n [emblaApi, onButtonClick]\n )\n\n const onInit = React.useCallback((emblaApi: EmblaCarouselType) => {\n setScrollSnaps(emblaApi.scrollSnapList())\n }, [])\n\n const onSelect = React.useCallback((emblaApi: EmblaCarouselType) => {\n setSelectedIndex(emblaApi.selectedScrollSnap())\n }, [])\n\n React.useEffect(() => {\n if (!emblaApi) return\n\n onInit(emblaApi)\n onSelect(emblaApi)\n\n emblaApi.on('reInit', onInit).on('reInit', onSelect).on('select', onSelect)\n }, [emblaApi, onInit, onSelect])\n\n return {\n selectedIndex,\n scrollSnaps,\n onDotButtonClick,\n }\n}\n\ntype PropType = React.ComponentPropsWithRef<'button'>\n\nexport const DotButton: React.FC<PropType> = props => {\n const { children, ...restProps } = props\n\n return (\n <button type=\"button\" {...restProps}>\n {children}\n </button>\n )\n}\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null)\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext)\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />')\n }\n\n return context\n}\n\nconst Carousel = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & CarouselProps>(\n (\n {\n orientation = 'horizontal',\n showNavigation = false,\n navigationPosition = 'inner',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins\n )\n const [canScrollPrev, setCanScrollPrev] = React.useState(false)\n const [canScrollNext, setCanScrollNext] = React.useState(false)\n\n const { selectedIndex, scrollSnaps, onDotButtonClick } = useDotButton(api)\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return\n }\n\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n }, [])\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev()\n }, [api])\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext()\n }, [api])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === 'ArrowRight') {\n event.preventDefault()\n scrollNext()\n }\n },\n [scrollPrev, scrollNext]\n )\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return\n }\n\n setApi(api)\n }, [api, setApi])\n\n React.useEffect(() => {\n if (!api) {\n return\n }\n\n onSelect(api)\n api.on('reInit', onSelect)\n api.on('select', onSelect)\n\n return () => {\n api?.off('select', onSelect)\n }\n }, [api, onSelect])\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n {showNavigation && (\n <div\n className={cn('absolute left-1/2 mx-auto flex -translate-x-1/2 justify-center gap-[8px]', {\n 'laptop:bottom-[40px] bottom-[24px]': navigationPosition === 'inner',\n 'laptop:-bottom-[40px] -bottom-[24px]': navigationPosition === 'outter',\n })}\n >\n {scrollSnaps.map((_, index) => (\n <DotButton\n key={index}\n onClick={() => onDotButtonClick(index)}\n className={cn('laptop:w-[30px] h-[3px] w-[16px] bg-[#86868C]', {\n 'bg-[#1D1D1F]': index === selectedIndex,\n })}\n />\n ))}\n </div>\n )}\n </div>\n </CarouselContext.Provider>\n )\n }\n)\nCarousel.displayName = 'Carousel'\n\nconst CarouselContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)}\n {...props}\n />\n </div>\n )\n }\n)\nCarouselContent.displayName = 'CarouselContent'\n\nconst CarouselItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { orientation } = useCarousel()\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn('w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n {...props}\n />\n )\n }\n)\nCarouselItem.displayName = 'CarouselItem'\n\nconst CarouselPrevious = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = 'secondary', size = 'icon', children, ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel()\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? '-left-12 top-1/2 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n {children ? (\n children\n ) : (\n <svg width=\"58\" height=\"58\" viewBox=\"0 0 58 58\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle\n opacity=\"0.2\"\n cx=\"29\"\n cy=\"29\"\n r=\"29\"\n transform=\"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 58)\"\n fill=\"#1D1D1F\"\n />\n <path\n d=\"M32.1583 36.8248C32.6139 36.3692 32.6139 35.6305 32.1583 35.1749L25.9832 28.9998L32.1583 22.8248C32.6139 22.3692 32.6139 21.6305 32.1583 21.1749C31.7027 20.7193 30.964 20.7193 30.5084 21.1749L23.5084 28.1749C23.0528 28.6305 23.0528 29.3692 23.5084 29.8248L30.5084 36.8248C30.964 37.2804 31.7027 37.2804 32.1583 36.8248Z\"\n fill=\"white\"\n />\n </svg>\n )}\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n )\n }\n)\nCarouselPrevious.displayName = 'CarouselPrevious'\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = 'secondary', size = 'icon', children, ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel()\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? '-right-12 top-1/2 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n {children ? (\n children\n ) : (\n <svg width=\"58\" height=\"58\" viewBox=\"0 0 58 58\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle opacity=\"0.2\" cx=\"29\" cy=\"29\" r=\"29\" transform=\"rotate(-180 29 29)\" fill=\"#1D1D1F\" />\n <path\n d=\"M25.8417 36.8248C25.3861 36.3692 25.3861 35.6305 25.8417 35.1749L32.0168 28.9998L25.8417 22.8248C25.3861 22.3692 25.3861 21.6305 25.8417 21.1749C26.2973 20.7193 27.036 20.7193 27.4916 21.1749L34.4916 28.1749C34.9472 28.6305 34.9472 29.3692 34.4916 29.8248L27.4916 36.8248C27.036 37.2804 26.2973 37.2804 25.8417 36.8248Z\"\n fill=\"white\"\n />\n </svg>\n )}\n <span className=\"sr-only\">Next slide</span>\n </Button>\n )\n }\n)\nCarouselNext.displayName = 'CarouselNext'\n\nexport { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext }\n"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport type { EmblaCarouselType } from 'embla-carousel'\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'\n\nimport { cn } from '../helpers/index.js'\nimport Button from './button.js'\n\ntype CarouselApi = UseEmblaCarouselType[1]\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\ntype CarouselProps = {\n /**\n * \u662F\u5426\u663E\u793A\u5BFC\u822A\u70B9\n */\n showNavigation?: boolean\n /**\n * \u5BFC\u822A\u70B9\u4F4D\u7F6E default inner\n */\n navigationPosition?: 'inner' | 'outter'\n opts?: CarouselOptions\n plugins?: CarouselPlugin\n orientation?: 'horizontal' | 'vertical'\n setApi?: (api: CarouselApi) => void\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n canScrollPrev: boolean\n canScrollNext: boolean\n} & CarouselProps\n\ntype UseDotButtonType = {\n selectedIndex: number\n scrollSnaps: number[]\n onDotButtonClick: (index: number) => void\n}\n\nconst useDotButton = (\n emblaApi: EmblaCarouselType | undefined,\n onButtonClick?: (emblaApi: EmblaCarouselType) => void\n): UseDotButtonType => {\n const [selectedIndex, setSelectedIndex] = React.useState(0)\n const [scrollSnaps, setScrollSnaps] = React.useState<number[]>([])\n\n const onDotButtonClick = React.useCallback(\n (index: number) => {\n if (!emblaApi) return\n emblaApi.scrollTo(index)\n if (onButtonClick) onButtonClick(emblaApi)\n },\n [emblaApi, onButtonClick]\n )\n\n const onInit = React.useCallback((emblaApi: EmblaCarouselType) => {\n setScrollSnaps(emblaApi.scrollSnapList())\n }, [])\n\n const onSelect = React.useCallback((emblaApi: EmblaCarouselType) => {\n setSelectedIndex(emblaApi.selectedScrollSnap())\n }, [])\n\n React.useEffect(() => {\n if (!emblaApi) return\n\n onInit(emblaApi)\n onSelect(emblaApi)\n\n emblaApi.on('reInit', onInit).on('reInit', onSelect).on('select', onSelect)\n }, [emblaApi, onInit, onSelect])\n\n return {\n selectedIndex,\n scrollSnaps,\n onDotButtonClick,\n }\n}\n\ntype PropType = React.ComponentPropsWithRef<'button'>\n\nexport const DotButton: React.FC<PropType> = props => {\n const { children, ...restProps } = props\n\n return (\n <button type=\"button\" {...restProps}>\n {children}\n </button>\n )\n}\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null)\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext)\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />')\n }\n\n return context\n}\n\nconst Carousel = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & CarouselProps>(\n (\n {\n orientation = 'horizontal',\n showNavigation = false,\n navigationPosition = 'inner',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins\n )\n const [canScrollPrev, setCanScrollPrev] = React.useState(false)\n const [canScrollNext, setCanScrollNext] = React.useState(false)\n\n const { selectedIndex, scrollSnaps, onDotButtonClick } = useDotButton(api)\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return\n }\n\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n }, [])\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev()\n }, [api])\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext()\n }, [api])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === 'ArrowRight') {\n event.preventDefault()\n scrollNext()\n }\n },\n [scrollPrev, scrollNext]\n )\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return\n }\n\n setApi(api)\n }, [api, setApi])\n\n React.useEffect(() => {\n if (!api) {\n return\n }\n\n onSelect(api)\n api.on('reInit', onSelect)\n api.on('select', onSelect)\n\n return () => {\n api?.off('select', onSelect)\n }\n }, [api, onSelect])\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n {showNavigation && (\n <div\n className={cn('absolute left-1/2 mx-auto flex -translate-x-1/2 justify-center gap-[8px]', {\n 'laptop:bottom-[40px] bottom-[24px]': navigationPosition === 'inner',\n 'laptop:-bottom-[40px] -bottom-[24px]': navigationPosition === 'outter',\n })}\n >\n {scrollSnaps.map((_, index) => (\n <DotButton\n key={index}\n onClick={() => onDotButtonClick(index)}\n className={cn('laptop:w-[30px] h-[3px] w-[16px] bg-[#86868C]', {\n 'bg-[#080A0F]': index === selectedIndex,\n })}\n />\n ))}\n </div>\n )}\n </div>\n </CarouselContext.Provider>\n )\n }\n)\nCarousel.displayName = 'Carousel'\n\nconst CarouselContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)}\n {...props}\n />\n </div>\n )\n }\n)\nCarouselContent.displayName = 'CarouselContent'\n\nconst CarouselItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { orientation } = useCarousel()\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn('w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n {...props}\n />\n )\n }\n)\nCarouselItem.displayName = 'CarouselItem'\n\nconst CarouselPrevious = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = 'secondary', size = 'icon', children, ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel()\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? '-left-12 top-1/2 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n {children ? (\n children\n ) : (\n <svg width=\"58\" height=\"58\" viewBox=\"0 0 58 58\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle\n opacity=\"0.2\"\n cx=\"29\"\n cy=\"29\"\n r=\"29\"\n transform=\"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 58)\"\n fill=\"#1D1D1F\"\n />\n <path\n d=\"M32.1583 36.8248C32.6139 36.3692 32.6139 35.6305 32.1583 35.1749L25.9832 28.9998L32.1583 22.8248C32.6139 22.3692 32.6139 21.6305 32.1583 21.1749C31.7027 20.7193 30.964 20.7193 30.5084 21.1749L23.5084 28.1749C23.0528 28.6305 23.0528 29.3692 23.5084 29.8248L30.5084 36.8248C30.964 37.2804 31.7027 37.2804 32.1583 36.8248Z\"\n fill=\"white\"\n />\n </svg>\n )}\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n )\n }\n)\nCarouselPrevious.displayName = 'CarouselPrevious'\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = 'secondary', size = 'icon', children, ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel()\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? '-right-12 top-1/2 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n {children ? (\n children\n ) : (\n <svg width=\"58\" height=\"58\" viewBox=\"0 0 58 58\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle opacity=\"0.2\" cx=\"29\" cy=\"29\" r=\"29\" transform=\"rotate(-180 29 29)\" fill=\"#1D1D1F\" />\n <path\n d=\"M25.8417 36.8248C25.3861 36.3692 25.3861 35.6305 25.8417 35.1749L32.0168 28.9998L25.8417 22.8248C25.3861 22.3692 25.3861 21.6305 25.8417 21.1749C26.2973 20.7193 27.036 20.7193 27.4916 21.1749L34.4916 28.1749C34.9472 28.6305 34.9472 29.3692 34.4916 29.8248L27.4916 36.8248C27.036 37.2804 26.2973 37.2804 25.8417 36.8248Z\"\n fill=\"white\"\n />\n </svg>\n )}\n <span className=\"sr-only\">Next slide</span>\n </Button>\n )\n }\n)\nCarouselNext.displayName = 'CarouselNext'\n\nexport { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext }\n"],
|
|
5
5
|
"mappings": "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",
|
|
6
6
|
"names": ["jsx", "jsxs", "React", "useEmblaCarousel", "cn", "Button", "useDotButton", "emblaApi", "onButtonClick", "selectedIndex", "setSelectedIndex", "scrollSnaps", "setScrollSnaps", "onDotButtonClick", "index", "onInit", "onSelect", "DotButton", "props", "children", "restProps", "CarouselContext", "useCarousel", "context", "Carousel", "orientation", "showNavigation", "navigationPosition", "opts", "setApi", "plugins", "className", "ref", "carouselRef", "api", "canScrollPrev", "setCanScrollPrev", "canScrollNext", "setCanScrollNext", "scrollPrev", "scrollNext", "handleKeyDown", "event", "_", "CarouselContent", "CarouselItem", "CarouselPrevious", "variant", "size", "CarouselNext"]
|
|
7
7
|
}
|
|
@@ -7,6 +7,11 @@ declare const checkboxVariants: (props?: ({
|
|
|
7
7
|
interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {
|
|
8
8
|
iconClassName?: string;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Checkbox - 复选框
|
|
12
|
+
*
|
|
13
|
+
* @description 允许用户进行多选操作的复选框组件,支持不同尺寸和自定义图标
|
|
14
|
+
*/
|
|
10
15
|
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
16
|
export default Checkbox;
|
|
12
17
|
export type { CheckboxProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/checkbox.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\n// import { CheckIcon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst CheckIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M7.5 15.8333L1.66667 10L3.75 7.91667L7.5 11.6667L16.25 3L18.3333 5.08333L7.5 15.8333Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst checkboxVariants = cva(\n 'border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground disabled:bg-btn-primary-disabled peer shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'size-[14px]',\n base: 'size-4',\n lg: 'size-5',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\ninterface CheckboxProps\n extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root
|
|
5
|
-
"mappings": "aAYM,cAAAA,MAAA,oBAVN,UAAYC,MAAW,QACvB,UAAYC,MAAuB,2BAGnC,OAAS,MAAAC,MAAU,sBACnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAaC,GAEfN,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGM,EACjG,SAAAN,EAAC,QACC,EAAE,wFACF,KAAK,eACP,EACF,EAIEO,EAAmBH,EACvB,0UACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,KAAM,SACN,GAAI,QACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\n// import { CheckIcon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst CheckIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M7.5 15.8333L1.66667 10L3.75 7.91667L7.5 11.6667L16.25 3L18.3333 5.08333L7.5 15.8333Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst checkboxVariants = cva(\n 'border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground disabled:bg-btn-primary-disabled peer shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'size-[14px]',\n base: 'size-4',\n lg: 'size-5',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\ninterface CheckboxProps\n extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {\n iconClassName?: string\n}\n\n/**\n * Checkbox - \u590D\u9009\u6846\n *\n * @description \u5141\u8BB8\u7528\u6237\u8FDB\u884C\u591A\u9009\u64CD\u4F5C\u7684\u590D\u9009\u6846\u7EC4\u4EF6\uFF0C\u652F\u6301\u4E0D\u540C\u5C3A\u5BF8\u548C\u81EA\u5B9A\u4E49\u56FE\u6807\n */\nconst Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n ({ className, size, iconClassName, ...props }, ref) => (\n <CheckboxPrimitive.Root ref={ref} className={cn(checkboxVariants({ size }), className)} {...props}>\n <CheckboxPrimitive.Indicator className={cn('flex size-full items-center justify-center text-current')}>\n <CheckIcon width={16} height={12} className={iconClassName} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n)\nCheckbox.displayName = 'Checkbox'\n\nexport default Checkbox\nexport type { CheckboxProps }\n"],
|
|
5
|
+
"mappings": "aAYM,cAAAA,MAAA,oBAVN,UAAYC,MAAW,QACvB,UAAYC,MAAuB,2BAGnC,OAAS,MAAAC,MAAU,sBACnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAaC,GAEfN,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGM,EACjG,SAAAN,EAAC,QACC,EAAE,wFACF,KAAK,eACP,EACF,EAIEO,EAAmBH,EACvB,0UACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,KAAM,SACN,GAAI,QACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAYMI,EAAWP,EAAM,WACrB,CAAC,CAAE,UAAAQ,EAAW,KAAAC,EAAM,cAAAC,EAAe,GAAGL,CAAM,EAAGM,IAC7CZ,EAACE,EAAkB,KAAlB,CAAuB,IAAKU,EAAK,UAAWT,EAAGI,EAAiB,CAAE,KAAAG,CAAK,CAAC,EAAGD,CAAS,EAAI,GAAGH,EAC1F,SAAAN,EAACE,EAAkB,UAAlB,CAA4B,UAAWC,EAAG,yDAAyD,EAClG,SAAAH,EAACK,EAAA,CAAU,MAAO,GAAI,OAAQ,GAAI,UAAWM,EAAe,EAC9D,EACF,CAEJ,EACAH,EAAS,YAAc,WAEvB,IAAOK,EAAQL",
|
|
6
6
|
"names": ["jsx", "React", "CheckboxPrimitive", "cn", "cva", "CheckIcon", "props", "checkboxVariants", "Checkbox", "className", "size", "iconClassName", "ref", "checkbox_default"]
|
|
7
7
|
}
|
|
@@ -2,12 +2,18 @@ import * as React from 'react';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
4
4
|
declare const colorVariants: (props?: ({
|
|
5
|
-
color?: "brand0" | "brand1" | "success0" | "success1" | "
|
|
5
|
+
color?: "brand0" | "brand1" | "success0" | "success1" | "warning0" | "warning1" | "error0" | "error1" | "infoPrimary" | "infoSecondary" | "infoTertiary" | "infoQuaternary" | "infoWhite" | "containerPrimary" | "containerSecondary0" | "containerSecondary1" | "bg0" | "bg1" | "lines" | "masks0" | "masks1" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
type ColorDivProps = ComponentPropsWithout<'div', RemovedProps>;
|
|
8
8
|
interface CommonColorProps extends VariantProps<typeof colorVariants> {
|
|
9
9
|
}
|
|
10
10
|
type ColorProps = CommonColorProps & ColorDivProps;
|
|
11
|
+
/**
|
|
12
|
+
* Color - 颜色容器
|
|
13
|
+
*
|
|
14
|
+
* @description 提供主题色彩配置的容器组件,支持品牌色、状态色等多种预设颜色
|
|
15
|
+
* @deprecated 已作废,请使用 默认的配色 或 直接设置颜色
|
|
16
|
+
*/
|
|
11
17
|
declare const Color: React.ForwardRefExoticComponent<CommonColorProps & ColorDivProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
18
|
export { Color };
|
|
13
19
|
export type { ColorProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import*as i from"react";import{Slot as c}from"@radix-ui/react-slot";import{cn as p}from"../helpers/index.js";import{cva as m}from"class-variance-authority";const b=m("",{variants:{color:{brand0:"bg-brand-0",brand1:"bg-brand-1",success0:"bg-success-0",success1:"bg-success-1",warning0:"bg-warning-0",warning1:"bg-warning-1",error0:"bg-error-0",error1:"bg-error-1",infoPrimary:"bg-info-primary",infoSecondary:"bg-info-secondary",infoTertiary:"bg-info-tertiary",infoQuaternary:"bg-info-quaternary",infoWhite:"bg-info-white",containerPrimary:"bg-container-primary",containerSecondary0:"bg-container-secondary-0",containerSecondary1:"bg-container-secondary-1",bg0:"bg-bg-0",bg1:"bg-bg-1",lines:"bg-lines",masks0:"bg-masks-0",masks1:"bg-masks-1"}},defaultVariants:{color:"brand0"}}),o=i.forwardRef((r,n)=>{const{children:e,color:a="brand0",className:s,...t}=r;return l(c,{...t,ref:n,className:p(b({color:a}),s),children:e})});o.displayName="Color";export{o as Color};
|
|
2
2
|
//# sourceMappingURL=color.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/color.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../helpers/index.js'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\nconst colorVariants = cva('', {\n variants: {\n color: {\n brand0: 'bg-brand-0',\n brand1: 'bg-brand-1',\n success0: 'bg-success-0',\n success1: 'bg-success-1',\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../helpers/index.js'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\nconst colorVariants = cva('', {\n variants: {\n color: {\n brand0: 'bg-brand-0',\n brand1: 'bg-brand-1',\n success0: 'bg-success-0',\n success1: 'bg-success-1',\n\n warning0: 'bg-warning-0',\n warning1: 'bg-warning-1',\n\n error0: 'bg-error-0',\n error1: 'bg-error-1',\n\n infoPrimary: 'bg-info-primary',\n infoSecondary: 'bg-info-secondary',\n infoTertiary: 'bg-info-tertiary',\n infoQuaternary: 'bg-info-quaternary',\n infoWhite: 'bg-info-white',\n\n containerPrimary: 'bg-container-primary',\n containerSecondary0: 'bg-container-secondary-0',\n containerSecondary1: 'bg-container-secondary-1',\n\n bg0: 'bg-bg-0',\n bg1: 'bg-bg-1',\n lines: 'bg-lines',\n masks0: 'bg-masks-0',\n masks1: 'bg-masks-1',\n },\n },\n defaultVariants: {\n color: 'brand0',\n },\n})\ntype ColorElement = React.ElementRef<'div'>\ntype ColorDivProps = ComponentPropsWithout<'div', RemovedProps>\ninterface CommonColorProps extends VariantProps<typeof colorVariants> {}\ntype ColorProps = CommonColorProps & ColorDivProps\n\n/**\n * Color - \u989C\u8272\u5BB9\u5668\n *\n * @description \u63D0\u4F9B\u4E3B\u9898\u8272\u5F69\u914D\u7F6E\u7684\u5BB9\u5668\u7EC4\u4EF6\uFF0C\u652F\u6301\u54C1\u724C\u8272\u3001\u72B6\u6001\u8272\u7B49\u591A\u79CD\u9884\u8BBE\u989C\u8272\n * @deprecated \u5DF2\u4F5C\u5E9F\uFF0C\u8BF7\u4F7F\u7528 \u9ED8\u8BA4\u7684\u914D\u8272 \u6216 \u76F4\u63A5\u8BBE\u7F6E\u989C\u8272\n */\nconst Color = React.forwardRef<ColorElement, ColorProps>((props, forwardedRef) => {\n const { children, color = 'brand0', className, ...colorProps } = props\n return (\n <Slot\n {...colorProps}\n ref={forwardedRef}\n className={cn(\n colorVariants({\n color,\n }),\n className\n )}\n >\n {children}\n </Slot>\n )\n})\nColor.displayName = 'Color'\nexport { Color }\nexport type { ColorProps }\n"],
|
|
5
|
+
"mappings": "AAsDI,cAAAA,MAAA,oBAtDJ,UAAYC,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,MAAAC,MAAU,sBACnB,OAA4B,OAAAC,MAAW,2BAEvC,MAAMC,EAAgBD,EAAI,GAAI,CAC5B,SAAU,CACR,MAAO,CACL,OAAQ,aACR,OAAQ,aACR,SAAU,eACV,SAAU,eAEV,SAAU,eACV,SAAU,eAEV,OAAQ,aACR,OAAQ,aAER,YAAa,kBACb,cAAe,oBACf,aAAc,mBACd,eAAgB,qBAChB,UAAW,gBAEX,iBAAkB,uBAClB,oBAAqB,2BACrB,oBAAqB,2BAErB,IAAK,UACL,IAAK,UACL,MAAO,WACP,OAAQ,aACR,OAAQ,YACV,CACF,EACA,gBAAiB,CACf,MAAO,QACT,CACF,CAAC,EAYKE,EAAQL,EAAM,WAAqC,CAACM,EAAOC,IAAiB,CAChF,KAAM,CAAE,SAAAC,EAAU,MAAAC,EAAQ,SAAU,UAAAC,EAAW,GAAGC,CAAW,EAAIL,EACjE,OACEP,EAACE,EAAA,CACE,GAAGU,EACJ,IAAKJ,EACL,UAAWL,EACTE,EAAc,CACZ,MAAAK,CACF,CAAC,EACDC,CACF,EAEC,SAAAF,EACH,CAEJ,CAAC,EACDH,EAAM,YAAc",
|
|
6
6
|
"names": ["jsx", "React", "Slot", "cn", "cva", "colorVariants", "Color", "props", "forwardedRef", "children", "color", "className", "colorProps"]
|
|
7
7
|
}
|
|
@@ -10,6 +10,11 @@ type ContainerProps = {
|
|
|
10
10
|
spaceBottom?: SpaceBottom;
|
|
11
11
|
mode?: Mode;
|
|
12
12
|
} & React.ComponentPropsWithoutRef<'div'>;
|
|
13
|
+
/**
|
|
14
|
+
* Container - 容器
|
|
15
|
+
*
|
|
16
|
+
* @description 页面布局容器组件,提供响应式间距和最大宽度限制,支持不同模式和间距配置
|
|
17
|
+
*/
|
|
13
18
|
declare const Container: React.ForwardRefExoticComponent<{
|
|
14
19
|
asChild?: boolean | undefined;
|
|
15
20
|
children?: React.ReactNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as u,jsx as
|
|
1
|
+
import{Fragment as u,jsx as t}from"react/jsx-runtime";import m from"react";import{cn as i}from"../helpers/utils.js";import{Slot as b}from"@radix-ui/react-slot";const g=({children:e})=>t(u,{children:e}),h=m.forwardRef(({...e},o)=>{const{asChild:p,children:n,className:s,childClassName:a,spaceY:c="none",spaceTop:r="none",spaceBottom:l="none",...x}=e,f=p?b:"div",C={default:"tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]",none:""},y={default:"tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",none:""},R={default:"tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]",none:""};return t(f,{...x,ref:o,className:i(s,"ipc_container","relative z-10 w-full bg-white"),children:t("div",{className:i("lg-desktop:max-w-full mx-auto size-full","tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4",a,C?.[c]||c,y?.[r]||r,R?.[l]||l),children:n})})}),d=m.forwardRef(({...e},o)=>{const{children:p,mode:n="section"}=e,a={section:h,fragment:g}[n];return t(a,{...e,ref:o,children:p})});d.displayName="Container";export{d as Container};
|
|
2
2
|
//# sourceMappingURL=container.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/container.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\nimport { cn } from '../helpers/utils.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { Mode, SpaceY, SpaceTop, SpaceBottom } from '../types/props.js'\n\ntype ContainerElement = React.ElementRef<'div'>\ntype ContainerProps = {\n asChild?: boolean\n children?: React.ReactNode\n className?: string\n childClassName?: string\n spaceY?: SpaceY\n spaceTop?: SpaceTop\n spaceBottom?: SpaceBottom\n mode?: Mode\n} & React.ComponentPropsWithoutRef<'div'>\n\nconst Fragment = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\nconst Section = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n childClassName,\n spaceY = 'none',\n spaceTop = 'none',\n spaceBottom = 'none',\n ...containerProps\n } = props\n\n const Comp = asChild ? Slot : 'div'\n\n const spaceY_map: any = {\n default: 'tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]',\n none: '',\n }\n\n const spaceTop_map: any = {\n default: 'tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]',\n none: '',\n }\n\n const spaceBottom_map: any = {\n default: 'tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]',\n none: '',\n }\n\n return (\n <Comp\n {...containerProps}\n ref={forwardedRef}\n className={cn(className, 'ipc_container', 'relative z-10 w-full
|
|
5
|
-
"mappings": "AAkBS,mBAAAA,EAAA,OAAAC,MAAA,oBAlBT,OAAOC,MAAW,QAClB,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBAerB,MAAMJ,EAAW,CAAC,CAAE,SAAAK,CAAS,IACpBJ,EAAAD,EAAA,CAAG,SAAAK,EAAS,EAGfC,EAAUJ,EAAM,WAA6C,CAAC,CAAE,GAAGK,CAAM,EAAGC,IAAiB,CACjG,KAAM,CACJ,QAAAC,EACA,SAAAJ,EACA,UAAAK,EACA,eAAAC,EACA,OAAAC,EAAS,OACT,SAAAC,EAAW,OACX,YAAAC,EAAc,OACd,GAAGC,CACL,EAAIR,EAEES,EAAOP,EAAUL,EAAO,MAExBa,EAAkB,CACtB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAoB,CACxB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAuB,CAC3B,QAAS,uFACT,KAAM,EACR,EAEA,OACElB,EAACe,EAAA,CACE,GAAGD,EACJ,IAAKP,EACL,UAAWL,EAAGO,EAAW,gBAAiB,+
|
|
4
|
+
"sourcesContent": ["import React from 'react'\nimport { cn } from '../helpers/utils.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { Mode, SpaceY, SpaceTop, SpaceBottom } from '../types/props.js'\n\ntype ContainerElement = React.ElementRef<'div'>\ntype ContainerProps = {\n asChild?: boolean\n children?: React.ReactNode\n className?: string\n childClassName?: string\n spaceY?: SpaceY\n spaceTop?: SpaceTop\n spaceBottom?: SpaceBottom\n mode?: Mode\n} & React.ComponentPropsWithoutRef<'div'>\n\nconst Fragment = ({ children }: { children: React.ReactNode }) => {\n return <>{children}</>\n}\n\nconst Section = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const {\n asChild,\n children,\n className,\n childClassName,\n spaceY = 'none',\n spaceTop = 'none',\n spaceBottom = 'none',\n ...containerProps\n } = props\n\n const Comp = asChild ? Slot : 'div'\n\n const spaceY_map: any = {\n default: 'tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]',\n none: '',\n }\n\n const spaceTop_map: any = {\n default: 'tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]',\n none: '',\n }\n\n const spaceBottom_map: any = {\n default: 'tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]',\n none: '',\n }\n\n return (\n <Comp\n {...containerProps}\n ref={forwardedRef}\n className={cn(className, 'ipc_container', 'relative z-10 w-full bg-white')}\n >\n <div\n className={cn(\n 'lg-desktop:max-w-full mx-auto size-full',\n 'tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4',\n childClassName,\n spaceY_map?.[spaceY] || spaceY,\n spaceTop_map?.[spaceTop] || spaceTop,\n spaceBottom_map?.[spaceBottom] || spaceBottom\n )}\n >\n {children}\n </div>\n </Comp>\n )\n})\n\n/**\n * Container - \u5BB9\u5668\n *\n * @description \u9875\u9762\u5E03\u5C40\u5BB9\u5668\u7EC4\u4EF6\uFF0C\u63D0\u4F9B\u54CD\u5E94\u5F0F\u95F4\u8DDD\u548C\u6700\u5927\u5BBD\u5EA6\u9650\u5236\uFF0C\u652F\u6301\u4E0D\u540C\u6A21\u5F0F\u548C\u95F4\u8DDD\u914D\u7F6E\n */\nconst Container = React.forwardRef<ContainerElement, ContainerProps>(({ ...props }, forwardedRef) => {\n const { children, mode = 'section' } = props\n\n const componentsMap: {\n [P in Mode]: React.ComponentType<any> | string\n } = {\n section: Section,\n fragment: Fragment,\n }\n\n const Component = componentsMap![mode!]\n\n return (\n <Component {...props} ref={forwardedRef}>\n {children}\n </Component>\n )\n})\n\nContainer.displayName = 'Container'\n\nexport { Container }\nexport type { ContainerProps }\n"],
|
|
5
|
+
"mappings": "AAkBS,mBAAAA,EAAA,OAAAC,MAAA,oBAlBT,OAAOC,MAAW,QAClB,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBAerB,MAAMJ,EAAW,CAAC,CAAE,SAAAK,CAAS,IACpBJ,EAAAD,EAAA,CAAG,SAAAK,EAAS,EAGfC,EAAUJ,EAAM,WAA6C,CAAC,CAAE,GAAGK,CAAM,EAAGC,IAAiB,CACjG,KAAM,CACJ,QAAAC,EACA,SAAAJ,EACA,UAAAK,EACA,eAAAC,EACA,OAAAC,EAAS,OACT,SAAAC,EAAW,OACX,YAAAC,EAAc,OACd,GAAGC,CACL,EAAIR,EAEES,EAAOP,EAAUL,EAAO,MAExBa,EAAkB,CACtB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAoB,CACxB,QAAS,uFACT,KAAM,EACR,EAEMC,EAAuB,CAC3B,QAAS,uFACT,KAAM,EACR,EAEA,OACElB,EAACe,EAAA,CACE,GAAGD,EACJ,IAAKP,EACL,UAAWL,EAAGO,EAAW,gBAAiB,+BAA+B,EAEzE,SAAAT,EAAC,OACC,UAAWE,EACT,0CACA,8EACAQ,EACAM,IAAaL,CAAM,GAAKA,EACxBM,IAAeL,CAAQ,GAAKA,EAC5BM,IAAkBL,CAAW,GAAKA,CACpC,EAEC,SAAAT,EACH,EACF,CAEJ,CAAC,EAOKe,EAAYlB,EAAM,WAA6C,CAAC,CAAE,GAAGK,CAAM,EAAGC,IAAiB,CACnG,KAAM,CAAE,SAAAH,EAAU,KAAAgB,EAAO,SAAU,EAAId,EASjCe,EALF,CACF,QAAShB,EACT,SAAUN,CACZ,EAEiCqB,CAAK,EAEtC,OACEpB,EAACqB,EAAA,CAAW,GAAGf,EAAO,IAAKC,EACxB,SAAAH,EACH,CAEJ,CAAC,EAEDe,EAAU,YAAc",
|
|
6
6
|
"names": ["Fragment", "jsx", "React", "cn", "Slot", "children", "Section", "props", "forwardedRef", "asChild", "className", "childClassName", "spaceY", "spaceTop", "spaceBottom", "containerProps", "Comp", "spaceY_map", "spaceTop_map", "spaceBottom_map", "Container", "mode", "Component"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
interface GridProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
interface GridItemProps {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
11
|
+
start?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
12
|
+
end?: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Grid - 网格布局
|
|
16
|
+
*
|
|
17
|
+
* @description 基于CSS Grid的12列网格布局容器组件,提供灵活的响应式布局方案
|
|
18
|
+
*/
|
|
19
|
+
declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const GridItem: React.ForwardRefExoticComponent<GridItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export { Grid, GridItem };
|
|
22
|
+
export type { GridProps, GridItemProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import a from"react";import{cn as l}from"../helpers/utils.js";const i={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},m={1:"col-start-1",2:"col-start-2",3:"col-start-3",4:"col-start-4",5:"col-start-5",6:"col-start-6",7:"col-start-7",8:"col-start-8",9:"col-start-9",10:"col-start-10",11:"col-start-11",12:"col-start-12"},f={2:"col-end-2",3:"col-end-3",4:"col-end-4",5:"col-end-5",6:"col-end-6",7:"col-end-7",8:"col-end-8",9:"col-end-9",10:"col-end-10",11:"col-end-11",12:"col-end-12",13:"col-end-13"},r=a.forwardRef(({className:o,children:s},c)=>d("div",{ref:c,className:l("laptop:gap-4 grid grid-cols-12 gap-3",o),children:s}));r.displayName="Grid";const n=a.forwardRef(({className:o,children:s,span:c=12,start:t,end:e},p)=>d("div",{ref:p,className:l(i[c],t&&m[t],e&&f[e],o),children:s}));n.displayName="GridItem";export{r as Grid,n as GridItem};
|
|
2
|
+
//# sourceMappingURL=grid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/grid.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react'\nimport type { ReactNode } from 'react'\nimport { cn } from '../helpers/utils.js'\n\ntype Element = React.ElementRef<'div'>\n\ninterface GridProps {\n children?: ReactNode\n className?: string\n}\n\ninterface GridItemProps {\n children?: ReactNode\n className?: string\n span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 // \u9650\u5236\u4E3A\u5177\u4F53\u7684\u6570\u5B57\u7C7B\u578B\n start?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 // \u8D77\u59CB\u5217\u4F4D\u7F6E\n end?: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 // \u7ED3\u675F\u5217\u4F4D\u7F6E\n}\n\nconst colSpanClasses = {\n 1: 'col-span-1',\n 2: 'col-span-2',\n 3: 'col-span-3',\n 4: 'col-span-4',\n 5: 'col-span-5',\n 6: 'col-span-6',\n 7: 'col-span-7',\n 8: 'col-span-8',\n 9: 'col-span-9',\n 10: 'col-span-10',\n 11: 'col-span-11',\n 12: 'col-span-12',\n} as const\n\nconst colStartClasses = {\n 1: 'col-start-1',\n 2: 'col-start-2',\n 3: 'col-start-3',\n 4: 'col-start-4',\n 5: 'col-start-5',\n 6: 'col-start-6',\n 7: 'col-start-7',\n 8: 'col-start-8',\n 9: 'col-start-9',\n 10: 'col-start-10',\n 11: 'col-start-11',\n 12: 'col-start-12',\n} as const\n\nconst colEndClasses = {\n 2: 'col-end-2',\n 3: 'col-end-3',\n 4: 'col-end-4',\n 5: 'col-end-5',\n 6: 'col-end-6',\n 7: 'col-end-7',\n 8: 'col-end-8',\n 9: 'col-end-9',\n 10: 'col-end-10',\n 11: 'col-end-11',\n 12: 'col-end-12',\n 13: 'col-end-13',\n} as const\n\n/**\n * Grid - \u7F51\u683C\u5E03\u5C40\n *\n * @description \u57FA\u4E8ECSS Grid\u768412\u5217\u7F51\u683C\u5E03\u5C40\u5BB9\u5668\u7EC4\u4EF6\uFF0C\u63D0\u4F9B\u7075\u6D3B\u7684\u54CD\u5E94\u5F0F\u5E03\u5C40\u65B9\u6848\n */\nconst Grid = React.forwardRef<Element, GridProps>(({ className, children }, forwardedRef) => {\n return (\n <div ref={forwardedRef} className={cn('laptop:gap-4 grid grid-cols-12 gap-3', className)}>\n {children}\n </div>\n )\n})\nGrid.displayName = 'Grid'\n\nconst GridItem = React.forwardRef<Element, GridItemProps>(\n ({ className, children, span = 12, start, end }, forwardedRef) => {\n return (\n <div\n ref={forwardedRef}\n className={cn(colSpanClasses[span], start && colStartClasses[start], end && colEndClasses[end], className)}\n >\n {children}\n </div>\n )\n }\n)\nGridItem.displayName = 'GridItem'\n\nexport { Grid, GridItem }\nexport type { GridProps, GridItemProps }\n"],
|
|
5
|
+
"mappings": "AAuEI,cAAAA,MAAA,oBAvEJ,OAAOC,MAAW,QAElB,OAAS,MAAAC,MAAU,sBAiBnB,MAAMC,EAAiB,CACrB,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,GAAI,cACJ,GAAI,cACJ,GAAI,aACN,EAEMC,EAAkB,CACtB,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,GAAI,eACJ,GAAI,eACJ,GAAI,cACN,EAEMC,EAAgB,CACpB,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,GAAI,aACJ,GAAI,aACJ,GAAI,aACJ,GAAI,YACN,EAOMC,EAAOL,EAAM,WAA+B,CAAC,CAAE,UAAAM,EAAW,SAAAC,CAAS,EAAGC,IAExET,EAAC,OAAI,IAAKS,EAAc,UAAWP,EAAG,uCAAwCK,CAAS,EACpF,SAAAC,EACH,CAEH,EACDF,EAAK,YAAc,OAEnB,MAAMI,EAAWT,EAAM,WACrB,CAAC,CAAE,UAAAM,EAAW,SAAAC,EAAU,KAAAG,EAAO,GAAI,MAAAC,EAAO,IAAAC,CAAI,EAAGJ,IAE7CT,EAAC,OACC,IAAKS,EACL,UAAWP,EAAGC,EAAeQ,CAAI,EAAGC,GAASR,EAAgBQ,CAAK,EAAGC,GAAOR,EAAcQ,CAAG,EAAGN,CAAS,EAExG,SAAAC,EACH,CAGN,EACAE,EAAS,YAAc",
|
|
6
|
+
"names": ["jsx", "React", "cn", "colSpanClasses", "colStartClasses", "colEndClasses", "Grid", "className", "children", "forwardedRef", "GridItem", "span", "start", "end"]
|
|
7
|
+
}
|
|
@@ -13,6 +13,11 @@ interface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProp
|
|
|
13
13
|
color?: string;
|
|
14
14
|
html?: string | SerializedEditorState<SerializedLexicalNode>;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Heading - 标题
|
|
18
|
+
*
|
|
19
|
+
* @description 用于显示各级标题的组件,支持响应式尺寸、字重、对齐方式和自定义颜色
|
|
20
|
+
*/
|
|
16
21
|
declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
17
22
|
export { Heading };
|
|
18
23
|
export type { HeadingProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/heading.tsx"],
|
|
4
|
-
"sourcesContent": ["import { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport React from 'react'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nconst headingVariants = cva('text-balance leading-tight tracking-[-0.04em]', {\n variants: {\n size: {\n none: 'tracking-[-0.04em]',\n 1: 'lg-desktop:text-[16px] text-[14px] leading-[120%]',\n 2: 'lg-desktop:text-[24px] text-[20px] leading-[120%]',\n 3: 'desktop:text-[32px] text-[24px] leading-[120%]',\n 4: 'desktop:text-[40px] lg-desktop:text-[48px] text-[32px] leading-[100%]',\n 5: 'desktop:text-[56px] lg-desktop:text-[64px] text-[40px] leading-[100%]',\n },\n weight: {\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extraBold: 'font-extrabold',\n black: 'font-black',\n },\n align: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n colorVariant: {\n primary: 'text-info-primary',\n secondary: 'text-info-secondary',\n tertiary: 'text-info-tertiary',\n white: 'text-info-white',\n },\n },\n defaultVariants: {\n size: 'none',\n weight: 'bold',\n colorVariant: 'primary',\n },\n})\n\ntype HeadingElement = React.ElementRef<'h1'>\n\ninterface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProps<typeof headingVariants> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n asChild?: boolean\n color?: string\n html?: string | SerializedEditorState<SerializedLexicalNode>\n}\n\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>((props, forwardedRef) => {\n const {\n children,\n className,\n size = 'none', // \u4E3A\u4E86\u517C\u5BB9\u65E7\u7248\u672C\u6837\u5F0F\uFF0C\u9ED8\u8BA4\u503C\u4E3A none\uFF0C\u6CA1\u6709\u9ED8\u8BA4\u7684\u5B57\u4F53\u5927\u5C0F\n align,\n weight,\n colorVariant,\n asChild,\n as: Tag = 'h2',\n color,\n html,\n ...headingProps\n } = props\n\n const htmlContentProps = html\n ? {\n dangerouslySetInnerHTML: { __html: typeof html === 'string' ? html : convertLexicalToHTML({ data: html }) },\n }\n : null\n\n const styleProps = color\n ? {\n style: {\n color,\n },\n }\n : null\n return (\n <Slot\n {...headingProps}\n ref={forwardedRef}\n className={cn(\n headingVariants({\n size,\n weight,\n align,\n colorVariant,\n }),\n className\n )}\n {...htmlContentProps}\n {...styleProps}\n >\n {asChild ? children : <Tag>{htmlContentProps ? null : children}</Tag>}\n </Slot>\n )\n})\n\nHeading.displayName = 'Heading'\n\nexport { Heading }\nexport type { HeadingProps }\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport React from 'react'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nconst headingVariants = cva('text-balance leading-tight tracking-[-0.04em]', {\n variants: {\n size: {\n none: 'tracking-[-0.04em]',\n 1: 'lg-desktop:text-[16px] text-[14px] leading-[120%]',\n 2: 'lg-desktop:text-[24px] text-[20px] leading-[120%]',\n 3: 'desktop:text-[32px] text-[24px] leading-[120%]',\n 4: 'desktop:text-[40px] lg-desktop:text-[48px] text-[32px] leading-[100%]',\n 5: 'desktop:text-[56px] lg-desktop:text-[64px] text-[40px] leading-[100%]',\n },\n weight: {\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extraBold: 'font-extrabold',\n black: 'font-black',\n },\n align: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n colorVariant: {\n primary: 'text-info-primary',\n secondary: 'text-info-secondary',\n tertiary: 'text-info-tertiary',\n white: 'text-info-white',\n },\n },\n defaultVariants: {\n size: 'none',\n weight: 'bold',\n colorVariant: 'primary',\n },\n})\n\ntype HeadingElement = React.ElementRef<'h1'>\n\ninterface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProps<typeof headingVariants> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n asChild?: boolean\n color?: string\n html?: string | SerializedEditorState<SerializedLexicalNode>\n}\n\n/**\n * Heading - \u6807\u9898\n *\n * @description \u7528\u4E8E\u663E\u793A\u5404\u7EA7\u6807\u9898\u7684\u7EC4\u4EF6\uFF0C\u652F\u6301\u54CD\u5E94\u5F0F\u5C3A\u5BF8\u3001\u5B57\u91CD\u3001\u5BF9\u9F50\u65B9\u5F0F\u548C\u81EA\u5B9A\u4E49\u989C\u8272\n */\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>((props, forwardedRef) => {\n const {\n children,\n className,\n size = 'none', // \u4E3A\u4E86\u517C\u5BB9\u65E7\u7248\u672C\u6837\u5F0F\uFF0C\u9ED8\u8BA4\u503C\u4E3A none\uFF0C\u6CA1\u6709\u9ED8\u8BA4\u7684\u5B57\u4F53\u5927\u5C0F\n align,\n weight,\n colorVariant,\n asChild,\n as: Tag = 'h2',\n color,\n html,\n ...headingProps\n } = props\n\n const htmlContentProps = html\n ? {\n dangerouslySetInnerHTML: { __html: typeof html === 'string' ? html : convertLexicalToHTML({ data: html }) },\n }\n : null\n\n const styleProps = color\n ? {\n style: {\n color,\n },\n }\n : null\n return (\n <Slot\n {...headingProps}\n ref={forwardedRef}\n className={cn(\n headingVariants({\n size,\n weight,\n align,\n colorVariant,\n }),\n className\n )}\n {...htmlContentProps}\n {...styleProps}\n >\n {asChild ? children : <Tag>{htmlContentProps ? null : children}</Tag>}\n </Slot>\n )\n})\n\nHeading.displayName = 'Heading'\n\nexport { Heading }\nexport type { HeadingProps }\n"],
|
|
5
|
+
"mappings": "AAqG4B,cAAAA,MAAA,oBArG5B,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BACvC,OAAOC,MAAW,QAClB,OAAS,wBAAAC,MAA4B,oCAGrC,MAAMC,EAAkBH,EAAI,gDAAiD,CAC3E,SAAU,CACR,KAAM,CACJ,KAAM,qBACN,EAAG,oDACH,EAAG,oDACH,EAAG,iDACH,EAAG,wEACH,EAAG,uEACL,EACA,OAAQ,CACN,OAAQ,cACR,SAAU,gBACV,KAAM,YACN,UAAW,iBACX,MAAO,YACT,EACA,MAAO,CACL,KAAM,YACN,OAAQ,cACR,MAAO,YACT,EACA,aAAc,CACZ,QAAS,oBACT,UAAW,sBACX,SAAU,qBACV,MAAO,iBACT,CACF,EACA,gBAAiB,CACf,KAAM,OACN,OAAQ,OACR,aAAc,SAChB,CACF,CAAC,EAgBKI,EAAUH,EAAM,WAAyC,CAACI,EAAOC,IAAiB,CACtF,KAAM,CACJ,SAAAC,EACA,UAAAC,EACA,KAAAC,EAAO,OACP,MAAAC,EACA,OAAAC,EACA,aAAAC,EACA,QAAAC,EACA,GAAIC,EAAM,KACV,MAAAC,EACA,KAAAC,EACA,GAAGC,CACL,EAAIZ,EAEEa,EAAmBF,EACrB,CACE,wBAAyB,CAAE,OAAQ,OAAOA,GAAS,SAAWA,EAAOd,EAAqB,CAAE,KAAMc,CAAK,CAAC,CAAE,CAC5G,EACA,KAEEG,EAAaJ,EACf,CACE,MAAO,CACL,MAAAA,CACF,CACF,EACA,KACJ,OACElB,EAACE,EAAA,CACE,GAAGkB,EACJ,IAAKX,EACL,UAAWR,EACTK,EAAgB,CACd,KAAAM,EACA,OAAAE,EACA,MAAAD,EACA,aAAAE,CACF,CAAC,EACDJ,CACF,EACC,GAAGU,EACH,GAAGC,EAEH,SAAAN,EAAUN,EAAWV,EAACiB,EAAA,CAAK,SAAAI,EAAmB,KAAOX,EAAS,EACjE,CAEJ,CAAC,EAEDH,EAAQ,YAAc",
|
|
6
6
|
"names": ["jsx", "cn", "Slot", "cva", "React", "convertLexicalToHTML", "headingVariants", "Heading", "props", "forwardedRef", "children", "className", "size", "align", "weight", "colorVariant", "asChild", "Tag", "color", "html", "headingProps", "htmlContentProps", "styleProps"]
|
|
7
7
|
}
|
|
@@ -7,7 +7,7 @@ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, Dialog
|
|
|
7
7
|
export { Popover, PopoverTrigger, PopoverContent } from './popover.js';
|
|
8
8
|
export { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js';
|
|
9
9
|
export { Text, type TextProps } from './text.js';
|
|
10
|
-
export { Grid, GridItem, type GridProps, type GridItemProps } from './
|
|
10
|
+
export { Grid, GridItem, type GridProps, type GridItemProps } from './grid.js';
|
|
11
11
|
export { Heading, type HeadingProps } from './heading.js';
|
|
12
12
|
export { Container, type ContainerProps } from './container.js';
|
|
13
13
|
export { Color, type ColorProps } from './color.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{default as e}from"./button.js";import{default as a}from"./badge.js";import{Input as n,InputSlot as u}from"./input.js";import{default as i}from"./checkbox.js";import{default as s}from"./skeleton.js";import{Dialog as m,DialogPortal as f,DialogOverlay as x,DialogClose as C,DialogTrigger as g,DialogContent as w,DialogHeader as P,DialogFooter as T,DialogTitle as M,DialogDescription as y}from"./dialog.js";import{Popover as I,PopoverTrigger as c,PopoverContent as G}from"./popover.js";import{RadioGroup as A,RadioGroupItem as S}from"./radio.js";import{Text as R}from"./text.js";import{Grid as L,GridItem as h}from"./
|
|
1
|
+
import{default as e}from"./button.js";import{default as a}from"./badge.js";import{Input as n,InputSlot as u}from"./input.js";import{default as i}from"./checkbox.js";import{default as s}from"./skeleton.js";import{Dialog as m,DialogPortal as f,DialogOverlay as x,DialogClose as C,DialogTrigger as g,DialogContent as w,DialogHeader as P,DialogFooter as T,DialogTitle as M,DialogDescription as y}from"./dialog.js";import{Popover as I,PopoverTrigger as c,PopoverContent as G}from"./popover.js";import{RadioGroup as A,RadioGroupItem as S}from"./radio.js";import{Text as R}from"./text.js";import{Grid as L,GridItem as h}from"./grid.js";import{Heading as B}from"./heading.js";import{Container as E}from"./container.js";import{Color as j}from"./color.js";import{Drawer as z,DrawerPortal as J,DrawerOverlay as K,DrawerTrigger as Q,DrawerClose as U,DrawerContent as V,DrawerHeader as W,DrawerFooter as X,DrawerTitle as Y,DrawerDescription as Z}from"./drawer.js";import{default as $}from"./link.js";import{Avatar as or,AvatarImage as er,AvatarFallback as tr}from"./avatar.js";import{default as pr}from"./input-number.js";import{DropdownMenu as ur,DropdownMenuTrigger as dr,DropdownMenuContent as ir,DropdownMenuItem as lr,DropdownMenuCheckboxItem as sr,DropdownMenuRadioItem as Dr,DropdownMenuLabel as mr,DropdownMenuSeparator as fr,DropdownMenuShortcut as xr,DropdownMenuGroup as Cr,DropdownMenuPortal as gr,DropdownMenuSub as wr,DropdownMenuSubContent as Pr,DropdownMenuSubTrigger as Tr,DropdownMenuRadioGroup as Mr}from"./drop-down.js";import{Card as br,CardHeader as Ir,CardFooter as cr,CardTitle as Gr,CardDescription as vr,CardContent as Ar}from"./card.js";import{Carousel as kr,CarouselContent as Rr,CarouselItem as Hr,CarouselPrevious as Lr,CarouselNext as hr}from"./carousel.js";import{Tabs as Br,TabsList as Nr,TabsTrigger as Er,TabsContent as Or}from"./tabs.js";import{Alert as qr,AlertTitle as zr,AlertDescription as Jr}from"./alert.js";import{default as Qr}from"./picture.js";import{default as Vr}from"./theme.js";import{default as Xr}from"./board.js";import{default as Zr}from"./loadingDots.js";import{ExposureDetector as $r}from"./ExposureDetector.js";export{qr as Alert,Jr as AlertDescription,zr as AlertTitle,or as Avatar,tr as AvatarFallback,er as AvatarImage,a as Badge,Xr as Board,e as Button,br as Card,Ar as CardContent,vr as CardDescription,cr as CardFooter,Ir as CardHeader,Gr as CardTitle,kr as Carousel,Rr as CarouselContent,Hr as CarouselItem,hr as CarouselNext,Lr as CarouselPrevious,i as Checkbox,j as Color,E as Container,m as Dialog,C as DialogClose,w as DialogContent,y as DialogDescription,T as DialogFooter,P as DialogHeader,x as DialogOverlay,f as DialogPortal,M as DialogTitle,g as DialogTrigger,z as Drawer,U as DrawerClose,V as DrawerContent,Z as DrawerDescription,X as DrawerFooter,W as DrawerHeader,K as DrawerOverlay,J as DrawerPortal,Y as DrawerTitle,Q as DrawerTrigger,ur as DropdownMenu,sr as DropdownMenuCheckboxItem,ir as DropdownMenuContent,Cr as DropdownMenuGroup,lr as DropdownMenuItem,mr as DropdownMenuLabel,gr as DropdownMenuPortal,Mr as DropdownMenuRadioGroup,Dr as DropdownMenuRadioItem,fr as DropdownMenuSeparator,xr as DropdownMenuShortcut,wr as DropdownMenuSub,Pr as DropdownMenuSubContent,Tr as DropdownMenuSubTrigger,dr as DropdownMenuTrigger,$r as ExposureDetector,L as Grid,h as GridItem,B as Heading,n as Input,pr as InputNumber,u as InputSlot,$ as Link,Zr as LoadingDots,Qr as Picture,I as Popover,G as PopoverContent,c as PopoverTrigger,A as RadioGroup,S as RadioGroupItem,s as Skeleton,Br as Tabs,Or as TabsContent,Nr as TabsList,Er as TabsTrigger,R as Text,Vr as Theme};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport { Input, InputSlot } from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './dialog.js'\nexport { Popover, PopoverTrigger, PopoverContent } from './popover.js'\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js'\nexport { Text, type TextProps } from './text.js'\nexport { Grid, GridItem, type GridProps, type GridItemProps } from './
|
|
4
|
+
"sourcesContent": ["export { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport { Input, InputSlot } from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './dialog.js'\nexport { Popover, PopoverTrigger, PopoverContent } from './popover.js'\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js'\nexport { Text, type TextProps } from './text.js'\nexport { Grid, GridItem, type GridProps, type GridItemProps } from './grid.js'\nexport { Heading, type HeadingProps } from './heading.js'\nexport { Container, type ContainerProps } from './container.js'\nexport { Color, type ColorProps } from './color.js'\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n} from './drawer.js'\nexport { default as Link, type LinkProps } from './link.js'\nexport { Avatar, AvatarImage, AvatarFallback } from './avatar.js'\nexport { default as InputNumber, type InputNumberProps } from './input-number.js'\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './drop-down.js'\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card.js'\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n} from './carousel.js'\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs.js'\nexport { Alert, AlertTitle, AlertDescription } from './alert.js'\nexport { default as Picture } from './picture.js'\nexport { default as Theme } from './theme.js'\nexport { default as Board } from './board.js'\nexport { default as LoadingDots } from './loadingDots.js'\nexport { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js'\n"],
|
|
5
5
|
"mappings": "AAAA,OAAoB,WAAXA,MAAyB,cAClC,OAAoB,WAAXA,MAAwB,aACjC,OAAS,SAAAC,EAAO,aAAAC,MAAiB,aAEjC,OAAoB,WAAXF,MAA2B,gBAEpC,OAAoB,WAAXA,MAA2B,gBACpC,OACE,UAAAG,EACA,gBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,qBAAAC,MACK,cACP,OAAS,WAAAC,EAAS,kBAAAC,EAAgB,kBAAAC,MAAsB,eACxD,OAAS,cAAAC,EAAY,kBAAAC,MAAsE,aAC3F,OAAS,QAAAC,MAA4B,YACrC,OAAS,QAAAC,EAAM,YAAAC,MAAoD,YACnE,OAAS,WAAAC,MAAkC,eAC3C,OAAS,aAAAC,MAAsC,iBAC/C,OAAS,SAAAC,MAA8B,aACvC,OACE,UAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,qBAAAC,MACK,cACP,OAAoB,WAAXjC,MAAuC,YAChD,OAAS,UAAAkC,GAAQ,eAAAC,GAAa,kBAAAC,OAAsB,cACpD,OAAoB,WAAXpC,OAAqD,oBAC9D,OACE,gBAAAqC,GACA,uBAAAC,GACA,uBAAAC,GACA,oBAAAC,GACA,4BAAAC,GACA,yBAAAC,GACA,qBAAAC,GACA,yBAAAC,GACA,wBAAAC,GACA,qBAAAC,GACA,sBAAAC,GACA,mBAAAC,GACA,0BAAAC,GACA,0BAAAC,GACA,0BAAAC,OACK,iBACP,OAAS,QAAAC,GAAM,cAAAC,GAAY,cAAAC,GAAY,aAAAC,GAAW,mBAAAC,GAAiB,eAAAC,OAAmB,YACtF,OAEE,YAAAC,GACA,mBAAAC,GACA,gBAAAC,GACA,oBAAAC,GACA,gBAAAC,OACK,gBACP,OAAS,QAAAC,GAAM,YAAAC,GAAU,eAAAC,GAAa,eAAAC,OAAmB,YACzD,OAAS,SAAAC,GAAO,cAAAC,GAAY,oBAAAC,OAAwB,aACpD,OAAoB,WAAXrE,OAA0B,eACnC,OAAoB,WAAXA,OAAwB,aACjC,OAAoB,WAAXA,OAAwB,aACjC,OAAoB,WAAXA,OAA8B,mBACvC,OAAS,oBAAAsE,OAAoD",
|
|
6
6
|
"names": ["default", "Input", "InputSlot", "Dialog", "DialogPortal", "DialogOverlay", "DialogClose", "DialogTrigger", "DialogContent", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription", "Popover", "PopoverTrigger", "PopoverContent", "RadioGroup", "RadioGroupItem", "Text", "Grid", "GridItem", "Heading", "Container", "Color", "Drawer", "DrawerPortal", "DrawerOverlay", "DrawerTrigger", "DrawerClose", "DrawerContent", "DrawerHeader", "DrawerFooter", "DrawerTitle", "DrawerDescription", "Avatar", "AvatarImage", "AvatarFallback", "DropdownMenu", "DropdownMenuTrigger", "DropdownMenuContent", "DropdownMenuItem", "DropdownMenuCheckboxItem", "DropdownMenuRadioItem", "DropdownMenuLabel", "DropdownMenuSeparator", "DropdownMenuShortcut", "DropdownMenuGroup", "DropdownMenuPortal", "DropdownMenuSub", "DropdownMenuSubContent", "DropdownMenuSubTrigger", "DropdownMenuRadioGroup", "Card", "CardHeader", "CardFooter", "CardTitle", "CardDescription", "CardContent", "Carousel", "CarouselContent", "CarouselItem", "CarouselPrevious", "CarouselNext", "Tabs", "TabsList", "TabsTrigger", "TabsContent", "Alert", "AlertTitle", "AlertDescription", "ExposureDetector"]
|
|
7
7
|
}
|
|
@@ -39,6 +39,11 @@ type InputNumberProps = {
|
|
|
39
39
|
/** 按下回车键时触发*/
|
|
40
40
|
onEnter?: (value: number, e: KeyboardEvent) => void;
|
|
41
41
|
} & VariantProps<typeof InputNumberVariants> & ComponentPropsWithout<'div', RemovedProps>;
|
|
42
|
+
/**
|
|
43
|
+
* InputNumber - 数字输入框
|
|
44
|
+
*
|
|
45
|
+
* @description 专用于数字输入的组件,支持步进调节、最值限制、状态提示和键盘操作
|
|
46
|
+
*/
|
|
42
47
|
declare const InputNumber: React.ForwardRefExoticComponent<{
|
|
43
48
|
/** 定义子组件作为父组件的类型,详细使用方式请参考radix-ui */
|
|
44
49
|
asChild?: boolean | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/input-number.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport { PlusIcon, MinusIcon } from '@radix-ui/react-icons'\nimport React, { useState, useEffect, forwardRef } from 'react'\nimport type { ChangeEvent, KeyboardEvent, FocusEvent } from 'react'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\n// \u5B9A\u4E49 InputNumber \u7684\u6837\u5F0F\u53D8\u4F53\nconst InputNumberVariants = cva('size-full border bg-transparent text-center text-base outline-none', {\n variants: {\n status: {\n default: 'border-lines-1 group-hover:border-lines-2',\n success: 'border-lines-3 group-hover:border-lines-3',\n warning: 'border-lines-4 group-hover:border-lines-4',\n error: 'border-lines-5 group-hover:border-lines-5',\n },\n disabled: {\n true: 'border-lines-1 group-hover:border-lines-1 text-info-quaternary cursor-not-allowed',\n },\n },\n})\n\ntype ColorType = 'default' | 'success' | 'warning' | 'error' | null\n\n// \u5B9A\u4E49\u7EC4\u4EF6\u7C7B\u578B\uFF0C\u7EE7\u627F div \u6807\u7B7E\u6807\u51C6\u5C5E\u6027\ntype InputNumberElement = React.ElementRef<'div'>\n\ntype InputNumberProps = {\n /** \u5B9A\u4E49\u5B50\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B,\u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n asChild?: boolean\n /** \u7C7B\u540D*/\n className?: string\n /** \u8F93\u5165\u6846\u4E0B\u65B9\u63D0\u793A\u6587\u672C\uFF0C\u4F1A\u6839\u636E\u4E0D\u540C\u7684 status \u5448\u73B0\u4E0D\u540C\u7684\u6837\u5F0F*/\n tips?: string\n /** \u6587\u672C\u6846\u72B6\u6001*/\n status?: ColorType\n /** \u6570\u5B57\u8F93\u5165\u6846\u7684\u503C */\n value?: number\n /** \u6570\u5B57\u8F93\u5165\u6846\u7684\u521D\u59CB\u503C */\n defaultValue?: number\n /** \u6570\u503C\u6539\u53D8\u6B65\u6570 */\n step?: number\n /** \u6700\u5C0F\u503C */\n min?: number\n /** \u6700\u5927\u503C */\n max?: number\n /** \u662F\u5426\u7981\u7528*/\n disabled?: boolean\n /** \u662F\u5426\u53EA\u8BFB*/\n readonly?: boolean\n /** \u6837\u5F0F*/\n style?: React.CSSProperties\n /** \u503C\u53D8\u5316\u65F6\u89E6\u53D1*/\n onChange?: (value: number) => void\n /** \u5931\u53BB\u7126\u70B9\u65F6\u89E6\u53D1*/\n onBlur?: (value: number, e: FocusEvent) => void\n /** \u6309\u4E0B\u56DE\u8F66\u952E\u65F6\u89E6\u53D1*/\n onEnter?: (value: number, e: KeyboardEvent) => void\n} & VariantProps<typeof InputNumberVariants> &\n ComponentPropsWithout<'div', RemovedProps>\n\nconst InputNumber = forwardRef<InputNumberElement, InputNumberProps>(\n (\n {\n value,\n defaultValue = 0,\n step = 1,\n min = 0,\n max,\n tips,\n style,\n children,\n asChild = false,\n disabled = false,\n readonly = false,\n status = 'default',\n className,\n onChange,\n onBlur,\n onEnter,\n },\n ref\n ) => {\n const [inputValue, setInputValue] = useState<number | string>(defaultValue)\n\n const Comp = asChild ? Slot : 'div'\n\n const baseClassName = cn('border-lines-1 flex size-12 items-center justify-center border text-base', {\n 'group-hover:border-lines-2': !disabled,\n 'text-info-quaternary cursor-not-allowed': disabled,\n })\n\n const textColor = (type: ColorType, flag: boolean) => {\n if (flag) return 'text-lines-1'\n return {\n default: 'text-lines-1',\n success: 'text-lines-3',\n warning: 'text-lines-4',\n error: 'text-lines-5',\n }[type || 'default']\n }\n\n const isValue = (params: string) => {\n return params === '' || /^[0-9]+$/.test(params)\n }\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (disabled || readonly) return\n const value = e.target.value\n // \u5141\u8BB8\u7A7A\u5B57\u7B26\u4E32\uFF0C\u6216\u4EC5\u5305\u542B\u6574\u6570\u7684\u5B57\u7B26\u4E32\n if (isValue(value)) {\n setInputValue(value)\n if (value !== '') {\n let newValue = Number(value)\n if (max !== undefined && newValue > max) {\n newValue = max\n }\n if (min !== undefined && newValue < min) {\n newValue = min\n }\n onChange?.(newValue)\n }\n }\n }\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n if (disabled || readonly) return\n if (inputValue === '' || isNaN(Number(inputValue))) {\n const newValue = min !== undefined ? min : 0\n setInputValue(newValue)\n onBlur?.(newValue, e)\n } else {\n const newValue = Number(inputValue)\n setInputValue(newValue)\n onBlur?.(newValue, e)\n }\n }\n\n const increment = () => {\n if (disabled || readonly) return\n let newValue = Number(inputValue) + (step ? Math.ceil(Number(step)) : 1)\n if (max !== undefined && newValue > max) {\n newValue = max\n }\n setInputValue(newValue)\n onChange?.(newValue)\n }\n\n const decrement = () => {\n if (disabled || readonly) return\n let newValue = Number(inputValue) - (step ? Math.ceil(Number(step)) : 1)\n if (min !== undefined && newValue < min) {\n newValue = min\n }\n setInputValue(newValue)\n onChange?.(newValue)\n }\n\n const handleKeyDown = (e: any) => {\n if (disabled || readonly) return\n if (e.key === 'Enter') {\n const initalValue = e.target?.value\n onEnter?.(initalValue, e)\n }\n }\n\n useEffect(() => {\n setInputValue(value || 0)\n }, [value])\n\n return (\n <Comp\n ref={ref}\n {...(style ? { style: style } : null)}\n className={cn({ 'group flex items-center': !asChild }, className)}\n >\n {asChild ? (\n children\n ) : (\n <>\n <button onClick={increment} className={baseClassName}>\n <PlusIcon />\n </button>\n <div className=\"relative mx-1.5 h-[52px] w-[105px]\">\n <input\n type=\"text\"\n value={inputValue}\n disabled={disabled}\n readOnly={readonly}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={handleInputChange}\n className={cn(InputNumberVariants({ status, disabled }))}\n />\n {tips ? (\n <span className={cn(textColor(status, disabled), 'absolute -bottom-4 left-0 w-full truncate text-xs')}>\n {tips}\n </span>\n ) : null}\n </div>\n <button onClick={decrement} className={baseClassName}>\n <MinusIcon />\n </button>\n </>\n )}\n </Comp>\n )\n }\n)\n\nInputNumber.displayName = 'InputNumber'\n\nexport default InputNumber\nexport type { InputNumberProps }\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport { PlusIcon, MinusIcon } from '@radix-ui/react-icons'\nimport React, { useState, useEffect, forwardRef } from 'react'\nimport type { ChangeEvent, KeyboardEvent, FocusEvent } from 'react'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\n// \u5B9A\u4E49 InputNumber \u7684\u6837\u5F0F\u53D8\u4F53\nconst InputNumberVariants = cva('size-full border bg-transparent text-center text-base outline-none', {\n variants: {\n status: {\n default: 'border-lines-1 group-hover:border-lines-2',\n success: 'border-lines-3 group-hover:border-lines-3',\n warning: 'border-lines-4 group-hover:border-lines-4',\n error: 'border-lines-5 group-hover:border-lines-5',\n },\n disabled: {\n true: 'border-lines-1 group-hover:border-lines-1 text-info-quaternary cursor-not-allowed',\n },\n },\n})\n\ntype ColorType = 'default' | 'success' | 'warning' | 'error' | null\n\n// \u5B9A\u4E49\u7EC4\u4EF6\u7C7B\u578B\uFF0C\u7EE7\u627F div \u6807\u7B7E\u6807\u51C6\u5C5E\u6027\ntype InputNumberElement = React.ElementRef<'div'>\n\ntype InputNumberProps = {\n /** \u5B9A\u4E49\u5B50\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B,\u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n asChild?: boolean\n /** \u7C7B\u540D*/\n className?: string\n /** \u8F93\u5165\u6846\u4E0B\u65B9\u63D0\u793A\u6587\u672C\uFF0C\u4F1A\u6839\u636E\u4E0D\u540C\u7684 status \u5448\u73B0\u4E0D\u540C\u7684\u6837\u5F0F*/\n tips?: string\n /** \u6587\u672C\u6846\u72B6\u6001*/\n status?: ColorType\n /** \u6570\u5B57\u8F93\u5165\u6846\u7684\u503C */\n value?: number\n /** \u6570\u5B57\u8F93\u5165\u6846\u7684\u521D\u59CB\u503C */\n defaultValue?: number\n /** \u6570\u503C\u6539\u53D8\u6B65\u6570 */\n step?: number\n /** \u6700\u5C0F\u503C */\n min?: number\n /** \u6700\u5927\u503C */\n max?: number\n /** \u662F\u5426\u7981\u7528*/\n disabled?: boolean\n /** \u662F\u5426\u53EA\u8BFB*/\n readonly?: boolean\n /** \u6837\u5F0F*/\n style?: React.CSSProperties\n /** \u503C\u53D8\u5316\u65F6\u89E6\u53D1*/\n onChange?: (value: number) => void\n /** \u5931\u53BB\u7126\u70B9\u65F6\u89E6\u53D1*/\n onBlur?: (value: number, e: FocusEvent) => void\n /** \u6309\u4E0B\u56DE\u8F66\u952E\u65F6\u89E6\u53D1*/\n onEnter?: (value: number, e: KeyboardEvent) => void\n} & VariantProps<typeof InputNumberVariants> &\n ComponentPropsWithout<'div', RemovedProps>\n\n/**\n * InputNumber - \u6570\u5B57\u8F93\u5165\u6846\n *\n * @description \u4E13\u7528\u4E8E\u6570\u5B57\u8F93\u5165\u7684\u7EC4\u4EF6\uFF0C\u652F\u6301\u6B65\u8FDB\u8C03\u8282\u3001\u6700\u503C\u9650\u5236\u3001\u72B6\u6001\u63D0\u793A\u548C\u952E\u76D8\u64CD\u4F5C\n */\nconst InputNumber = forwardRef<InputNumberElement, InputNumberProps>(\n (\n {\n value,\n defaultValue = 0,\n step = 1,\n min = 0,\n max,\n tips,\n style,\n children,\n asChild = false,\n disabled = false,\n readonly = false,\n status = 'default',\n className,\n onChange,\n onBlur,\n onEnter,\n },\n ref\n ) => {\n const [inputValue, setInputValue] = useState<number | string>(defaultValue)\n\n const Comp = asChild ? Slot : 'div'\n\n const baseClassName = cn('border-lines-1 flex size-12 items-center justify-center border text-base', {\n 'group-hover:border-lines-2': !disabled,\n 'text-info-quaternary cursor-not-allowed': disabled,\n })\n\n const textColor = (type: ColorType, flag: boolean) => {\n if (flag) return 'text-lines-1'\n return {\n default: 'text-lines-1',\n success: 'text-lines-3',\n warning: 'text-lines-4',\n error: 'text-lines-5',\n }[type || 'default']\n }\n\n const isValue = (params: string) => {\n return params === '' || /^[0-9]+$/.test(params)\n }\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (disabled || readonly) return\n const value = e.target.value\n // \u5141\u8BB8\u7A7A\u5B57\u7B26\u4E32\uFF0C\u6216\u4EC5\u5305\u542B\u6574\u6570\u7684\u5B57\u7B26\u4E32\n if (isValue(value)) {\n setInputValue(value)\n if (value !== '') {\n let newValue = Number(value)\n if (max !== undefined && newValue > max) {\n newValue = max\n }\n if (min !== undefined && newValue < min) {\n newValue = min\n }\n onChange?.(newValue)\n }\n }\n }\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n if (disabled || readonly) return\n if (inputValue === '' || isNaN(Number(inputValue))) {\n const newValue = min !== undefined ? min : 0\n setInputValue(newValue)\n onBlur?.(newValue, e)\n } else {\n const newValue = Number(inputValue)\n setInputValue(newValue)\n onBlur?.(newValue, e)\n }\n }\n\n const increment = () => {\n if (disabled || readonly) return\n let newValue = Number(inputValue) + (step ? Math.ceil(Number(step)) : 1)\n if (max !== undefined && newValue > max) {\n newValue = max\n }\n setInputValue(newValue)\n onChange?.(newValue)\n }\n\n const decrement = () => {\n if (disabled || readonly) return\n let newValue = Number(inputValue) - (step ? Math.ceil(Number(step)) : 1)\n if (min !== undefined && newValue < min) {\n newValue = min\n }\n setInputValue(newValue)\n onChange?.(newValue)\n }\n\n const handleKeyDown = (e: any) => {\n if (disabled || readonly) return\n if (e.key === 'Enter') {\n const initalValue = e.target?.value\n onEnter?.(initalValue, e)\n }\n }\n\n useEffect(() => {\n setInputValue(value || 0)\n }, [value])\n\n return (\n <Comp\n ref={ref}\n {...(style ? { style: style } : null)}\n className={cn({ 'group flex items-center': !asChild }, className)}\n >\n {asChild ? (\n children\n ) : (\n <>\n <button onClick={increment} className={baseClassName}>\n <PlusIcon />\n </button>\n <div className=\"relative mx-1.5 h-[52px] w-[105px]\">\n <input\n type=\"text\"\n value={inputValue}\n disabled={disabled}\n readOnly={readonly}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={handleInputChange}\n className={cn(InputNumberVariants({ status, disabled }))}\n />\n {tips ? (\n <span className={cn(textColor(status, disabled), 'absolute -bottom-4 left-0 w-full truncate text-xs')}>\n {tips}\n </span>\n ) : null}\n </div>\n <button onClick={decrement} className={baseClassName}>\n <MinusIcon />\n </button>\n </>\n )}\n </Comp>\n )\n }\n)\n\nInputNumber.displayName = 'InputNumber'\n\nexport default InputNumber\nexport type { InputNumberProps }\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "cn", "Slot", "PlusIcon", "MinusIcon", "useState", "useEffect", "forwardRef", "cva", "InputNumberVariants", "InputNumber", "value", "defaultValue", "step", "min", "max", "tips", "style", "children", "asChild", "disabled", "readonly", "status", "className", "onChange", "onBlur", "onEnter", "ref", "inputValue", "setInputValue", "Comp", "baseClassName", "textColor", "type", "flag", "isValue", "params", "handleInputChange", "newValue", "handleBlur", "increment", "decrement", "handleKeyDown", "initalValue", "input_number_default"]
|
|
7
7
|
}
|
|
@@ -18,5 +18,10 @@ interface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {
|
|
|
18
18
|
* 用来在 Input 组件中插入额外的内容,比如icon ,按钮
|
|
19
19
|
*/
|
|
20
20
|
declare const InputSlot: React.ForwardRefExoticComponent<InputSlotProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
/**
|
|
22
|
+
* Input - 输入框
|
|
23
|
+
*
|
|
24
|
+
* @description 文本输入组件,支持各种输入类型、不同尺寸和插槽功能
|
|
25
|
+
*/
|
|
21
26
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
22
27
|
export { Input, InputSlot };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/input.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst inputVariants = cva(\n 'border-input text-info-primary bg-background flex w-full flex-row items-center overflow-hidden rounded-md border focus-visible:outline-none',\n {\n variants: {\n size: {\n sm: 'h-8 text-sm',\n base: 'h-10',\n lg: 'h-12 text-lg',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\nexport interface InputProps extends ComponentPropsWithout<'input', 'size'>, VariantProps<typeof inputVariants> {}\n\ntype InputSlotElement = React.ElementRef<'div'>\ninterface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {\n /**\n * \u63D2\u69FD\u7684\u4F4D\u7F6E\n * default: right\n */\n side?: 'left' | 'right'\n}\n\n/**\n * InputSlot\n * \u7528\u6765\u5728 Input \u7EC4\u4EF6\u4E2D\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9\uFF0C\u6BD4\u5982icon \uFF0C\u6309\u94AE\n */\nconst InputSlot = React.forwardRef<InputSlotElement, InputSlotProps>((props, forwardedRef) => {\n const { className, side = 'right', children, ...slotProps } = props\n\n return (\n <div\n ref={forwardedRef}\n {...slotProps}\n className={cn('flex h-full items-center', className, {\n '-order-1': side === 'left',\n 'order-2': side === 'right',\n })}\n >\n {children}\n </div>\n )\n})\n\nconst Input = React.forwardRef<React.ElementRef<'input'>, InputProps>(\n ({ className, type, size, children, ...props }, ref) => {\n if (!React.isValidElement(children)) {\n return <input type={type} className={cn(inputVariants({ size }), 'px-3', className)} ref={ref} {...props} />\n }\n return (\n <div className={cn(inputVariants({ size }), className)}>\n <input\n type={type}\n className={cn(\n 'placeholder:text-muted-foreground flex size-full px-3 file:border-0 file:bg-transparent file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50'\n )}\n ref={ref}\n {...props}\n />\n {children}\n </div>\n )\n }\n)\nInput.displayName = 'Input'\nInputSlot.displayName = 'InputSlot'\n\nexport { Input, InputSlot }\n"],
|
|
5
|
-
"mappings": "aA0CI,cAAAA,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst inputVariants = cva(\n 'border-input text-info-primary bg-background flex w-full flex-row items-center overflow-hidden rounded-md border focus-visible:outline-none',\n {\n variants: {\n size: {\n sm: 'h-8 text-sm',\n base: 'h-10',\n lg: 'h-12 text-lg',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\nexport interface InputProps extends ComponentPropsWithout<'input', 'size'>, VariantProps<typeof inputVariants> {}\n\ntype InputSlotElement = React.ElementRef<'div'>\ninterface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {\n /**\n * \u63D2\u69FD\u7684\u4F4D\u7F6E\n * default: right\n */\n side?: 'left' | 'right'\n}\n\n/**\n * InputSlot\n * \u7528\u6765\u5728 Input \u7EC4\u4EF6\u4E2D\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9\uFF0C\u6BD4\u5982icon \uFF0C\u6309\u94AE\n */\nconst InputSlot = React.forwardRef<InputSlotElement, InputSlotProps>((props, forwardedRef) => {\n const { className, side = 'right', children, ...slotProps } = props\n\n return (\n <div\n ref={forwardedRef}\n {...slotProps}\n className={cn('flex h-full items-center', className, {\n '-order-1': side === 'left',\n 'order-2': side === 'right',\n })}\n >\n {children}\n </div>\n )\n})\n\n/**\n * Input - \u8F93\u5165\u6846\n *\n * @description \u6587\u672C\u8F93\u5165\u7EC4\u4EF6\uFF0C\u652F\u6301\u5404\u79CD\u8F93\u5165\u7C7B\u578B\u3001\u4E0D\u540C\u5C3A\u5BF8\u548C\u63D2\u69FD\u529F\u80FD\n */\nconst Input = React.forwardRef<React.ElementRef<'input'>, InputProps>(\n ({ className, type, size, children, ...props }, ref) => {\n if (!React.isValidElement(children)) {\n return <input type={type} className={cn(inputVariants({ size }), 'px-3', className)} ref={ref} {...props} />\n }\n return (\n <div className={cn(inputVariants({ size }), className)}>\n <input\n type={type}\n className={cn(\n 'placeholder:text-muted-foreground flex size-full px-3 file:border-0 file:bg-transparent file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50'\n )}\n ref={ref}\n {...props}\n />\n {children}\n </div>\n )\n }\n)\nInput.displayName = 'Input'\nInputSlot.displayName = 'InputSlot'\n\nexport { Input, InputSlot }\n"],
|
|
5
|
+
"mappings": "aA0CI,cAAAA,EAwBE,QAAAC,MAxBF,oBAxCJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBAEnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAgBD,EACpB,8IACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,KAAM,OACN,GAAI,cACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAiBME,EAAYJ,EAAM,WAA6C,CAACK,EAAOC,IAAiB,CAC5F,KAAM,CAAE,UAAAC,EAAW,KAAAC,EAAO,QAAS,SAAAC,EAAU,GAAGC,CAAU,EAAIL,EAE9D,OACEP,EAAC,OACC,IAAKQ,EACJ,GAAGI,EACJ,UAAWT,EAAG,2BAA4BM,EAAW,CACnD,WAAYC,IAAS,OACrB,UAAWA,IAAS,OACtB,CAAC,EAEA,SAAAC,EACH,CAEJ,CAAC,EAOKE,EAAQX,EAAM,WAClB,CAAC,CAAE,UAAAO,EAAW,KAAAK,EAAM,KAAAC,EAAM,SAAAJ,EAAU,GAAGJ,CAAM,EAAGS,IACzCd,EAAM,eAAeS,CAAQ,EAIhCV,EAAC,OAAI,UAAWE,EAAGE,EAAc,CAAE,KAAAU,CAAK,CAAC,EAAGN,CAAS,EACnD,UAAAT,EAAC,SACC,KAAMc,EACN,UAAWX,EACT,qLACF,EACA,IAAKa,EACJ,GAAGT,EACN,EACCI,GACH,EAbOX,EAAC,SAAM,KAAMc,EAAM,UAAWX,EAAGE,EAAc,CAAE,KAAAU,CAAK,CAAC,EAAG,OAAQN,CAAS,EAAG,IAAKO,EAAM,GAAGT,EAAO,CAgBhH,EACAM,EAAM,YAAc,QACpBP,EAAU,YAAc",
|
|
6
6
|
"names": ["jsx", "jsxs", "React", "cn", "cva", "inputVariants", "InputSlot", "props", "forwardedRef", "className", "side", "children", "slotProps", "Input", "type", "size", "ref"]
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
5
5
|
declare const linkVariants: (props?: ({
|
|
6
6
|
size?: "base" | "lg" | null | undefined;
|
|
7
|
-
variant?: "primary" | "
|
|
7
|
+
variant?: "primary" | "secondary" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
type LinkProps = {
|
|
10
10
|
/** 定义子组件作为父组件的类型,详细使用方式请参考radix-ui */
|
|
@@ -22,6 +22,11 @@ type LinkProps = {
|
|
|
22
22
|
/** 点击事件,禁用状态无法触发*/
|
|
23
23
|
onClick?: Function;
|
|
24
24
|
} & VariantProps<typeof linkVariants> & ComponentPropsWithout<'a', RemovedProps>;
|
|
25
|
+
/**
|
|
26
|
+
* Link - 链接
|
|
27
|
+
*
|
|
28
|
+
* @description 可点击的链接组件,支持不同尺寸、样式变体、禁用状态和后置图标
|
|
29
|
+
*/
|
|
25
30
|
declare const Link: React.ForwardRefExoticComponent<{
|
|
26
31
|
/** 定义子组件作为父组件的类型,详细使用方式请参考radix-ui */
|
|
27
32
|
asChild?: boolean | undefined;
|
|
@@ -39,7 +44,7 @@ declare const Link: React.ForwardRefExoticComponent<{
|
|
|
39
44
|
onClick?: Function | undefined;
|
|
40
45
|
} & VariantProps<(props?: ({
|
|
41
46
|
size?: "base" | "lg" | null | undefined;
|
|
42
|
-
variant?: "primary" | "
|
|
47
|
+
variant?: "primary" | "secondary" | null | undefined;
|
|
43
48
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & ComponentPropsWithout<"a", RemovedProps> & React.RefAttributes<HTMLAnchorElement>>;
|
|
44
49
|
export default Link;
|
|
45
50
|
export type { LinkProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as C,jsx as i,jsxs as P}from"react/jsx-runtime";import u from"react";import{Slot as d}from"@radix-ui/react-slot";import{cn as h}from"../helpers/index.js";import{cva as x}from"class-variance-authority";const v=x("tracking hover:text-brand-0 font-bold underline transition-colors",{variants:{size:{base:"text-text-2",lg:"text-text-3"},variant:{
|
|
1
|
+
"use client";import{Fragment as C,jsx as i,jsxs as P}from"react/jsx-runtime";import u from"react";import{Slot as d}from"@radix-ui/react-slot";import{cn as h}from"../helpers/index.js";import{cva as x}from"class-variance-authority";const v=x("tracking hover:text-brand-0 font-bold underline transition-colors",{variants:{size:{base:"text-text-2",lg:"text-text-3"},variant:{secondary:"text-info-secondary hover:text-info-primary",primary:"text-info-primary hover:text-brand-0"}}}),a=u.forwardRef(({children:p,size:s="base",variant:l="primary",className:m,asChild:c=!1,href:o,style:r,disabled:e=!1,suffixIcon:t,onClick:f,...y},k)=>i(c?d:"a",{ref:k,onClick:n=>{if(!e&&f?.(n),e||!o){n.preventDefault();return}},href:e?void 0:o,className:h(v({size:s,variant:l}),m,{"flex items-center":t,"cursor-pointer":!e,"text-info-quaternary cursor-not-allowed hover:text-info-quaternary":e}),...r?{style:r}:null,...y,children:P(C,{children:[p,t&&i("span",{className:"svg",children:t})]})}));a.displayName="Link";var V=a;export{V as default};
|
|
2
2
|
//# sourceMappingURL=link.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/link.tsx"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React from 'react'\nimport type { ReactNode } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../helpers/index.js'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\n// \u5B9A\u4E49 link \u7684\u6837\u5F0F\u53D8\u4F53\nconst linkVariants = cva('tracking hover:text-brand-0 font-bold underline transition-colors', {\n variants: {\n size: {\n base: 'text-text-2', // \u4E2D\n lg: 'text-text-3', // \u5927\n },\n variant: {\n secondary: 'text-info-secondary hover:text-info-primary',\n primary: 'text-info-primary hover:text-brand-0',\n },\n },\n})\n// \u5B9A\u4E49\u7EC4\u4EF6\u7C7B\u578B\uFF0C\u7EE7\u627F a \u6807\u7B7E\u6807\u51C6\u5C5E\u6027\ntype LinkElement = React.ElementRef<'a'>\ntype LinkProps = {\n /** \u5B9A\u4E49\u5B50\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B,\u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n asChild?: boolean\n /** \u7C7B\u540D*/\n className?: string\n /** \u7981\u7528\u94FE\u63A5 */\n disabled?: boolean\n /** \u540E\u7F6E\u56FE\u6807*/\n suffixIcon?: ReactNode\n /** \u8DF3\u8F6C\u94FE\u63A5*/\n href?: string\n /** \u6837\u5F0F*/\n style?: React.CSSProperties\n /** \u70B9\u51FB\u4E8B\u4EF6\uFF0C\u7981\u7528\u72B6\u6001\u65E0\u6CD5\u89E6\u53D1*/\n onClick?: Function\n} & VariantProps<typeof linkVariants> &\n ComponentPropsWithout<'a', RemovedProps>\n\n/**\n * Link - \u94FE\u63A5\n *\n * @description \u53EF\u70B9\u51FB\u7684\u94FE\u63A5\u7EC4\u4EF6\uFF0C\u652F\u6301\u4E0D\u540C\u5C3A\u5BF8\u3001\u6837\u5F0F\u53D8\u4F53\u3001\u7981\u7528\u72B6\u6001\u548C\u540E\u7F6E\u56FE\u6807\n */\nconst Link = React.forwardRef<LinkElement, LinkProps>(\n (\n {\n children,\n size = 'base',\n variant = 'primary',\n className,\n asChild = false,\n href,\n style,\n disabled = false,\n suffixIcon,\n onClick,\n ...props // \u8FD9\u91CC\u4F1A\u5305\u542B href\u3001target\u3001rel \u7B49\u6807\u51C6 anchor \u5C5E\u6027\n }: LinkProps,\n forwardedRef\n ) => {\n const Comp = asChild ? Slot : 'a'\n\n const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {\n !disabled && onClick?.(event)\n if (disabled || !href) {\n event.preventDefault()\n return\n }\n }\n\n return (\n <Comp\n ref={forwardedRef}\n onClick={handleClick}\n href={disabled ? undefined : href}\n className={cn(linkVariants({ size, variant }), className, {\n 'flex items-center': suffixIcon,\n 'cursor-pointer': !disabled,\n 'text-info-quaternary cursor-not-allowed hover:text-info-quaternary': disabled,\n })}\n {...(style ? { style: style } : null)}\n {...props}\n >\n <>\n {children}\n {suffixIcon && <span className=\"svg\">{suffixIcon}</span>}\n </>\n </Comp>\n )\n }\n)\nLink.displayName = 'Link'\n\nexport default Link\nexport type { LinkProps }\n"],
|
|
5
|
+
"mappings": "aAsFQ,mBAAAA,EAEiB,OAAAC,EAFjB,QAAAC,MAAA,oBArFR,OAAOC,MAAW,QAElB,OAAS,QAAAC,MAAY,uBACrB,OAAS,MAAAC,MAAU,sBACnB,OAA4B,OAAAC,MAAW,2BAIvC,MAAMC,EAAeD,EAAI,qEAAsE,CAC7F,SAAU,CACR,KAAM,CACJ,KAAM,cACN,GAAI,aACN,EACA,QAAS,CACP,UAAW,8CACX,QAAS,sCACX,CACF,CACF,CAAC,EA0BKE,EAAOL,EAAM,WACjB,CACE,CACE,SAAAM,EACA,KAAAC,EAAO,OACP,QAAAC,EAAU,UACV,UAAAC,EACA,QAAAC,EAAU,GACV,KAAAC,EACA,MAAAC,EACA,SAAAC,EAAW,GACX,WAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EACAC,IAaEnB,EAXWY,EAAUT,EAAO,IAW3B,CACC,IAAKgB,EACL,QAXiBC,GAA+C,CAElE,GADA,CAACL,GAAYE,IAAUG,CAAK,EACxBL,GAAY,CAACF,EAAM,CACrBO,EAAM,eAAe,EACrB,MACF,CACF,EAMI,KAAML,EAAW,OAAYF,EAC7B,UAAWT,EAAGE,EAAa,CAAE,KAAAG,EAAM,QAAAC,CAAQ,CAAC,EAAGC,EAAW,CACxD,oBAAqBK,EACrB,iBAAkB,CAACD,EACnB,qEAAsEA,CACxE,CAAC,EACA,GAAID,EAAQ,CAAE,MAAOA,CAAM,EAAI,KAC/B,GAAGI,EAEJ,SAAAjB,EAAAF,EAAA,CACG,UAAAS,EACAQ,GAAchB,EAAC,QAAK,UAAU,MAAO,SAAAgB,EAAW,GACnD,EACF,CAGN,EACAT,EAAK,YAAc,OAEnB,IAAOc,EAAQd",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "React", "Slot", "cn", "cva", "linkVariants", "Link", "children", "size", "variant", "className", "asChild", "href", "style", "disabled", "suffixIcon", "onClick", "props", "forwardedRef", "event", "link_default"]
|
|
7
7
|
}
|