@anker-in/headless-ui 1.0.25 → 1.0.26-alpha.1761902931346
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 +21 -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 +21 -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/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 +29 -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/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 +41 -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 +19 -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 +59 -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/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 +21 -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 +21 -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/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 +29 -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/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 +41 -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 +19 -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 +59 -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/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,31 @@
|
|
|
1
|
+
import type { Media, Theme } from '../../types/props.js';
|
|
2
|
+
export interface ImageTextFeatureItem {
|
|
3
|
+
/** 功能图标 */
|
|
4
|
+
icon: string;
|
|
5
|
+
/** 功能标题 */
|
|
6
|
+
text: string;
|
|
7
|
+
/** 功能描述 */
|
|
8
|
+
desc: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ImageTextFeatureProps {
|
|
11
|
+
data: {
|
|
12
|
+
/** 主标题 */
|
|
13
|
+
title: string;
|
|
14
|
+
/** 副标题 */
|
|
15
|
+
subtitle?: string;
|
|
16
|
+
/** PC端图片 */
|
|
17
|
+
pcImage: Media;
|
|
18
|
+
/** 移动端图片 */
|
|
19
|
+
mobileImage: Media;
|
|
20
|
+
/** 平板端图片 */
|
|
21
|
+
padImage?: Media;
|
|
22
|
+
/** 功能项列表 */
|
|
23
|
+
items: ImageTextFeatureItem[];
|
|
24
|
+
/** 图片位置,默认 left */
|
|
25
|
+
imagePosition?: 'left' | 'right';
|
|
26
|
+
/** 主题,默认 light */
|
|
27
|
+
theme?: Theme;
|
|
28
|
+
};
|
|
29
|
+
/** 自定义类名 */
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ImageWithTextProps } from './types.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<ImageWithTextProps & 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 a}from"react/jsx-runtime";import g,{useImperativeHandle as h,useRef as T}from"react";import{Heading as s,Picture as v,Text as N}from"../../components/index.js";import{cn as I}from"../../helpers/utils.js";import{withLayout as w}from"../../shared/Styles.js";import{useExposure as k}from"../../hooks/useExposure.js";const y="image",D="image_with_text",r=g.forwardRef(({data:n,className:c},d)=>{const{title:m,subtitle:t,desc:x,descIcon:i,image:p,padImage:f,mobileImage:u,theme:l="dark"}=n,o=T(null);return k(o,{componentType:y,componentName:D,componentTitle:m,componentDescription:t}),h(d,()=>o.current),a("section",{ref:o,"data-ui-component-id":"ImageWithText",className:I("flex flex-col gap-[24px] laptop:flex-row laptop:gap-[48px] lg-desktop:gap-[64px]",{"text-white":l==="dark","text-[#1f1f1f]":l==="light"},c),children:[a("div",{className:"flex flex-col justify-center",children:[e(s,{as:"h2",size:4,html:m}),t&&e(N,{as:"p",size:3,html:t,className:"mt-[4px] text-[14px] tablet:text-[14px] laptop:mt-[16px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]"}),a("div",{className:"flex flex-row gap-[8px]",children:[i&&e("img",{src:i,alt:"icon",className:"h-[36px] w-[36px] desktop:h-[48px] desktop:w-[48px]"}),x&&e(s,{as:"h4",size:5,html:x,className:"text-[#3AD1FF] md:text-[40px] min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px]"})]})]}),e("div",{className:"",children:e(v,{source:`${p.url},${f?.url||p.url} 1024, ${u?.url||p.url} 768`,className:"rounded-[10px] laptop:rounded-[16px]"})})]})});r.displayName="ImageWithText";var R=w(r);export{R as default};
|
|
2
|
+
//# sourceMappingURL=ImageWithText.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ImageWithText/ImageWithText.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } 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 { ImageWithTextProps } from './types.js'\n\nconst componentType = 'image'\nconst componentName = 'image_with_text'\n\nconst ImageWithText = React.forwardRef<HTMLDivElement, ImageWithTextProps>(({ data, className }, ref) => {\n const { title, subtitle, desc, descIcon, image, padImage, mobileImage, theme = 'dark' } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\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 return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ImageWithText\"\n className={cn(\n 'flex flex-col gap-[24px] laptop:flex-row laptop:gap-[48px] lg-desktop:gap-[64px]',\n {\n 'text-white': theme === 'dark',\n 'text-[#1f1f1f]': theme === 'light',\n },\n className\n )}\n >\n <div className=\"flex flex-col justify-center\">\n <Heading as={'h2'} size={4} html={title} />\n {subtitle && (\n <Text\n as={'p'}\n size={3}\n html={subtitle}\n className=\"mt-[4px] text-[14px] tablet:text-[14px] laptop:mt-[16px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />\n )}\n <div className=\"flex flex-row gap-[8px]\">\n {descIcon && (\n <img src={descIcon} alt=\"icon\" className=\"h-[36px] w-[36px] desktop:h-[48px] desktop:w-[48px]\" />\n )}\n {desc && (\n <Heading\n as={'h4'}\n size={5}\n html={desc}\n className=\"text-[#3AD1FF] md:text-[40px] min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px]\"\n />\n )}\n </div>\n </div>\n <div className=\"\">\n <Picture\n source={`${image.url},${padImage?.url || image.url} 1024, ${mobileImage?.url || image.url} 768`}\n className=\"rounded-[10px] laptop:rounded-[16px]\"\n />\n </div>\n </section>\n )\n})\n\nIm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I,UAAU,GACb,SAAAA,EAACM,EAAA,CACC,OAAQ,GAAGe,EAAM,GAAG,IAAIC,GAAU,KAAOD,EAAM,GAAG,UAAUE,GAAa,KAAOF,EAAM,GAAG,OACzF,UAAU,uCACZ,EACF,GACF,CAEJ,CAAC,EAEDR,EAAc,YAAc,gBAE5B,IAAOa,EAAQjB,EAAWI,CAAa",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "Heading", "Picture", "Text", "cn", "withLayout", "useExposure", "componentType", "componentName", "ImageWithText", "data", "className", "ref", "title", "subtitle", "desc", "descIcon", "image", "padImage", "mobileImage", "theme", "boxRef", "ImageWithText_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ImageWithText/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { default } from './ImageWithText.js'\nexport type { ImageWithTextProps } from './types.js'\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,WAAAA,MAAe",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Media, Theme } from '../../types/props.js';
|
|
2
|
+
export interface ImageWithTextProps {
|
|
3
|
+
data: {
|
|
4
|
+
/** 主标题 */
|
|
5
|
+
title: string;
|
|
6
|
+
/** 副标题/描述 */
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
/** 描述文本(通常是大号高亮文本) */
|
|
9
|
+
desc?: string;
|
|
10
|
+
/** 描述文本图标 */
|
|
11
|
+
descIcon?: string;
|
|
12
|
+
/** PC端图片 URL */
|
|
13
|
+
image: Media;
|
|
14
|
+
/** 平板端图片 URL */
|
|
15
|
+
padImage?: Media;
|
|
16
|
+
/** 移动端图片 URL */
|
|
17
|
+
mobileImage?: Media;
|
|
18
|
+
/** 主题,默认 dark */
|
|
19
|
+
theme?: Theme;
|
|
20
|
+
};
|
|
21
|
+
/** 自定义类名 */
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KSP 卡片项数据结构
|
|
3
|
+
*/
|
|
4
|
+
export interface KspCardItem {
|
|
5
|
+
/** 标题 */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** 描述 */
|
|
8
|
+
desc?: string;
|
|
9
|
+
/** 桌面端图片 URL */
|
|
10
|
+
imageUrl?: string;
|
|
11
|
+
/** 移动端图片 URL */
|
|
12
|
+
mobImageUrl?: string;
|
|
13
|
+
/** 桌面端视频 URL */
|
|
14
|
+
videoUrl?: string;
|
|
15
|
+
/** 移动端视频 URL */
|
|
16
|
+
mobVideoUrl?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* KSP 数据结构
|
|
20
|
+
*/
|
|
21
|
+
export interface KspData {
|
|
22
|
+
/** 主标题 */
|
|
23
|
+
title?: string;
|
|
24
|
+
/** KSP 卡片列表(需要 7 个项) */
|
|
25
|
+
items: KspCardItem[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Ksp 组件 Props
|
|
29
|
+
*/
|
|
30
|
+
export interface KspProps {
|
|
31
|
+
/** KSP 数据 */
|
|
32
|
+
data: KspData;
|
|
33
|
+
/** 自定义类名 */
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<KspProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
|
|
37
|
+
className?: string;
|
|
38
|
+
data?: Record<string, any>;
|
|
39
|
+
} & import("react").RefAttributes<any>>;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Fragment as w,jsx as e,jsxs as p}from"react/jsx-runtime";import{Heading as i,Picture as c,Text as n}from"../../components/index.js";import{cn as r}from"../../helpers/utils.js";import{withLayout as k}from"../../shared/Styles.js";const s=({title:l,desc:o,imageUrl:a,mobImageUrl:t,videoUrl:m,mobVideoUrl:d,className:x})=>p("div",{className:r("ksp-card relative overflow-hidden rounded-[16px] bg-[#1f1f1f]",x),children:[m&&d?p(w,{children:[e("video",{playsInline:!0,autoPlay:!0,muted:!0,loop:!0,src:m,poster:a,className:"ksp-card-video ksp-card-video-desktop absolute bottom-0 hidden w-full laptop:inline-block"}),e("video",{playsInline:!0,autoPlay:!0,muted:!0,loop:!0,src:d,poster:t,className:"ksp-card-video ksp-card-video-mobile absolute inline-block -translate-y-[80px] object-contain object-center laptop:hidden"})]}):(a||t)&&e(c,{source:`${a}, ${t} 768`,className:"ksp-card-image h-full w-full",imgClassName:"h-full w-full object-cover object-bottom"}),p("div",{className:"ksp-card-content absolute left-[16px] top-[16px] desktop:left-[24px] desktop:top-[24px] lg-desktop:left-[32px] lg-desktop:top-[32px]",children:[e(i,{size:3,html:l,className:"ksp-card-title hidden w-full tablet:block"}),e(i,{size:2,html:l,className:"ksp-card-title block w-full tablet:hidden tablet:w-[340px]"}),e(n,{size:2,html:o,className:"ksp-card-desc mt-[4px] text-[14px] tablet:block tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]"})]})]});function h({data:l,className:o}){const{title:a,items:t}=l;return p("section",{"data-ui-component-id":"ksp",className:r("ksp-container flex scroll-mt-[108px] flex-col justify-center bg-black laptop:scroll-mt-[46px]",o),children:[e(i,{as:"h1",size:4,html:a,className:"ksp-title text-left text-white laptop:text-center"}),p("div",{className:"ksp-desktop-layout mt-[24px] hidden flex-col gap-4 text-white min-md:mt-[24px] min-xxl:mt-[24px] tablet:flex",children:[p("div",{className:"ksp-row ksp-row-1 flex flex-nowrap items-stretch gap-4",children:[e(s,{className:"w-[59.53%] tablet:min-h-[240px] desktop:min-h-[256px] lg-desktop:min-h-[320px]",...t[0]}),e(s,{className:"w-[39.30%] tablet:min-h-[240px] desktop:min-h-[256px] lg-desktop:min-h-[320px]",...t[1]})]}),p("div",{className:"ksp-row ksp-row-2 flex flex-nowrap items-stretch gap-4",children:[e(s,{className:"w-[33%] tablet:min-h-[240px] laptop:w-[29.19%] desktop:min-h-[256px] lg-desktop:min-h-[320px]",...t[4]}),e(s,{className:"w-[33%] tablet:min-h-[240px] laptop:w-[39.30%] desktop:min-h-[256px] lg-desktop:min-h-[320px]",...t[3]}),e(s,{className:"w-[33%] tablet:min-h-[240px] laptop:w-[29.19%] desktop:min-h-[256px] lg-desktop:min-h-[320px]",...t[2]})]}),p("div",{className:"ksp-row ksp-row-3 flex flex-nowrap items-stretch gap-4",children:[e(s,{className:"order-2 w-[59.53%] tablet:min-h-[240px] desktop:order-1 desktop:min-h-[256px] desktop:w-[39.30%] lg-desktop:min-h-[320px]",...t[5]}),e(s,{className:"order-1 w-[39.30%] tablet:min-h-[240px] desktop:order-2 desktop:min-h-[256px] desktop:w-[59.53%] lg-desktop:min-h-[320px]",...t[6]})]})]}),p("div",{className:"ksp-mobile-layout mt-[24px] flex flex-col gap-[12px] text-white tablet:hidden",children:[e(s,{className:"h-[240px] w-[100%]",...t[0]}),p("div",{className:"ksp-row ksp-row-mobile-1 flex max-h-[240px] flex-nowrap items-stretch gap-[12px]",children:[e(s,{className:"w-[50%]",...t[1]}),e(s,{className:"w-[50%]",...t[2]})]}),e(s,{className:"max-h-[240px] w-[100%]",...t[6]}),p("div",{className:"ksp-row ksp-row-mobile-2 flex max-h-[240px] flex-nowrap items-stretch gap-[12px]",children:[e(s,{className:"w-[50%]",...t[3]}),e(s,{className:"w-[50%]",...t[4]})]}),e(s,{className:"max-h-[280px] w-[100%]",...t[5]})]})]})}var g=k(h);export{g as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/Ksp/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\n\n/**\n * KSP \u5361\u7247\u9879\u6570\u636E\u7ED3\u6784\n */\nexport interface KspCardItem {\n /** \u6807\u9898 */\n title?: string\n /** \u63CF\u8FF0 */\n desc?: string\n /** \u684C\u9762\u7AEF\u56FE\u7247 URL */\n imageUrl?: string\n /** \u79FB\u52A8\u7AEF\u56FE\u7247 URL */\n mobImageUrl?: string\n /** \u684C\u9762\u7AEF\u89C6\u9891 URL */\n videoUrl?: string\n /** \u79FB\u52A8\u7AEF\u89C6\u9891 URL */\n mobVideoUrl?: string\n}\n\n/**\n * KSP \u6570\u636E\u7ED3\u6784\n */\nexport interface KspData {\n /** \u4E3B\u6807\u9898 */\n title?: string\n /** KSP \u5361\u7247\u5217\u8868\uFF08\u9700\u8981 7 \u4E2A\u9879\uFF09 */\n items: KspCardItem[]\n}\n\n/**\n * Ksp \u7EC4\u4EF6 Props\n */\nexport interface KspProps {\n /** KSP \u6570\u636E */\n data: KspData\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\ninterface ImageCardProps extends KspCardItem {\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nconst ImageCard = ({\n title,\n desc,\n imageUrl,\n mobImageUrl,\n videoUrl,\n mobVideoUrl,\n className,\n}: ImageCardProps) => {\n return (\n <div className={cn('ksp-card relative overflow-hidden rounded-[16px] bg-[#1f1f1f]', className)}>\n {videoUrl && mobVideoUrl ? (\n <>\n <video\n playsInline\n autoPlay\n muted\n loop\n src={videoUrl}\n poster={imageUrl}\n className=\"ksp-card-video ksp-card-video-desktop absolute bottom-0 hidden w-full laptop:inline-block\"\n />\n <video\n playsInline\n autoPlay\n muted\n loop\n src={mobVideoUrl}\n poster={mobImageUrl}\n className=\"ksp-card-video ksp-card-video-mobile absolute inline-block -translate-y-[80px] object-contain object-center laptop:hidden\"\n />\n </>\n ) : (\n (imageUrl || mobImageUrl) && (\n <Picture\n source={`${imageUrl}, ${mobImageUrl} 768`}\n className=\"ksp-card-image h-full w-full\"\n imgClassName=\"h-full w-full object-cover object-bottom\"\n />\n )\n )}\n <div className=\"ksp-card-content absolute left-[16px] top-[16px] desktop:left-[24px] desktop:top-[24px] lg-desktop:left-[32px] lg-desktop:top-[32px]\">\n <Heading size={3} html={title} className=\"ksp-card-title hidden w-full tablet:block\" />\n <Heading size={2} html={title} className=\"ksp-card-title block w-full tablet:hidden tablet:w-[340px]\" />\n <Text\n size={2}\n html={desc}\n className=\"ksp-card-desc mt-[4px] text-[14px] tablet:block tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />\n </div>\n\n </div>\n )\n}\n\n/**\n * Ksp - Key Selling Point \u5173\u952E\u5356\u70B9\u7EC4\u4EF6\n * \n * \u5C55\u793A\u4EA7\u54C1\u7684\u5173\u952E\u5356\u70B9\uFF0C\u652F\u6301\u56FE\u7247\u548C\u89C6\u9891\uFF0C\u5177\u6709\u590D\u6742\u7684\u54CD\u5E94\u5F0F\u5E03\u5C40\u3002\n * \u5E03\u5C40\u9700\u8981 7 \u4E2A\u5361\u7247\u9879\uFF0C\u5206\u522B\u5BF9\u5E94\u4E0D\u540C\u5C3A\u5BF8\u548C\u4F4D\u7F6E\u3002\n * \n * @example\n * ```tsx\n * <Ksp\n * data={{\n * title: '\u4E3A\u4EC0\u4E48\u9009\u62E9\u6211\u4EEC',\n * items: [\n * {\n * title: '\u9AD8\u6027\u80FD',\n * desc: '\u5F3A\u5927\u7684\u5904\u7406\u80FD\u529B',\n * imageUrl: '/desktop.jpg',\n * mobImageUrl: '/mobile.jpg'\n * },\n * // ... \u9700\u8981 7 \u4E2A\u9879\n * ]\n * }}\n * />\n * ```\n */\nfunction Ksp({ data, className }: KspProps) {\n const { title, items } = data\n\n return (\n <section\n data-ui-component-id=\"ksp\"\n className={cn('ksp-container flex scroll-mt-[108px] flex-col justify-center bg-black laptop:scroll-mt-[46px]', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"ksp-title text-left text-white laptop:text-center\" />\n {/* ipad, pc\u7AEF */}\n <div className=\"ksp-desktop-layout mt-[24px] hidden flex-col gap-4 text-white min-md:mt-[24px] min-xxl:mt-[24px] tablet:flex\">\n <div className=\"ksp-row ksp-row-1 flex flex-nowrap items-stretch gap-4\">\n <ImageCard\n className=\"w-[59.53%] tablet:min-h-[240px] desktop:min-h-[256px] lg-desktop:min-h-[320px]\"\n {...items[0]}\n />\n <ImageCard\n className=\"w-[39.30%] tablet:min-h-[240px] desktop:min-h-[256px] lg-desktop:min-h-[320px]\"\n {...items[1]}\n />\n </div>\n\n <div className=\"ksp-row ksp-row-2 flex flex-nowrap items-stretch gap-4\">\n <ImageCard\n className=\"w-[33%] tablet:min-h-[240px] laptop:w-[29.19%] desktop:min-h-[256px] lg-desktop:min-h-[320px]\"\n {...items[4]}\n />\n <ImageCard\n className=\"w-[33%] tablet:min-h-[240px] laptop:w-[39.30%] desktop:min-h-[256px] lg-desktop:min-h-[320px]\"\n {...items[3]}\n />\n <ImageCard\n className=\"w-[33%] tablet:min-h-[240px] laptop:w-[29.19%] desktop:min-h-[256px] lg-desktop:min-h-[320px]\"\n {...items[2]}\n />\n </div>\n\n <div className=\"ksp-row ksp-row-3 flex flex-nowrap items-stretch gap-4\">\n <ImageCard\n className=\"order-2 w-[59.53%] tablet:min-h-[240px] desktop:order-1 desktop:min-h-[256px] desktop:w-[39.30%] lg-desktop:min-h-[320px]\"\n {...items[5]}\n />\n <ImageCard\n className=\"order-1 w-[39.30%] tablet:min-h-[240px] desktop:order-2 desktop:min-h-[256px] desktop:w-[59.53%] lg-desktop:min-h-[320px]\"\n {...items[6]}\n />\n </div>\n </div>\n\n {/* \u624B\u673A\u7AEF */}\n <div className=\"ksp-mobile-layout mt-[24px] flex flex-col gap-[12px] text-white tablet:hidden\">\n <ImageCard className=\"h-[240px] w-[100%]\" {...items[0]} />\n <div className=\"ksp-row ksp-row-mobile-1 flex max-h-[240px] flex-nowrap items-stretch gap-[12px]\">\n <ImageCard className=\"w-[50%]\" {...items[1]} />\n <ImageCard className=\"w-[50%]\" {...items[2]} />\n </div>\n <ImageCard className=\"max-h-[240px] w-[100%]\" {...items[6]} />\n <div className=\"ksp-row ksp-row-mobile-2 flex max-h-[240px] flex-nowrap items-stretch gap-[12px]\">\n <ImageCard className=\"w-[50%]\" {...items[3]} />\n <ImageCard className=\"w-[50%]\" {...items[4]} />\n </div>\n <ImageCard className=\"max-h-[280px] w-[100%]\" {...items[5]} />\n </div>\n </section>\n )\n}\n\n\nexport default withLayout(Ksp)"],
|
|
5
|
+
"mappings": "AA2DQ,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBA3DR,OAAS,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BACvC,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBA6C3B,MAAMC,EAAY,CAAC,CACjB,MAAAC,EACA,KAAAC,EACA,SAAAC,EACA,YAAAC,EACA,SAAAC,EACA,YAAAC,EACA,UAAAC,CACF,IAEIb,EAAC,OAAI,UAAWI,EAAG,gEAAiES,CAAS,EAC1F,UAAAF,GAAYC,EACXZ,EAAAF,EAAA,CACE,UAAAC,EAAC,SACC,YAAW,GACX,SAAQ,GACR,MAAK,GACL,KAAI,GACJ,IAAKY,EACL,OAAQF,EACR,UAAU,4FACZ,EACAV,EAAC,SACC,YAAW,GACX,SAAQ,GACR,MAAK,GACL,KAAI,GACJ,IAAKa,EACL,OAAQF,EACR,UAAU,4HACZ,GACF,GAECD,GAAYC,IACXX,EAACG,EAAA,CACC,OAAQ,GAAGO,CAAQ,KAAKC,CAAW,OACnC,UAAU,+BACV,aAAa,2CACf,EAGJV,EAAC,OAAI,UAAU,uIACb,UAAAD,EAACE,EAAA,CAAQ,KAAM,EAAG,KAAMM,EAAO,UAAU,4CAA4C,E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ACAjB,EAACO,EAAA,CAAU,UAAU,yBAA0B,GAAGU,EAAM,CAAC,EAAG,EAC5DhB,EAAC,OAAI,UAAU,mFACb,UAAAD,EAACO,EAAA,CAAU,UAAU,UAAW,GAAGU,EAAM,CAAC,EAAG,EAC7CjB,EAACO,EAAA,CAAU,UAAU,UAAW,GAAGU,EAAM,CAAC,EAAG,GAC/C,EACAjB,EAACO,EAAA,CAAU,UAAU,yBAA0B,GAAGU,EAAM,CAAC,EAAG,GAC9D,GACF,CAEJ,CAGA,IAAOC,EAAQZ,EAAWS,CAAG",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "Heading", "Picture", "Text", "cn", "withLayout", "ImageCard", "title", "desc", "imageUrl", "mobImageUrl", "videoUrl", "mobVideoUrl", "className", "Ksp", "data", "items", "Ksp_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Theme } from '../../types/props.js';
|
|
2
|
+
/**
|
|
3
|
+
* 评论项数据结构
|
|
4
|
+
*/
|
|
5
|
+
export interface ReviewItem {
|
|
6
|
+
/** 评论者名称 */
|
|
7
|
+
name: string;
|
|
8
|
+
/** 评论者头像 URL */
|
|
9
|
+
avatar: string;
|
|
10
|
+
/** 评论内容 */
|
|
11
|
+
comment: string;
|
|
12
|
+
/** 评分(1-5星) */
|
|
13
|
+
rating?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 轮播评论数据结构
|
|
17
|
+
*/
|
|
18
|
+
export interface MarqueeReviewData {
|
|
19
|
+
/** 主标题 */
|
|
20
|
+
title: string;
|
|
21
|
+
/** 副标题 */
|
|
22
|
+
subtitle: string;
|
|
23
|
+
/** 评论列表 */
|
|
24
|
+
items: ReviewItem[];
|
|
25
|
+
/** 主题:light 或 dark */
|
|
26
|
+
theme?: Theme;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* MarqueeReview 组件 Props
|
|
30
|
+
*/
|
|
31
|
+
export interface MarqueeReviewProps {
|
|
32
|
+
/** 评论数据 */
|
|
33
|
+
data: MarqueeReviewData;
|
|
34
|
+
/** 自定义类名 */
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<MarqueeReviewProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
|
|
38
|
+
className?: string;
|
|
39
|
+
data?: Record<string, any>;
|
|
40
|
+
} & import("react").RefAttributes<any>>;
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Text as o,Heading as c,Avatar as g,AvatarImage as k,AvatarFallback as w}from"../../components/index.js";import{cn as m}from"../../helpers/utils.js";import{withLayout as b}from"../../shared/Styles.js";const x=9,u=3,y=(t,a)=>Array.from({length:Math.ceil(t.length/a)},(i,p)=>t.slice(p*a,(p+1)*a)),N=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})}),C=({item:t})=>r("div",{className:"flex h-[240px] flex-grow flex-col justify-between rounded-2xl bg-container-primary p-[16px] text-info-primary min-l:p-[24px] laptop:h-[240px] desktop:h-[240px] lg-desktop:h-[240px]",children:[r("div",{className:"flex justify-between",children:[r("div",{className:"flex flex-col",children:[e(o,{size:4,html:t.name,className:"hidden laptop:block"}),e(o,{size:2,html:t.name,className:"block laptop:hidden"}),e("div",{className:"mt-2 flex gap-1",children:new Array(t.rating||5).fill(0).map((a,i)=>e(N,{},i))})]}),r(g,{size:"small",className:" h-[40px] w-[40px] laptop:h-[48px] laptop:w-[48px]",children:[e(k,{src:t.avatar,alt:"avatar"}),e(w,{children:(t.name??"").slice(0,2).toUpperCase()})]})]}),e("div",{children:e(c,{as:"h6",size:2,html:`"${t.comment}`,className:"line-clamp-5 min-h-[120px] text-wrap"})})]});function L({data:t,className:a}){const{title:i,subtitle:p,items:l=[],theme:f="light"}=t,d=y(l.length<x?[...l,...l.slice(x-l.length)]:l,u).slice(0,3).map(n=>[...n,...n]);return r("section",{className:m("flex flex-col items-center justify-center py-3 text-info-primary",a,{"aiui-dark":f==="dark"}),children:[e("style",{jsx:!0,children:`
|
|
2
|
+
@keyframes scroll {
|
|
3
|
+
from {
|
|
4
|
+
transform: translateX(0%);
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
transform: translateY(-50%);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.fade-edges {
|
|
12
|
+
-webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
|
|
13
|
+
mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
|
|
14
|
+
-webkit-mask-repeat: no-repeat;
|
|
15
|
+
mask-repeat: no-repeat;
|
|
16
|
+
-webkit-mask-size: 100% 100%;
|
|
17
|
+
mask-size: 100% 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.scroll-track {
|
|
21
|
+
animation: scroll 20s linear infinite;
|
|
22
|
+
height: fit-content;
|
|
23
|
+
}
|
|
24
|
+
`}),e(c,{as:"h1",size:4,html:i,className:"w-full text-left laptop:text-center"}),e(o,{size:2,html:p,className:"mt-[4px] w-full text-left text-[14px] tablet:mt-[16px] tablet:text-[14px] laptop:text-center laptop:text-[14px] desktop:mt-[8px] desktop:text-[16px] lg-desktop:text-[18px]"}),e("div",{className:m("fade-edges mt-[24px] flex h-[480px] gap-4 overflow-hidden laptop:h-[384px] desktop:h-[512px] lg-desktop:h-[640px]"),children:d.map((n,s)=>e("div",{className:m("scroll-track relative flex flex-col gap-4 flex-1",{"top-10":s===0||s===2,"hidden desktop:flex":s===1,"hidden tablet:flex":s===2}),children:n.map((h,v)=>e(C,{item:h},v))},s))})]})}var R=b(L);export{R as default};
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/MarqueeReview/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text, Heading, Avatar, AvatarImage, AvatarFallback } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { Theme } from '../../types/props.js'\n\nconst FIX_ITEMS_LENGTH = 9\nconst COUNT = 3\n\n/**\n * \u8BC4\u8BBA\u9879\u6570\u636E\u7ED3\u6784\n */\nexport interface ReviewItem {\n /** \u8BC4\u8BBA\u8005\u540D\u79F0 */\n name: string\n /** \u8BC4\u8BBA\u8005\u5934\u50CF URL */\n avatar: string\n /** \u8BC4\u8BBA\u5185\u5BB9 */\n comment: string\n /** \u8BC4\u5206(1-5\u661F) */\n rating?: number\n}\n\n/**\n * \u8F6E\u64AD\u8BC4\u8BBA\u6570\u636E\u7ED3\u6784\n */\nexport interface MarqueeReviewData {\n /** \u4E3B\u6807\u9898 */\n title: string\n /** \u526F\u6807\u9898 */\n subtitle: string\n /** \u8BC4\u8BBA\u5217\u8868 */\n items: ReviewItem[]\n /** \u4E3B\u9898\uFF1Alight \u6216 dark */\n theme?: Theme\n}\n\n/**\n * MarqueeReview \u7EC4\u4EF6 Props\n */\nexport interface MarqueeReviewProps {\n /** \u8BC4\u8BBA\u6570\u636E */\n data: MarqueeReviewData\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nconst _chunk = <T,>(array: T[], size: number): T[][] => {\n return Array.from({ length: Math.ceil(array.length / size) }, (_, index) =>\n array.slice(index * size, (index + 1) * size)\n )\n}\n\nconst StarIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z\"\n fill=\"#F77234\"\n />\n </svg>\n)\n\ninterface CardProps {\n item: ReviewItem\n}\n\nconst Card = ({ item }: CardProps) => {\n return (\n <div className=\"flex h-[240px] flex-grow flex-col justify-between rounded-2xl bg-container-primary p-[16px] text-info-primary min-l:p-[24px] laptop:h-[240px] desktop:h-[240px] lg-desktop:h-[240px]\">\n <div className=\"flex justify-between\">\n <div className=\"flex flex-col\">\n <Text size={4} html={item.name} className=\"hidden laptop:block\" />\n <Text size={2} html={item.name} className=\"block laptop:hidden\" />\n <div className=\"mt-2 flex gap-1\">\n {new Array(item.rating || 5).fill(0).map((_, index) => (\n <StarIcon key={index} />\n ))}\n </div>\n </div>\n <Avatar size=\"small\" className=\" h-[40px] w-[40px] laptop:h-[48px] laptop:w-[48px]\">\n <AvatarImage src={item.avatar} alt=\"avatar\" />\n <AvatarFallback>{(item.name ?? '').slice(0, 2).toUpperCase()}</AvatarFallback>\n </Avatar>\n </div>\n <div>\n <Heading as=\"h6\" size={2} html={`\"${item.comment}`} className=\"line-clamp-5 min-h-[120px] text-wrap\" />\n </div>\n </div>\n )\n}\n\n/**\n * MarqueeReview - \u5782\u76F4\u6EDA\u52A8\u7684\u8BC4\u8BBA\u8F6E\u64AD\u7EC4\u4EF6\n *\n * \u7528\u4E8E\u5C55\u793A\u7528\u6237\u8BC4\u8BBA,\u652F\u6301\u591A\u5217\u5782\u76F4\u65E0\u9650\u6EDA\u52A8\u6548\u679C\u3002\n *\n * @example\n * ```tsx\n * <MarqueeReview\n * data={{\n * title: \"\u5BA2\u6237\u8BC4\u4EF7\",\n * subtitle: \"\u770B\u770B\u7528\u6237\u600E\u4E48\u8BF4\",\n * items: [\n * {\n * name: \"\u5F20\u4E09\",\n * avatar: \"/avatar1.jpg\",\n * comment: \"\u975E\u5E38\u597D\u7528\u7684\u4EA7\u54C1!\",\n * rating: 5\n * }\n * ]\n * }}\n * />\n * ```\n */\nfunction MarqueeReview({ data, className }: MarqueeReviewProps) {\n const { title, subtitle, items = [], theme = 'light' } = data\n\n const chunkItems = _chunk(\n items.length < FIX_ITEMS_LENGTH ? [...items, ...items.slice(FIX_ITEMS_LENGTH - items.length)] : items,\n COUNT\n )\n .slice(0, 3)\n .map(item => [...item, ...item])\n\n return (\n <section className={cn('flex flex-col items-center justify-center py-3 text-info-primary', className, { 'aiui-dark': theme === 'dark' })}>\n <style jsx>\n {`\n @keyframes scroll {\n from {\n transform: translateX(0%);\n }\n to {\n transform: translateY(-50%);\n }\n }\n\n .fade-edges {\n -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);\n mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);\n -webkit-mask-repeat: no-repeat;\n mask-repeat: no-repeat;\n -webkit-mask-size: 100% 100%;\n mask-size: 100% 100%;\n }\n\n .scroll-track {\n animation: scroll 20s linear infinite;\n height: fit-content;\n }\n `}\n </style>\n <Heading as=\"h1\" size={4} html={title} className=\"w-full text-left laptop:text-center\" />\n <Text\n size={2}\n html={subtitle}\n className=\"mt-[4px] w-full text-left text-[14px] tablet:mt-[16px] tablet:text-[14px] laptop:text-center laptop:text-[14px] desktop:mt-[8px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />\n <div\n className={cn(\n 'fade-edges mt-[24px] flex h-[480px] gap-4 overflow-hidden laptop:h-[384px] desktop:h-[512px] lg-desktop:h-[640px]'\n )}\n >\n {chunkItems.map((items, index) => (\n <div\n key={index}\n className={cn('scroll-track relative flex flex-col gap-4 flex-1', {\n 'top-10': index === 0 || index === 2,\n 'hidden desktop:flex': index === 1,\n 'hidden tablet:flex': index === 2,\n })}\n >\n {items.map((item, innerIndex) => (\n <Card key={innerIndex} item={item} />\n ))}\n </div>\n ))}\n </div>\n </section>\n )\n}\n\nexport default withLayout(MarqueeReview)"],
|
|
5
|
+
"mappings": "AAsDI,cAAAA,EAeI,QAAAC,MAfJ,oBAtDJ,OAAS,QAAAC,EAAM,WAAAC,EAAS,UAAAC,EAAQ,eAAAC,EAAa,kBAAAC,MAAsB,4BACnE,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAG3B,MAAMC,EAAmB,EACnBC,EAAQ,EAwCRC,EAAS,CAAKC,EAAYC,IACvB,MAAM,KAAK,CAAE,OAAQ,KAAK,KAAKD,EAAM,OAASC,CAAI,CAAE,EAAG,CAACC,EAAGC,IAChEH,EAAM,MAAMG,EAAQF,GAAOE,EAAQ,GAAKF,CAAI,CAC9C,EAGIG,EAAW,IACfhB,EAAC,OAAI,MAAM,KAAK,OAAO,K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AI,CAAC,EAEjC,OACEjB,EAAC,WAAQ,UAAWM,EAAG,mEAAqEc,EAAW,CAAE,YAAaI,IAAU,MAAO,CAAC,EACtI,UAAAzB,EAAC,SAAM,IAAG,GACP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAwBH,EACAA,EAACG,EAAA,CAAQ,GAAG,KAAK,KAAM,EAAG,KAAMmB,EAAO,UAAU,sCAAsC,EACvFtB,EAACE,EAAA,CACC,KAAM,EACN,KAAMqB,EACN,UAAU,8KACZ,EACAvB,EAAC,OACC,UAAWO,EACT,mHACF,EAEC,SAAAmB,EAAW,IAAI,CAACF,EAAOT,IACtBf,EAAC,OAEC,UAAWO,EAAG,mDAAoD,CAChE,SAAUQ,IAAU,GAAKA,IAAU,EACnC,sBAAuBA,IAAU,EACjC,qBAAsBA,IAAU,CAClC,CAAC,EAEA,SAAAS,EAAM,IAAI,CAACN,EAAMS,IAChB3B,EAACiB,EAAA,CAAsB,KAAMC,GAAlBS,CAAwB,CACpC,GATIZ,CAUP,CACD,EACH,GACF,CAEJ,CAEA,IAAOa,EAAQpB,EAAWW,CAAa",
|
|
6
|
+
"names": ["jsx", "jsxs", "Text", "Heading", "Avatar", "AvatarImage", "AvatarFallback", "cn", "withLayout", "FIX_ITEMS_LENGTH", "COUNT", "_chunk", "array", "size", "_", "index", "StarIcon", "Card", "item", "MarqueeReview", "data", "className", "title", "subtitle", "items", "theme", "chunkItems", "innerIndex", "MarqueeReview_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Media, Theme, Shape } from '../../types/props.js';
|
|
2
|
+
export interface ProductItemData {
|
|
3
|
+
/** 产品标签文本 */
|
|
4
|
+
text?: string;
|
|
5
|
+
/** 桌面端媒体(视频或图片) */
|
|
6
|
+
media?: Media;
|
|
7
|
+
/** 移动端媒体(视频或图片) */
|
|
8
|
+
mobMedia?: Media;
|
|
9
|
+
/** 桌面端封面图(仅用于视频) */
|
|
10
|
+
poster?: string;
|
|
11
|
+
/** 移动端封面图(仅用于视频) */
|
|
12
|
+
mobPoster?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ProductCompareProps {
|
|
15
|
+
/** 组件数据 */
|
|
16
|
+
data: {
|
|
17
|
+
/** 主标题 */
|
|
18
|
+
title?: string;
|
|
19
|
+
/** 副标题 */
|
|
20
|
+
subtitle?: string;
|
|
21
|
+
/** 我们的产品数据 */
|
|
22
|
+
ourProduct?: ProductItemData;
|
|
23
|
+
/** 竞品数据 */
|
|
24
|
+
competitor?: ProductItemData;
|
|
25
|
+
/** 主题:light 或 dark */
|
|
26
|
+
theme?: Theme;
|
|
27
|
+
/** 形状:rounded 或 square */
|
|
28
|
+
shape?: Shape;
|
|
29
|
+
};
|
|
30
|
+
/** 外层容器类名 */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<ProductCompareProps, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
|
|
34
|
+
className?: string;
|
|
35
|
+
data?: Record<string, any>;
|
|
36
|
+
} & import("react").RefAttributes<any>>;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t,jsxs as l}from"react/jsx-runtime";import{useEffect as x,useRef as f,useState as b}from"react";import{Heading as c,Text as h}from"../../components/index.js";import{cn as m}from"../../helpers/index.js";import{withLayout as g}from"../../shared/Styles.js";function u({children:e,offset:a=800}){const[r,p]=b(!1),o=f(null);return x(()=>{const i=new IntersectionObserver(([s])=>s.isIntersecting&&p(!0),{rootMargin:`${a}px`});return o.current&&i.observe(o.current),()=>i.disconnect()},[a]),t("div",{ref:o,className:"size-full",children:r&&e})}function d({media:e,poster:a,className:r}){return e?.url?e.mimeType?.startsWith("video/")?t("video",{src:e.url,playsInline:!0,autoPlay:!0,muted:!0,loop:!0,poster:a,preload:"metadata",disablePictureInPicture:!0,disableRemotePlayback:!0,"webkit-playsinline":"true","x5-video-player-type":"h5","x5-video-player-fullscreen":"false","x5-playsinline":"true",className:r,width:e.width,height:e.height}):t("img",{src:e.url,alt:e.alt||"",className:r,width:e.width,height:e.height}):null}function v(e){const{title:a,subtitle:r,ourProduct:p={},competitor:o={},theme:i="light",shape:s="rounded"}=e.data,n={rounded:"rounded-[12px] laptop:rounded-[16px]",square:"rounded-none"}[s];return l("section",{className:m("product-compare text-info-primary bg-container-primary",e.className,{"aiui-dark":i==="dark"}),children:[a&&t(c,{as:"h2",size:3,html:a,className:"section-title text-left"}),r&&t(h,{as:"p",size:2,html:r,className:"section-subtitle mt-[4px] text-left text-[14px] tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]"}),l("div",{className:"product-compare-container mt-[24px] flex w-full flex-col items-stretch gap-[16px] tablet:flex-row tablet:flex-nowrap",children:[l("div",{className:m("product-compare-item product-compare-competitor relative order-2 flex-shrink overflow-hidden tablet:order-1 tablet:w-[50%] laptop:w-[39.30%]",n),children:[t("div",{className:"product-compare-label product-compare-competitor-label absolute left-[16px] top-[16px] rounded-[24px] bg-[#000] bg-opacity-20 px-[20px] pb-[10px] pt-[11px] font-bold laptop:left-[28px] laptop:top-[28px] laptop:px-[28px] laptop:pb-[14px] laptop:pt-[15px] desktop:left-[32px] desktop:top-[32px]",children:t(c,{as:"h6",className:"font-bold",size:1,children:o.text})}),l(u,{offset:1500,children:[t(d,{media:o.media,poster:o.poster,className:"product-compare-media product-compare-competitor-media hidden w-full h-full object-cover laptop:block"}),t(d,{media:o.mobMedia,poster:o.mobPoster,className:"product-compare-media product-compare-competitor-media-mobile block laptop:hidden"})]})]}),l("div",{className:m("product-compare-item product-compare-our-product relative order-1 flex-shrink overflow-hidden tablet:order-2 tablet:w-[50%] laptop:w-[59.53%]",n),children:[t("div",{className:"product-compare-label product-compare-our-product-label absolute left-[16px] top-[16px] rounded-[24px] bg-brand-0 px-[20px] pb-[10px] pt-[11px] font-bold laptop:left-[28px] laptop:top-[28px] laptop:px-[28px] laptop:pb-[14px] laptop:pt-[15px] desktop:left-[32px] desktop:top-[32px]",children:t(c,{as:"h6",className:"font-bold",size:1,children:p.text})}),l(u,{offset:1500,children:[t(d,{media:p.media,poster:p.poster,className:"product-compare-media product-compare-our-product-media hidden w-full laptop:block"}),t(d,{media:p.mobMedia,poster:p.mobPoster,className:"product-compare-media product-compare-our-product-media-mobile block laptop:hidden"})]})]})]})]})}var k=g(v);export{k as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ProductCompare/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useEffect, useRef, useState } from 'react'\nimport { Heading, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport type { Media, Theme, Shape } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js';\n\nfunction LazyMedia({ children, offset = 800 }: { children: React.ReactNode; offset?: number }) {\n const [loaded, setLoaded] = useState(false)\n const ref = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n ([entry]) => entry.isIntersecting && setLoaded(true),\n { rootMargin: `${offset}px` }\n )\n ref.current && observer.observe(ref.current)\n return () => observer.disconnect()\n }, [offset])\n\n return <div ref={ref} className=\"size-full\">{loaded && children}</div>\n}\n\nfunction MediaElement({ media, poster, className }: { media?: Media; poster?: string; className?: string }) {\n if (!media?.url) return null\n \n const isVideo = media.mimeType?.startsWith('video/')\n \n if (isVideo) {\n return (\n <video\n src={media.url}\n playsInline\n autoPlay\n muted\n loop\n poster={poster}\n preload=\"metadata\"\n disablePictureInPicture\n disableRemotePlayback\n webkit-playsinline=\"true\"\n x5-video-player-type=\"h5\"\n x5-video-player-fullscreen=\"false\"\n x5-playsinline=\"true\"\n className={className}\n width={media.width}\n height={media.height}\n />\n )\n }\n \n return (\n <img\n src={media.url}\n alt={media.alt || ''}\n className={className}\n width={media.width}\n height={media.height}\n />\n )\n}\n\nexport interface ProductItemData {\n /** \u4EA7\u54C1\u6807\u7B7E\u6587\u672C */\n text?: string\n /** \u684C\u9762\u7AEF\u5A92\u4F53\uFF08\u89C6\u9891\u6216\u56FE\u7247\uFF09 */\n media?: Media\n /** \u79FB\u52A8\u7AEF\u5A92\u4F53\uFF08\u89C6\u9891\u6216\u56FE\u7247\uFF09 */\n mobMedia?: Media\n /** \u684C\u9762\u7AEF\u5C01\u9762\u56FE\uFF08\u4EC5\u7528\u4E8E\u89C6\u9891\uFF09 */\n poster?: string\n /** \u79FB\u52A8\u7AEF\u5C01\u9762\u56FE\uFF08\u4EC5\u7528\u4E8E\u89C6\u9891\uFF09 */\n mobPoster?: string\n}\n\nexport interface ProductCompareProps {\n /** \u7EC4\u4EF6\u6570\u636E */\n data: {\n /** \u4E3B\u6807\u9898 */\n title?: string\n /** \u526F\u6807\u9898 */\n subtitle?: string\n /** \u6211\u4EEC\u7684\u4EA7\u54C1\u6570\u636E */\n ourProduct?: ProductItemData\n /** \u7ADE\u54C1\u6570\u636E */\n competitor?: ProductItemData\n /** \u4E3B\u9898\uFF1Alight \u6216 dark */\n theme?: Theme\n /** \u5F62\u72B6\uFF1Arounded \u6216 square */\n shape?: Shape\n }\n /** \u5916\u5C42\u5BB9\u5668\u7C7B\u540D */\n className?: string\n}\n\nfunction ProductCompare(props: ProductCompareProps) {\n const { title, subtitle, ourProduct = {}, competitor = {}, theme = 'light', shape = 'rounded' } = props.data\n \n // \u6839\u636E\u5F62\u72B6\u8BBE\u7F6E\u5706\u89D2\n const shapeClass = {\n rounded: 'rounded-[12px] laptop:rounded-[16px]',\n square: 'rounded-none',\n }[shape]\n\n return (\n <section className={cn('product-compare text-info-primary bg-container-primary', props.className, { 'aiui-dark': theme === 'dark' })}>\n {title && <Heading as={'h2'} size={3} html={title} className=\"section-title text-left\" />}\n {subtitle && <Text\n as=\"p\"\n size={2}\n html={subtitle}\n className=\"section-subtitle mt-[4px] text-left text-[14px] tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />}\n <div className=\"product-compare-container mt-[24px] flex w-full flex-col items-stretch gap-[16px] tablet:flex-row tablet:flex-nowrap\">\n <div className={cn('product-compare-item product-compare-competitor relative order-2 flex-shrink overflow-hidden tablet:order-1 tablet:w-[50%] laptop:w-[39.30%]', shapeClass)}>\n <div className=\"product-compare-label product-compare-competitor-label absolute left-[16px] top-[16px] rounded-[24px] bg-[#000] bg-opacity-20 px-[20px] pb-[10px] pt-[11px] font-bold laptop:left-[28px] laptop:top-[28px] laptop:px-[28px] laptop:pb-[14px] laptop:pt-[15px] desktop:left-[32px] desktop:top-[32px]\">\n <Heading as={'h6'} className=\"font-bold\" size={1}>\n {competitor.text}\n </Heading>\n </div>\n <LazyMedia offset={1500}>\n <MediaElement\n media={competitor.media}\n poster={competitor.poster}\n className=\"product-compare-media product-compare-competitor-media hidden w-full h-full object-cover laptop:block\"\n />\n <MediaElement\n media={competitor.mobMedia}\n poster={competitor.mobPoster}\n className=\"product-compare-media product-compare-competitor-media-mobile block laptop:hidden\"\n />\n </LazyMedia>\n </div>\n <div className={cn('product-compare-item product-compare-our-product relative order-1 flex-shrink overflow-hidden tablet:order-2 tablet:w-[50%] laptop:w-[59.53%]', shapeClass)}>\n <div className=\"product-compare-label product-compare-our-product-label absolute left-[16px] top-[16px] rounded-[24px] bg-brand-0 px-[20px] pb-[10px] pt-[11px] font-bold laptop:left-[28px] laptop:top-[28px] laptop:px-[28px] laptop:pb-[14px] laptop:pt-[15px] desktop:left-[32px] desktop:top-[32px]\">\n <Heading as={'h6'} className=\"font-bold\" size={1}>\n {ourProduct.text}\n </Heading>\n </div>\n <LazyMedia offset={1500}>\n <MediaElement\n media={ourProduct.media}\n poster={ourProduct.poster}\n className=\"product-compare-media product-compare-our-product-media hidden w-full laptop:block\"\n />\n <MediaElement\n media={ourProduct.mobMedia}\n poster={ourProduct.mobPoster}\n className=\"product-compare-media product-compare-our-product-media-mobile block laptop:hidden\"\n />\n </LazyMedia>\n </div>\n </div>\n </section>\n )\n}\n\nexport default withLayout(ProductCompare)"],
|
|
5
|
+
"mappings": "AAmBS,cAAAA,EAoGC,QAAAC,MApGD,oBAnBT,OAAS,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QAC5C,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,MAAAC,MAAU,yBAEnB,OAAS,cAAAC,MAAkB,yBAE3B,SAASC,EAAU,CAAE,SAAAC,EAAU,OAAAC,EAAS,GAAI,EAAmD,CAC7F,KAAM,CAACC,EAAQC,CAAS,EAAIT,EAAS,EAAK,EACpCU,EAAMX,EAAuB,IAAI,EAEvC,OAAAD,EAAU,IAAM,CACd,MAAMa,EAAW,IAAI,qBACnB,CAAC,CAACC,CAAK,IAAMA,EAAM,gBAAkBH,EAAU,EAAI,EACnD,CAAE,WAAY,GAAGF,CAAM,IAAK,CAC9B,EACA,OAAAG,EAAI,SAAWC,EAAS,QAAQD,EAAI,OAAO,EACpC,IAAMC,EAAS,WAAW,CACnC,EAAG,CAACJ,CAAM,CAAC,EAEJX,EAAC,OAAI,IAAKc,EAAK,UAAU,YAAa,SAAAF,GAAUF,EAAS,CAClE,CAEA,SAASO,EAAa,CAAE,MAAAC,EAAO,OAAAC,EAAQ,UAAAC,CAAU,EAA2D,CAC1G,OAAKF,GAAO,IAEIA,EAAM,UAAU,WAAW,QAAQ,EAI/ClB,EAAC,SACC,IAAKkB,EAAM,IACX,YAAW,GACX,SAAQ,GACR,MAAK,GACL,KAAI,GACJ,OAAQC,EACR,QAAQ,WACR,wBAAuB,GACvB,sBAAqB,GACrB,qBAAmB,OACnB,uBAAqB,KACrB,6BAA2B,QAC3B,iBAAe,OACf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KAAM,EAC5C,SAAAoB,EAAW,KACd,EACF,EACAxB,EAACQ,EAAA,CAAU,OAAQ,KACjB,UAAAT,EAACiB,EAAA,CACC,MAAOQ,EAAW,MAClB,OAAQA,EAAW,OACnB,UAAU,qFACZ,EACAzB,EAACiB,EAAA,CACC,MAAOQ,EAAW,SAClB,OAAQA,EAAW,UACnB,UAAU,qFACZ,GACF,GACF,GACF,GACF,CAEJ,CAEA,IAAOK,EAAQtB,EAAWa,CAAc",
|
|
6
|
+
"names": ["jsx", "jsxs", "useEffect", "useRef", "useState", "Heading", "Text", "cn", "withLayout", "LazyMedia", "children", "offset", "loaded", "setLoaded", "ref", "observer", "entry", "MediaElement", "media", "poster", "className", "ProductCompare", "props", "title", "subtitle", "ourProduct", "competitor", "theme", "shape", "shapeClass", "ProductCompare_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ProductHeroProps } from './types.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<ProductHeroProps & 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 t,jsxs as s}from"react/jsx-runtime";import f,{useRef as x,useImperativeHandle as b}from"react";import{Heading as a,Button as h,Picture as H,Text as P}from"../../components/index.js";import{cn as v}from"../../helpers/utils.js";import{withLayout as N}from"../../shared/Styles.js";import{useExposure as g}from"../../hooks/useExposure.js";const k="image",w="product_hero",l=f.forwardRef(({data:r,className:i},m)=>{const{title:p,subtitle:e,ctaText:c,poster:n,mobPoster:u,ctaLink:d}=r,o=x(null);return g(o,{componentType:k,componentName:w,componentTitle:p,componentDescription:e}),b(m,()=>o.current),s("section",{ref:o,"data-ui-component-id":"ProductHero",className:v("flex w-full flex-col items-center justify-between gap-[32px] tablet:flex-row tablet:gap-[16px] lg-desktop:gap-[64px]",i),children:[s("div",{className:"flex w-full flex-col items-start gap-[24px] tablet:basis-[42%] laptop:basis-[36%]",children:[s("div",{children:[t(a,{as:"h3",size:4,html:p}),t(a,{as:"h4",size:2,html:e,className:"mt-[4px] hidden laptop:mt-[12px] laptop:block desktop:mt-[16px]"}),t(P,{as:"p",size:2,html:e,className:"mt-[4px] block laptop:mt-[12px] laptop:hidden desktop:mt-[16px]"})]}),t("a",{href:d,children:t(h,{className:"w-fit",children:c})})]}),t(H,{className:"aspect-[358/360] flex-shrink tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%]",source:`${n.url}, ${u.url} 768`})]})});l.displayName="ProductHero";var R=N(l);export{R as default};
|
|
2
|
+
//# sourceMappingURL=ProductHero.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ProductHero/ProductHero.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Heading, Button, 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 { ProductHeroProps } from './types.js'\n\nconst componentType = 'image'\nconst componentName = 'product_hero'\n\nconst ProductHero = React.forwardRef<HTMLDivElement, ProductHeroProps>(({ data, className }, ref) => {\n const { title, subtitle, ctaText, poster, mobPoster, ctaLink } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\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 return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ProductHero\"\n className={cn(\n 'flex w-full flex-col items-center justify-between gap-[32px] tablet:flex-row tablet:gap-[16px] lg-desktop:gap-[64px]',\n className\n )}\n >\n <div className=\"flex w-full flex-col items-start gap-[24px] tablet:basis-[42%] laptop:basis-[36%]\">\n <div>\n <Heading as={'h3'} size={4} html={title} />\n <Heading\n as={'h4'}\n size={2}\n html={subtitle}\n className=\"mt-[4px] hidden laptop:mt-[12px] laptop:block desktop:mt-[16px]\"\n />\n <Text\n as={'p'}\n size={2}\n html={subtitle}\n className=\"mt-[4px] block laptop:mt-[12px] laptop:hidden desktop:mt-[16px]\"\n />\n </div>\n <a href={ctaLink}>\n <Button className=\"w-fit\">{ctaText}</Button>\n </a>\n </div>\n <Picture\n className=\"aspect-[358/360] flex-shrink tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%]\"\n source={`${poster.url}, ${mobPoster.url} 768`}\n />\n </section>\n )\n})\n\nProductHero.displayName = 'ProductHero'\n\nexport default withLayout(ProductHero)\n"],
|
|
5
|
+
"mappings": "aAmCQ,OACE,OAAAA,EADF,QAAAC,MAAA,oBAlCR,OAAOC,GAAS,UAAAC,EAAQ,uBAAAC,MAA2B,QACnD,OAAS,WAAAC,EAAS,UAAAC,EAAQ,WAAAC,EAAS,QAAAC,MAAY,4BAC/C,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAG5B,MAAMC,EAAgB,QAChBC,EAAgB,eAEhBC,EAAcZ,EAAM,WAA6C,CAAC,CAAE,KAAAa,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACnG,KAAM,CAAE,MAAAC,EAAO,SAAAC,EAAU,QAAAC,EAAS,OAAAC,EAAQ,UAAAC,EAAW,QAAAC,CAAQ,EAAIR,EAE3DS,EAASrB,EAAuB,IAAI,EAE1C,OAAAQ,EAAYa,EAAQ,CAClB,cAAAZ,EACA,cAAAC,EACA,eAAgBK,EAChB,qBAAsBC,CACxB,CAAC,EAEDf,EAAoBa,EAAK,IAAMO,EAAO,OAAyB,EAG7DvB,EAAC,WACC,IAAKuB,EACL,uBAAqB,cACrB,UAAWf,EACT,uHACAO,CACF,EAEA,UAAAf,EAAC,OAAI,UAAU,oFACb,UAAAA,EAAC,OACC,UAAAD,EAACK,EAAA,CAAQ,GAAI,KAAM,KAAM,EAAG,KAAMa,EAAO,EACzClB,EAACK,EAAA,CACC,GAAI,KACJ,KAAM,EACN,KAAMc,EACN,UAAU,kEACZ,EACAnB,EAACQ,EAAA,CACC,GAAI,IACJ,KAAM,EACN,KAAMW,EACN,UAAU,kEACZ,GACF,EACAnB,EAAC,KAAE,KAAMuB,EACP,SAAAvB,EAACM,EAAA,CAAO,UAAU,QAAS,SAAAc,EAAQ,EACrC,GACF,EACApB,EAACO,EAAA,CACC,UAAU,6FACV,OAAQ,GAAGc,EAAO,GAAG,KAAKC,EAAU,GAAG,OACzC,GACF,CAEJ,CAAC,EAEDR,EAAY,YAAc,cAE1B,IAAOW,EAAQf,EAAWI,CAAW",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "useRef", "useImperativeHandle", "Heading", "Button", "Picture", "Text", "cn", "withLayout", "useExposure", "componentType", "componentName", "ProductHero", "data", "className", "ref", "title", "subtitle", "ctaText", "poster", "mobPoster", "ctaLink", "boxRef", "ProductHero_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/ProductHero/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { default } from './ProductHero.js'\nexport type { ProductHeroProps } from './types.js'\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,WAAAA,MAAe",
|
|
6
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Media } from '../../types/props';
|
|
2
|
+
export interface ProductHeroProps {
|
|
3
|
+
data: {
|
|
4
|
+
/** 主标题 */
|
|
5
|
+
title: string;
|
|
6
|
+
/** 副标题 */
|
|
7
|
+
subtitle: string;
|
|
8
|
+
/** CTA 按钮文本 */
|
|
9
|
+
ctaText: string;
|
|
10
|
+
/** CTA 按钮链接 */
|
|
11
|
+
ctaLink: string;
|
|
12
|
+
/** 桌面端图片 URL */
|
|
13
|
+
poster: Media;
|
|
14
|
+
/** 移动端图片 URL */
|
|
15
|
+
mobPoster: Media;
|
|
16
|
+
/** 3D 模型源(可选,暂未使用) */
|
|
17
|
+
modelSrc?: string;
|
|
18
|
+
};
|
|
19
|
+
/** 自定义类名 */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -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,EAAqB,YAAAC,MAAgB,QAC7D,OAAS,WAAAC,MAAqB,4BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAG5B,MAAMC,EAAgB,QAChBC,EAAgB,mBAEhBC,EAAkBV,EAAM,WAC5B,CAAC,CAAE,KAAAW,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CAC5B,KAAM,CAAE,SAAAC,EAAU,UAAAC,CAAU,EAAIJ,GAAQ,CAAC,EACnC,CAACK,EAAYC,CAAa,EAAId,EAAS,EAAE,EACzCe,EAAOjB,EAA8C,CAAC,CAAC,EAEvDkB,EAASlB,EAAuB,IAAI,EAE1CM,EAAYY,EAAQ,CAClB,cAAAX,EACA,cAAAC,EACA,eAAgB,kBAClB,CAAC,EAEDP,EAAoBW,EAAK,IAAMM,EAAO,OAAyB,EAE/D,MAAMC,EAAcC,GACbA,EAEHvB,EAAC,OAAI,UAAU,YACb,SAAAA,EAAC,KACC,UAAU,oEACV,wBAAyB,CACvB,OAAQuB,GAAK,EACf,EACF,EACF,EATa,KAaXC,EAAeC,GACZA,EAAS,IAAI,CAACC,EAAIC,IAAQ,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E,KACJpC,EAAC,OAAI,UAAU,oCACb,SAAAA,EAAC,OAAI,UAAU,SACZ,SAAAgB,EAAS,KAAK,IAAI,CAACoB,EAAMC,IAEtBpC,EAAC,OAEC,UAAU,0CACV,IAAMqC,GAAM,CACVlB,EAAK,QAAQgB,EAAK,KAAK,EAAIE,CAC7B,EAEC,UAAAF,EAAK,OACJpC,EAACM,EAAA,CACC,GAAG,KACH,UAAU,4CACV,KAAM8B,EAAK,OAAS,GACtB,EAEDF,EAAaE,CAAI,IAbbC,CAcP,CAEH,EACH,EACF,GACF,EACE,KACN,EACF,CAEJ,CACF,EAEAzB,EAAgB,YAAc,kBAE9B,IAAO2B,EAAQ/B,EAAWI,CAAe",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "useRef", "useImperativeHandle", "useState", "Heading", "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;
|