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