@anker-in/headless-ui 0.0.27-alpha.0 → 0.0.27-alpha.2

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.
Files changed (172) hide show
  1. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
  2. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +2 -2
  3. package/dist/cjs/biz-components/Category/index.js +1 -1
  4. package/dist/cjs/biz-components/Category/index.js.map +2 -2
  5. package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -0
  6. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  7. package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
  8. package/dist/cjs/biz-components/Marquee/index.js +1 -1
  9. package/dist/cjs/biz-components/Marquee/index.js.map +2 -2
  10. package/dist/cjs/biz-components/MemberEquity/index.js +30 -30
  11. package/dist/cjs/biz-components/MemberEquity/index.js.map +2 -2
  12. package/dist/cjs/biz-components/ShelfDisplay/index.js +9 -9
  13. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +2 -2
  14. package/dist/cjs/biz-components/Slogan/index.js +1 -1
  15. package/dist/cjs/biz-components/Slogan/index.js.map +2 -2
  16. package/dist/cjs/components/button.js +1 -1
  17. package/dist/cjs/components/button.js.map +2 -2
  18. package/dist/cjs/components/card.js +1 -1
  19. package/dist/cjs/components/card.js.map +2 -2
  20. package/dist/cjs/components/carousel.js +1 -1
  21. package/dist/cjs/components/carousel.js.map +2 -2
  22. package/dist/cjs/components/container.js +1 -1
  23. package/dist/cjs/components/container.js.map +2 -2
  24. package/dist/cjs/components/dialog.js +1 -1
  25. package/dist/cjs/components/dialog.js.map +2 -2
  26. package/dist/cjs/components/gird.js +1 -1
  27. package/dist/cjs/components/gird.js.map +2 -2
  28. package/dist/cjs/components/heading.d.ts +1 -1
  29. package/dist/cjs/components/heading.js +1 -1
  30. package/dist/cjs/components/heading.js.map +2 -2
  31. package/dist/cjs/components/text.js +1 -1
  32. package/dist/cjs/components/text.js.map +1 -1
  33. package/dist/cjs/stories/container.stories.js +6 -6
  34. package/dist/cjs/stories/container.stories.js.map +2 -2
  35. package/dist/cjs/stories/dialog.stories.js +1 -1
  36. package/dist/cjs/stories/dialog.stories.js.map +2 -2
  37. package/dist/cjs/stories/evaluate.stories.js +1 -1
  38. package/dist/cjs/stories/evaluate.stories.js.map +2 -2
  39. package/dist/cjs/stories/heading.stories.d.ts +3 -2
  40. package/dist/cjs/stories/heading.stories.js +1 -1
  41. package/dist/cjs/stories/heading.stories.js.map +2 -2
  42. package/dist/cjs/stories/text.stories.js +1 -1
  43. package/dist/cjs/stories/text.stories.js.map +2 -2
  44. package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
  45. package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +2 -2
  46. package/dist/esm/biz-components/Category/index.js +1 -1
  47. package/dist/esm/biz-components/Category/index.js.map +2 -2
  48. package/dist/esm/biz-components/Evaluate/index.d.ts +1 -0
  49. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  50. package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
  51. package/dist/esm/biz-components/Marquee/index.js +1 -1
  52. package/dist/esm/biz-components/Marquee/index.js.map +2 -2
  53. package/dist/esm/biz-components/MemberEquity/index.js +29 -29
  54. package/dist/esm/biz-components/MemberEquity/index.js.map +2 -2
  55. package/dist/esm/biz-components/ShelfDisplay/index.js +9 -9
  56. package/dist/esm/biz-components/ShelfDisplay/index.js.map +2 -2
  57. package/dist/esm/biz-components/Slogan/index.js +1 -1
  58. package/dist/esm/biz-components/Slogan/index.js.map +2 -2
  59. package/dist/esm/components/button.js +1 -1
  60. package/dist/esm/components/button.js.map +2 -2
  61. package/dist/esm/components/card.js +1 -1
  62. package/dist/esm/components/card.js.map +2 -2
  63. package/dist/esm/components/carousel.js +1 -1
  64. package/dist/esm/components/carousel.js.map +2 -2
  65. package/dist/esm/components/container.js +1 -1
  66. package/dist/esm/components/container.js.map +2 -2
  67. package/dist/esm/components/dialog.js +1 -1
  68. package/dist/esm/components/dialog.js.map +2 -2
  69. package/dist/esm/components/gird.js +1 -1
  70. package/dist/esm/components/gird.js.map +2 -2
  71. package/dist/esm/components/heading.d.ts +1 -1
  72. package/dist/esm/components/heading.js +1 -1
  73. package/dist/esm/components/heading.js.map +2 -2
  74. package/dist/esm/components/text.js +1 -1
  75. package/dist/esm/components/text.js.map +1 -1
  76. package/dist/esm/stories/container.stories.js +6 -6
  77. package/dist/esm/stories/container.stories.js.map +2 -2
  78. package/dist/esm/stories/dialog.stories.js +1 -1
  79. package/dist/esm/stories/dialog.stories.js.map +2 -2
  80. package/dist/esm/stories/evaluate.stories.js +1 -1
  81. package/dist/esm/stories/evaluate.stories.js.map +2 -2
  82. package/dist/esm/stories/heading.stories.d.ts +3 -2
  83. package/dist/esm/stories/heading.stories.js +1 -1
  84. package/dist/esm/stories/heading.stories.js.map +2 -2
  85. package/dist/esm/stories/text.stories.js +2 -2
  86. package/dist/esm/stories/text.stories.js.map +2 -2
  87. package/package.json +2 -3
  88. package/style.css +69 -34
  89. package/src/biz-components/BrandEquity/BrandEquity.tsx +0 -77
  90. package/src/biz-components/BrandEquity/index.ts +0 -1
  91. package/src/biz-components/Category/index.tsx +0 -57
  92. package/src/biz-components/Evaluate/index.tsx +0 -85
  93. package/src/biz-components/HeroBanner/HeroBanner.tsx +0 -103
  94. package/src/biz-components/HeroBanner/index.tsx +0 -1
  95. package/src/biz-components/HeroBanner/types.ts +0 -28
  96. package/src/biz-components/Marquee/index.tsx +0 -79
  97. package/src/biz-components/MemberEquity/index.tsx +0 -114
  98. package/src/biz-components/MemberEquity/types.ts +0 -26
  99. package/src/biz-components/Shelf/Shelf.tsx +0 -22
  100. package/src/biz-components/Shelf/index.ts +0 -1
  101. package/src/biz-components/Shelf/types.ts +0 -6
  102. package/src/biz-components/ShelfDisplay/index.tsx +0 -142
  103. package/src/biz-components/Slogan/index.tsx +0 -53
  104. package/src/biz-components/Slogan/types.ts +0 -25
  105. package/src/biz-components/index.ts +0 -11
  106. package/src/components/alert.tsx +0 -124
  107. package/src/components/avatar.tsx +0 -126
  108. package/src/components/badge.tsx +0 -27
  109. package/src/components/button.tsx +0 -183
  110. package/src/components/card.tsx +0 -51
  111. package/src/components/carousel.tsx +0 -352
  112. package/src/components/checkbox.tsx +0 -42
  113. package/src/components/color.tsx +0 -77
  114. package/src/components/container.tsx +0 -28
  115. package/src/components/dialog.tsx +0 -98
  116. package/src/components/drawer.tsx +0 -115
  117. package/src/components/drop-down.tsx +0 -182
  118. package/src/components/gird.tsx +0 -90
  119. package/src/components/heading.tsx +0 -80
  120. package/src/components/index.ts +0 -26
  121. package/src/components/input-number.tsx +0 -216
  122. package/src/components/input.tsx +0 -79
  123. package/src/components/link.tsx +0 -99
  124. package/src/components/picture.tsx +0 -100
  125. package/src/components/popover.tsx +0 -31
  126. package/src/components/radio.tsx +0 -85
  127. package/src/components/skeleton.tsx +0 -41
  128. package/src/components/tabs.tsx +0 -78
  129. package/src/components/text.tsx +0 -99
  130. package/src/components/theme.tsx +0 -20
  131. package/src/helpers/component-props.ts +0 -17
  132. package/src/helpers/constants.ts +0 -0
  133. package/src/helpers/index.ts +0 -2
  134. package/src/helpers/utils.ts +0 -16
  135. package/src/icons/spinner.tsx +0 -26
  136. package/src/index.ts +0 -1
  137. package/src/shared/Styles.tsx +0 -94
  138. package/src/stories/HeroBanner.stories.tsx +0 -86
  139. package/src/stories/MemberEquity.stories.tsx +0 -107
  140. package/src/stories/alert.stories.tsx +0 -41
  141. package/src/stories/avatar.stories.tsx +0 -83
  142. package/src/stories/badge.stories.tsx +0 -40
  143. package/src/stories/brandEquity.stories.tsx +0 -73
  144. package/src/stories/button.stories.tsx +0 -145
  145. package/src/stories/card.stories.tsx +0 -97
  146. package/src/stories/carousel.stories.tsx +0 -161
  147. package/src/stories/category.stories.tsx +0 -52
  148. package/src/stories/checkbox.stories.tsx +0 -93
  149. package/src/stories/container.stories.tsx +0 -97
  150. package/src/stories/dialog.stories.tsx +0 -74
  151. package/src/stories/drawer.stories.tsx +0 -88
  152. package/src/stories/drop-down.stories.tsx +0 -83
  153. package/src/stories/evaluate.stories.tsx +0 -53
  154. package/src/stories/grid.stories.tsx +0 -190
  155. package/src/stories/heading.stories.tsx +0 -96
  156. package/src/stories/input-number.stories.tsx +0 -52
  157. package/src/stories/input.stories.tsx +0 -64
  158. package/src/stories/link.stories.tsx +0 -142
  159. package/src/stories/marquee.stories.tsx +0 -102
  160. package/src/stories/picture.stories.tsx +0 -51
  161. package/src/stories/popover.stories.tsx +0 -41
  162. package/src/stories/radio.stories.tsx +0 -55
  163. package/src/stories/shelf.stories.tsx +0 -35
  164. package/src/stories/shelfDisplay.stories.tsx +0 -69
  165. package/src/stories/skeleton.stories.tsx +0 -67
  166. package/src/stories/slogan.stories.tsx +0 -99
  167. package/src/stories/tabs.stories.tsx +0 -179
  168. package/src/stories/text.stories.tsx +0 -130
  169. package/src/styles/global.css +0 -4
  170. package/src/styles/index.css +0 -0
  171. package/src/types/index.ts +0 -0
  172. package/src/types/props.ts +0 -5
@@ -1,103 +0,0 @@
1
- import React from "react"
2
- import type { HeroBannerProps } from "./types.js"
3
- import { Button, Text } from "../../components/index.js"
4
- import { cn } from "../../helpers/index.js"
5
- import { withStyles } from "../../shared/Styles.js"
6
-
7
- const HeroBanner = React.forwardRef<HTMLDivElement, HeroBannerProps>(
8
- ({
9
- title,
10
- subtitle,
11
- background,
12
- primaryButton,
13
- secondaryButton,
14
- theme = "light",
15
- className,
16
- products = []
17
- }, ref) => {
18
- const textColorClass = theme === "dark" ? "text-white" : "text-[#1D1D1F]"
19
- const dividerColorClass = theme === "dark" ? "bg-white" : "bg-[#1D1D1F]"
20
-
21
- return (
22
- <div
23
- ref={ref}
24
- className={cn(
25
- "relative flex min-h-[720px] w-full flex-col justify-between overflow-hidden bg-cover bg-center bg-no-repeat",
26
- className
27
- )}
28
- style={{ backgroundImage: `url(${background})` }}
29
- >
30
- {/* 内容区域 */}
31
- <div className="relative z-10 flex flex-col gap-8 px-32 pt-[307px]">
32
- <div className="max-w-[686px] space-y-4">
33
- <h1 className={cn(
34
- "hero-banner-title font-mont text-[64px] font-bold leading-none tracking-[-0.04em]",
35
- textColorClass
36
- )}>
37
- {title}
38
- </h1>
39
- <p className={cn(
40
- "hero-banner-subtitle text-lg font-medium leading-[1.2] tracking-[-0.02em]",
41
- textColorClass
42
- )}>
43
- {subtitle}
44
- </p>
45
- </div>
46
-
47
- {/* 按钮组 */}
48
- <div className="flex items-center gap-4">
49
- {secondaryButton && (
50
- <Button
51
- size="lg"
52
- variant="nature"
53
- theme={theme}
54
- className="hero-banner-primary-button"
55
- {...secondaryButton}
56
- >
57
- {secondaryButton.text}
58
- </Button>
59
- )}
60
- {primaryButton && (
61
- <Button
62
- size="lg"
63
- variant="secondary"
64
- theme={theme}
65
- {...primaryButton}
66
- className="hero-banner-secondary-button bg-transparent border-black text-black hover:bg-black hover:text-white"
67
- >
68
- {primaryButton.text}
69
- </Button>
70
- )}
71
- </div>
72
- </div>
73
-
74
- {/* 底部产品列表 */}
75
- {products.length > 0 && (
76
- <div className="relative z-10 flex items-center gap-3 px-32 pb-6">
77
- {products.map((product, index) => (
78
- <React.Fragment key={index}>
79
- <Text
80
- className={cn(
81
- "hero-banner-product-text text-sm font-medium leading-[1.2] tracking-[-0.02em]",
82
- theme === "dark" ? "text-white" : "text-[#1D1D1F]"
83
- )}
84
- >
85
- {product.title}
86
- </Text>
87
- {index < products.length - 1 && (
88
- <div className={cn("h-4 w-px", dividerColorClass)} />
89
- )}
90
- </React.Fragment>
91
- ))}
92
- </div>
93
- )}
94
- </div>
95
- )
96
- }
97
- )
98
-
99
- HeroBanner.displayName = "HeroBanner"
100
-
101
- export default withStyles(HeroBanner)
102
-
103
-
@@ -1 +0,0 @@
1
- export { default } from './HeroBanner.js'
@@ -1,28 +0,0 @@
1
- import type { ButtonProps } from "../../components/button"
2
-
3
- export interface HeroBannerProps {
4
- /** 主标题 */
5
- title: string
6
- /** 副标题/描述文本 */
7
- subtitle: string
8
- /** 背景图片URL */
9
- background: string
10
- /** 主按钮文本和配置 */
11
- primaryButton?: {
12
- text: string
13
- } & Omit<ButtonProps, 'children'>
14
- /** 次要按钮文本和配置 */
15
- secondaryButton?: {
16
- text: string
17
- } & Omit<ButtonProps, 'children'>
18
- /** 自定义类名 */
19
- className?: string
20
- /** 主题 */
21
- theme?: "light" | "dark"
22
- /** 底部产品列表 */
23
- products?: Array<{
24
- title: string
25
- active?: boolean
26
- }>
27
- }
28
-
@@ -1,79 +0,0 @@
1
- import React from 'react'
2
- import { cn } from '../../helpers/utils.js'
3
- import { default as FastMarquee } from 'react-fast-marquee'
4
- import { type MarqueeProps as FastMarqueeProps } from 'react-fast-marquee'
5
- import { Picture, Text } from '../../components'
6
-
7
- const Marquee = React.forwardRef<HTMLDivElement, FastMarqueeProps>(
8
- ({children, ...props}, ref) => {
9
- return (
10
- <FastMarquee
11
- ref={ref}
12
- {...props}
13
- >
14
- {children}
15
- </FastMarquee>
16
- )
17
- }
18
- )
19
-
20
- Marquee.displayName = 'Marquee'
21
-
22
- interface MarqueeListProps {
23
- children?: React.ReactNode;
24
- className?: string;
25
- }
26
-
27
- const MarqueeList = React.forwardRef<
28
- HTMLDivElement,
29
- MarqueeListProps
30
- >(({ className, children, ...props }, ref) => {
31
- return (
32
- <div className={cn("flex gap-6 items-center md:gap-16", className)} ref={ref}>
33
- {children}
34
- </div>
35
- )
36
- })
37
-
38
- MarqueeList.displayName = 'MarqueeList'
39
-
40
- interface MarqueeImageContentProps {
41
- image: string
42
- className?: string;
43
- }
44
-
45
- const MarqueeImageContent = ({ image, className }: MarqueeImageContentProps) => {
46
- return (
47
- <Picture
48
- source={image}
49
- className={cn("aspect-w-[120] w-[72px] aspect-h-[80] md:w-[120px]", className)}
50
- imgClassName="object-cover"
51
- />
52
- )
53
- }
54
-
55
- MarqueeImageContent.displayName = 'MarqueeImageContent'
56
-
57
- interface MarqueeTextContentProps {
58
- text: string
59
- className?: string;
60
- }
61
-
62
- const MarqueeTextContent = React.forwardRef<
63
- HTMLDivElement,
64
- MarqueeTextContentProps
65
- >(({ text, className }, ref) => {
66
- return (
67
- <Text
68
- as="div"
69
- ref={ref}
70
- html={text}
71
- className={cn("size-14 text-nowrap flex items-center justify-center leading-[1.2] text-lines-2 font-medium", className)}
72
- />
73
- )
74
- })
75
-
76
- MarqueeTextContent.displayName = 'MarqueeTextContent'
77
-
78
- export { Marquee, MarqueeList, MarqueeImageContent, MarqueeTextContent }
79
- export type { FastMarqueeProps, MarqueeListProps, MarqueeImageContentProps, MarqueeTextContentProps }
@@ -1,114 +0,0 @@
1
- import React from 'react';
2
- import { Button } from '../../components/index.js';
3
- import { withStyles } from '../../shared/Styles.js';
4
- import type { MemberEquityProps } from './types.js';
5
-
6
- const MemberEquity: React.FC<MemberEquityProps> = ({
7
- title,
8
- description,
9
- backgroundImage,
10
- primaryButton,
11
- secondaryButton,
12
- shape = 'square',
13
- theme = 'light',
14
- className = '',
15
- }) => {
16
-
17
- const handleButtonPrimaryClick = () => {
18
- // 执行主按钮的点击事件
19
-
20
- }
21
-
22
- const handleButtonSecondaryClick = () => {
23
- // 执行副按钮的点击事件
24
- }
25
-
26
- return (
27
- <section
28
- data-ui-component-id="MemberEquity"
29
- className={`
30
- relative w-full overflow-hidden bg-[#242426]
31
- ${shape === 'round' ? 'rounded-none sm:rounded-lg md:rounded-xl lg:rounded-2xl' : ''}
32
- ${className}
33
- `}
34
- >
35
-
36
- <div
37
- className="absolute inset-0 w-full h-full"
38
- style={{
39
- backgroundImage: `
40
- radial-gradient(circle at 70% 176%, rgba(84, 85, 87, 0) 72%, rgba(84, 85, 87, 1) 100%),
41
- url(${backgroundImage})
42
- `,
43
- backgroundSize: 'cover',
44
- backgroundPosition: 'center',
45
- }}
46
- />
47
- <div className={`
48
- relative w-full mx-auto
49
- aspect-[343/200] xs:aspect-[343/200]
50
- sm:aspect-[343/200]
51
- md:aspect-[592/336]
52
- lg:aspect-[800/448]
53
- xl:aspect-[1000/560]
54
- flex items-center
55
- `}>
56
- <div className={`
57
- w-full px-4 sm:px-6 md:px-[76px] lg:px-[111px] xl:px-[139px]
58
- flex flex-col gap-4 sm:gap-5 md:gap-6 lg:gap-7 xl:gap-8
59
- `}>
60
- <div className="flex flex-col gap-2 sm:gap-2 md:gap-3 lg:gap-3 xl:gap-4">
61
- <h2 className={`
62
- member-equity-title font-mont font-bold text-white tracking-[-0.04em]
63
- text-xl sm:text-2xl md:text-3xl lg:text-4xl xl:text-[32px]
64
- leading-[1.2]
65
- max-w-[280px] sm:max-w-[300px] md:max-w-[400px] lg:max-w-[500px] xl:max-w-[547px]
66
- `}>
67
- {title}
68
- </h2>
69
- <p className={`
70
- member-equity-description font-pingfang font-semibold text-white tracking-[-0.02em]
71
- text-sm sm:text-sm md:text-base lg:text-lg xl:text-lg
72
- leading-[1.4]
73
- max-w-[260px] sm:max-w-[286px] md:max-w-[350px] lg:max-w-[426px] xl:max-w-[547px]
74
- `}>
75
- {description}
76
- </p>
77
- </div>
78
-
79
- {/* 按钮组 */}
80
- <div className="flex items-center gap-3 sm:gap-3 md:gap-4 lg:gap-4 xl:gap-4">
81
- <Button
82
- theme={theme}
83
- variant="primary"
84
- onClick={handleButtonPrimaryClick}
85
- className={`
86
- member-equity-button-primary bg-transparent border-white border-[1px] text-white text-xs sm:text-sm md:text-sm lg:text-base xl:text-base
87
- px-4 sm:px-5 md:px-6 lg:px-7 xl:px-7 hover:bg-white hover:text-black
88
- py-2 sm:py-[10px] md:py-[11px] lg:py-[12px] xl:py-[14px]
89
- ${shape === 'round' ? 'rounded-[16px] sm:rounded-[19px] md:rounded-[20px] lg:rounded-[22px] xl:rounded-[24px]' : ''}
90
- `}
91
- >
92
- {primaryButton.text}
93
- </Button>
94
- <Button
95
- theme={theme}
96
- variant="secondary"
97
- onClick={handleButtonSecondaryClick}
98
- className={`
99
- member-equity-button-secondary text-xs sm:text-sm md:text-sm lg:text-base xl:text-base
100
- px-4 sm:px-5 md:px-6 lg:px-7 xl:px-7
101
- py-2 sm:py-[10px] md:py-[11px] lg:py-[12px] xl:py-[14px]
102
- ${shape === 'round' ? 'rounded-[16px] sm:rounded-[19px] md:rounded-[20px] lg:rounded-[22px] xl:rounded-[24px]' : ''}
103
- `}
104
- >
105
- {secondaryButton.text}
106
- </Button>
107
- </div>
108
- </div>
109
- </div>
110
- </section>
111
- );
112
- };
113
-
114
- export default withStyles(MemberEquity);
@@ -1,26 +0,0 @@
1
- import type { ComponentCommonProps } from '../../types/props.js';
2
-
3
- export interface MemberEquityProps extends ComponentCommonProps {
4
- /** 标题 */
5
- title: string;
6
- /** 描述文本 */
7
- description: string;
8
- /** 背景图片 URL */
9
- backgroundImage: string;
10
- /** 主按钮配置 */
11
- primaryButton: {
12
- text: string;
13
- href: string;
14
- };
15
- /** 副按钮配置 */
16
- secondaryButton: {
17
- text: string;
18
- href: string;
19
- };
20
- /** 形状 */
21
- shape?: 'round' | 'square';
22
- /** 主题 */
23
- theme?: 'light' | 'dark';
24
- /** 自定义类名 */
25
- className?: string;
26
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * 这是一个demo 模版
3
- */
4
- import { withStyles } from '../../shared/Styles.js'
5
- import type { ShelfProps } from './types.js'
6
-
7
- const Shelf = (props: ShelfProps) => {
8
- console.log('~ Shelf props', props)
9
- return (
10
- <div>
11
- <h1 className="text-2xl font-bold">{props.title}</h1>
12
- <h2>{props.subtitle}</h2>
13
- <div>
14
- {props.products.map(product => (
15
- <div key={product.sku}>{product.name}</div>
16
- ))}
17
- </div>
18
- </div>
19
- )
20
- }
21
-
22
- export default withStyles(Shelf)
@@ -1 +0,0 @@
1
- export { default } from './Shelf.js'
@@ -1,6 +0,0 @@
1
- export type ShelfProps = {
2
- id: string
3
- title: string
4
- subtitle: string
5
- products: any[]
6
- }
@@ -1,142 +0,0 @@
1
- import React from 'react'
2
- import { cn } from '../../helpers/utils'
3
- import Picture from '../../components/picture'
4
- import Button from '../../components/button'
5
- export interface ShelfDisplayItem {
6
- /** 产品图片*/
7
- img: string
8
- /** 折扣后价格*/
9
- price: string
10
- title: string
11
- /** 折扣前价格*/
12
- basePrice: string
13
- subTitle: string
14
- /** 标签*/
15
- tagItems: string[]
16
- }
17
-
18
- export interface ShelfDisplayProps {
19
- products: ShelfDisplayItem[]
20
- /** 卡片形状 */
21
- itemShape?: 'round' | 'square'
22
- className?: string
23
- /** 主题色*/
24
- theme?: 'light' | 'dark'
25
- /** 按钮形状 */
26
- shape?: 'round' | 'square'
27
- /** 主按钮配置 */
28
- primaryButton?: string
29
- /** 副按钮配置 */
30
- secondaryButton?: string
31
- /** 按钮事件*/
32
- event?: {
33
- primaryButton?: {
34
- onClick: (v: any) => void
35
- },
36
- secondaryButton?: {
37
- onClick: (v: any) => void
38
- }
39
- },
40
- }
41
-
42
- const ShelfDisplay: React.FC<ShelfDisplayProps> = ({
43
- className = '',
44
- shape = 'square',
45
- itemShape = 'square',
46
- products = [],
47
- primaryButton,
48
- secondaryButton,
49
- event
50
- }) => {
51
-
52
- const onPrimaryButton = (params: ShelfDisplayItem) => {
53
- event?.primaryButton?.onClick?.(params)
54
- }
55
-
56
- const onSecondaryButton = (params: ShelfDisplayItem) => {
57
- event?.secondaryButton?.onClick(params)
58
- }
59
-
60
- return (
61
- <>
62
- <div className={cn('w-full', className)}>
63
- <div className={cn('flex overflow-hidden', 'md:px-[140px] lg:px-[268px]')}>
64
- <div className={cn('w-full flex', 'gap-3 md:gap-4 overflow-x-auto overflow-y-hidden')}>
65
- {products?.map((item, index) => {
66
- return (
67
- <div
68
- key={index}
69
- className={cn(
70
- 'bg-[#EAEAEC] p-4 flex flex-col min-w-[288px] max-w-[288px]',
71
- 'md:min-w-[316px] md:max-w-[316px] lg:min-w-[404px] lg:max-w-[404px] lg:pt-4 lg:px-6 lg:pb-6',
72
- itemShape === 'round' ? 'rounded-2xl' : 'rounded-none'
73
- )}
74
- >
75
- <div className={cn('h-[137px] overflow-hidden relative inline-block mb-2', 'lg:mb-3 lg:h-[195px]')}>
76
- <Picture
77
- source={item?.img || ''}
78
- className="h-full [&_img]:w-auto object-cover flex justify-center"
79
- />
80
- </div>
81
- <div className="mb-1 flex gap-1 flex-wrap lg:mb-2">
82
- {item?.tagItems?.map((tag, index) => {
83
- return (
84
- <div
85
- key={index}
86
- className="border-2 border-[#00BEFA] px-2 py-1 text-sm font-bold rounded-3xl text-[#00BEFA] lg:text-base"
87
- >
88
- {tag}
89
- </div>
90
- )
91
- })}
92
- </div>
93
- <p className="flex-1 font-bold text-xl text-[#1D1D1F] leading-[1.2] tracking-[-0.04em] lg:text-2xl">
94
- {item?.title || ''}
95
- </p>
96
- <h3 className="mt-1 mb-5 text-sm font-semibold text-[#1D1D1F] leading-[1.2] tracking-[-0.02em] lg:mt-2 lg:mb-6 lg:text-lg">
97
- {item?.subTitle || ''}
98
- </h3>
99
- <div className="mb-2 flex items-center">
100
- <div className="font-bold text-xl text-[#1D1D1F] lg:text-2xl">
101
- {item?.price || ''}
102
- </div>
103
- <div className="ml-1 font-bold text-xl text-[#86868C] lg:text-2xl">
104
- {item?.basePrice || ''}
105
- </div>
106
- </div>
107
- {/* 按钮组 */}
108
- <div className="flex items-center gap-3">
109
- <Button
110
- variant="primary"
111
- onClick={() => onPrimaryButton(item)}
112
- className={`
113
- flex-1 bg-transparent border-[#1D1D1F] border box-border text-[#1D1D1F] text-xs md:text-sm lg:text-base
114
- px-4 md:px-6 lg:px-7 hover:bg-transparent hover:text-black py-2 md:py-2.5 lg:py-3 tracking-[-0.04em]
115
- ${shape === 'round' ? 'rounded-[20px] lg:rounded-3xl' : ''}
116
- `}
117
- >
118
- {primaryButton || ''}
119
- </Button>
120
- <Button
121
- variant="secondary"
122
- onClick={() => onSecondaryButton(item)}
123
- className={`
124
- flex-1 bg-[#1D1D1F] border-[#1D1D1F] border text-white box-border text-xs md:text-sm lg:text-base
125
- px-4 md:px-6 lg:px-7 py-2 md:py-2.5 lg:py-3 tracking-[-0.04em]
126
- ${shape === 'round' ? 'rounded-[20px] lg:rounded-3xl' : ''}
127
- `}
128
- >
129
- {secondaryButton || ''}
130
- </Button>
131
- </div>
132
- </div>
133
- )
134
- })}
135
- </div>
136
- </div>
137
- </div>
138
- </>
139
- )
140
- }
141
-
142
- export default ShelfDisplay
@@ -1,53 +0,0 @@
1
- import React from 'react'
2
- import { cn } from '../../helpers/utils.js'
3
- import { Heading, Text } from '../../components/index.js'
4
- import { withStyles } from '../../shared/Styles.js'
5
- import type { SloganProps } from './types.js'
6
-
7
- const Slogan = React.forwardRef<HTMLDivElement, SloganProps>(
8
- ({ title, features, className }, ref) => {
9
- return (
10
- <div
11
- ref={ref}
12
- className={cn(
13
- 'flex flex-col items-start md:flex-row md:items-end justify-center md:justify-between text-center w-full',
14
- 'px-4 sm:px-6 md:px-8 lg:px-16 xl:px-32',
15
- 'gap-8 py-8 sm:py-10 md:py-12 lg:py-16 xl:py-20',
16
- className
17
- )}
18
- >
19
- <Heading
20
- as="h2"
21
- size={2}
22
- weight={"bold"}
23
- align={"left"}
24
- className='slogan-title text-[#1D1D1F] !leading-none text-[40px] md:text-[40px] lg:text-[48px] xl:text-[64px]'
25
- >
26
- {title}
27
- </Heading>
28
- {features && features.length > 0 && (
29
- <div className="flex flex-row w-full gap-3 max-w-[423px] items-center">
30
- {features.slice(0, 3).map((feature, index) => (
31
- <React.Fragment key={index}>
32
- {index > 0 && (
33
- <div className="self-stretch w-px bg-[#D9D9D9]" />
34
- )}
35
- <div className="flex-1">
36
- <Text
37
- align="left"
38
- className="slogan-feature-text font-medium line-clamp-3 md:line-clamp-2 text-[#1D1D1F] text-[12px] leading-[1.4] sm:text-[13px] md:text-[14px]"
39
- html={feature}
40
- />
41
- </div>
42
- </React.Fragment>
43
- ))}
44
- </div>
45
- )}
46
- </div>
47
- )
48
- }
49
- )
50
-
51
- Slogan.displayName = 'Slogan'
52
-
53
- export default withStyles(Slogan)
@@ -1,25 +0,0 @@
1
- export interface Feature {
2
- /**
3
- * 特性标题
4
- */
5
- title: string
6
- /**
7
- * 特性描述
8
- */
9
- description: string
10
- }
11
-
12
- export interface SloganProps {
13
- /**
14
- * 主标题
15
- */
16
- title: string
17
- /**
18
- * 特性列表,最多支持3个
19
- */
20
- features?: string[]
21
- /**
22
- * 自定义类名
23
- */
24
- className?: string
25
- }
@@ -1,11 +0,0 @@
1
- export { default as Shelf } from './Shelf/index.js'
2
- export { default as BrandEquity } from './BrandEquity/index.js'
3
- export { default as MemberEquity } from './MemberEquity/index.js'
4
- export { default as Slogan } from './Slogan/index.js'
5
- export { default as ShelfDisplay } from './ShelfDisplay/index.js'
6
- export { default as Evaluate } from './Evaluate/index.js'
7
- export { default as Category } from './Category/index.js'
8
- export { default as HeroBanner } from './HeroBanner/index.js'
9
-
10
-
11
- export * from './Marquee'