@anker-in/headless-ui 1.0.24 → 1.0.26-alpha.1761893017767
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/FeatureCards/FeatureCards.d.ts +7 -0
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +2 -0
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +7 -0
- package/dist/cjs/biz-components/FeatureCards/index.d.ts +2 -0
- package/dist/cjs/biz-components/FeatureCards/index.js +2 -0
- package/dist/cjs/biz-components/FeatureCards/index.js.map +7 -0
- package/dist/cjs/biz-components/FeatureCards/types.d.ts +25 -0
- package/dist/cjs/biz-components/FeatureCards/types.js +2 -0
- package/dist/cjs/biz-components/FeatureCards/types.js.map +7 -0
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +7 -0
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.js +2 -0
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.js.map +7 -0
- package/dist/cjs/biz-components/FeatureShowcase/index.d.ts +2 -0
- package/dist/cjs/biz-components/FeatureShowcase/index.js +2 -0
- package/dist/cjs/biz-components/FeatureShowcase/index.js.map +7 -0
- package/dist/cjs/biz-components/FeatureShowcase/types.d.ts +20 -0
- package/dist/cjs/biz-components/FeatureShowcase/types.js +2 -0
- package/dist/cjs/biz-components/FeatureShowcase/types.js.map +7 -0
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +7 -0
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.js +2 -0
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.js.map +7 -0
- package/dist/cjs/biz-components/ImageTextFeature/index.d.ts +2 -0
- package/dist/cjs/biz-components/ImageTextFeature/index.js +2 -0
- package/dist/cjs/biz-components/ImageTextFeature/index.js.map +7 -0
- package/dist/cjs/biz-components/ImageTextFeature/types.d.ts +31 -0
- package/dist/cjs/biz-components/ImageTextFeature/types.js +2 -0
- package/dist/cjs/biz-components/ImageTextFeature/types.js.map +7 -0
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +7 -0
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +2 -0
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +7 -0
- package/dist/cjs/biz-components/ImageWithText/index.d.ts +2 -0
- package/dist/cjs/biz-components/ImageWithText/index.js +2 -0
- package/dist/cjs/biz-components/ImageWithText/index.js.map +7 -0
- package/dist/cjs/biz-components/ImageWithText/types.d.ts +23 -0
- package/dist/cjs/biz-components/ImageWithText/types.js +2 -0
- package/dist/cjs/biz-components/ImageWithText/types.js.map +7 -0
- package/dist/cjs/biz-components/Ksp/index.d.ts +40 -0
- package/dist/cjs/biz-components/Ksp/index.js +2 -0
- package/dist/cjs/biz-components/Ksp/index.js.map +7 -0
- package/dist/cjs/biz-components/MarqueeReview/index.d.ts +41 -0
- package/dist/cjs/biz-components/MarqueeReview/index.js +25 -0
- package/dist/cjs/biz-components/MarqueeReview/index.js.map +7 -0
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +37 -0
- package/dist/cjs/biz-components/ProductCompare/index.js +2 -0
- package/dist/cjs/biz-components/ProductCompare/index.js.map +7 -0
- package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +7 -0
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +2 -0
- package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +7 -0
- package/dist/cjs/biz-components/ProductHero/index.d.ts +2 -0
- package/dist/cjs/biz-components/ProductHero/index.js +2 -0
- package/dist/cjs/biz-components/ProductHero/index.js.map +7 -0
- package/dist/cjs/biz-components/ProductHero/types.d.ts +20 -0
- package/dist/cjs/biz-components/ProductHero/types.js +2 -0
- package/dist/cjs/biz-components/ProductHero/types.js.map +7 -0
- package/dist/cjs/biz-components/Specs/dropdown.d.ts +11 -0
- package/dist/cjs/biz-components/Specs/dropdown.js +3 -0
- package/dist/cjs/biz-components/Specs/dropdown.js.map +7 -0
- package/dist/cjs/biz-components/Specs/index.d.ts +6 -0
- package/dist/cjs/biz-components/Specs/index.js +2 -0
- package/dist/cjs/biz-components/Specs/index.js.map +7 -0
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +7 -0
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.js +2 -0
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.js.map +7 -0
- package/dist/cjs/biz-components/SpecsComparison/index.d.ts +2 -0
- package/dist/cjs/biz-components/SpecsComparison/index.js +2 -0
- package/dist/cjs/biz-components/SpecsComparison/index.js.map +7 -0
- package/dist/cjs/biz-components/SpecsComparison/types.d.ts +34 -0
- package/dist/cjs/biz-components/SpecsComparison/types.js +2 -0
- package/dist/cjs/biz-components/SpecsComparison/types.js.map +7 -0
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +7 -0
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.js +2 -0
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.js.map +7 -0
- package/dist/cjs/biz-components/TabWithImage/index.d.ts +2 -0
- package/dist/cjs/biz-components/TabWithImage/index.js +2 -0
- package/dist/cjs/biz-components/TabWithImage/index.js.map +7 -0
- package/dist/cjs/biz-components/TabWithImage/types.d.ts +28 -0
- package/dist/cjs/biz-components/TabWithImage/types.js +2 -0
- package/dist/cjs/biz-components/TabWithImage/types.js.map +7 -0
- package/dist/cjs/biz-components/TabsGroup/index.d.ts +7 -0
- package/dist/cjs/biz-components/TabsGroup/index.js +2 -0
- package/dist/cjs/biz-components/TabsGroup/index.js.map +7 -0
- package/dist/cjs/biz-components/TabsGroup/types.d.ts +16 -0
- package/dist/cjs/biz-components/TabsGroup/types.js +2 -0
- package/dist/cjs/biz-components/TabsGroup/types.js.map +7 -0
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +7 -0
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.js +2 -0
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.js.map +7 -0
- package/dist/cjs/biz-components/TabsWithMedia/index.d.ts +2 -0
- package/dist/cjs/biz-components/TabsWithMedia/index.js +2 -0
- package/dist/cjs/biz-components/TabsWithMedia/index.js.map +7 -0
- package/dist/cjs/biz-components/TabsWithMedia/types.d.ts +40 -0
- package/dist/cjs/biz-components/TabsWithMedia/types.js +2 -0
- package/dist/cjs/biz-components/TabsWithMedia/types.js.map +7 -0
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.d.ts +7 -0
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.js +2 -0
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.js.map +7 -0
- package/dist/cjs/biz-components/VideoFeature/index.d.ts +2 -0
- package/dist/cjs/biz-components/VideoFeature/index.js +2 -0
- package/dist/cjs/biz-components/VideoFeature/index.js.map +7 -0
- package/dist/cjs/biz-components/VideoFeature/types.d.ts +18 -0
- package/dist/cjs/biz-components/VideoFeature/types.js +2 -0
- package/dist/cjs/biz-components/VideoFeature/types.js.map +7 -0
- package/dist/cjs/biz-components/index.d.ts +61 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/cpn-components/CpnNavigation/index.js +1 -1
- package/dist/cjs/cpn-components/CpnNavigation/index.js.map +3 -3
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/Styles.js.map +3 -3
- package/dist/cjs/stories/MarqueeReview.stories.d.ts +73 -0
- package/dist/cjs/stories/MarqueeReview.stories.js +19 -0
- package/dist/cjs/stories/MarqueeReview.stories.js.map +7 -0
- package/dist/cjs/stories/featureCards.stories.d.ts +28 -0
- package/dist/cjs/stories/featureCards.stories.js +2 -0
- package/dist/cjs/stories/featureCards.stories.js.map +7 -0
- package/dist/cjs/stories/featureShowcase.stories.d.ts +28 -0
- package/dist/cjs/stories/featureShowcase.stories.js +2 -0
- package/dist/cjs/stories/featureShowcase.stories.js.map +7 -0
- package/dist/cjs/stories/imageTextFeature.stories.d.ts +27 -0
- package/dist/cjs/stories/imageTextFeature.stories.js +2 -0
- package/dist/cjs/stories/imageTextFeature.stories.js.map +7 -0
- package/dist/cjs/stories/imageWithText.stories.d.ts +27 -0
- package/dist/cjs/stories/imageWithText.stories.js +2 -0
- package/dist/cjs/stories/imageWithText.stories.js.map +7 -0
- package/dist/cjs/stories/ksp.stories.d.ts +63 -0
- package/dist/cjs/stories/ksp.stories.js +129 -0
- package/dist/cjs/stories/ksp.stories.js.map +7 -0
- package/dist/cjs/stories/productCompare.stories.d.ts +49 -0
- package/dist/cjs/stories/productCompare.stories.js +63 -0
- package/dist/cjs/stories/productCompare.stories.js.map +7 -0
- package/dist/cjs/stories/productHero.stories.d.ts +28 -0
- package/dist/cjs/stories/productHero.stories.js +2 -0
- package/dist/cjs/stories/productHero.stories.js.map +7 -0
- package/dist/cjs/stories/specs.stories.d.ts +13 -0
- package/dist/cjs/stories/specs.stories.js +57 -0
- package/dist/cjs/stories/specs.stories.js.map +7 -0
- package/dist/cjs/stories/specsComparison.stories.d.ts +27 -0
- package/dist/cjs/stories/specsComparison.stories.js +30 -0
- package/dist/cjs/stories/specsComparison.stories.js.map +7 -0
- package/dist/cjs/stories/tabWithImage.stories.d.ts +27 -0
- package/dist/cjs/stories/tabWithImage.stories.js +2 -0
- package/dist/cjs/stories/tabWithImage.stories.js.map +7 -0
- package/dist/cjs/stories/tabsWithMedia.stories.d.ts +27 -0
- package/dist/cjs/stories/tabsWithMedia.stories.js +2 -0
- package/dist/cjs/stories/tabsWithMedia.stories.js.map +7 -0
- package/dist/cjs/stories/videoFeature.stories.d.ts +28 -0
- package/dist/cjs/stories/videoFeature.stories.js +2 -0
- package/dist/cjs/stories/videoFeature.stories.js.map +7 -0
- package/dist/cjs/types/props.d.ts +4 -0
- package/dist/cjs/types/props.js +1 -1
- package/dist/cjs/types/props.js.map +1 -1
- package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +7 -0
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js +2 -0
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +7 -0
- package/dist/esm/biz-components/FeatureCards/index.d.ts +2 -0
- package/dist/esm/biz-components/FeatureCards/index.js +2 -0
- package/dist/esm/biz-components/FeatureCards/index.js.map +7 -0
- package/dist/esm/biz-components/FeatureCards/types.d.ts +25 -0
- package/dist/esm/biz-components/FeatureCards/types.js +1 -0
- package/dist/esm/biz-components/FeatureCards/types.js.map +7 -0
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +7 -0
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.js +2 -0
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.js.map +7 -0
- package/dist/esm/biz-components/FeatureShowcase/index.d.ts +2 -0
- package/dist/esm/biz-components/FeatureShowcase/index.js +2 -0
- package/dist/esm/biz-components/FeatureShowcase/index.js.map +7 -0
- package/dist/esm/biz-components/FeatureShowcase/types.d.ts +20 -0
- package/dist/esm/biz-components/FeatureShowcase/types.js +1 -0
- package/dist/esm/biz-components/FeatureShowcase/types.js.map +7 -0
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +7 -0
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.js +2 -0
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.js.map +7 -0
- package/dist/esm/biz-components/ImageTextFeature/index.d.ts +2 -0
- package/dist/esm/biz-components/ImageTextFeature/index.js +2 -0
- package/dist/esm/biz-components/ImageTextFeature/index.js.map +7 -0
- package/dist/esm/biz-components/ImageTextFeature/types.d.ts +31 -0
- package/dist/esm/biz-components/ImageTextFeature/types.js +1 -0
- package/dist/esm/biz-components/ImageTextFeature/types.js.map +7 -0
- package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +7 -0
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +2 -0
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +7 -0
- package/dist/esm/biz-components/ImageWithText/index.d.ts +2 -0
- package/dist/esm/biz-components/ImageWithText/index.js +2 -0
- package/dist/esm/biz-components/ImageWithText/index.js.map +7 -0
- package/dist/esm/biz-components/ImageWithText/types.d.ts +23 -0
- package/dist/esm/biz-components/ImageWithText/types.js +1 -0
- package/dist/esm/biz-components/ImageWithText/types.js.map +7 -0
- package/dist/esm/biz-components/Ksp/index.d.ts +40 -0
- package/dist/esm/biz-components/Ksp/index.js +2 -0
- package/dist/esm/biz-components/Ksp/index.js.map +7 -0
- package/dist/esm/biz-components/MarqueeReview/index.d.ts +41 -0
- package/dist/esm/biz-components/MarqueeReview/index.js +25 -0
- package/dist/esm/biz-components/MarqueeReview/index.js.map +7 -0
- package/dist/esm/biz-components/ProductCompare/index.d.ts +37 -0
- package/dist/esm/biz-components/ProductCompare/index.js +2 -0
- package/dist/esm/biz-components/ProductCompare/index.js.map +7 -0
- package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +7 -0
- package/dist/esm/biz-components/ProductHero/ProductHero.js +2 -0
- package/dist/esm/biz-components/ProductHero/ProductHero.js.map +7 -0
- package/dist/esm/biz-components/ProductHero/index.d.ts +2 -0
- package/dist/esm/biz-components/ProductHero/index.js +2 -0
- package/dist/esm/biz-components/ProductHero/index.js.map +7 -0
- package/dist/esm/biz-components/ProductHero/types.d.ts +20 -0
- package/dist/esm/biz-components/ProductHero/types.js +1 -0
- package/dist/esm/biz-components/ProductHero/types.js.map +7 -0
- package/dist/esm/biz-components/Specs/dropdown.d.ts +11 -0
- package/dist/esm/biz-components/Specs/dropdown.js +3 -0
- package/dist/esm/biz-components/Specs/dropdown.js.map +7 -0
- package/dist/esm/biz-components/Specs/index.d.ts +6 -0
- package/dist/esm/biz-components/Specs/index.js +2 -0
- package/dist/esm/biz-components/Specs/index.js.map +7 -0
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +7 -0
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.js +2 -0
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.js.map +7 -0
- package/dist/esm/biz-components/SpecsComparison/index.d.ts +2 -0
- package/dist/esm/biz-components/SpecsComparison/index.js +2 -0
- package/dist/esm/biz-components/SpecsComparison/index.js.map +7 -0
- package/dist/esm/biz-components/SpecsComparison/types.d.ts +34 -0
- package/dist/esm/biz-components/SpecsComparison/types.js +1 -0
- package/dist/esm/biz-components/SpecsComparison/types.js.map +7 -0
- package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +7 -0
- package/dist/esm/biz-components/TabWithImage/TabWithImage.js +2 -0
- package/dist/esm/biz-components/TabWithImage/TabWithImage.js.map +7 -0
- package/dist/esm/biz-components/TabWithImage/index.d.ts +2 -0
- package/dist/esm/biz-components/TabWithImage/index.js +2 -0
- package/dist/esm/biz-components/TabWithImage/index.js.map +7 -0
- package/dist/esm/biz-components/TabWithImage/types.d.ts +28 -0
- package/dist/esm/biz-components/TabWithImage/types.js +1 -0
- package/dist/esm/biz-components/TabWithImage/types.js.map +7 -0
- package/dist/esm/biz-components/TabsGroup/index.d.ts +7 -0
- package/dist/esm/biz-components/TabsGroup/index.js +2 -0
- package/dist/esm/biz-components/TabsGroup/index.js.map +7 -0
- package/dist/esm/biz-components/TabsGroup/types.d.ts +16 -0
- package/dist/esm/biz-components/TabsGroup/types.js +1 -0
- package/dist/esm/biz-components/TabsGroup/types.js.map +7 -0
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +7 -0
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.js +2 -0
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.js.map +7 -0
- package/dist/esm/biz-components/TabsWithMedia/index.d.ts +2 -0
- package/dist/esm/biz-components/TabsWithMedia/index.js +2 -0
- package/dist/esm/biz-components/TabsWithMedia/index.js.map +7 -0
- package/dist/esm/biz-components/TabsWithMedia/types.d.ts +40 -0
- package/dist/esm/biz-components/TabsWithMedia/types.js +1 -0
- package/dist/esm/biz-components/TabsWithMedia/types.js.map +7 -0
- package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +7 -0
- package/dist/esm/biz-components/VideoFeature/VideoFeature.js +2 -0
- package/dist/esm/biz-components/VideoFeature/VideoFeature.js.map +7 -0
- package/dist/esm/biz-components/VideoFeature/index.d.ts +2 -0
- package/dist/esm/biz-components/VideoFeature/index.js +2 -0
- package/dist/esm/biz-components/VideoFeature/index.js.map +7 -0
- package/dist/esm/biz-components/VideoFeature/types.d.ts +18 -0
- package/dist/esm/biz-components/VideoFeature/types.js +1 -0
- package/dist/esm/biz-components/VideoFeature/types.js.map +7 -0
- package/dist/esm/biz-components/index.d.ts +61 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/cpn-components/CpnNavigation/index.js +1 -1
- package/dist/esm/cpn-components/CpnNavigation/index.js.map +2 -2
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/Styles.js.map +3 -3
- package/dist/esm/stories/MarqueeReview.stories.d.ts +73 -0
- package/dist/esm/stories/MarqueeReview.stories.js +19 -0
- package/dist/esm/stories/MarqueeReview.stories.js.map +7 -0
- package/dist/esm/stories/featureCards.stories.d.ts +28 -0
- package/dist/esm/stories/featureCards.stories.js +2 -0
- package/dist/esm/stories/featureCards.stories.js.map +7 -0
- package/dist/esm/stories/featureShowcase.stories.d.ts +28 -0
- package/dist/esm/stories/featureShowcase.stories.js +2 -0
- package/dist/esm/stories/featureShowcase.stories.js.map +7 -0
- package/dist/esm/stories/imageTextFeature.stories.d.ts +27 -0
- package/dist/esm/stories/imageTextFeature.stories.js +2 -0
- package/dist/esm/stories/imageTextFeature.stories.js.map +7 -0
- package/dist/esm/stories/imageWithText.stories.d.ts +27 -0
- package/dist/esm/stories/imageWithText.stories.js +2 -0
- package/dist/esm/stories/imageWithText.stories.js.map +7 -0
- package/dist/esm/stories/ksp.stories.d.ts +63 -0
- package/dist/esm/stories/ksp.stories.js +129 -0
- package/dist/esm/stories/ksp.stories.js.map +7 -0
- package/dist/esm/stories/productCompare.stories.d.ts +49 -0
- package/dist/esm/stories/productCompare.stories.js +63 -0
- package/dist/esm/stories/productCompare.stories.js.map +7 -0
- package/dist/esm/stories/productHero.stories.d.ts +28 -0
- package/dist/esm/stories/productHero.stories.js +2 -0
- package/dist/esm/stories/productHero.stories.js.map +7 -0
- package/dist/esm/stories/specs.stories.d.ts +13 -0
- package/dist/esm/stories/specs.stories.js +57 -0
- package/dist/esm/stories/specs.stories.js.map +7 -0
- package/dist/esm/stories/specsComparison.stories.d.ts +27 -0
- package/dist/esm/stories/specsComparison.stories.js +30 -0
- package/dist/esm/stories/specsComparison.stories.js.map +7 -0
- package/dist/esm/stories/tabWithImage.stories.d.ts +27 -0
- package/dist/esm/stories/tabWithImage.stories.js +2 -0
- package/dist/esm/stories/tabWithImage.stories.js.map +7 -0
- package/dist/esm/stories/tabsWithMedia.stories.d.ts +27 -0
- package/dist/esm/stories/tabsWithMedia.stories.js +2 -0
- package/dist/esm/stories/tabsWithMedia.stories.js.map +7 -0
- package/dist/esm/stories/videoFeature.stories.d.ts +28 -0
- package/dist/esm/stories/videoFeature.stories.js +2 -0
- package/dist/esm/stories/videoFeature.stories.js.map +7 -0
- package/dist/esm/types/props.d.ts +4 -0
- package/dist/tokens/base.css +3 -0
- package/package.json +4 -1
- package/tailwind.config.js +2 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SpecsComparisonProps } from './types.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<SpecsComparisonProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
data?: Record<string, any>;
|
|
6
|
+
}, "ref"> & React.RefAttributes<any>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as l,jsxs as r}from"react/jsx-runtime";import E,{useRef as u,useImperativeHandle as C,useState as H}from"react";import{Heading as f}from"../../components/index.js";import{cn as i}from"../../helpers/utils.js";import{withLayout as L}from"../../shared/Styles.js";import{useExposure as M}from"../../hooks/useExposure.js";const R="specs",k="specs_comparison",v=E.forwardRef(({data:b,className:g},w)=>{const{LeftMenu:o,RightMenu:m}=b||{},[h,N]=H(""),d=u({}),s=u(null);M(s,{componentType:R,componentName:k,componentTitle:"Specs Comparison"}),C(w,()=>s.current);const x=e=>e?l("div",{className:"break-all",children:l("p",{className:"text-sm font-bold text-[#1D1D1F] min-xl:text-base min-xxl:text-lg",dangerouslySetInnerHTML:{__html:e||""}})}):null,y=e=>e.map((t,a)=>{const T=a===0,c=m?.menus?.[0]?.subTitle,n=m?.menus?.[1]?.subTitle,D=n&&n[t],S=/^[✅❌]$/,p=D&&(n[t]!==c?.[t]||S.test(n[t]));return r("div",{className:i("box-border flex w-full overflow-hidden border-t border-t-[#E4E5E6] l:flex-col",T&&"border-t-0"),children:[l(f,{as:"h3",html:t||"",className:"mr-4 flex-1 pt-4 text-base font-bold text-[#000000] l:text-lg min-l:min-w-[216px] min-l:max-w-[216px] min-xl:min-w-[268px] min-xl:max-w-[268px] min-xl:p-6 min-xxl:min-w-[356px] min-xxl:max-w-[356px] min-xxl:text-lg"}),r("div",{className:i("grid flex-1 place-self-center pb-4 pt-2 l:w-full l:gap-4 min-l:gap-8 min-xl:gap-12 min-xl:p-6 min-xxl:gap-16",p?"grid-cols-2":"grid-cols-1"),children:[x(c?.[t]),p&&x(n?.[t])]})]},t)}),F=e=>{const{subTitle:t}=e;return y(t)};return l("div",{ref:s,"data-ui-component-id":"SpecsComparison",className:i("w-full overflow-hidden bg-[#F5F5F7]",g),children:l("div",{className:"container mx-auto",children:o?.data?r("div",{className:"my-16 box-border flex w-full overflow-hidden min-l:mb-24 min-xl:mb-32",children:[o.data.length>1?l("div",{className:"flex l:hidden min-l:mr-6 min-xl:mr-12",children:l("div",{className:"box-border overflow-hidden min-l:w-[196px] min-xl:w-[284px] min-xxl:w-[356px]",children:o.data.map(e=>l("div",{onClick:()=>{N(e.title),d.current[e.title]?.scrollIntoView({behavior:"smooth"})},title:e.title||"",className:i("box-border cursor-pointer overflow-hidden truncate rounded-lg px-6 py-2 text-base font-bold leading-9 text-[#1D1D1F] min-xxl:py-4 min-xxl:text-lg",h===e.title&&"bg-[#FFFFFF]"),children:e.title||""},e.title))})}):null,l("div",{className:"box-border flex-1 overflow-hidden",children:l("div",{className:"w-full",children:o.data.map((e,t)=>r("div",{className:"w-full overflow-hidden pt-10 first:pt-0",ref:a=>{d.current[e.title]=a},children:[e.title&&l(f,{as:"h2",className:"mb-6 text-2xl font-bold min-l:text-[32px]",html:e.title||""}),F(e)]},t))})})]}):null})})});v.displayName="SpecsComparison";var q=L(v);export{q as default};
|
|
2
|
+
//# sourceMappingURL=SpecsComparison.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/SpecsComparison/SpecsComparison.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle, useState } from 'react'\nimport { Heading, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { SpecsComparisonProps } from './types.js'\n\nconst componentType = 'specs'\nconst componentName = 'specs_comparison'\n\nconst SpecsComparison = React.forwardRef<HTMLDivElement, SpecsComparisonProps>(\n ({ data, className }, ref) => {\n const { LeftMenu, RightMenu } = data || {}\n const [selectItem, setSelectItem] = useState('')\n const refs = useRef<Record<string, HTMLDivElement | null>>({})\n\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: 'Specs Comparison',\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const normalNode = (v: string) => {\n if (!v) return null\n return (\n <div className=\"break-all\">\n <p\n className=\"text-sm font-bold text-[#1D1D1F] min-xl:text-base min-xxl:text-lg\"\n dangerouslySetInnerHTML={{\n __html: v || '',\n }}\n />\n </div>\n )\n }\n\n const productNode = (subTitle: string[]) => {\n return subTitle.map((st, idx) => {\n const isFirstParameter = idx === 0\n const leftData = RightMenu?.menus?.[0]?.subTitle\n const rightData = RightMenu?.menus?.[1]?.subTitle\n const hasRightData = rightData && rightData[st]\n const reg = /^[\u2705\u274C]$/\n const isSame =\n hasRightData &&\n (rightData[st] !== leftData?.[st] || reg.test(rightData[st]))\n\n return (\n <div\n key={st}\n className={cn(\n 'box-border flex w-full overflow-hidden border-t border-t-[#E4E5E6] l:flex-col',\n isFirstParameter && 'border-t-0'\n )}\n >\n <Heading\n as=\"h3\"\n html={st || ''}\n className=\"mr-4 flex-1 pt-4 text-base font-bold text-[#000000] l:text-lg min-l:min-w-[216px] min-l:max-w-[216px] min-xl:min-w-[268px] min-xl:max-w-[268px] min-xl:p-6 min-xxl:min-w-[356px] min-xxl:max-w-[356px] min-xxl:text-lg\"\n />\n <div\n className={cn(\n 'grid flex-1 place-self-center pb-4 pt-2 l:w-full l:gap-4 min-l:gap-8 min-xl:gap-12 min-xl:p-6 min-xxl:gap-16',\n isSame ? 'grid-cols-2' : 'grid-cols-1'\n )}\n >\n {normalNode(leftData?.[st])}\n {isSame && normalNode(rightData?.[st])}\n </div>\n </div>\n )\n })\n }\n\n const childrenNode = (node: { subTitle: string[]; isProduct?: boolean }) => {\n const { subTitle } = node\n return productNode(subTitle)\n }\n\n return (\n <div\n ref={boxRef}\n data-ui-component-id=\"SpecsComparison\"\n className={cn('w-full overflow-hidden bg-[#F5F5F7]', className)}\n >\n <div className=\"container mx-auto\">\n {LeftMenu?.data ? (\n <div className=\"my-16 box-border flex w-full overflow-hidden min-l:mb-24 min-xl:mb-32\">\n {LeftMenu.data.length > 1 ? (\n <div className=\"flex l:hidden min-l:mr-6 min-xl:mr-12\">\n <div className=\"box-border overflow-hidden min-l:w-[196px] min-xl:w-[284px] min-xxl:w-[356px]\">\n {LeftMenu.data.map((item) => {\n return (\n <div\n key={item.title}\n onClick={() => {\n setSelectItem(item.title)\n const el = refs.current[item.title]\n el?.scrollIntoView({ behavior: 'smooth' })\n }}\n title={item.title || ''}\n className={cn(\n 'box-border cursor-pointer overflow-hidden truncate rounded-lg px-6 py-2 text-base font-bold leading-9 text-[#1D1D1F] min-xxl:py-4 min-xxl:text-lg',\n selectItem === item.title && 'bg-[#FFFFFF]'\n )}\n >\n {item.title || ''}\n </div>\n )\n })}\n </div>\n </div>\n ) : null}\n <div className=\"box-border flex-1 overflow-hidden\">\n <div className=\"w-full\">\n {LeftMenu.data.map((item, index) => {\n return (\n <div\n key={index}\n className=\"w-full overflow-hidden pt-10 first:pt-0\"\n ref={(r) => {\n refs.current[item.title] = r\n }}\n >\n {item.title && (\n <Heading\n as=\"h2\"\n className=\"mb-6 text-2xl font-bold min-l:text-[32px]\"\n html={item.title || ''}\n />\n )}\n {childrenNode(item)}\n </div>\n )\n })}\n </div>\n </div>\n </div>\n ) : null}\n </div>\n </div>\n )\n }\n)\n\nSpecsComparison.displayName = 'SpecsComparison'\n\nexport default withLayout(SpecsComparison)\n"],
|
|
5
|
+
"mappings": "aA+BU,cAAAA,EAkCE,QAAAC,MAlCF,oBA9BV,OAAOC,GAAS,UAAAC,EAAQ,uBAAAC,EA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ading", "cn", "withLayout", "useExposure", "componentType", "componentName", "SpecsComparison", "data", "className", "ref", "LeftMenu", "RightMenu", "selectItem", "setSelectItem", "refs", "boxRef", "normalNode", "v", "productNode", "subTitle", "st", "idx", "isFirstParameter", "leftData", "rightData", "hasRightData", "reg", "isSame", "childrenNode", "node", "item", "index", "r", "SpecsComparison_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/SpecsComparison/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { default } from './SpecsComparison.js'\nexport type {\n SpecsComparisonProps,\n SpecsComparisonMenuItem,\n SpecsComparisonLeftMenuItem,\n} from './types.js'\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,WAAAA,MAAe",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface SpecsComparisonMenuItem {
|
|
2
|
+
/** 产品 SKU */
|
|
3
|
+
sku: string;
|
|
4
|
+
/** 产品 handle */
|
|
5
|
+
handle: string;
|
|
6
|
+
/** 规格数据,key 为规格项名称,value 为规格值 */
|
|
7
|
+
subTitle: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export interface SpecsComparisonLeftMenuItem {
|
|
10
|
+
/** 分类标题 */
|
|
11
|
+
title: string;
|
|
12
|
+
/** 规格项列表 */
|
|
13
|
+
subTitle: string[];
|
|
14
|
+
/** 是否为产品规格 */
|
|
15
|
+
isProduct?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface SpecsComparisonProps {
|
|
18
|
+
data: {
|
|
19
|
+
/** 左侧菜单配置 */
|
|
20
|
+
LeftMenu: {
|
|
21
|
+
data: SpecsComparisonLeftMenuItem[];
|
|
22
|
+
};
|
|
23
|
+
/** 右侧产品列表配置 */
|
|
24
|
+
RightMenu: {
|
|
25
|
+
menus: SpecsComparisonMenuItem[];
|
|
26
|
+
};
|
|
27
|
+
/** 默认选中菜单配置 */
|
|
28
|
+
DefaultSelectMenu: {
|
|
29
|
+
buttonText: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/** 自定义类名 */
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TabWithImageProps } from './types.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<TabWithImageProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
data?: Record<string, any>;
|
|
6
|
+
}, "ref"> & React.RefAttributes<any>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import I,{useState as x,useEffect as N,useRef as d,useImperativeHandle as k}from"react";import{Heading as f,Picture as D,Text as E}from"../../components/index.js";import{cn as u}from"../../helpers/utils.js";import{withLayout as H}from"../../shared/Styles.js";import{useExposure as L}from"../../hooks/useExposure.js";import{motion as M,AnimatePresence as W}from"framer-motion";const P="image",R="tab_with_image",b=I.forwardRef(({data:v,className:h},g)=>{const{title:n,subtitle:z,desc:p,imageUrl:A,mobImageUrl:S,datalist:i=[]}=v,m=d(null);L(m,{componentType:P,componentName:R,componentTitle:n,componentDescription:p}),k(g,()=>m.current);const w=(o,t)=>{y(o),t.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[a,y]=x(0),r=d([]),[c,T]=x({left:0,width:0});return N(()=>{const o=r.current[a];if(o){const{offsetLeft:t,offsetWidth:l}=o;T({left:t,width:l})}},[a,i.length]),s("section",{ref:m,"data-ui-component-id":"TabWithImage",className:u("flex text-[#fff] l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]",h),children:[s("div",{className:"inline-flex flex-col justify-center min-md:gap-[24px] laptop:basis-[36%]",children:[s("div",{children:[e(f,{as:"h3",size:4,html:n}),e(E,{as:"p",size:1,html:p,className:"mt-[4px] text-[14px] tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]"})]}),e("div",{className:"relative md:overflow-hidden md:overflow-x-scroll md:scrollbar-hidden",children:s("div",{className:"relative inline-flex rounded-[24px] bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[e("div",{className:"absolute bottom-0 top-0 rounded-[24px] bg-white transition-all duration-300 ease-in-out",style:{left:c.left,width:c.width}}),i.map((o,t)=>e("div",{ref:l=>{r.current[t]=l},onClick:l=>w(t,l),className:u("relative z-10 cursor-pointer rounded-[24px] px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px] min-xxl:px-[28px] min-xxl:py-[15px]",a===t?"text-black":"text-white"),children:e(f,{as:"h1",size:1,html:o?.title,className:"text-balance-normal !whitespace-nowrap md:text-[14px]"})},t))]})})]}),e("div",{className:" relative w-full flex-shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]",children:e(W,{mode:"wait",children:e(M.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"absolute left-0 top-0 w-full",children:e(D,{source:`${i[a].image} ,${i[a].imgPad} 1440, ${i[a].imageMob} 767`,className:"rounded-[16px] md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] "})},i[a].image)})})]})});b.displayName="TabWithImage";var V=H(b);export{V as default};
|
|
2
|
+
//# sourceMappingURL=TabWithImage.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/TabWithImage/TabWithImage.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { TabWithImageProps, TabWithImageDataItem } from './types.js'\nimport { motion, AnimatePresence } from 'framer-motion'\n\nconst componentType = 'image'\nconst componentName = 'tab_with_image'\n\nconst TabWithImage = React.forwardRef<HTMLDivElement, TabWithImageProps>(({ data, className }, ref) => {\n const { title, subtitle, desc, imageUrl, mobImageUrl, datalist = [] } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: desc,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const handleClick = (index: number, e: React.MouseEvent<HTMLDivElement>) => {\n setActiveIndex(index)\n ;(e.target as HTMLElement).scrollIntoView({\n behavior: 'smooth', // \u5E73\u6ED1\u6EDA\u52A8\n inline: 'center', // \u6A2A\u5411\u5C45\u4E2D\u5BF9\u9F50\n block: 'nearest', // \u5782\u76F4\u65B9\u5411\u4E0D\u52A8\n })\n }\n\n const [activeIndex, setActiveIndex] = useState(0)\n const tabRefs = useRef<Array<HTMLDivElement | null>>([]) // \u8BB0\u5F55\u6BCF\u4E2Atab\u7684\u4F4D\u7F6E\n const [sliderStyle, setSliderStyle] = useState({ left: 0, width: 0 })\n\n useEffect(() => {\n const current = tabRefs.current[activeIndex]\n if (current) {\n const { offsetLeft, offsetWidth } = current\n setSliderStyle({ left: offsetLeft, width: offsetWidth })\n }\n }, [activeIndex, datalist.length])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"TabWithImage\"\n className={cn(\n 'flex text-[#fff] l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]',\n className\n )}\n >\n <div className=\"inline-flex flex-col justify-center min-md:gap-[24px] laptop:basis-[36%]\">\n <div>\n <Heading as={'h3'} size={4} html={title} />\n <Text\n as={'p'}\n size={1}\n html={desc}\n className=\"mt-[4px] text-[14px] tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />\n </div>\n\n <div className=\"relative md:overflow-hidden md:overflow-x-scroll md:scrollbar-hidden\">\n <div className=\"relative inline-flex rounded-[24px] bg-[#1D1D1F] px-[4px] md:my-[24px]\">\n {/* \u6ED1\u52A8\u80CC\u666F */}\n <div\n className=\"absolute bottom-0 top-0 rounded-[24px] bg-white transition-all duration-300 ease-in-out\"\n style={{\n left: sliderStyle.left,\n width: sliderStyle.width,\n }}\n />\n\n {/* Tab Items */}\n {datalist.map((item: TabWithImageDataItem, index: number) => (\n <div\n key={index}\n ref={(el) => {\n tabRefs.current[index] = el\n }}\n onClick={(e) => handleClick(index, e)}\n className={cn(\n 'relative z-10 cursor-pointer rounded-[24px] px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px] min-xxl:px-[28px] min-xxl:py-[15px]',\n activeIndex === index ? 'text-black' : 'text-white'\n )}\n >\n <Heading\n as=\"h1\"\n size={1}\n html={item?.title}\n className=\"text-balance-normal !whitespace-nowrap md:text-[14px]\"\n />\n </div>\n ))}\n </div>\n </div>\n </div>\n <div className=\" relative w-full flex-shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]\">\n <AnimatePresence mode=\"wait\">\n <motion.div\n key={datalist[activeIndex].image}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.3 }}\n className=\"absolute left-0 top-0 w-full\"\n >\n <Picture\n source={`${datalist[activeIndex].image} ,${datalist[activeIndex].imgPad} 1440, ${datalist[activeIndex].imageMob} 767`}\n className=\"rounded-[16px] md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] \"\n />\n </motion.div>\n </AnimatePresence>\n </div>\n </section>\n )\n})\n\nTabWithImage.displayName = 'TabWithImage'\n\nexport default withLayout(TabWithImage)\n"],
|
|
5
|
+
"mappings": "aAyDQ,OACE,OAAAA,EADF,QAAAC,MAAA,oBAxDR,OAAOC,GAAS,YAAAC,EAAU,aAAAC,EAAW,UAAAC,EAAQ,uBAAAC,MAA2B,QACxE,OAAS,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BACvC,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAE5B,OAAS,UAAAC,EAAQ,mBAAAC,MAAuB,gBAExC,MAAMC,EAAgB,QAChBC,EAAgB,iBAEhBC,EAAef,EAAM,WAA8C,CAAC,CAAE,KAAAgB,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACrG,KAAM,CAAE,MAAAC,EAAO,SAAAC,EAAU,KAAAC,EAAM,SAAAC,EAAU,YAAAC,EAAa,SAAAC,EAAW,CAAC,CAAE,EAAIR,EAElES,EAAStB,EAAuB,IAAI,EAE1CO,EAAYe,EAAQ,CAClB,cAAAZ,EACA,cAAAC,EACA,eAAgBK,EAChB,qBAAsBE,CACxB,CAAC,EAEDjB,EAAoBc,EAAK,IAAMO,EAAO,OAAyB,EAE/D,MAAMC,EAAc,CAACC,EAAeC,IAAwC,CAC1EC,EAAeF,CAAK,EAClBC,EAAE,OAAuB,eAAe,CACxC,SAAU,SACV,OAAQ,SACR,MAAO,SACT,CAAC,CACH,EAEM,CAACE,EAAaD,CAAc,EAAI5B,EAAS,CAAC,EAC1C8B,EAAU5B,EAAqC,CAAC,CAAC,EACjD,CAAC6B,EAAaC,CAAc,EAAIhC,EAAS,CAAE,KAAM,EAAG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+BAEV,SAAAb,EAACQ,EAAA,CACC,OAAQ,GAAGkB,EAASM,CAAW,EAAE,KAAK,KAAKN,EAASM,CAAW,EAAE,MAAM,UAAUN,EAASM,CAAW,EAAE,QAAQ,OAC/G,UAAU,8JACZ,GAVKN,EAASM,CAAW,EAAE,KAW7B,EACF,EACF,GACF,CAEJ,CAAC,EAEDf,EAAa,YAAc,eAE3B,IAAOwB,EAAQ9B,EAAWM,CAAY",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "useState", "useEffect", "useRef", "useImperativeHandle", "Heading", "Picture", "Text", "cn", "withLayout", "useExposure", "motion", "AnimatePresence", "componentType", "componentName", "TabWithImage", "data", "className", "ref", "title", "subtitle", "desc", "imageUrl", "mobImageUrl", "datalist", "boxRef", "handleClick", "index", "e", "setActiveIndex", "activeIndex", "tabRefs", "sliderStyle", "setSliderStyle", "current", "offsetLeft", "offsetWidth", "item", "el", "TabWithImage_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/TabWithImage/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { default } from './TabWithImage.js'\nexport type { TabWithImageProps, TabWithImageDataItem } from './types.js'\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,WAAAA,MAAe",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface TabWithImageDataItem {
|
|
2
|
+
/** 桌面端图片 URL */
|
|
3
|
+
image: string;
|
|
4
|
+
/** 平板端图片 URL */
|
|
5
|
+
imgPad?: string;
|
|
6
|
+
/** 移动端图片 URL */
|
|
7
|
+
imageMob?: string;
|
|
8
|
+
/** Tab 标题 */
|
|
9
|
+
title: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TabWithImageProps {
|
|
12
|
+
data: {
|
|
13
|
+
/** 主标题 */
|
|
14
|
+
title: string;
|
|
15
|
+
/** 副标题(可选) */
|
|
16
|
+
subtitle?: string;
|
|
17
|
+
/** 描述文本 */
|
|
18
|
+
desc: string;
|
|
19
|
+
/** 默认图片 URL(可选) */
|
|
20
|
+
imageUrl?: string;
|
|
21
|
+
/** 默认移动端图片 URL(可选) */
|
|
22
|
+
mobImageUrl?: string;
|
|
23
|
+
/** 数据列表 */
|
|
24
|
+
datalist: TabWithImageDataItem[];
|
|
25
|
+
};
|
|
26
|
+
/** 自定义类名 */
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TabsGroupProps } from './types.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<TabsGroupProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
data?: Record<string, any>;
|
|
6
|
+
}, "ref"> & React.RefAttributes<any>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as s,jsxs as u}from"react/jsx-runtime";import{withLayout as n}from"../../shared/Styles.js";import*as e from"../../components/tabs.js";import{cn as p}from"../../helpers/index.js";import l from"react";const c=l.forwardRef(({data:i,className:r},m)=>{const{theme:o,shape:b,align:T,tabs:t}=i;return s("section",{ref:m,className:p(o==="dark"?"aiui-dark":"",r),children:u(e.Tabs,{shape:b,align:T,defaultValue:t[0].tabName,children:[s(e.TabsList,{className:"tabs-list",children:t.map(a=>s(e.TabsTrigger,{value:a.tabName,className:"tabs-trigger",children:a.tabName},a.tabName))}),t.map(a=>s(e.TabsContent,{value:a.tabName,className:"tabs-content",children:a.children(a.tabContent?.[0])},a.tabName))]})})});var v=n(c);export{v as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/TabsGroup/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { withLayout } from '../../shared/Styles.js'\nimport * as TabsPrimitive from '../../components/tabs.js'\nimport { cn } from '../../helpers/index.js'\nimport type { TabsGroupProps } from './types.js'\nimport React from 'react'\n\nconst TabsGroup = React.forwardRef<HTMLDivElement, TabsGroupProps>(({ data, className }, forwardedRef) => {\n const { theme, shape, align, tabs } = data\n\n return (\n <section ref={forwardedRef} className={cn(theme === 'dark' ? 'aiui-dark' : '', className)}>\n <TabsPrimitive.Tabs shape={shape} align={align} defaultValue={tabs[0].tabName}>\n <TabsPrimitive.TabsList className=\"tabs-list\">\n {tabs.map(tab => (\n <TabsPrimitive.TabsTrigger key={tab.tabName} value={tab.tabName} className=\"tabs-trigger\">\n {tab.tabName}\n </TabsPrimitive.TabsTrigger>\n ))}\n </TabsPrimitive.TabsList>\n {tabs.map(tab => (\n <TabsPrimitive.TabsContent key={tab.tabName} value={tab.tabName} className=\"tabs-content\">\n {tab.children(tab.tabContent?.[0])}\n </TabsPrimitive.TabsContent>\n ))}\n </TabsPrimitive.Tabs>\n </section>\n )\n})\n\nexport default withLayout(TabsGroup)\n"],
|
|
5
|
+
"mappings": "aAYM,OAGM,OAAAA,EAHN,QAAAC,MAAA,oBAXN,OAAS,cAAAC,MAAkB,yBAC3B,UAAYC,MAAmB,2BAC/B,OAAS,MAAAC,MAAU,yBAEnB,OAAOC,MAAW,QAElB,MAAMC,EAAYD,EAAM,WAA2C,CAAC,CAAE,KAAAE,EAAM,UAAAC,CAAU,EAAGC,IAAiB,CACxG,KAAM,CAAE,MAAAC,EAAO,MAAAC,EAAO,MAAAC,EAAO,KAAAC,CAAK,EAAIN,EAEtC,OACEP,EAAC,WAAQ,IAAKS,EAAc,UAAWL,EAAGM,IAAU,OAAS,YAAc,GAAIF,CAAS,EACtF,SAAAP,EAACE,EAAc,KAAd,CAAmB,MAAOQ,EAAO,MAAOC,EAAO,aAAcC,EAAK,CAAC,EAAE,QACpE,UAAAb,EAACG,EAAc,SAAd,CAAuB,UAAU,YAC/B,SAAAU,EAAK,IAAIC,GACRd,EAACG,EAAc,YAAd,CAA4C,MAAOW,EAAI,QAAS,UAAU,eACxE,SAAAA,EAAI,SADyBA,EAAI,OAEpC,CACD,EACH,EACCD,EAAK,IAAIC,GACRd,EAACG,EAAc,YAAd,CAA4C,MAAOW,EAAI,QAAS,UAAU,eACxE,SAAAA,EAAI,SAASA,EAAI,aAAa,CAAC,CAAC,GADHA,EAAI,OAEpC,CACD,GACH,EACF,CAEJ,CAAC,EAED,IAAOC,EAAQb,EAAWI,CAAS",
|
|
6
|
+
"names": ["jsx", "jsxs", "withLayout", "TabsPrimitive", "cn", "React", "TabsGroup", "data", "className", "forwardedRef", "theme", "shape", "align", "tabs", "tab", "TabsGroup_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { Align, Shape, Theme } from '../../types/props.js';
|
|
3
|
+
export type TabsGroupProps = {
|
|
4
|
+
data: {
|
|
5
|
+
sectionTitle?: string;
|
|
6
|
+
theme: Theme;
|
|
7
|
+
shape: Shape;
|
|
8
|
+
align: Align;
|
|
9
|
+
tabs: {
|
|
10
|
+
tabName: string;
|
|
11
|
+
tabContent: any[];
|
|
12
|
+
children: (data: any) => React.ReactNode;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TabsWithMediaProps } from './types.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<TabsWithMediaProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
data?: Record<string, any>;
|
|
6
|
+
}, "ref"> & React.RefAttributes<any>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as o,jsxs as S}from"react/jsx-runtime";import A,{useEffect as U,useImperativeHandle as B,useMemo as V,useRef as x,useState as g}from"react";import{Heading as M,Picture as _,Text as q}from"../../components/index.js";import{cn as p}from"../../helpers/utils.js";import{withLayout as O}from"../../shared/Styles.js";import{useExposure as Q}from"../../hooks/useExposure.js";import{Swiper as G,SwiperSlide as J}from"swiper/react";import{Pagination as K,EffectFade as X}from"swiper/modules";import{motion as Y,AnimatePresence as Z}from"framer-motion";import{useMediaQuery as $}from"react-responsive";const ee="video",te="tabs_with_media",ie=[{time:2.4,point:2.4,highlightIdx:0},{time:2.5,point:4.9,highlightIdx:1},{time:2.5,point:7.4,highlightIdx:2},{time:2.8,point:10.2,highlightIdx:3},{time:2.6,point:12.8,highlightIdx:4},{time:3.2,point:16,highlightIdx:5}],E=A.forwardRef(({data:R,className:C},D)=>{const{title:w,poster:H,videoUrl:P,mobvideoUrl:W,items:f=[],timeIdx:a=ie}=R,[y,z]=g(null),b=x([]),T=x(null),u=x(null),h=x(null);Q(h,{componentType:ee,componentName:te,componentTitle:w}),B(D,()=>h.current);const oe=e=>{const i=T.current,s=b.current[e];if(i&&s){const t=i.getBoundingClientRect(),m=s.getBoundingClientRect().left-t.left-i.clientWidth/2+s.clientWidth/2;i.scrollTo({left:i.scrollLeft+m,behavior:"smooth"})}},k=$({query:"(max-width: 768px)"}),[ne,v,j,l,F]=V(()=>{const s=f.length,t=f?.map((n,r)=>({...n,key:r,index:r}))||[];return[t,t.concat(t),5,2,s]},[f,k]),[d,I]=g(l),[c,N]=g(v.slice(0,j)),L=(e,i,s)=>{if(e!==d&&i!==l){if(i>l){const t=i-l,n=[...c];n.splice(0,t);const r=c[c.length-1]?.key+1,m=[...v].splice(r,t);n.push(...m),N([...n])}if(i<l){const t=l-i,n=[...c];n.splice(-t);const r=c[0]?.key,m=[...v].splice(F+r-t,t);n.unshift(...m),N([...n])}if(I(e),y?.slideTo(e),!s){let t=0;a.forEach(n=>{n.highlightIdx<e&&(t+=n.time)}),u.current&&(u.current.currentTime=t)}}};return U(()=>{const e=u.current;if(!e)return;const i=()=>{const s=e.currentTime;for(let t=0;t<a.length;t++){const n=t===0?0:a[t-1].point;if(s>=n&&s<a[t].point){L(a[t].highlightIdx,a[t].highlightIdx,!0);break}}s>=a[a.length-1].point&&(e.currentTime=0,e.play())};return e.addEventListener("timeupdate",i),()=>{e.removeEventListener("timeupdate",i)}},[y,a]),S("section",{ref:h,"data-ui-component-id":"TabsWithMedia",className:p("flex flex-col overflow-hidden text-[#fff] sm:overflow-visible",C),children:[o(M,{as:"h3",size:4,html:w,className:"text-center"}),o("div",{className:" relative w-full overflow-x-auto scrollbar-hidden sm:overflow-visible",children:o("div",{className:p("mx-auto mt-[16px] w-full max-w-[824px] tablet:w-fit"),children:o("div",{className:p("flex translate-x-0 items-center justify-center gap-[16px] transition-all md:gap-[8px]"),ref:T,children:o(Z,{mode:"popLayout",children:c?.map((e,i)=>o(Y.div,{layout:!0,ref:s=>{b.current[e?.index]=s},onClick:()=>{L(e?.key,i)},className:"min-w-[28px] flex-none cursor-pointer overflow-hidden sm:overflow-visible",initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:"easeOut"},children:o("div",{className:"flex items-center justify-between",children:S("div",{className:p("flex",{"flex items-center justify-center gap-[8px] rounded-[48px] bg-[#fff] p-2 md:gap-[4px] md:p-1":d===e?.key}),children:[o("div",{className:p("flex h-[28] w-[28] items-center justify-center rounded-full md:flex-shrink-0 lg-desktop:h-[48px] lg-desktop:w-[48px]",{"h-[28px] w-[28px] bg-[#ccc] bg-opacity-50 lg-desktop:h-[48px] lg-desktop:w-[48px]":d!==e?.index}),style:d===e?.key?{background:"var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))"}:void 0,children:o(_,{source:e?.icon,className:"h-[22px] w-[22px] md:h-[14px] md:w-[14px]"})}),o("div",{className:"",children:o(M,{as:"h4",size:2,html:e?.tab,className:p("dynamic-width-heading line-clamp-1 h-0 w-0 overflow-hidden whitespace-nowrap text-nowrap text-[#000] opacity-0 transition-all duration-300 ease-linear xs:text-[16px] sm:text-[18px]",{"h-auto w-[calc-size(auto,size)] px-[6px] opacity-100":d===e?.key})})})]})})},e?.key))})})})}),o("div",{className:"mt-[16px] lg-desktop:mt-[24px]",children:o(G,{slidesPerView:1,effect:"fade",fadeEffect:{crossFade:!0},modules:[K,X],onSlideChange:e=>{const i=e.realIndex;I(i)},onSwiper:e=>z(e),children:f.map((e,i)=>o(J,{style:{transition:"opacity 1s ease-in-out"},className:"rounded-[26px]",children:o("div",{children:o(q,{as:"p",size:2,html:e.desc,className:"text-center desktop:text-[20px] lg-desktop:text-[18px]"})})},i))})}),o("div",{className:"mt-[24px] overflow-hidden rounded-[22px] laptop:mt-[32px] desktop:mt-[40px] lg-desktop:mt-[64px]",children:o("video",{className:"mx-auto h-[360px] w-fit desktop:h-[448px] lg-desktop:h-[560px]",src:k?W:P,poster:H,playsInline:!0,autoPlay:!0,muted:!0,loop:!0,ref:u})})]})});E.displayName="TabsWithMedia";var ue=O(E);export{ue as default};
|
|
2
|
+
//# sourceMappingURL=TabsWithMedia.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/TabsWithMedia/TabsWithMedia.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'\nimport { Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { TabsWithMediaProps, TabItem, TimeIndex } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, EffectFade } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\nimport { motion, AnimatePresence } from 'framer-motion'\nimport { useMediaQuery } from 'react-responsive'\n\nconst componentType = 'video'\nconst componentName = 'tabs_with_media'\n\n// \u9ED8\u8BA4\u65F6\u95F4\u70B9\u914D\u7F6E\nconst defaultTimeIdx: TimeIndex[] = [\n { time: 2.4, point: 2.4, highlightIdx: 0 },\n { time: 2.5, point: 4.9, highlightIdx: 1 },\n { time: 2.5, point: 7.4, highlightIdx: 2 },\n { time: 2.8, point: 10.2, highlightIdx: 3 },\n { time: 2.6, point: 12.8, highlightIdx: 4 },\n { time: 3.2, point: 16, highlightIdx: 5 },\n]\n\nconst TabsWithMedia = React.forwardRef<HTMLDivElement, TabsWithMediaProps>(({ data, className }, ref) => {\n const { title, poster, videoUrl, mobvideoUrl, items = [], timeIdx = defaultTimeIdx } = data\n\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n const tabRefs = useRef<(HTMLDivElement | null)[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const videoRef = useRef<HTMLVideoElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const scrollToTabCenter = (index: number) => {\n const container = scrollContainerRef.current\n const tab = tabRefs.current[index]\n\n if (container && tab) {\n const containerRect = container.getBoundingClientRect()\n const tabRect = tab.getBoundingClientRect()\n const offset = tabRect.left - containerRect.left\n const scroll = offset - container.clientWidth / 2 + tab.clientWidth / 2\n\n container.scrollTo({\n left: container.scrollLeft + scroll,\n behavior: 'smooth',\n })\n }\n }\n\n const isMob = useMediaQuery({ query: '(max-width: 768px)' })\n\n const [list, listDouble, row, center, listLength] = useMemo(() => {\n const row = 5\n const center = 2\n const listLength = items.length\n\n const list =\n items?.map((item: TabItem, index: number) => {\n return {\n ...item,\n key: index,\n index: index,\n }\n }) || []\n\n return [list, list.concat(list), row, center, listLength]\n }, [items, isMob])\n\n const [idx, setIdx] = useState(center)\n\n const [cureentList, setCureentList] = useState(listDouble.slice(0, row))\n\n // \u70B9\u51FB tab \u8DF3\u8F6C\u5BF9\u5E94\u89C6\u9891\u4F4D\u7F6E\n const handleNavClick = (key: number, index: number, isAuto?: boolean) => {\n if (key === idx) return\n if (index === center) return\n if (index > center) {\n const gap = index - center\n const copy = [...cureentList]\n copy.splice(0, gap)\n const lastkey = (cureentList[cureentList.length - 1] as any)?.key + 1\n const add = [...listDouble].splice(lastkey, gap)\n copy.push(...add)\n setCureentList([...copy])\n }\n if (index < center) {\n const gap = center - index\n const copy = [...cureentList]\n copy.splice(-gap)\n const firstkey = (cureentList[0] as any)?.key\n const add = [...listDouble].splice(listLength + firstkey - gap, gap)\n copy.unshift(...add)\n setCureentList([...copy])\n }\n\n setIdx(key)\n swiper?.slideTo(key)\n\n if (!isAuto) {\n let time = 0\n timeIdx.forEach((item) => {\n if (item.highlightIdx < key) {\n time += item.time\n }\n })\n if (videoRef.current) {\n videoRef.current.currentTime = time\n }\n }\n }\n\n // \u64AD\u653E\u65F6\u6839\u636E\u65F6\u95F4\u5207\u6362 Swiper + tab\n useEffect(() => {\n const video = videoRef.current\n if (!video) return\n\n const handleTimeUpdate = () => {\n const currentTime = video.currentTime\n\n // \u81EA\u52A8\u5207\u6362\u5185\u5BB9\n for (let i = 0; i < timeIdx.length; i++) {\n const prev = i === 0 ? 0 : timeIdx[i - 1].point\n if (currentTime >= prev && currentTime < timeIdx[i].point) {\n handleNavClick(timeIdx[i].highlightIdx, timeIdx[i].highlightIdx, true)\n break\n }\n }\n\n // \u4FEE\u590D\uFF1A\u64AD\u653E\u5230\u6700\u540E\u540E\u81EA\u52A8\u5F52\u96F6\u5E76\u91CD\u65B0\u64AD\u653E\n if (currentTime >= timeIdx[timeIdx.length - 1].point) {\n video.currentTime = 0\n video.play()\n }\n }\n\n video.addEventListener('timeupdate', handleTimeUpdate)\n return () => {\n video.removeEventListener('timeupdate', handleTimeUpdate)\n }\n }, [swiper, timeIdx])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"TabsWithMedia\"\n className={cn('flex flex-col overflow-hidden text-[#fff] sm:overflow-visible', className)}\n >\n <Heading as=\"h3\" size={4} html={title} className=\"text-center\" />\n <div className=\" relative w-full overflow-x-auto scrollbar-hidden sm:overflow-visible\">\n <div className={cn('mx-auto mt-[16px] w-full max-w-[824px] tablet:w-fit')}>\n <div\n className={cn(\n 'flex translate-x-0 items-center justify-center gap-[16px] transition-all md:gap-[8px]'\n )}\n ref={scrollContainerRef}\n >\n <AnimatePresence mode=\"popLayout\">\n {cureentList?.map((item: any, index: number) => (\n <motion.div\n layout\n key={item?.key}\n ref={(el) => {\n tabRefs.current[item?.index] = el\n }}\n onClick={() => {\n handleNavClick(item?.key, index)\n }}\n className=\"min-w-[28px] flex-none cursor-pointer overflow-hidden sm:overflow-visible\"\n initial={{ opacity: 1 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{\n duration: 0.3,\n ease: 'easeOut',\n }}\n >\n <div className=\"flex items-center justify-between\">\n <div\n className={cn('flex', {\n 'flex items-center justify-center gap-[8px] rounded-[48px] bg-[#fff] p-2 md:gap-[4px] md:p-1':\n idx === item?.key,\n })}\n >\n <div\n className={cn(\n 'flex h-[28] w-[28] items-center justify-center rounded-full md:flex-shrink-0 lg-desktop:h-[48px] lg-desktop:w-[48px]',\n {\n 'h-[28px] w-[28px] bg-[#ccc] bg-opacity-50 lg-desktop:h-[48px] lg-desktop:w-[48px]':\n idx !== item?.index,\n }\n )}\n style={\n idx === item?.key\n ? {\n background:\n 'var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))',\n }\n : undefined\n }\n >\n <Picture\n source={item?.icon}\n className=\"h-[22px] w-[22px] md:h-[14px] md:w-[14px]\"\n />\n </div>\n\n <div className=\"\">\n <Heading\n as=\"h4\"\n size={2}\n html={item?.tab}\n className={cn(\n 'dynamic-width-heading line-clamp-1 h-0 w-0 overflow-hidden whitespace-nowrap text-nowrap text-[#000] opacity-0 transition-all duration-300 ease-linear xs:text-[16px] sm:text-[18px]',\n {\n 'h-auto w-[calc-size(auto,size)] px-[6px] opacity-100':\n idx === item?.key,\n }\n )}\n />\n </div>\n </div>\n </div>\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </div>\n </div>\n <div className=\"mt-[16px] lg-desktop:mt-[24px]\">\n <Swiper\n slidesPerView={1}\n effect=\"fade\"\n fadeEffect={{ crossFade: true }}\n modules={[Pagination, EffectFade]}\n onSlideChange={(swiper) => {\n const newIndex = swiper.realIndex\n setIdx(newIndex)\n }}\n onSwiper={(swiper) => setSwiper(swiper)}\n >\n {items.map((it: TabItem, ind: number) => (\n <SwiperSlide\n key={ind}\n style={{ transition: 'opacity 1s ease-in-out' }}\n className=\"rounded-[26px]\"\n >\n <div>\n <Text\n as=\"p\"\n size={2}\n html={it.desc}\n className=\"text-center desktop:text-[20px] lg-desktop:text-[18px]\"\n />\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n <div className=\"mt-[24px] overflow-hidden rounded-[22px] laptop:mt-[32px] desktop:mt-[40px] lg-desktop:mt-[64px]\">\n <video\n className=\"mx-auto h-[360px] w-fit desktop:h-[448px] lg-desktop:h-[560px]\"\n src={isMob ? mobvideoUrl : videoUrl}\n poster={poster}\n playsInline\n autoPlay\n muted\n loop\n ref={videoRef}\n />\n </div>\n </section>\n )\n})\n\nTabsWithMedia.displayName = 'TabsWithMedia'\n\nexport default withLayout(TabsWithMedia)\n"],
|
|
5
|
+
"mappings": "aA8JM,cAAAA,EA8Bc,QAAAC,MA9Bd,oBA7JN,OAAOC,GAAS,aAAAC,EAAW,uBAAAC,EAAqB,WAAAC,EAAS,UAAAC,E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,MAAMsC,EAAWtC,EAAO,UACxBoB,EAAOkB,CAAQ,CACjB,EACA,SAAWtC,GAAWC,EAAUD,CAAM,EAErC,SAAAF,EAAM,IAAI,CAACyC,EAAaC,IACvB1E,EAACe,EAAA,CAEC,MAAO,CAAE,WAAY,wBAAyB,EAC9C,UAAU,iBAEV,SAAAf,EAAC,OACC,SAAAA,EAACU,EAAA,CACC,GAAG,IACH,KAAM,EACN,KAAM+D,EAAG,KACT,UAAU,yDACZ,EACF,GAXKC,CAYP,CACD,EACH,EACF,EACA1E,EAAC,OAAI,UAAU,mGACb,SAAAA,EAAC,SACC,UAAU,iEACV,IAAK8C,EAAQf,EAAcD,EAC3B,OAAQD,EACR,YAAW,GACX,SAAQ,GACR,MAAK,GACL,KAAI,GACJ,IAAKS,EACP,EACF,GACF,CAEJ,CAAC,EAEDd,EAAc,YAAc,gBAE5B,IAAOmD,GAAQ/D,EAAWY,CAAa",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "useEffect", "useImperativeHandle", "useMemo", "useRef", "useState", "Heading", "Picture", "Text", "cn", "withLayout", "useExposure", "Swiper", "SwiperSlide", "Pagination", "EffectFade", "motion", "AnimatePresence", "useMediaQuery", "componentType", "componentName", "defaultTimeIdx", "TabsWithMedia", "data", "className", "ref", "title", "poster", "videoUrl", "mobvideoUrl", "items", "timeIdx", "swiper", "setSwiper", "tabRefs", "scrollContainerRef", "videoRef", "boxRef", "scrollToTabCenter", "index", "container", "tab", "containerRect", "scroll", "isMob", "list", "listDouble", "row", "center", "listLength", "item", "idx", "setIdx", "cureentList", "setCureentList", "handleNavClick", "key", "isAuto", "gap", "copy", "lastkey", "add", "firstkey", "time", "video", "handleTimeUpdate", "currentTime", "i", "prev", "el", "newIndex", "it", "ind", "TabsWithMedia_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/TabsWithMedia/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { default } from './TabsWithMedia.js'\nexport type { TabsWithMediaProps, TabItem, TimeIndex } from './types.js'\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,WAAAA,MAAe",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface TabItem {
|
|
2
|
+
/** Tab 标签文本 */
|
|
3
|
+
tab: string;
|
|
4
|
+
/** 描述文本 */
|
|
5
|
+
desc: string;
|
|
6
|
+
/** Tab 图标 URL */
|
|
7
|
+
icon: string;
|
|
8
|
+
/** 视频封面图 */
|
|
9
|
+
poster?: string;
|
|
10
|
+
/** Tab 图标(可选) */
|
|
11
|
+
tabIcon?: string;
|
|
12
|
+
/** 视频 URL(可选) */
|
|
13
|
+
videoUrl?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TimeIndex {
|
|
16
|
+
/** 片段时长 */
|
|
17
|
+
time: number;
|
|
18
|
+
/** 时间节点 */
|
|
19
|
+
point: number;
|
|
20
|
+
/** 高亮索引 */
|
|
21
|
+
highlightIdx: number;
|
|
22
|
+
}
|
|
23
|
+
export interface TabsWithMediaProps {
|
|
24
|
+
data: {
|
|
25
|
+
/** 主标题 */
|
|
26
|
+
title: string;
|
|
27
|
+
/** 默认视频封面图 */
|
|
28
|
+
poster?: string;
|
|
29
|
+
/** 桌面端视频 URL */
|
|
30
|
+
videoUrl: string;
|
|
31
|
+
/** 移动端视频 URL */
|
|
32
|
+
mobvideoUrl?: string;
|
|
33
|
+
/** Tab 项列表 */
|
|
34
|
+
items: TabItem[];
|
|
35
|
+
/** 时间点配置(可选,用于视频时间自动切换) */
|
|
36
|
+
timeIdx?: TimeIndex[];
|
|
37
|
+
};
|
|
38
|
+
/** 自定义类名 */
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VideoFeatureProps } from './types.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<VideoFeatureProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
data?: Record<string, any>;
|
|
6
|
+
}, "ref"> & React.RefAttributes<any>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as c}from"react/jsx-runtime";import D,{useImperativeHandle as L,useRef as o,useState as a}from"react";import{Heading as N,Text as T}from"../../components/index.js";import{cn as w}from"../../helpers/utils.js";import{withLayout as H}from"../../shared/Styles.js";import{useExposure as M}from"../../hooks/useExposure.js";import{useIntersectionObserverDelay as p}from"../../hooks/useIntersectionObserver.js";const E="video",R="video_feature",n=D.forwardRef(({data:m,className:u},x)=>{const{title:l,subtitle:i,poster:f,videoUrl:v,mobPoster:b,mobvideoUrl:s}=m,t=o(null),r=o(null),d=o(null),[h,V]=a(""),[y,k]=a("");return M(t,{componentType:E,componentName:R,componentTitle:l,componentDescription:i}),L(x,()=>t.current),p(r,{once:!0,threshold:.1,callback:()=>{V(v)}}),p(d,{once:!0,threshold:.1,callback:()=>{s&&k(s)}}),c("section",{ref:t,"data-ui-component-id":"VideoFeature",className:w("flex flex-col items-center rounded-[16px] text-white",u),children:[e(N,{as:"h2",size:4,html:l,className:"w-full text-left laptop:text-center"}),e(T,{as:"p",size:4,html:i,className:"mt-[4px] w-full text-left text-[14px] tablet:text-[14px] laptop:mt-[8px] laptop:text-center laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]"}),c("div",{className:"mt-[24px] overflow-hidden rounded-[16px] xl:h-[360px]",children:[e("div",{ref:r,children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:f,src:h,loop:!0,className:"hidden h-full w-full object-cover xl:h-[360px] tablet:block"})}),e("div",{ref:d,children:e("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:b,src:y,loop:!0,className:"block tablet:hidden"})})]})]})});n.displayName="VideoFeature";var U=H(n);export{U as default};
|
|
2
|
+
//# sourceMappingURL=VideoFeature.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/VideoFeature/VideoFeature.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport { Heading, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useIntersectionObserverDelay } from '../../hooks/useIntersectionObserver.js'\nimport type { VideoFeatureProps } from './types.js'\n\nconst componentType = 'video'\nconst componentName = 'video_feature'\n\nconst VideoFeature = React.forwardRef<HTMLDivElement, VideoFeatureProps>(({ data, className }, ref) => {\n const { title, subtitle, poster, videoUrl, mobPoster, mobvideoUrl } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n const desktopVideoRef = useRef<HTMLDivElement>(null)\n const mobileVideoRef = useRef<HTMLDivElement>(null)\n\n // \u63A7\u5236\u89C6\u9891\u662F\u5426\u52A0\u8F7D\n const [loadedDesktopVideoSrc, setLoadedDesktopVideoSrc] = useState('')\n const [loadedMobileVideoSrc, setLoadedMobileVideoSrc] = useState('')\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u684C\u9762\u7AEF\u89C6\u9891\u61D2\u52A0\u8F7D\n useIntersectionObserverDelay(desktopVideoRef, {\n once: true,\n threshold: 0.1,\n callback: () => {\n setLoadedDesktopVideoSrc(videoUrl)\n },\n })\n\n // \u79FB\u52A8\u7AEF\u89C6\u9891\u61D2\u52A0\u8F7D\n useIntersectionObserverDelay(mobileVideoRef, {\n once: true,\n threshold: 0.1,\n callback: () => {\n if (mobvideoUrl) {\n setLoadedMobileVideoSrc(mobvideoUrl)\n }\n },\n })\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"VideoFeature\"\n className={cn('flex flex-col items-center rounded-[16px] text-white', className)}\n >\n <Heading as={'h2'} size={4} html={title} className=\"w-full text-left laptop:text-center\" />\n <Text\n as={'p'}\n size={4}\n html={subtitle}\n className=\"mt-[4px] w-full text-left text-[14px] tablet:text-[14px] laptop:mt-[8px] laptop:text-center laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />\n <div className=\"mt-[24px] overflow-hidden rounded-[16px] xl:h-[360px]\">\n <div ref={desktopVideoRef}>\n <video\n playsInline\n autoPlay\n muted\n poster={poster}\n src={loadedDesktopVideoSrc}\n loop\n className=\"hidden h-full w-full object-cover xl:h-[360px] tablet:block\"\n ></video>\n </div>\n <div ref={mobileVideoRef}>\n <video\n playsInline\n autoPlay\n muted\n poster={mobPoster}\n src={loadedMobileVideoSrc}\n loop\n className=\"block tablet:hidden\"\n ></video>\n </div>\n </div>\n </section>\n )\n})\n\nVideoFeature.displayName = 'VideoFeature'\n\nexport default withLayout(VideoFeature)\n"],
|
|
5
|
+
"mappings": "aA0DM,cAAAA,EAOA,QAAAC,MAPA,oBAzDN,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,EAAQ,YAAAC,MAAgB,QAC7D,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,gCAAAC,MAAoC,yCAG7C,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,EAAeZ,EAAM,WAA8C,CAAC,CAAE,KAAAa,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACrG,KAAM,CAAE,MAAAC,EAAO,SAAAC,EAAU,OAA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|
|
6
|
+
"names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "useState", "Heading", "Text", "cn", "withLayout", "useExposure", "useIntersectionObserverDelay", "componentType", "componentName", "VideoFeature", "data", "className", "ref", "title", "subtitle", "poster", "videoUrl", "mobPoster", "mobvideoUrl", "boxRef", "desktopVideoRef", "mobileVideoRef", "loadedDesktopVideoSrc", "setLoadedDesktopVideoSrc", "loadedMobileVideoSrc", "setLoadedMobileVideoSrc", "VideoFeature_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/VideoFeature/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { default } from './VideoFeature.js'\nexport type { VideoFeatureProps } from './types.js'\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,WAAAA,MAAe",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface VideoFeatureProps {
|
|
2
|
+
data: {
|
|
3
|
+
/** 主标题 */
|
|
4
|
+
title: string;
|
|
5
|
+
/** 副标题/描述 */
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
/** 桌面端视频 URL */
|
|
8
|
+
videoUrl: string;
|
|
9
|
+
/** 桌面端视频封面图 */
|
|
10
|
+
poster?: string;
|
|
11
|
+
/** 移动端视频 URL */
|
|
12
|
+
mobvideoUrl?: string;
|
|
13
|
+
/** 移动端视频封面图 */
|
|
14
|
+
mobPoster?: string;
|
|
15
|
+
};
|
|
16
|
+
/** 自定义类名 */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -13,6 +13,8 @@ export { default as MediaPlayerBase } from './MediaPlayerBase/index.js';
|
|
|
13
13
|
export { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js';
|
|
14
14
|
export { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js';
|
|
15
15
|
export { default as Marquee } from './Marquee/index.js';
|
|
16
|
+
export { default as MarqueeReview } from './MarqueeReview/index.js';
|
|
17
|
+
export type { MarqueeReviewProps, MarqueeReviewData, ReviewItem } from './MarqueeReview/index.js';
|
|
16
18
|
export { default as WhyChoose } from './WhyChoose/index.js';
|
|
17
19
|
export { default as Faq } from './Faq/index.js';
|
|
18
20
|
export { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js';
|
|
@@ -30,3 +32,62 @@ export { default as AiuiProvider } from './AiuiProvider/index.js';
|
|
|
30
32
|
export { default as Tabs } from './Tabs/index.js';
|
|
31
33
|
export { default as CreativeModule } from './CreativeModule/index.js';
|
|
32
34
|
export { default as GraphicOverlay } from './GraphicOverlay/index.js';
|
|
35
|
+
export { default as Specs } from './Specs/index.js';
|
|
36
|
+
export { default as TabGroup } from './TabsGroup/index.js';
|
|
37
|
+
export { default as ProductCompare } from './ProductCompare/index.js';
|
|
38
|
+
export type { ProductCompareProps, ProductItemData } from './ProductCompare/index.js';
|
|
39
|
+
export { default as Ksp } from './Ksp/index.js';
|
|
40
|
+
export type { KspProps, KspData, KspCardItem } from './Ksp/index.js';
|
|
41
|
+
export { default as ImageTextFeature } from './ImageTextFeature/index.js';
|
|
42
|
+
export type { ImageTextFeatureProps, ImageTextFeatureItem } from './ImageTextFeature/index.js';
|
|
43
|
+
export { default as FeatureCards } from './FeatureCards/index.js';
|
|
44
|
+
export type { FeatureCardsProps, FeatureCardItem } from './FeatureCards/index.js';
|
|
45
|
+
export { default as ImageWithText } from './ImageWithText/index.js';
|
|
46
|
+
export type { ImageWithTextProps } from './ImageWithText/index.js';
|
|
47
|
+
export { default as VideoFeature } from './VideoFeature/index.js';
|
|
48
|
+
export type { VideoFeatureProps } from './VideoFeature/index.js';
|
|
49
|
+
export { default as TabsWithMedia } from './TabsWithMedia/index.js';
|
|
50
|
+
export type { TabsWithMediaProps, TabItem, TimeIndex } from './TabsWithMedia/index.js';
|
|
51
|
+
export { default as TabWithImage } from './TabWithImage/index.js';
|
|
52
|
+
export type { TabWithImageProps, TabWithImageDataItem } from './TabWithImage/index.js';
|
|
53
|
+
export { default as FeatureShowcase } from './FeatureShowcase/index.js';
|
|
54
|
+
export type { FeatureShowcaseProps, FeatureShowcaseItem } from './FeatureShowcase/index.js';
|
|
55
|
+
export { default as ProductHero } from './ProductHero/index.js';
|
|
56
|
+
export type { ProductHeroProps } from './ProductHero/index.js';
|
|
57
|
+
export { default as SpecsComparison } from './SpecsComparison/index.js';
|
|
58
|
+
export type { SpecsComparisonProps, SpecsComparisonMenuItem, SpecsComparisonLeftMenuItem, } from './SpecsComparison/index.js';
|
|
59
|
+
export declare const PAYLOAD_COMPONENT_MAP: {
|
|
60
|
+
'ipc-aplusdesc': string;
|
|
61
|
+
'ipc-banner': string;
|
|
62
|
+
'ipc-brand-equity': string;
|
|
63
|
+
'ipc-category': string;
|
|
64
|
+
'ipc-collection-banner': string;
|
|
65
|
+
'ipc-collection-shelves': string;
|
|
66
|
+
'ipc-creativemodule': string;
|
|
67
|
+
'ipc-download': string;
|
|
68
|
+
'ipc-evaluate': string;
|
|
69
|
+
'ipc-faq': string;
|
|
70
|
+
'ipc-features': string;
|
|
71
|
+
'ipc-footcharger': string;
|
|
72
|
+
'ipc-ga-block': string;
|
|
73
|
+
'ipc-giftbox': string;
|
|
74
|
+
'ipc-graphic': string;
|
|
75
|
+
'ipc-graphicmore': string;
|
|
76
|
+
'ipc-graphicoverlay': string;
|
|
77
|
+
'ipc-marquee': string;
|
|
78
|
+
'ipc-mediaplayerbase': string;
|
|
79
|
+
'ipc-mediaplayermulti': string;
|
|
80
|
+
'ipc-mediaplayersticky': string;
|
|
81
|
+
'ipc-member-equity': string;
|
|
82
|
+
'ipc-mlg-block': string;
|
|
83
|
+
'ipc-search-page-tabs': string;
|
|
84
|
+
'ipc-selectstore': string;
|
|
85
|
+
'ipc-shelfdisplay': string;
|
|
86
|
+
'ipc-slogan': string;
|
|
87
|
+
'ipc-spacer': string;
|
|
88
|
+
'ipc-specs': string;
|
|
89
|
+
'ipc-tabs': string;
|
|
90
|
+
'ipc-text-marquee': string;
|
|
91
|
+
'ipc-title': string;
|
|
92
|
+
'ipc-whychoose': string;
|
|
93
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{default as
|
|
1
|
+
import{default as t}from"./BrandEquity/index.js";import{default as p}from"./MemberEquity/index.js";import{default as s}from"./Slogan/index.js";import{default as f}from"./Title/index.js";import{default as l}from"./Spacer/index.js";import{default as d}from"./ShelfDisplay/index.js";import{default as n}from"./Evaluate/index.js";import{default as h}from"./Category/index.js";import{default as g}from"./HeroBanner/index.js";import{default as C}from"./AccordionCards/index.js";import{default as T}from"./Graphic/index.js";import{default as b}from"./MediaPlayerBase/index.js";import{default as F}from"./MediaPlayerSticky/index.js";import{default as B}from"./MediaPlayerMulti/index.js";import{default as j}from"./Marquee/index.js";import{default as w}from"./MarqueeReview/index.js";import{default as W}from"./WhyChoose/index.js";import{default as E}from"./Faq/index.js";import{MarqueeItem as H,MarqueeImageContent as R,MarqueeTextContent as K}from"./Marquee/index.js";import{default as N}from"./MultiLayoutGraphicBlock/index.js";import{default as V}from"./GraphicAttractionBlock/index.js";import{default as z}from"./HeaderNavigation/index.js";import{default as Q}from"./FooterNavigation/index.js";import{default as X}from"./SearchPage/index.js";import{IPC_SEARCH_PAGE as $,SearchPageTabType as ee}from"./SearchPage/types.js";import{withLayout as re}from"../shared/Styles.js";import{default as oe}from"./AiuiProvider/index.js";import{default as ie}from"./Tabs/index.js";import{default as ce}from"./CreativeModule/index.js";import{default as ue}from"./GraphicOverlay/index.js";import{default as me}from"./Specs/index.js";import{default as xe}from"./TabsGroup/index.js";import{default as ye}from"./ProductCompare/index.js";import{default as Pe}from"./Ksp/index.js";import{default as Me}from"./ImageTextFeature/index.js";import{default as Se}from"./FeatureCards/index.js";import{default as Ie}from"./ImageWithText/index.js";import{default as qe}from"./VideoFeature/index.js";import{default as ve}from"./TabsWithMedia/index.js";import{default as Ge}from"./TabWithImage/index.js";import{default as ke}from"./FeatureShowcase/index.js";import{default as Ae}from"./ProductHero/index.js";import{default as De}from"./SpecsComparison/index.js";const e={"ipc-aplusdesc":"AplusDesc","ipc-banner":"Banner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose"};export{C as AccordionCards,oe as AiuiProvider,t as BrandEquity,h as Category,ce as CreativeModule,n as Evaluate,E as Faq,Se as FeatureCards,ke as FeatureShowcase,Q as FooterNavigation,T as Graphic,V as GraphicAttractionBlock,ue as GraphicOverlay,z as HeaderNavigation,g as HeroBanner,$ as IPC_SEARCH_PAGE,Me as ImageTextFeature,Ie as ImageWithText,Pe as Ksp,j as Marquee,R as MarqueeImageContent,H as MarqueeItem,w as MarqueeReview,K as MarqueeTextContent,b as MediaPlayerBase,B as MediaPlayerMulti,F as MediaPlayerSticky,p as MemberEquity,N as MultiLayoutGraphicBlock,e as PAYLOAD_COMPONENT_MAP,ye as ProductCompare,Ae as ProductHero,X as SearchPage,ee as SearchPageTabType,d as ShelfDisplay,s as Slogan,l as Spacer,me as Specs,De as SpecsComparison,xe as TabGroup,Ge as TabWithImage,ie as Tabs,ve as TabsWithMedia,f as Title,qe as VideoFeature,W as WhyChoose,re as withLayout};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|