@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
package/components//345/216/237/345/255/220/345/206/273/347/273/223/346/270/205/345/215/225.md
CHANGED
|
@@ -1,260 +1,270 @@
|
|
|
1
|
-
# 原子冻结清单(Frozen Atomic Layer)
|
|
2
|
-
|
|
3
|
-
Frozen ≠ 不扩展,而是「语义与接口永不破坏」
|
|
4
|
-
|
|
5
|
-
## 一、冻结的总体规则(先定宪法)
|
|
6
|
-
|
|
7
|
-
以下 4 条,比具体组件更重要:
|
|
8
|
-
|
|
9
|
-
### 1️⃣ 冻结的是「语义 + Props 结构」
|
|
10
|
-
允许内部 Tailwind / DOM 变,不允许 Props 含义变化
|
|
11
|
-
|
|
12
|
-
### 2️⃣ 冻结的是「层级关系」
|
|
13
|
-
Section > Layout > Content > Action(永远不交叉)
|
|
14
|
-
|
|
15
|
-
### 3️⃣ 冻结的是「参数空间」
|
|
16
|
-
枚举值只加不改,默认值永不删除
|
|
17
|
-
|
|
18
|
-
### 4️⃣ 冻结的是「AI 可操作边界」
|
|
19
|
-
AI 只能改 frozen props,新能力通过新增原子,不改旧原子
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 二、🧊 真正“永远不动”的原子(核心冻结层)
|
|
24
|
-
|
|
25
|
-
> 语义和接口永不改变,AI 只能操作内容
|
|
26
|
-
|
|
27
|
-
### 🧱 1. Structure (结构) - 绝对冻结
|
|
28
|
-
|
|
29
|
-
**Section** ✅
|
|
30
|
-
```ts
|
|
31
|
-
interface SectionProps {
|
|
32
|
-
id?: string
|
|
33
|
-
tone?: "light" | "dark" | "brand"
|
|
34
|
-
density?: "compact" | "normal" | "relaxed"
|
|
35
|
-
maxWidth?: "sm" | "md" | "lg" | "xl" | "full"
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
*原因:页面骨架,全站升级依赖它*
|
|
39
|
-
|
|
40
|
-
**Container** ✅
|
|
41
|
-
```ts
|
|
42
|
-
interface ContainerProps {
|
|
43
|
-
size?: "sm" | "md" | "lg" | "xl"
|
|
44
|
-
align?: "left" | "center"
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
*原因:限宽核心*
|
|
48
|
-
|
|
49
|
-
**Main** ✅
|
|
50
|
-
```ts
|
|
51
|
-
interface MainProps {
|
|
52
|
-
class?: string
|
|
53
|
-
className?: string
|
|
54
|
-
backgrounds?: BackgroundConfig[]
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
*原因:页面主内容区域,对应 `<main>` 标签,与 Header/Footer 平级,设计模式需独立渲染*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
**
|
|
90
|
-
```ts
|
|
91
|
-
interface
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### 🧱
|
|
134
|
-
|
|
135
|
-
**
|
|
136
|
-
```ts
|
|
137
|
-
interface
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
**
|
|
146
|
-
```ts
|
|
147
|
-
interface
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
###
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
1
|
+
# 原子冻结清单(Frozen Atomic Layer)
|
|
2
|
+
|
|
3
|
+
Frozen ≠ 不扩展,而是「语义与接口永不破坏」
|
|
4
|
+
|
|
5
|
+
## 一、冻结的总体规则(先定宪法)
|
|
6
|
+
|
|
7
|
+
以下 4 条,比具体组件更重要:
|
|
8
|
+
|
|
9
|
+
### 1️⃣ 冻结的是「语义 + Props 结构」
|
|
10
|
+
允许内部 Tailwind / DOM 变,不允许 Props 含义变化
|
|
11
|
+
|
|
12
|
+
### 2️⃣ 冻结的是「层级关系」
|
|
13
|
+
Section > Layout > Content > Action(永远不交叉)
|
|
14
|
+
|
|
15
|
+
### 3️⃣ 冻结的是「参数空间」
|
|
16
|
+
枚举值只加不改,默认值永不删除
|
|
17
|
+
|
|
18
|
+
### 4️⃣ 冻结的是「AI 可操作边界」
|
|
19
|
+
AI 只能改 frozen props,新能力通过新增原子,不改旧原子
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 二、🧊 真正“永远不动”的原子(核心冻结层)
|
|
24
|
+
|
|
25
|
+
> 语义和接口永不改变,AI 只能操作内容
|
|
26
|
+
|
|
27
|
+
### 🧱 1. Structure (结构) - 绝对冻结
|
|
28
|
+
|
|
29
|
+
**Section** ✅
|
|
30
|
+
```ts
|
|
31
|
+
interface SectionProps {
|
|
32
|
+
id?: string
|
|
33
|
+
tone?: "light" | "dark" | "brand"
|
|
34
|
+
density?: "compact" | "normal" | "relaxed"
|
|
35
|
+
maxWidth?: "sm" | "md" | "lg" | "xl" | "full"
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
*原因:页面骨架,全站升级依赖它*
|
|
39
|
+
|
|
40
|
+
**Container** ✅
|
|
41
|
+
```ts
|
|
42
|
+
interface ContainerProps {
|
|
43
|
+
size?: "sm" | "md" | "lg" | "xl"
|
|
44
|
+
align?: "left" | "center"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
*原因:限宽核心*
|
|
48
|
+
|
|
49
|
+
**Main** ✅
|
|
50
|
+
```ts
|
|
51
|
+
interface MainProps {
|
|
52
|
+
class?: string
|
|
53
|
+
className?: string
|
|
54
|
+
backgrounds?: BackgroundConfig[]
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
*原因:页面主内容区域,对应 `<main>` 标签,与 Header/Footer 平级,设计模式需独立渲染*
|
|
58
|
+
|
|
59
|
+
**Frame** ✅
|
|
60
|
+
```ts
|
|
61
|
+
interface FrameProps extends HTMLAttributes<HTMLTag> {
|
|
62
|
+
className?: string
|
|
63
|
+
backgrounds?: BackgroundConfig[]
|
|
64
|
+
tag?: string
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
*原因:设计系统基础裁剪容器,负责 `relative isolate` 定位 + BackgroundGroup 渲染,通过 `tag` 可切换底层标签,所有需要背景层的容器都应基于 Frame*
|
|
68
|
+
|
|
69
|
+
### 🧱 2. Layout (布局) - 高优先冻结
|
|
70
|
+
|
|
71
|
+
**Grid** ✅
|
|
72
|
+
```ts
|
|
73
|
+
interface GridProps {
|
|
74
|
+
cols?: Responsive<number>
|
|
75
|
+
gap?: GapToken
|
|
76
|
+
align?: "start" | "center" | "end"
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Stack** ✅
|
|
81
|
+
```ts
|
|
82
|
+
interface StackProps {
|
|
83
|
+
direction?: "vertical" | "horizontal"
|
|
84
|
+
gap?: GapToken
|
|
85
|
+
align?: "start" | "center" | "end"
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Split** ✅
|
|
90
|
+
```ts
|
|
91
|
+
interface SplitProps {
|
|
92
|
+
ratio?: "1:1" | "2:1" | "3:2"
|
|
93
|
+
reverse?: boolean
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 🧱 3. Content (内容) - 语义冻结
|
|
98
|
+
|
|
99
|
+
**Heading** ✅
|
|
100
|
+
```ts
|
|
101
|
+
interface HeadingProps {
|
|
102
|
+
level?: 1 | 2 | 3 | 4
|
|
103
|
+
emphasis?: "strong" | "normal" | "soft"
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Text** ✅
|
|
108
|
+
```ts
|
|
109
|
+
interface TextProps {
|
|
110
|
+
size?: "sm" | "md" | "lg"
|
|
111
|
+
tone?: "normal" | "muted"
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Media** ✅
|
|
116
|
+
```ts
|
|
117
|
+
interface MediaProps {
|
|
118
|
+
src: string
|
|
119
|
+
type?: "image" | "video"
|
|
120
|
+
ratio?: AspectRatio
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Link** ✅
|
|
125
|
+
```ts
|
|
126
|
+
interface LinkProps {
|
|
127
|
+
href: string
|
|
128
|
+
external?: boolean
|
|
129
|
+
variant?: "default" | "muted" | "nav"
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 🧱 4. Action (转化) - 转化冻结
|
|
134
|
+
|
|
135
|
+
**Button / CTA** ✅
|
|
136
|
+
```ts
|
|
137
|
+
interface ButtonProps {
|
|
138
|
+
variant?: "primary" | "secondary" | "ghost"
|
|
139
|
+
size?: "sm" | "md" | "lg"
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 🧱 5. Semantic & Form (业务冻结)
|
|
144
|
+
|
|
145
|
+
**Feature** (卖点) ✅
|
|
146
|
+
```ts
|
|
147
|
+
interface FeatureProps {
|
|
148
|
+
title: string
|
|
149
|
+
description: string
|
|
150
|
+
icon?: string
|
|
151
|
+
emphasis?: "normal" | "strong"
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**SpecList / Table** (参数) ✅
|
|
156
|
+
```ts
|
|
157
|
+
interface SpecListProps { items: { label: string; value: string }[]; layout?: "list" | "grid" }
|
|
158
|
+
interface TableProps { columns: any[]; rows: any[]; striped?: boolean }
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**FAQ / Breadcrumb** (SEO) ✅
|
|
162
|
+
*语义稳定,对应 Schema 结构*
|
|
163
|
+
|
|
164
|
+
**Input / Select / Textarea** (询盘) ✅
|
|
165
|
+
*HTML 表单标准语义*
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 三、❄️ 半冻结原子(规则冻结,形态可扩)
|
|
170
|
+
|
|
171
|
+
> 不允许破坏规则,但允许新增形态 (Variant)
|
|
172
|
+
|
|
173
|
+
**Box** (装饰容器)
|
|
174
|
+
*规则稳定 (padding/radius),但 background 可扩*
|
|
175
|
+
|
|
176
|
+
**Prose** (富文本)
|
|
177
|
+
*Typography 规则稳定*
|
|
178
|
+
|
|
179
|
+
**Spacer / Align / Divider**
|
|
180
|
+
*空间规则稳定*
|
|
181
|
+
|
|
182
|
+
**Badge / Icon**
|
|
183
|
+
*基础元数据稳定,样式可扩*
|
|
184
|
+
|
|
185
|
+
**LogoCloud / Testimonial / Rating / PriceTag**
|
|
186
|
+
*信任组件,核心字段稳定,UI 风格可变*
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 四、🔥 明确 “永远不冻结”的原子
|
|
191
|
+
|
|
192
|
+
> 设计趋势变化快,形态多变,AI 需在受控范围操作
|
|
193
|
+
|
|
194
|
+
- **❌ Repeat** (工具组件,render 不稳定)
|
|
195
|
+
- **❌ Pagination** (交互多变)
|
|
196
|
+
- **❌ Countdown** (样式多变)
|
|
197
|
+
- **❌ Carousel / Tabs / Modal** (交互逻辑复杂,易滥用)
|
|
198
|
+
- **❌ Animation** (装饰层)
|
|
199
|
+
|
|
200
|
+
### Animation 治理规则(装饰层,不冻结)
|
|
201
|
+
|
|
202
|
+
**使用方式**:直接在元素上写 `data-aos-*` 属性,无需 wrapper
|
|
203
|
+
|
|
204
|
+
```html
|
|
205
|
+
<h2 data-aos="fade-up">标题</h2>
|
|
206
|
+
<p data-aos="fade-up" data-aos-delay="80">文案</p>
|
|
207
|
+
<button data-aos="fade-up" data-aos-delay="160">按钮</button>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**可用字段**:
|
|
211
|
+
- `data-aos`:动画类型(fade-up / fade-down / fade-left / fade-right / zoom-in / slide-up 等)
|
|
212
|
+
- `data-aos-delay`:延迟(ms),用于 stagger 效果
|
|
213
|
+
- `data-aos-duration`:持续时间(ms)
|
|
214
|
+
- `data-aos-offset`:触发偏移(px)
|
|
215
|
+
- `data-aos-easing`:缓动函数
|
|
216
|
+
- `data-aos-once`:是否只播放一次
|
|
217
|
+
|
|
218
|
+
**治理红线**(校验器守门):
|
|
219
|
+
- **禁止嵌套**:父子不能同时带 `data-aos`
|
|
220
|
+
- **禁止首屏主 CTA**:hero 区域主按钮不加动画
|
|
221
|
+
- **移动端降级**:≤768px 只允许 fade 系 + duration≤300ms
|
|
222
|
+
- **支持全局关闭**:提供一键禁用开关
|
|
223
|
+
|
|
224
|
+
**AI 约束**:
|
|
225
|
+
- 只能改 `data-aos-*` 值
|
|
226
|
+
- 不能把 Animation 升级为 frozen 原子
|
|
227
|
+
|
|
228
|
+
原因
|
|
229
|
+
|
|
230
|
+
- **设计趋势变化快**
|
|
231
|
+
- **AI 容易滥用**
|
|
232
|
+
- **对外贸转化非核心**
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 五、冻结层的工程落地
|
|
237
|
+
|
|
238
|
+
### 1️⃣ 在代码里显式标记
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
/**
|
|
242
|
+
* @frozen
|
|
243
|
+
* DO NOT CHANGE PROPS SEMANTICS
|
|
244
|
+
*/
|
|
245
|
+
export interface SectionProps { ... }
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### 2️⃣ 校验器规则(AI 守门)
|
|
249
|
+
|
|
250
|
+
- **禁止删除 frozen props**
|
|
251
|
+
- **禁止改 enum 含义**
|
|
252
|
+
- **禁止替换 frozen component**
|
|
253
|
+
|
|
254
|
+
### 3️⃣ 版本策略
|
|
255
|
+
|
|
256
|
+
```txt
|
|
257
|
+
frozenAtomsVersion: "1.x"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 六、一句话总结
|
|
263
|
+
|
|
264
|
+
你不是在做组件库,你是在做一套“**长期稳定的设计语言内核**”。
|
|
265
|
+
|
|
266
|
+
这份冻结清单一旦立住:
|
|
267
|
+
- **AI 永远不乱**
|
|
268
|
+
- **模板永远可升级**
|
|
269
|
+
- **客户永远可定制**
|
|
270
|
+
- **系统越用越值钱**
|