@rxdrag/website-lib 0.0.120 → 0.0.122

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.
@@ -1,353 +0,0 @@
1
- # 原子化物料清单
2
-
3
- 共 25 个原子,按冻结层级分类
4
-
5
- ---
6
-
7
- ## 一、🧊 完全冻结(Frozen)
8
-
9
- > 语义和接口永不改变,AI 只能操作内容,不能改结构
10
-
11
- ### 1. 结构原子
12
-
13
- **Section**
14
- ```ts
15
- interface SectionProps {
16
- id: string
17
- tone?: "light" | "dark" | "brand"
18
- density?: "compact" | "normal" | "relaxed"
19
- maxWidth?: "sm" | "md" | "lg" | "xl" | "full"
20
- }
21
- ```
22
- - tone:控制背景、基础文字色
23
- - density:上下 padding(mobile 自动降级一档)
24
- - maxWidth:内容最大宽度(mobile 自动 full)
25
-
26
- **Container**
27
- ```ts
28
- interface ContainerProps {
29
- size?: "sm" | "md" | "lg" | "xl"
30
- align?: "left" | "center"
31
- }
32
- ```
33
-
34
- ### 2. 布局原子
35
-
36
- **Grid**
37
- ```ts
38
- interface GridProps {
39
- cols?: number | { base: number; md?: number; lg?: number }
40
- gap?: "xs" | "sm" | "md" | "lg" | "xl"
41
- align?: "start" | "center" | "end"
42
- }
43
- ```
44
-
45
- **Stack**
46
- ```ts
47
- interface StackProps {
48
- direction?: "vertical" | "horizontal"
49
- gap?: "xs" | "sm" | "md" | "lg"
50
- align?: "start" | "center" | "end"
51
- }
52
- ```
53
- - mobile 强制 vertical
54
-
55
- **Split**
56
- ```ts
57
- interface SplitProps {
58
- ratio?: "1:1" | "2:1" | "3:2"
59
- reverse?: boolean
60
- }
61
- ```
62
- - mobile 自动 stack
63
-
64
- ### 3. 内容原子
65
-
66
- **Heading**
67
- ```ts
68
- interface HeadingProps {
69
- level?: 1 | 2 | 3 | 4
70
- emphasis?: "strong" | "normal" | "soft"
71
- }
72
- ```
73
- - 自动响应式字号缩放
74
- - H1 mobile 自动降级
75
-
76
- **Text**
77
- ```ts
78
- interface TextProps {
79
- size?: "sm" | "md" | "lg"
80
- tone?: "muted" | "normal"
81
- }
82
- ```
83
-
84
- **Media**
85
- ```ts
86
- interface MediaProps {
87
- type?: "image" | "video"
88
- src: string
89
- ratio?: "1:1" | "4:3" | "16:9"
90
- }
91
- ```
92
- - 自动 lazy + responsive image
93
-
94
- **Link**
95
- ```ts
96
- interface LinkProps {
97
- href: string
98
- external?: boolean // 自动加 target="_blank" rel="noopener"
99
- variant?: "default" | "muted" | "nav"
100
- }
101
- ```
102
-
103
- ### 4. 行为原子
104
-
105
- **Button / CTA**
106
- ```ts
107
- interface ButtonProps {
108
- variant?: "primary" | "secondary" | "ghost"
109
- size?: "sm" | "md" | "lg"
110
- }
111
- ```
112
-
113
- ### 5. 语义原子(SEO 核心)
114
-
115
- **Feature**(卖点)
116
- ```ts
117
- interface FeatureProps {
118
- icon?: string
119
- title: string
120
- description: string
121
- emphasis?: "normal" | "strong"
122
- }
123
- ```
124
-
125
- **SpecList**(参数列表)
126
- ```ts
127
- interface SpecListProps {
128
- items: { label: string; value: string }[]
129
- layout?: "grid" | "list"
130
- }
131
- ```
132
-
133
- **Table**(多列对比表)
134
- ```ts
135
- interface TableProps {
136
- columns: { key: string; label: string }[]
137
- rows: Record<string, string>[]
138
- striped?: boolean
139
- compact?: boolean
140
- }
141
- ```
142
-
143
- **FAQ**
144
- ```ts
145
- interface FAQProps {
146
- items: { question: string; answer: string }[]
147
- defaultOpen?: number
148
- }
149
- ```
150
- - SEO Schema:FAQPage
151
-
152
- **Breadcrumb**
153
- ```ts
154
- interface BreadcrumbProps {
155
- items: { label: string; href?: string }[]
156
- }
157
- ```
158
- - SEO Schema:BreadcrumbList
159
-
160
- ### 6. 表单原子(询盘核心)
161
-
162
- **Input**
163
- ```ts
164
- interface InputProps {
165
- type?: "text" | "email" | "tel" | "number"
166
- label?: string
167
- placeholder?: string
168
- required?: boolean
169
- error?: string
170
- }
171
- ```
172
-
173
- **Textarea**
174
- ```ts
175
- interface TextareaProps {
176
- label?: string
177
- placeholder?: string
178
- rows?: number
179
- required?: boolean
180
- }
181
- ```
182
-
183
- **Select**
184
- ```ts
185
- interface SelectProps {
186
- options: { value: string; label: string }[]
187
- label?: string
188
- placeholder?: string
189
- required?: boolean
190
- }
191
- ```
192
-
193
- ---
194
-
195
- ## 二、🧊❄️ 半冻结(Semi-Frozen)
196
-
197
- > 规则冻结,形态可扩展(可加 variant,但不改核心接口)
198
-
199
- **Box**
200
- ```ts
201
- interface BoxProps {
202
- padding?: "none" | "sm" | "md" | "lg"
203
- background?: "none" | "muted" | "card"
204
- border?: boolean
205
- radius?: "none" | "sm" | "md" | "lg"
206
- }
207
- ```
208
- - 场景:Feature 卡片、Pricing 卡片、侧边栏模块
209
-
210
- **Prose**
211
- ```ts
212
- interface ProseProps {
213
- size?: "sm" | "md" | "lg"
214
- }
215
- ```
216
- - 自动处理段落/标题间距、列表/引用样式
217
- - 对应 Tailwind `prose` 类
218
- - 场景:产品详情、博客正文、About 页面
219
-
220
- **Spacer**
221
- ```ts
222
- interface SpacerProps {
223
- size?: "xs" | "sm" | "md" | "lg"
224
- }
225
- ```
226
-
227
- **Align**
228
- ```ts
229
- interface AlignProps {
230
- x?: "left" | "center" | "right"
231
- y?: "top" | "center" | "bottom"
232
- }
233
- ```
234
-
235
- **Badge**
236
- ```ts
237
- interface BadgeProps {
238
- tone?: "info" | "success" | "warning"
239
- }
240
- ```
241
-
242
- **Icon**
243
- ```ts
244
- interface IconProps {
245
- name: string // iconify 格式,如 "mdi:check"
246
- size?: "sm" | "md" | "lg" | "xl"
247
- color?: "current" | "muted" | "brand"
248
- }
249
- ```
250
-
251
- **Divider**
252
- ```ts
253
- interface DividerProps {
254
- orientation?: "horizontal" | "vertical"
255
- spacing?: "sm" | "md" | "lg"
256
- }
257
- ```
258
-
259
- **LogoCloud**
260
- ```ts
261
- interface LogoCloudProps {
262
- logos: string[]
263
- columns?: Responsive<number>
264
- tone?: "mono" | "color"
265
- }
266
- ```
267
-
268
- **Testimonial**
269
- ```ts
270
- interface TestimonialProps {
271
- quote: string
272
- author: string
273
- role?: string
274
- avatar?: string
275
- }
276
- ```
277
-
278
- **Rating**
279
- ```ts
280
- interface RatingProps {
281
- value: number // 0-5
282
- max?: number
283
- size?: "sm" | "md" | "lg"
284
- showValue?: boolean
285
- }
286
- ```
287
-
288
- **PriceTag**
289
- ```ts
290
- interface PriceTagProps {
291
- amount: number
292
- currency?: "USD" | "EUR" | "CNY"
293
- original?: number // 原价(用于折扣展示)
294
- size?: "sm" | "md" | "lg"
295
- }
296
- ```
297
-
298
- ---
299
-
300
- ## 三、🔥 不冻结(Unfrozen)
301
-
302
- > 设计趋势变化快,形态多变,AI 需在受控范围操作
303
-
304
- **Repeat**
305
- ```ts
306
- interface RepeatProps<T> {
307
- items: T[]
308
- columns?: number | Responsive<number>
309
- render: (item: T) => AstroNode
310
- }
311
- ```
312
- - 工具组件,render 函数形态不稳定
313
- - 用于批量生成 Features / Logos / Testimonials
314
-
315
- **Pagination**
316
- ```ts
317
- interface PaginationProps {
318
- current: number
319
- total: number
320
- pageSize?: number
321
- onChange?: (page: number) => void
322
- }
323
- ```
324
- - 交互模式可能变化(无限滚动 vs 分页)
325
-
326
- **Countdown**
327
- ```ts
328
- interface CountdownProps {
329
- endTime: Date | string
330
- format?: "d:h:m:s" | "h:m:s"
331
- onEnd?: () => void
332
- }
333
- ```
334
- - 促销场景,样式/动效多变
335
-
336
- **Animation**(装饰层)
337
- - 直接用 `data-aos-*` 属性
338
- - 详见《原子冻结清单》
339
-
340
- **Carousel / Tabs / Modal**
341
- - 形态多变,易滥用
342
- - 不纳入冻结层
343
-
344
- ---
345
-
346
- ## 四、判断公式
347
-
348
- 新原子是否该加?满足 ≥2 条才值得:
349
-
350
- - 在 3 个以上站点重复出现?
351
- - AI 是否能明确理解它的语义?
352
- - 是否能明显减少模板复杂度?
353
- - 是否对转化 / SEO 有直接价值?