@snowui-design-system/components 0.2.0-alpha.6 → 0.2.0-alpha.8
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 +27 -22
- package/package.json +12 -8
- package/src/assets/gradient-avatar/blue.svg +1 -0
- package/src/assets/gradient-avatar/cyan.svg +1 -0
- package/src/assets/gradient-avatar/green.svg +1 -0
- package/src/assets/gradient-avatar/orange.svg +1 -0
- package/src/assets/gradient-avatar/purple.svg +1 -0
- package/src/assets/gradient-avatar/red.svg +1 -0
- package/src/components/Accordion.md +1 -1
- package/src/components/Accordion.svelte +5 -1
- package/src/components/Avatar.md +95 -58
- package/src/components/Avatar.svelte +286 -92
- package/src/components/Avatar.test.ts +24 -3
- package/src/components/Badge.md +31 -2
- package/src/components/Badge.svelte +38 -3
- package/src/components/Badge.test.ts +14 -1
- package/src/components/Button.svelte +7 -1
- package/src/components/CodeBlock.md +8 -7
- package/src/components/CodeBlock.svelte +59 -25
- package/src/components/CodeBlock.test.ts +24 -2
- package/src/components/Dialog.svelte +1 -0
- package/src/components/Gradient.md +278 -0
- package/src/components/Gradient.svelte +1283 -0
- package/src/components/Gradient.test.ts +77 -0
- package/src/components/Icon.svelte +3 -1
- package/src/components/Image.svelte +11 -8
- package/src/components/Indicator.md +18 -4
- package/src/components/Indicator.svelte +151 -11
- package/src/components/Indicator.test.ts +25 -0
- package/src/components/Listbox.md +5 -0
- package/src/components/Listbox.svelte +26 -0
- package/src/components/Listbox.test.ts +14 -0
- package/src/components/MenuItem.md +5 -0
- package/src/components/MenuItem.svelte +6 -0
- package/src/components/Popover.md +5 -0
- package/src/components/Popover.svelte +25 -0
- package/src/components/Popover.test.ts +14 -0
- package/src/components/ScrollArea.md +7 -3
- package/src/components/ScrollArea.test.ts +3 -2
- package/src/components/SelectButton.svelte +8 -2
- package/src/components/Skeleton.md +13 -1
- package/src/components/Skeleton.svelte +30 -2
- package/src/components/Slider.md +68 -6
- package/src/components/Slider.svelte +329 -21
- package/src/components/Slider.test.ts +65 -0
- package/src/components/SnowUILogo.md +210 -0
- package/src/components/SnowUILogo.svelte +478 -0
- package/src/components/SnowUILogo.test.ts +62 -0
- package/src/components/Table.md +21 -5
- package/src/components/Table.svelte +18 -0
- package/src/components/TableBody.md +12 -1
- package/src/components/TableBody.svelte +26 -2
- package/src/components/TableBody.test.ts +3 -0
- package/src/components/TableCell.md +9 -3
- package/src/components/TableCell.svelte +108 -74
- package/src/components/TableCell.test.ts +2 -2
- package/src/components/TableHead.md +9 -3
- package/src/components/TableHead.svelte +36 -39
- package/src/components/TableHead.test.ts +5 -5
- package/src/components/TableRow.md +15 -5
- package/src/components/TableRow.svelte +47 -10
- package/src/components/TableRow.test.ts +2 -2
- package/src/components/TableToolbar.svelte +8 -3
- package/src/components/Text.md +7 -1
- package/src/components/Text.svelte +15 -7
- package/src/components/Tooltip.md +13 -4
- package/src/components/Tooltip.svelte +45 -7
- package/src/components/Tooltip.test.ts +27 -3
- package/src/index.ts +7 -0
- package/src/lib/color.md +2 -2
- package/src/lib/edge-fade.md +1 -0
- package/src/lib/overlay-scrollbar.md +6 -1
- package/src/lib/table-context.svelte.ts +11 -0
- package/src/lib/table-role-blur.ts +46 -0
- package/src/lib/table-truncation.md +14 -0
- package/src/lib/table-truncation.ts +83 -0
- package/src/lib/tooltip-motion-dismiss.md +18 -0
- package/src/lib/tooltip-motion-dismiss.ts +148 -0
- package/src/lib/tooltip-overlay.ts +9 -0
- package/src/logic/README.md +4 -1
- package/src/logic/continuous-hover.svelte.md +22 -0
- package/src/logic/continuous-hover.svelte.ts +436 -0
- package/src/logic/frame-truncation.md +9 -3
- package/src/logic/frame-truncation.svelte.ts +6 -0
- package/src/logic/layout-flip.ts +182 -5
- package/src/motion/presets/README.md +1 -0
- package/src/motion/presets/continuous-hover.md +11 -0
- package/src/motion/presets/continuous-hover.ts +18 -0
- package/src/motion/tokens.md +3 -1
- package/src/motion/tokens.ts +2 -0
- package/src/styles/README.md +16 -2
- package/src/styles/components.css +911 -0
- package/src/styles/index.css +3 -1
- package/src/styles/layout.css +44 -0
- package/src/styles/scrollbar.css +27 -7
- package/src/styles/themes.css +146 -0
package/src/logic/layout-flip.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* layout-flip.ts
|
|
3
|
-
* v1.
|
|
3
|
+
* v1.1.0
|
|
4
4
|
* 模块级 FLIP 布局转场工具。
|
|
5
5
|
* 独立于 Motion 编排上下文,无需 initMotion() 即可使用。
|
|
6
6
|
* Frame controller 通过此模块暴露 captureFlip / playFlipTo 能力,
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
export interface FlipTransitionOptions {
|
|
11
11
|
duration?: number;
|
|
12
12
|
easing?: string;
|
|
13
|
+
/**
|
|
14
|
+
* transform:默认高性能 FLIP,使用 translate + scale。
|
|
15
|
+
* layout:实际过渡位置与尺寸,内容不会随容器缩放,适合文字排版需要保持字号的场景。
|
|
16
|
+
*/
|
|
17
|
+
strategy?: "transform" | "layout";
|
|
13
18
|
onComplete?: () => void;
|
|
14
19
|
}
|
|
15
20
|
|
|
@@ -19,6 +24,163 @@ const FLIP_EASING = "ease-out";
|
|
|
19
24
|
/** 模块级 DOMRect 注册表,键为 layoutId,无需 initMotion 上下文。 */
|
|
20
25
|
const flipRegistry = new Map<string, DOMRect>();
|
|
21
26
|
|
|
27
|
+
const LAYOUT_STYLE_PROPERTIES = [
|
|
28
|
+
"inset",
|
|
29
|
+
"top",
|
|
30
|
+
"right",
|
|
31
|
+
"bottom",
|
|
32
|
+
"left",
|
|
33
|
+
"width",
|
|
34
|
+
"height",
|
|
35
|
+
"transition",
|
|
36
|
+
"transform",
|
|
37
|
+
"transform-origin",
|
|
38
|
+
"will-change",
|
|
39
|
+
] as const;
|
|
40
|
+
|
|
41
|
+
type InlineStyleSnapshot = Map<
|
|
42
|
+
(typeof LAYOUT_STYLE_PROPERTIES)[number],
|
|
43
|
+
{ value: string; priority: string }
|
|
44
|
+
>;
|
|
45
|
+
|
|
46
|
+
function captureInlineStyles(element: HTMLElement): InlineStyleSnapshot {
|
|
47
|
+
return new Map(
|
|
48
|
+
LAYOUT_STYLE_PROPERTIES.map((property) => [
|
|
49
|
+
property,
|
|
50
|
+
{
|
|
51
|
+
value: element.style.getPropertyValue(property),
|
|
52
|
+
priority: element.style.getPropertyPriority(property),
|
|
53
|
+
},
|
|
54
|
+
]),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function restoreInlineStyles(
|
|
59
|
+
element: HTMLElement,
|
|
60
|
+
snapshot: InlineStyleSnapshot,
|
|
61
|
+
) {
|
|
62
|
+
for (const [property, { value, priority }] of snapshot) {
|
|
63
|
+
if (value) {
|
|
64
|
+
element.style.setProperty(property, value, priority);
|
|
65
|
+
} else {
|
|
66
|
+
element.style.removeProperty(property);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function setLayoutRect(element: HTMLElement, rect: DOMRect) {
|
|
72
|
+
element.style.setProperty("inset", "auto");
|
|
73
|
+
element.style.setProperty("top", `${rect.top}px`);
|
|
74
|
+
element.style.setProperty("left", `${rect.left}px`);
|
|
75
|
+
element.style.setProperty("right", "auto");
|
|
76
|
+
element.style.setProperty("bottom", "auto");
|
|
77
|
+
element.style.setProperty("width", `${rect.width}px`);
|
|
78
|
+
element.style.setProperty("height", `${rect.height}px`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function layoutTransitionValue(duration: number, easing: string) {
|
|
82
|
+
return [
|
|
83
|
+
`top ${duration}ms ${easing}`,
|
|
84
|
+
`left ${duration}ms ${easing}`,
|
|
85
|
+
`width ${duration}ms ${easing}`,
|
|
86
|
+
`height ${duration}ms ${easing}`,
|
|
87
|
+
].join(", ");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function waitForTransition(
|
|
91
|
+
element: HTMLElement,
|
|
92
|
+
duration: number,
|
|
93
|
+
properties: ReadonlySet<string>,
|
|
94
|
+
onComplete: () => void,
|
|
95
|
+
) {
|
|
96
|
+
let done = false;
|
|
97
|
+
const finish = () => {
|
|
98
|
+
if (done) return;
|
|
99
|
+
done = true;
|
|
100
|
+
element.removeEventListener("transitionend", onEnd);
|
|
101
|
+
clearTimeout(fallback);
|
|
102
|
+
onComplete();
|
|
103
|
+
};
|
|
104
|
+
const onEnd = (event: TransitionEvent) => {
|
|
105
|
+
if (event.target === element && properties.has(event.propertyName)) {
|
|
106
|
+
finish();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const fallback = setTimeout(finish, Math.max(0, duration) + 50);
|
|
110
|
+
element.addEventListener("transitionend", onEnd);
|
|
111
|
+
return finish;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function beginLayoutEnter(
|
|
115
|
+
element: HTMLElement,
|
|
116
|
+
fromRect: DOMRect,
|
|
117
|
+
toRect: DOMRect,
|
|
118
|
+
options?: FlipTransitionOptions,
|
|
119
|
+
) {
|
|
120
|
+
const duration = options?.duration ?? FLIP_DURATION;
|
|
121
|
+
const easing = options?.easing ?? FLIP_EASING;
|
|
122
|
+
const previousStyles = captureInlineStyles(element);
|
|
123
|
+
|
|
124
|
+
element.style.setProperty("transition", "none");
|
|
125
|
+
element.style.setProperty("transform", "none");
|
|
126
|
+
element.style.setProperty("will-change", "top, left, width, height");
|
|
127
|
+
setLayoutRect(element, fromRect);
|
|
128
|
+
|
|
129
|
+
requestAnimationFrame(() => {
|
|
130
|
+
requestAnimationFrame(() => {
|
|
131
|
+
const finish = waitForTransition(
|
|
132
|
+
element,
|
|
133
|
+
duration,
|
|
134
|
+
new Set(["top", "left", "width", "height"]),
|
|
135
|
+
() => {
|
|
136
|
+
restoreInlineStyles(element, previousStyles);
|
|
137
|
+
options?.onComplete?.();
|
|
138
|
+
},
|
|
139
|
+
);
|
|
140
|
+
element.style.setProperty(
|
|
141
|
+
"transition",
|
|
142
|
+
layoutTransitionValue(duration, easing),
|
|
143
|
+
);
|
|
144
|
+
setLayoutRect(element, toRect);
|
|
145
|
+
if (duration <= 0) finish();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function applyLayoutExit(
|
|
151
|
+
element: HTMLElement,
|
|
152
|
+
fromRect: DOMRect,
|
|
153
|
+
toRect: DOMRect,
|
|
154
|
+
options?: FlipTransitionOptions,
|
|
155
|
+
) {
|
|
156
|
+
const duration = options?.duration ?? FLIP_DURATION;
|
|
157
|
+
const easing = options?.easing ?? FLIP_EASING;
|
|
158
|
+
const previousStyles = captureInlineStyles(element);
|
|
159
|
+
|
|
160
|
+
element.style.setProperty("transition", "none");
|
|
161
|
+
element.style.setProperty("transform", "none");
|
|
162
|
+
element.style.setProperty("will-change", "top, left, width, height");
|
|
163
|
+
setLayoutRect(element, fromRect);
|
|
164
|
+
// 固化退出起点,避免同一任务内写入终点时浏览器合并两次布局。
|
|
165
|
+
element.getBoundingClientRect();
|
|
166
|
+
|
|
167
|
+
const finish = waitForTransition(
|
|
168
|
+
element,
|
|
169
|
+
duration,
|
|
170
|
+
new Set(["top", "left", "width", "height"]),
|
|
171
|
+
() => {
|
|
172
|
+
restoreInlineStyles(element, previousStyles);
|
|
173
|
+
options?.onComplete?.();
|
|
174
|
+
},
|
|
175
|
+
);
|
|
176
|
+
element.style.setProperty(
|
|
177
|
+
"transition",
|
|
178
|
+
layoutTransitionValue(duration, easing),
|
|
179
|
+
);
|
|
180
|
+
setLayoutRect(element, toRect);
|
|
181
|
+
if (duration <= 0) finish();
|
|
182
|
+
}
|
|
183
|
+
|
|
22
184
|
/**
|
|
23
185
|
* 捕获元素当前位置并写入注册表,供后续 beginFlipEnter 读取起点。
|
|
24
186
|
*/
|
|
@@ -35,7 +197,11 @@ export function captureFlipRect(id: string, element: HTMLElement): void {
|
|
|
35
197
|
* 注册表条目消费后自动删除,重复调用安全。
|
|
36
198
|
* 返回 true 表示找到起点并启动了动效。
|
|
37
199
|
*/
|
|
38
|
-
export function beginFlipEnter(
|
|
200
|
+
export function beginFlipEnter(
|
|
201
|
+
id: string,
|
|
202
|
+
element: HTMLElement,
|
|
203
|
+
options?: FlipTransitionOptions,
|
|
204
|
+
): boolean {
|
|
39
205
|
const fromRect = flipRegistry.get(id);
|
|
40
206
|
if (!fromRect) return false;
|
|
41
207
|
flipRegistry.delete(id);
|
|
@@ -45,6 +211,10 @@ export function beginFlipEnter(id: string, element: HTMLElement, options?: FlipT
|
|
|
45
211
|
|
|
46
212
|
const duration = options?.duration ?? FLIP_DURATION;
|
|
47
213
|
const easing = options?.easing ?? FLIP_EASING;
|
|
214
|
+
if (options?.strategy === "layout") {
|
|
215
|
+
beginLayoutEnter(element, fromRect, toRect, options);
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
48
218
|
const dx = fromRect.left - toRect.left;
|
|
49
219
|
const dy = fromRect.top - toRect.top;
|
|
50
220
|
const scaleX = fromRect.width / toRect.width;
|
|
@@ -76,7 +246,8 @@ export function applyFlipExit(
|
|
|
76
246
|
options?: FlipTransitionOptions,
|
|
77
247
|
): void {
|
|
78
248
|
const fromRect = element.getBoundingClientRect();
|
|
79
|
-
const toRect =
|
|
249
|
+
const toRect =
|
|
250
|
+
target instanceof HTMLElement ? target.getBoundingClientRect() : target;
|
|
80
251
|
if (fromRect.width <= 0 || toRect.width <= 0) {
|
|
81
252
|
options?.onComplete?.();
|
|
82
253
|
return;
|
|
@@ -84,6 +255,10 @@ export function applyFlipExit(
|
|
|
84
255
|
|
|
85
256
|
const duration = options?.duration ?? FLIP_DURATION;
|
|
86
257
|
const easing = options?.easing ?? FLIP_EASING;
|
|
258
|
+
if (options?.strategy === "layout") {
|
|
259
|
+
applyLayoutExit(element, fromRect, toRect, options);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
87
262
|
const dx = toRect.left - fromRect.left;
|
|
88
263
|
const dy = toRect.top - fromRect.top;
|
|
89
264
|
const scaleX = toRect.width / fromRect.width;
|
|
@@ -96,8 +271,10 @@ export function applyFlipExit(
|
|
|
96
271
|
element.removeEventListener("transitionend", onEnd);
|
|
97
272
|
options?.onComplete?.();
|
|
98
273
|
};
|
|
99
|
-
const onEnd = (
|
|
100
|
-
if (
|
|
274
|
+
const onEnd = (event: TransitionEvent) => {
|
|
275
|
+
if (event.target === element && event.propertyName === "transform") {
|
|
276
|
+
finish();
|
|
277
|
+
}
|
|
101
278
|
};
|
|
102
279
|
|
|
103
280
|
element.style.transformOrigin = "top left";
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
| `REPLACEMENT_APPEAR_MOTION` | Icon / Text / CodeBlock 等内容替换 | Overlay、Dialog | SnowUI replacement default |
|
|
17
17
|
| `RESIZE_MOTION` | Accordion、Card、Panel 及后续组件的宽高、padding 等尺寸变化 | 生命周期进入、内容替换 | transitions.dev Card resize |
|
|
18
18
|
| `TAB_INDICATOR_MOTION` | Tab、Segmented 共享 indicator 的位置与尺寸变化 | 普通容器 resize、生命周期进入 | transitions.dev Tabs sliding |
|
|
19
|
+
| `CONTINUOUS_HOVER_MOTION` | Sidebar、Listbox、Popover、TableBody、Accordion、Tab / Segmented 的共享 hover 背景移动 | 单项独立 hover、生命周期进入 | Fluid Functionalism proximity hover |
|
|
19
20
|
| `HOVER_SCALE_UP_MOTION` | hover 轻微放大 | 生命周期出现、Modal | transitions.dev Avatar group hover-in |
|
|
20
21
|
| `HOVER_LIFT_MOTION` | hover 上浮并轻微放大 | 普通内容进入 | transitions.dev Avatar group hover |
|
|
21
22
|
| `NUMBER_POP_APPEAR_MOTION` | 数字或短计数值弹入 | 长文本、页面切换 | transitions.dev Number pop-in |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Continuous Hover Motion
|
|
2
|
+
|
|
3
|
+
`CONTINUOUS_HOVER_MOTION` 是连续 hover 背景在项目间移动和改变尺寸时使用的语义预设。
|
|
4
|
+
|
|
5
|
+
- 移动 / 尺寸 duration:60ms
|
|
6
|
+
- 首次显隐响应 duration:0ms
|
|
7
|
+
- easing:standard `cubic-bezier(0.22, 1, 0.36, 1)`
|
|
8
|
+
- 首次进入只淡入,不从上次离开的位置飞入
|
|
9
|
+
- `prefers-reduced-motion: reduce` 下关闭过渡
|
|
10
|
+
- pointermove 每帧只消费最后一次鼠标位置,且优先于同帧的滚动 / 尺寸刷新。
|
|
11
|
+
- 直接命中项只测量当前项的当帧真实位置;只有经过间隙时才刷新并扫描集合几何。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { MotionConfig } from "../../logic/motion-config";
|
|
2
|
+
import {
|
|
3
|
+
MOTION_DURATION_CONTINUOUS_HOVER_MS,
|
|
4
|
+
MOTION_DURATION_CONTINUOUS_HOVER_RESPONSE_MS,
|
|
5
|
+
MOTION_EASING_STANDARD,
|
|
6
|
+
} from "../tokens";
|
|
7
|
+
import { motionMsVar } from "./utils";
|
|
8
|
+
|
|
9
|
+
export const CONTINUOUS_HOVER_MOTION: MotionConfig = {
|
|
10
|
+
duration: MOTION_DURATION_CONTINUOUS_HOVER_MS,
|
|
11
|
+
easing: MOTION_EASING_STANDARD,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const CONTINUOUS_HOVER_MOTION_STYLE = [
|
|
15
|
+
`--snowui-continuous-hover-motion-duration: ${motionMsVar(CONTINUOUS_HOVER_MOTION.duration, MOTION_DURATION_CONTINUOUS_HOVER_MS)}`,
|
|
16
|
+
`--snowui-continuous-hover-motion-easing: ${CONTINUOUS_HOVER_MOTION.easing ?? MOTION_EASING_STANDARD}`,
|
|
17
|
+
`--snowui-continuous-hover-response-duration: ${MOTION_DURATION_CONTINUOUS_HOVER_RESPONSE_MS}ms`,
|
|
18
|
+
].join("; ");
|
package/src/motion/tokens.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# motion/tokens.ts 文档
|
|
2
2
|
|
|
3
|
-
> **版本**: v1.
|
|
3
|
+
> **版本**: v1.7.0
|
|
4
4
|
> **职责**: 保存 SnowUI 已转正动效 preset 共用的基础数值 token。
|
|
5
5
|
|
|
6
6
|
`tokens.ts` 是 motion 数值的最低层单一来源。组件不直接复制这些值;组件应优先引用 `motion/presets/` 中的语义 preset。
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
| `MOTION_DURATION_STANDARD_*` | dropdown overlay、generic fallback、dialog 等标准进入 / 退出节奏 |
|
|
22
22
|
| `MOTION_DURATION_RESIZE_MS` | Card、Accordion、Panel 等明确尺寸变化节奏 |
|
|
23
23
|
| `MOTION_DURATION_TAB_INDICATOR_MS` | Tab / Segmented indicator 位置与尺寸同步变化 |
|
|
24
|
+
| `MOTION_DURATION_CONTINUOUS_HOVER_MS` / `MOTION_DURATION_CONTINUOUS_HOVER_RESPONSE_MS` | 连续悬停背景移动 / 变形 60ms,首次显隐响应 0ms |
|
|
24
25
|
| `MOTION_DURATION_*` / `MOTION_STAGGER_*` | 通用效果优先引用 250ms 基准;Badge、Tooltip、shake 等专项效果保留精确时长与 stagger |
|
|
25
26
|
| `MOTION_EASING_*` | standard、in-out、linear 以及 Badge / Number / Check 各自精确 bounce 曲线 |
|
|
26
27
|
| `MOTION_SPRING_MOVE_*` | Frame 默认位移临界阻尼 spring:stiffness 300 / damping 34.6410161514 / mass 1;不会越过目标产生回弹 |
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
|
|
37
38
|
## 变更记录
|
|
38
39
|
|
|
40
|
+
- v1.7.0 (2026-07-30): 新增连续悬停背景专项移动与响应时长 token,避免沿用偏慢的 250ms 基础节奏。
|
|
39
41
|
- v1.6.0 (2026-07-12): 默认位移 damping 从 Rare UI 基线 30 调为临界阻尼 `2 * sqrt(300 * 1) = 34.6410161514`,保留 spring 加减速并去除回弹;基线参数 300 / 30 / 1 保留于本记录供恢复。
|
|
40
42
|
- v1.5.0 (2026-07-12): 默认位移改为 Rare UI Sidebar 同参数 spring,新增 move duration 与 stiffness / damping / mass token。
|
|
41
43
|
- v1.4.0 (2026-07-12): 曾新增默认位移 cubic-bezier;v1.5.0 起由真实 spring 取代。
|
package/src/motion/tokens.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const MOTION_DURATION_STANDARD_APPEAR_MS = MOTION_DURATION_BASE_MS;
|
|
|
22
22
|
export const MOTION_DURATION_STANDARD_DISAPPEAR_MS = 150;
|
|
23
23
|
export const MOTION_DURATION_RESIZE_MS = MOTION_DURATION_BASE_MS;
|
|
24
24
|
export const MOTION_DURATION_TAB_INDICATOR_MS = MOTION_DURATION_BASE_MS;
|
|
25
|
+
export const MOTION_DURATION_CONTINUOUS_HOVER_MS = 60;
|
|
26
|
+
export const MOTION_DURATION_CONTINUOUS_HOVER_RESPONSE_MS = 0;
|
|
25
27
|
export const MOTION_DURATION_AVATAR_HOVER_MS = MOTION_DURATION_BASE_MS;
|
|
26
28
|
export const MOTION_DURATION_PANEL_APPEAR_MS = MOTION_DURATION_BASE_MS;
|
|
27
29
|
export const MOTION_DURATION_PANEL_DISAPPEAR_MS = MOTION_DURATION_BASE_MS;
|
package/src/styles/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# 通用样式目录 (Styles Directory)
|
|
2
2
|
|
|
3
|
-
> **版本**: v1.
|
|
3
|
+
> **版本**: v1.6.0
|
|
4
4
|
> **路径**: `./.`
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
本目录是 Components 包唯一的样式来源。组件构建、GitHub 仓库和 npm 包不得读取仓库外的 `styles/`。
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
| 文件 | 用途 |
|
|
13
13
|
| :--- | :--- |
|
|
14
14
|
| [layout.css](./layout.css) | 布局工具类 (morph-container, direction) |
|
|
15
|
+
| [themes.css](./themes.css) | Components 包内主题变量;只允许项目所有者与 `styles/snowui-themes.css` 手工同步 |
|
|
16
|
+
| [components.css](./components.css) | 组件公开 override 变量入口 |
|
|
15
17
|
| [tokens.css](./tokens.css) | 核心 Token(`--text-*` / `--leading-*` + 几何基准变量) |
|
|
16
18
|
| [scale.css](./scale.css) | 统一尺寸比例计算(height/width/mixed/aspect) |
|
|
17
19
|
| [scale.md](./scale.md) | `scale.css` 规则与覆盖优先级文档 |
|
|
@@ -49,10 +51,22 @@ Demo 内引入(唯一允许入口):
|
|
|
49
51
|
</style>
|
|
50
52
|
```
|
|
51
53
|
|
|
54
|
+
包消费方可显式引入:
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
@import "@snowui-design-system/components/styles";
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`themes.css` 与 `styles/snowui-themes.css` 必须逐字一致。AI 与脚本只能校验,禁止自动复制或覆盖。
|
|
61
|
+
|
|
52
62
|
---
|
|
53
63
|
|
|
54
64
|
## 更新日志 (Changelog)
|
|
55
65
|
|
|
66
|
+
### v1.6.0 (2026-07-13)
|
|
67
|
+
|
|
68
|
+
- 新增包内 `themes.css` 与 `components.css`,彻底移除 Components 对外部 `styles/` 的运行时、构建和发布依赖。
|
|
69
|
+
|
|
56
70
|
### v1.5.1 (2026-02-17)
|
|
57
71
|
|
|
58
72
|
#### 文档
|