@rxdrag/website-lib 0.0.151 → 0.0.153
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/README.md +2 -2
- package/components/AnimationNumber.astro +217 -217
- package/components/Background.astro +140 -114
- package/components/BackgroundGroup.astro +20 -26
- package/components/BaseFooter.astro +24 -39
- package/components/BaseHeader.astro +22 -25
- package/components/Box.astro +20 -22
- package/components/Button.astro +80 -0
- package/components/Carousel.astro +456 -315
- package/components/CarouselPagination.astro +97 -76
- package/components/CarouselSlide.astro +10 -16
- package/components/Collapse.astro +125 -125
- package/components/CollapseIndicator.astro +20 -20
- package/components/Container.astro +27 -32
- package/components/Content.astro +20 -0
- package/components/CookieConsent.astro +47 -47
- package/components/CookieConsent.css +52 -52
- package/components/CookieConsentConfig.ts +208 -208
- package/components/Dialog.astro +342 -338
- package/components/DialogTrigger.astro +32 -32
- package/components/Document.astro +240 -225
- package/components/Frame.astro +32 -0
- package/components/GlassBorder.astro +104 -0
- package/components/GlassRefraction.astro +85 -0
- package/components/GradientBorder.astro +80 -0
- package/components/Grid.astro +32 -34
- package/components/GridCell.astro +28 -32
- package/components/Heading.astro +24 -24
- package/components/Icon.astro +29 -29
- package/components/Image.astro +100 -100
- package/components/Image.md +14 -14
- package/components/Link.astro +89 -99
- package/components/Main.astro +17 -17
- package/components/Meta.astro +65 -65
- package/components/Popover.astro +189 -189
- package/components/RichTextView.astro +28 -28
- package/components/Section.astro +26 -44
- package/components/TabButton.astro +32 -16
- package/components/TabPanel.astro +20 -19
- package/components/Tabs.astro +220 -147
- package/components/Video.astro +6 -4
- package/components/YearsSince.astro +20 -20
- package/components//344/270/211/345/261/202/346/250/241/345/236/213.md +5 -5
- package/components//344/270/273/351/242/230Token.md +198 -198
- package/components//345/216/237/345/255/220/345/206/273/347/273/223/346/270/205/345/215/225.md +270 -260
- package/components//347/211/251/346/226/231/346/270/205/345/215/225.md +599 -567
- package/index.ts +5 -5
- package/package.json +7 -7
- package/components/BaseBlock.astro +0 -34
- package/components/Motion.astro +0 -77
- package/components/Stack.astro +0 -31
|
@@ -1,198 +1,198 @@
|
|
|
1
|
-
# 外贸网站 Theme Token(精简版)
|
|
2
|
-
|
|
3
|
-
基于 **TailwindCSS + ShadcnUI**,专为 **ToB 外贸询盘转化** 设计。
|
|
4
|
-
|
|
5
|
-
> ⚠️ **Tailwind 内置项不再重复**:font-size、font-weight、spacing、rounded、shadow、z-index、duration、ease 等直接使用 Tailwind 默认值。
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 一、需要自定义的 Tailwind 配置
|
|
10
|
-
|
|
11
|
-
修改 `tailwind.config.js` 的 `theme.extend`:
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
// tailwind.config.js
|
|
15
|
-
module.exports = {
|
|
16
|
-
theme: {
|
|
17
|
-
extend: {
|
|
18
|
-
// ========== 颜色(CSS变量映射)==========
|
|
19
|
-
colors: {
|
|
20
|
-
// ShadcnUI 基础色
|
|
21
|
-
border: "hsl(var(--border))",
|
|
22
|
-
input: "hsl(var(--input))",
|
|
23
|
-
ring: "hsl(var(--ring))",
|
|
24
|
-
background: "hsl(var(--background))",
|
|
25
|
-
foreground: "hsl(var(--foreground))",
|
|
26
|
-
primary: {
|
|
27
|
-
DEFAULT: "hsl(var(--primary))",
|
|
28
|
-
foreground: "hsl(var(--primary-foreground))",
|
|
29
|
-
},
|
|
30
|
-
secondary: {
|
|
31
|
-
DEFAULT: "hsl(var(--secondary))",
|
|
32
|
-
foreground: "hsl(var(--secondary-foreground))",
|
|
33
|
-
},
|
|
34
|
-
muted: {
|
|
35
|
-
DEFAULT: "hsl(var(--muted))",
|
|
36
|
-
foreground: "hsl(var(--muted-foreground))",
|
|
37
|
-
},
|
|
38
|
-
accent: {
|
|
39
|
-
DEFAULT: "hsl(var(--accent))",
|
|
40
|
-
foreground: "hsl(var(--accent-foreground))",
|
|
41
|
-
},
|
|
42
|
-
destructive: {
|
|
43
|
-
DEFAULT: "hsl(var(--destructive))",
|
|
44
|
-
foreground: "hsl(var(--destructive-foreground))",
|
|
45
|
-
},
|
|
46
|
-
card: {
|
|
47
|
-
DEFAULT: "hsl(var(--card))",
|
|
48
|
-
foreground: "hsl(var(--card-foreground))",
|
|
49
|
-
},
|
|
50
|
-
// 数据可视化
|
|
51
|
-
chart: {
|
|
52
|
-
1: "hsl(var(--chart-1))",
|
|
53
|
-
2: "hsl(var(--chart-2))",
|
|
54
|
-
},
|
|
55
|
-
// 营销高亮
|
|
56
|
-
highlight: "hsl(var(--highlight))",
|
|
57
|
-
// 社交品牌色(固定值)
|
|
58
|
-
social: {
|
|
59
|
-
whatsapp: "#25D366",
|
|
60
|
-
linkedin: "#0A66C2",
|
|
61
|
-
facebook: "#1877F2",
|
|
62
|
-
youtube: "#FF0000",
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
// ========== 圆角(基于 --radius 变量)==========
|
|
66
|
-
borderRadius: {
|
|
67
|
-
lg: "var(--radius)",
|
|
68
|
-
md: "calc(var(--radius) - 2px)",
|
|
69
|
-
sm: "calc(var(--radius) - 4px)",
|
|
70
|
-
},
|
|
71
|
-
// ========== 自定义字体(可选)==========
|
|
72
|
-
fontFamily: {
|
|
73
|
-
decorative: ["Cinzel", "Cormorant Garamond", "serif"],
|
|
74
|
-
},
|
|
75
|
-
// ========== 模块间距(响应式)==========
|
|
76
|
-
spacing: {
|
|
77
|
-
"section-compact": "3rem", // 48px - 紧凑模块
|
|
78
|
-
"section-normal": "5rem", // 80px - 标准模块
|
|
79
|
-
"section-relaxed": "7.5rem", // 120px - Hero区域
|
|
80
|
-
},
|
|
81
|
-
// ========== 自定义动画 ==========
|
|
82
|
-
keyframes: {
|
|
83
|
-
"fade-up": {
|
|
84
|
-
"0%": { opacity: "0", transform: "translateY(20px)" },
|
|
85
|
-
"100%": { opacity: "1", transform: "translateY(0)" },
|
|
86
|
-
},
|
|
87
|
-
"fade-down": {
|
|
88
|
-
"0%": { opacity: "0", transform: "translateY(-20px)" },
|
|
89
|
-
"100%": { opacity: "1", transform: "translateY(0)" },
|
|
90
|
-
},
|
|
91
|
-
"scale-in": {
|
|
92
|
-
"0%": { opacity: "0", transform: "scale(0.95)" },
|
|
93
|
-
"100%": { opacity: "1", transform: "scale(1)" },
|
|
94
|
-
},
|
|
95
|
-
"slide-in-right": {
|
|
96
|
-
"0%": { transform: "translateX(100%)" },
|
|
97
|
-
"100%": { transform: "translateX(0)" },
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
animation: {
|
|
101
|
-
"fade-up": "fade-up 0.5s ease-out",
|
|
102
|
-
"fade-down": "fade-down 0.3s ease-out",
|
|
103
|
-
"scale-in": "scale-in 0.3s ease-out",
|
|
104
|
-
"slide-in-right": "slide-in-right 0.3s ease-out",
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## 二、CSS 变量定义
|
|
114
|
-
|
|
115
|
-
在 `globals.css` 中定义(ShadcnUI 格式):
|
|
116
|
-
|
|
117
|
-
```css
|
|
118
|
-
@layer base {
|
|
119
|
-
:root {
|
|
120
|
-
--background: 0 0% 100%;
|
|
121
|
-
--foreground: 0 0% 20%;
|
|
122
|
-
--card: 0 0% 98%;
|
|
123
|
-
--card-foreground: 0 0% 20%;
|
|
124
|
-
--primary: 217 58% 43%; /* 工业蓝 #2E5AAC */
|
|
125
|
-
--primary-foreground: 0 0% 100%;
|
|
126
|
-
--secondary: 0 0% 96%;
|
|
127
|
-
--secondary-foreground: 0 0% 20%;
|
|
128
|
-
--muted: 0 0% 96%;
|
|
129
|
-
--muted-foreground: 0 0% 45%;
|
|
130
|
-
--accent: 30 90% 50%; /* 强调橙 */
|
|
131
|
-
--accent-foreground: 0 0% 100%;
|
|
132
|
-
--destructive: 0 84% 60%;
|
|
133
|
-
--destructive-foreground: 0 0% 100%;
|
|
134
|
-
--border: 0 0% 90%;
|
|
135
|
-
--input: 0 0% 90%;
|
|
136
|
-
--ring: 217 58% 43%;
|
|
137
|
-
--radius: 0.5rem;
|
|
138
|
-
--chart-1: 217 58% 43%;
|
|
139
|
-
--chart-2: 30 90% 50%;
|
|
140
|
-
--highlight: 48 96% 53%; /* 高亮黄 */
|
|
141
|
-
}
|
|
142
|
-
.dark {
|
|
143
|
-
--background: 0 0% 10%;
|
|
144
|
-
--foreground: 0 0% 90%;
|
|
145
|
-
/* ... 暗色模式对应值 */
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## 三、语义化排版组合
|
|
153
|
-
|
|
154
|
-
直接使用 Tailwind class 组合:
|
|
155
|
-
|
|
156
|
-
| 用途 | Class 组合 |
|
|
157
|
-
|:-----|:-----------|
|
|
158
|
-
| **Lead 导语** | `text-xl text-muted-foreground` |
|
|
159
|
-
| **Caption 注脚** | `text-xs text-muted-foreground` |
|
|
160
|
-
| **Spec 参数** | `font-mono text-sm bg-muted px-1 rounded` |
|
|
161
|
-
| **Quote 引用** | `font-serif italic text-lg text-foreground/80` |
|
|
162
|
-
| **Eyebrow 眉题** | `text-sm font-medium tracking-widest uppercase text-primary` |
|
|
163
|
-
| **Form Label** | `text-sm font-medium leading-none` |
|
|
164
|
-
| **Error Text** | `text-sm font-medium text-destructive` |
|
|
165
|
-
| **Success Text** | `text-sm font-medium text-green-600` |
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## 四、外贸站特有 Token
|
|
170
|
-
|
|
171
|
-
### CTA 按钮层级
|
|
172
|
-
|
|
173
|
-
| 类型 | 场景 |
|
|
174
|
-
|:-----|:-----|
|
|
175
|
-
| **Primary** | "Get a Quote"、"Contact Us"、"Inquiry Now" |
|
|
176
|
-
| **Secondary** | "Learn More"、"View Details"、"Download Catalog" |
|
|
177
|
-
| **Ghost** | 导航链接、紧凑操作 |
|
|
178
|
-
|
|
179
|
-
### 社交品牌色
|
|
180
|
-
|
|
181
|
-
| 平台 | 色值 | 用途 |
|
|
182
|
-
|:-----|:-----|:-----|
|
|
183
|
-
| WhatsApp | `#25D366` | 即时沟通核心 |
|
|
184
|
-
| LinkedIn | `#0A66C2` | B2B 专业背书 |
|
|
185
|
-
| Facebook | `#1877F2` | 社媒引流 |
|
|
186
|
-
| YouTube | `#FF0000` | 工厂/产品视频 |
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## 五、AOS 滚动动效
|
|
191
|
-
|
|
192
|
-
| Attribute | 效果 |
|
|
193
|
-
|:----------|:-----|
|
|
194
|
-
| `data-aos="fade-up"` | 向上淡入(通用入场) |
|
|
195
|
-
| `data-aos="fade-in"` | 原地淡入 |
|
|
196
|
-
| `data-aos="zoom-in"` | 缩放淡入 |
|
|
197
|
-
| `data-aos-delay="100"` | 延迟(交错动画) |
|
|
198
|
-
| `data-aos-once="true"` | 只播放一次(推荐)|
|
|
1
|
+
# 外贸网站 Theme Token(精简版)
|
|
2
|
+
|
|
3
|
+
基于 **TailwindCSS + ShadcnUI**,专为 **ToB 外贸询盘转化** 设计。
|
|
4
|
+
|
|
5
|
+
> ⚠️ **Tailwind 内置项不再重复**:font-size、font-weight、spacing、rounded、shadow、z-index、duration、ease 等直接使用 Tailwind 默认值。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 一、需要自定义的 Tailwind 配置
|
|
10
|
+
|
|
11
|
+
修改 `tailwind.config.js` 的 `theme.extend`:
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
// tailwind.config.js
|
|
15
|
+
module.exports = {
|
|
16
|
+
theme: {
|
|
17
|
+
extend: {
|
|
18
|
+
// ========== 颜色(CSS变量映射)==========
|
|
19
|
+
colors: {
|
|
20
|
+
// ShadcnUI 基础色
|
|
21
|
+
border: "hsl(var(--border))",
|
|
22
|
+
input: "hsl(var(--input))",
|
|
23
|
+
ring: "hsl(var(--ring))",
|
|
24
|
+
background: "hsl(var(--background))",
|
|
25
|
+
foreground: "hsl(var(--foreground))",
|
|
26
|
+
primary: {
|
|
27
|
+
DEFAULT: "hsl(var(--primary))",
|
|
28
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
29
|
+
},
|
|
30
|
+
secondary: {
|
|
31
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
32
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
33
|
+
},
|
|
34
|
+
muted: {
|
|
35
|
+
DEFAULT: "hsl(var(--muted))",
|
|
36
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
37
|
+
},
|
|
38
|
+
accent: {
|
|
39
|
+
DEFAULT: "hsl(var(--accent))",
|
|
40
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
41
|
+
},
|
|
42
|
+
destructive: {
|
|
43
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
44
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
45
|
+
},
|
|
46
|
+
card: {
|
|
47
|
+
DEFAULT: "hsl(var(--card))",
|
|
48
|
+
foreground: "hsl(var(--card-foreground))",
|
|
49
|
+
},
|
|
50
|
+
// 数据可视化
|
|
51
|
+
chart: {
|
|
52
|
+
1: "hsl(var(--chart-1))",
|
|
53
|
+
2: "hsl(var(--chart-2))",
|
|
54
|
+
},
|
|
55
|
+
// 营销高亮
|
|
56
|
+
highlight: "hsl(var(--highlight))",
|
|
57
|
+
// 社交品牌色(固定值)
|
|
58
|
+
social: {
|
|
59
|
+
whatsapp: "#25D366",
|
|
60
|
+
linkedin: "#0A66C2",
|
|
61
|
+
facebook: "#1877F2",
|
|
62
|
+
youtube: "#FF0000",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
// ========== 圆角(基于 --radius 变量)==========
|
|
66
|
+
borderRadius: {
|
|
67
|
+
lg: "var(--radius)",
|
|
68
|
+
md: "calc(var(--radius) - 2px)",
|
|
69
|
+
sm: "calc(var(--radius) - 4px)",
|
|
70
|
+
},
|
|
71
|
+
// ========== 自定义字体(可选)==========
|
|
72
|
+
fontFamily: {
|
|
73
|
+
decorative: ["Cinzel", "Cormorant Garamond", "serif"],
|
|
74
|
+
},
|
|
75
|
+
// ========== 模块间距(响应式)==========
|
|
76
|
+
spacing: {
|
|
77
|
+
"section-compact": "3rem", // 48px - 紧凑模块
|
|
78
|
+
"section-normal": "5rem", // 80px - 标准模块
|
|
79
|
+
"section-relaxed": "7.5rem", // 120px - Hero区域
|
|
80
|
+
},
|
|
81
|
+
// ========== 自定义动画 ==========
|
|
82
|
+
keyframes: {
|
|
83
|
+
"fade-up": {
|
|
84
|
+
"0%": { opacity: "0", transform: "translateY(20px)" },
|
|
85
|
+
"100%": { opacity: "1", transform: "translateY(0)" },
|
|
86
|
+
},
|
|
87
|
+
"fade-down": {
|
|
88
|
+
"0%": { opacity: "0", transform: "translateY(-20px)" },
|
|
89
|
+
"100%": { opacity: "1", transform: "translateY(0)" },
|
|
90
|
+
},
|
|
91
|
+
"scale-in": {
|
|
92
|
+
"0%": { opacity: "0", transform: "scale(0.95)" },
|
|
93
|
+
"100%": { opacity: "1", transform: "scale(1)" },
|
|
94
|
+
},
|
|
95
|
+
"slide-in-right": {
|
|
96
|
+
"0%": { transform: "translateX(100%)" },
|
|
97
|
+
"100%": { transform: "translateX(0)" },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
animation: {
|
|
101
|
+
"fade-up": "fade-up 0.5s ease-out",
|
|
102
|
+
"fade-down": "fade-down 0.3s ease-out",
|
|
103
|
+
"scale-in": "scale-in 0.3s ease-out",
|
|
104
|
+
"slide-in-right": "slide-in-right 0.3s ease-out",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 二、CSS 变量定义
|
|
114
|
+
|
|
115
|
+
在 `globals.css` 中定义(ShadcnUI 格式):
|
|
116
|
+
|
|
117
|
+
```css
|
|
118
|
+
@layer base {
|
|
119
|
+
:root {
|
|
120
|
+
--background: 0 0% 100%;
|
|
121
|
+
--foreground: 0 0% 20%;
|
|
122
|
+
--card: 0 0% 98%;
|
|
123
|
+
--card-foreground: 0 0% 20%;
|
|
124
|
+
--primary: 217 58% 43%; /* 工业蓝 #2E5AAC */
|
|
125
|
+
--primary-foreground: 0 0% 100%;
|
|
126
|
+
--secondary: 0 0% 96%;
|
|
127
|
+
--secondary-foreground: 0 0% 20%;
|
|
128
|
+
--muted: 0 0% 96%;
|
|
129
|
+
--muted-foreground: 0 0% 45%;
|
|
130
|
+
--accent: 30 90% 50%; /* 强调橙 */
|
|
131
|
+
--accent-foreground: 0 0% 100%;
|
|
132
|
+
--destructive: 0 84% 60%;
|
|
133
|
+
--destructive-foreground: 0 0% 100%;
|
|
134
|
+
--border: 0 0% 90%;
|
|
135
|
+
--input: 0 0% 90%;
|
|
136
|
+
--ring: 217 58% 43%;
|
|
137
|
+
--radius: 0.5rem;
|
|
138
|
+
--chart-1: 217 58% 43%;
|
|
139
|
+
--chart-2: 30 90% 50%;
|
|
140
|
+
--highlight: 48 96% 53%; /* 高亮黄 */
|
|
141
|
+
}
|
|
142
|
+
.dark {
|
|
143
|
+
--background: 0 0% 10%;
|
|
144
|
+
--foreground: 0 0% 90%;
|
|
145
|
+
/* ... 暗色模式对应值 */
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 三、语义化排版组合
|
|
153
|
+
|
|
154
|
+
直接使用 Tailwind class 组合:
|
|
155
|
+
|
|
156
|
+
| 用途 | Class 组合 |
|
|
157
|
+
|:-----|:-----------|
|
|
158
|
+
| **Lead 导语** | `text-xl text-muted-foreground` |
|
|
159
|
+
| **Caption 注脚** | `text-xs text-muted-foreground` |
|
|
160
|
+
| **Spec 参数** | `font-mono text-sm bg-muted px-1 rounded` |
|
|
161
|
+
| **Quote 引用** | `font-serif italic text-lg text-foreground/80` |
|
|
162
|
+
| **Eyebrow 眉题** | `text-sm font-medium tracking-widest uppercase text-primary` |
|
|
163
|
+
| **Form Label** | `text-sm font-medium leading-none` |
|
|
164
|
+
| **Error Text** | `text-sm font-medium text-destructive` |
|
|
165
|
+
| **Success Text** | `text-sm font-medium text-green-600` |
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 四、外贸站特有 Token
|
|
170
|
+
|
|
171
|
+
### CTA 按钮层级
|
|
172
|
+
|
|
173
|
+
| 类型 | 场景 |
|
|
174
|
+
|:-----|:-----|
|
|
175
|
+
| **Primary** | "Get a Quote"、"Contact Us"、"Inquiry Now" |
|
|
176
|
+
| **Secondary** | "Learn More"、"View Details"、"Download Catalog" |
|
|
177
|
+
| **Ghost** | 导航链接、紧凑操作 |
|
|
178
|
+
|
|
179
|
+
### 社交品牌色
|
|
180
|
+
|
|
181
|
+
| 平台 | 色值 | 用途 |
|
|
182
|
+
|:-----|:-----|:-----|
|
|
183
|
+
| WhatsApp | `#25D366` | 即时沟通核心 |
|
|
184
|
+
| LinkedIn | `#0A66C2` | B2B 专业背书 |
|
|
185
|
+
| Facebook | `#1877F2` | 社媒引流 |
|
|
186
|
+
| YouTube | `#FF0000` | 工厂/产品视频 |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 五、AOS 滚动动效
|
|
191
|
+
|
|
192
|
+
| Attribute | 效果 |
|
|
193
|
+
|:----------|:-----|
|
|
194
|
+
| `data-aos="fade-up"` | 向上淡入(通用入场) |
|
|
195
|
+
| `data-aos="fade-in"` | 原地淡入 |
|
|
196
|
+
| `data-aos="zoom-in"` | 缩放淡入 |
|
|
197
|
+
| `data-aos-delay="100"` | 延迟(交错动画) |
|
|
198
|
+
| `data-aos-once="true"` | 只播放一次(推荐)|
|