@snowui-design-system/components 0.1.0 → 0.2.0-alpha.4

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 (319) hide show
  1. package/README.md +1 -2
  2. package/package.json +9 -3
  3. package/src/components/Accordion.md +218 -0
  4. package/src/components/Accordion.svelte +301 -0
  5. package/src/components/Accordion.test.ts +126 -0
  6. package/src/components/AccordionItem.md +114 -0
  7. package/src/components/AccordionItem.svelte +389 -0
  8. package/src/components/AccordionItem.test.ts +52 -0
  9. package/src/components/Avatar.md +54 -36
  10. package/src/components/Avatar.svelte +73 -126
  11. package/src/components/AvatarGroup.md +17 -14
  12. package/src/components/AvatarGroup.svelte +12 -50
  13. package/src/components/AvatarGroup.test.ts +69 -68
  14. package/src/components/Badge.md +53 -8
  15. package/src/components/Badge.svelte +303 -79
  16. package/src/components/Badge.test.ts +47 -0
  17. package/src/components/Breadcrumb.md +164 -0
  18. package/src/components/Breadcrumb.svelte +330 -0
  19. package/src/components/Breadcrumb.test.ts +154 -0
  20. package/src/components/Button.md +243 -57
  21. package/src/components/Button.svelte +278 -177
  22. package/src/components/Button.test.ts +175 -86
  23. package/src/components/ButtonGroup.md +140 -0
  24. package/src/components/ButtonGroup.svelte +491 -0
  25. package/src/components/ButtonGroup.test.ts +58 -0
  26. package/src/components/Card.md +186 -0
  27. package/src/components/Card.svelte +408 -0
  28. package/src/components/Card.test.ts +193 -0
  29. package/src/components/Checkbox.md +14 -10
  30. package/src/components/Checkbox.svelte +39 -99
  31. package/src/components/Chip.md +185 -0
  32. package/src/components/Chip.svelte +241 -0
  33. package/src/components/Chip.test.ts +117 -0
  34. package/src/components/CodeBlock.md +29 -16
  35. package/src/components/CodeBlock.svelte +132 -352
  36. package/src/components/CodeBlock.test.ts +15 -1
  37. package/src/components/CopyButton.md +41 -0
  38. package/src/components/CopyButton.svelte +164 -0
  39. package/src/components/CopyButton.test.ts +26 -0
  40. package/src/components/Dialog.md +95 -0
  41. package/src/components/Dialog.svelte +416 -0
  42. package/src/components/Dialog.test.ts +145 -0
  43. package/src/components/ExpandButton.md +41 -0
  44. package/src/components/ExpandButton.svelte +103 -0
  45. package/src/components/ExpandButton.test.ts +18 -0
  46. package/src/components/Form.md +4 -3
  47. package/src/components/Form.test.ts +72 -73
  48. package/src/components/Frame.md +243 -0
  49. package/src/components/Frame.svelte +208 -87
  50. package/src/components/Frame.test.ts +121 -0
  51. package/src/components/Icon.md +34 -6
  52. package/src/components/Icon.svelte +46 -95
  53. package/src/components/Image.md +24 -13
  54. package/src/components/Image.svelte +42 -128
  55. package/src/components/ImageGroup.md +6 -7
  56. package/src/components/ImageGroup.svelte +1 -28
  57. package/src/components/Indicator.md +92 -0
  58. package/src/components/Indicator.svelte +490 -0
  59. package/src/components/Indicator.test.ts +57 -0
  60. package/src/components/Input.md +81 -28
  61. package/src/components/Input.svelte +291 -178
  62. package/src/components/Input.test.ts +85 -48
  63. package/src/components/Kbd.md +0 -3
  64. package/src/components/Kbd.svelte +0 -1
  65. package/src/components/Link.md +192 -0
  66. package/src/components/Link.svelte +464 -0
  67. package/src/components/Link.test.ts +110 -0
  68. package/src/components/Listbox.md +52 -10
  69. package/src/components/Listbox.svelte +204 -50
  70. package/src/components/Listbox.test.ts +76 -33
  71. package/src/components/LocaleProvider.md +52 -0
  72. package/src/components/LocaleProvider.svelte +30 -0
  73. package/src/components/LocaleProvider.test.ts +32 -0
  74. package/src/components/MenuItem.md +23 -9
  75. package/src/components/MenuItem.svelte +57 -47
  76. package/src/components/MenuItem.test.ts +72 -65
  77. package/src/components/Pagination.md +504 -0
  78. package/src/components/Pagination.svelte +958 -0
  79. package/src/components/Pagination.test.ts +316 -0
  80. package/src/components/Popover.md +245 -42
  81. package/src/components/Popover.svelte +558 -127
  82. package/src/components/Popover.test.ts +361 -44
  83. package/src/components/Progress.md +91 -0
  84. package/src/components/Progress.svelte +374 -0
  85. package/src/components/Progress.test.ts +56 -0
  86. package/src/components/Radio.md +4 -6
  87. package/src/components/Radio.svelte +25 -117
  88. package/src/components/ScrollArea.md +116 -0
  89. package/src/components/ScrollArea.svelte +180 -0
  90. package/src/components/ScrollArea.test.ts +84 -0
  91. package/src/components/SearchInput.md +135 -0
  92. package/src/components/SearchInput.svelte +153 -0
  93. package/src/components/SearchInput.test.ts +61 -0
  94. package/src/components/Select.md +39 -8
  95. package/src/components/Select.svelte +196 -45
  96. package/src/components/Select.test.ts +79 -41
  97. package/src/components/SelectButton.md +50 -0
  98. package/src/components/SelectButton.svelte +186 -0
  99. package/src/components/SelectButton.test.ts +142 -0
  100. package/src/components/Separator.md +89 -0
  101. package/src/components/Separator.svelte +143 -0
  102. package/src/components/Separator.test.ts +35 -0
  103. package/src/components/Skeleton.md +2 -5
  104. package/src/components/Skeleton.svelte +202 -7
  105. package/src/components/Skeleton.test.ts +10 -10
  106. package/src/components/Slider.md +101 -0
  107. package/src/components/Slider.svelte +566 -0
  108. package/src/components/Slider.test.ts +51 -0
  109. package/src/components/Spinner.md +3 -4
  110. package/src/components/Spinner.svelte +11 -23
  111. package/src/components/{Toggle.md → Switch.md} +20 -21
  112. package/src/components/Switch.svelte +314 -0
  113. package/src/components/Switch.test.ts +57 -0
  114. package/src/components/Table.md +249 -0
  115. package/src/components/Table.svelte +139 -0
  116. package/src/components/Table.test.ts +64 -0
  117. package/src/components/TableBody.md +63 -0
  118. package/src/components/TableBody.svelte +78 -0
  119. package/src/components/TableBody.test.ts +13 -0
  120. package/src/components/TableCell.md +89 -0
  121. package/src/components/TableCell.svelte +368 -0
  122. package/src/components/TableCell.test.ts +51 -0
  123. package/src/components/TableHead.md +129 -0
  124. package/src/components/TableHead.svelte +281 -0
  125. package/src/components/TableHead.test.ts +44 -0
  126. package/src/components/TableHeader.md +26 -0
  127. package/src/components/TableHeader.svelte +10 -0
  128. package/src/components/TableHeader.test.ts +3 -0
  129. package/src/components/TableRow.md +36 -0
  130. package/src/components/TableRow.svelte +64 -0
  131. package/src/components/TableRow.test.ts +2 -0
  132. package/src/components/TableToolbar.svelte +260 -0
  133. package/src/components/Tag.md +270 -0
  134. package/src/components/Tag.svelte +462 -0
  135. package/src/components/Tag.test.ts +91 -0
  136. package/src/components/Text.md +87 -25
  137. package/src/components/Text.svelte +467 -93
  138. package/src/components/Text.test.ts +21 -36
  139. package/src/components/Textarea.md +22 -7
  140. package/src/components/Textarea.svelte +76 -155
  141. package/src/components/Textarea.test.ts +12 -5
  142. package/src/components/Tooltip.md +101 -12
  143. package/src/components/Tooltip.svelte +581 -108
  144. package/src/components/Tooltip.test.ts +63 -1
  145. package/src/context.ts +93 -5
  146. package/src/dev.ts +6 -10
  147. package/src/i18n/locale.svelte.ts +60 -0
  148. package/src/i18n/messages.ts +45 -0
  149. package/src/index.ts +177 -2
  150. package/src/keys.ts +7 -0
  151. package/src/lib/clipboard.ts +10 -0
  152. package/src/lib/color.md +36 -0
  153. package/src/lib/color.ts +57 -0
  154. package/src/lib/date-format.md +37 -0
  155. package/src/lib/date-format.ts +130 -0
  156. package/src/lib/edge-fade.md +101 -0
  157. package/src/lib/edge-fade.ts +55 -0
  158. package/src/lib/floating-position.md +20 -0
  159. package/src/lib/floating-position.ts +107 -0
  160. package/src/lib/number-format.md +40 -0
  161. package/src/lib/number-format.ts +132 -0
  162. package/src/lib/overlay-scrollbar.md +36 -0
  163. package/src/lib/overlay-scrollbar.svelte.ts +221 -0
  164. package/src/lib/overlay-trigger-timing.md +15 -0
  165. package/src/lib/overlay-trigger-timing.ts +8 -0
  166. package/src/lib/progressive-blur.md +95 -0
  167. package/src/lib/progressive-blur.ts +266 -0
  168. package/src/lib/resizable.md +41 -0
  169. package/src/lib/resizable.ts +211 -0
  170. package/src/lib/table-context.svelte.ts +129 -0
  171. package/src/lib/table-row-context.svelte.ts +16 -0
  172. package/src/lib/tooltip-behavior.ts +39 -0
  173. package/src/lib/tooltip-delay.md +33 -0
  174. package/src/lib/tooltip-delay.ts +49 -0
  175. package/src/lib/tooltip-overlay.md +30 -0
  176. package/src/lib/tooltip-overlay.ts +64 -0
  177. package/src/lib/truncate.md +7 -2
  178. package/src/lib/truncate.ts +105 -10
  179. package/src/logic/README.md +17 -7
  180. package/src/logic/component-parts.md +32 -0
  181. package/src/logic/component-parts.svelte.ts +130 -0
  182. package/src/logic/dialog.md +30 -0
  183. package/src/logic/dialog.svelte.ts +88 -0
  184. package/src/logic/frame-actions.md +28 -0
  185. package/src/logic/frame-actions.svelte.ts +49 -0
  186. package/src/logic/frame-class-state.md +21 -0
  187. package/src/logic/frame-class-state.svelte.ts +163 -0
  188. package/src/logic/frame-dom-runtime.svelte.ts +51 -0
  189. package/src/logic/frame-inline-style.md +56 -0
  190. package/src/logic/frame-inline-style.svelte.ts +623 -0
  191. package/src/logic/frame-motion-defaults.md +90 -9
  192. package/src/logic/frame-motion-defaults.ts +55 -49
  193. package/src/logic/frame-motion.svelte.ts +173 -0
  194. package/src/logic/frame-perception.md +83 -0
  195. package/src/logic/frame-perception.svelte.ts +273 -0
  196. package/src/logic/frame-prop-filter.ts +7 -1
  197. package/src/logic/frame-scale-observer.md +153 -0
  198. package/src/logic/frame-scale-observer.svelte.ts +98 -0
  199. package/src/logic/frame-scale-resolver.md +25 -0
  200. package/src/logic/frame-scale-resolver.svelte.ts +56 -0
  201. package/src/logic/frame-state-value.md +74 -0
  202. package/src/logic/frame-state-value.ts +30 -0
  203. package/src/logic/frame-state.svelte.ts +426 -0
  204. package/src/logic/frame-truncation.md +17 -3
  205. package/src/logic/frame-truncation.svelte.ts +23 -43
  206. package/src/logic/frame-types.md +2 -1
  207. package/src/logic/frame-types.ts +41 -7
  208. package/src/logic/frame-utils.md +4 -0
  209. package/src/logic/frame-utils.ts +54 -26
  210. package/src/logic/image-preview.md +9 -2
  211. package/src/logic/image-preview.ts +33 -7
  212. package/src/logic/morph.md +19 -0
  213. package/src/logic/morph.ts +7 -0
  214. package/src/logic/motion-config.ts +49 -3
  215. package/src/logic/motion-engine.md +43 -0
  216. package/src/logic/motion-engine.ts +272 -0
  217. package/src/logic/overlay-presence.svelte.ts +71 -0
  218. package/src/logic/popover.md +89 -0
  219. package/src/logic/popover.svelte.ts +236 -0
  220. package/src/logic/resource-size.md +21 -0
  221. package/src/logic/resource-size.ts +53 -0
  222. package/src/logic/text-collapse.md +2 -1
  223. package/src/logic/text-collapse.svelte.ts +1 -1
  224. package/src/logic/wc-adapter.ts +1 -1
  225. package/src/motion/README.md +97 -37
  226. package/src/motion/{defaults/bridge.md → bridge.md} +24 -4
  227. package/src/motion/{defaults/bridge.ts → bridge.ts} +16 -5
  228. package/src/motion/{defaults/content-crossfade.ts → content-crossfade.ts} +1 -1
  229. package/src/motion/{defaults/expand.md → expand.md} +2 -2
  230. package/src/motion/{defaults/expand.ts → expand.ts} +4 -3
  231. package/src/motion/fade-in.md +40 -0
  232. package/src/motion/fade-in.ts +14 -0
  233. package/src/motion/{defaults/fade-out.md → fade-out.md} +2 -2
  234. package/src/motion/fade-out.ts +14 -0
  235. package/src/motion/{defaults/morph.md → morph.md} +1 -1
  236. package/src/motion/{defaults/morph.ts → morph.ts} +3 -3
  237. package/src/motion/move.md +179 -0
  238. package/src/motion/move.ts +74 -0
  239. package/src/motion/number.md +50 -0
  240. package/src/motion/number.ts +30 -0
  241. package/src/motion/presets/README.md +50 -0
  242. package/src/motion/presets/dialog.md +20 -0
  243. package/src/motion/presets/dialog.ts +47 -0
  244. package/src/motion/presets/effects.md +32 -0
  245. package/src/motion/presets/effects.ts +111 -0
  246. package/src/motion/presets/generic.md +27 -0
  247. package/src/motion/presets/generic.ts +32 -0
  248. package/src/motion/presets/overlay.md +21 -0
  249. package/src/motion/presets/overlay.ts +18 -0
  250. package/src/motion/presets/replacement.md +19 -0
  251. package/src/motion/presets/replacement.ts +6 -0
  252. package/src/motion/presets/resize.md +23 -0
  253. package/src/motion/presets/resize.ts +16 -0
  254. package/src/motion/presets/tab.md +21 -0
  255. package/src/motion/presets/tab.ts +19 -0
  256. package/src/motion/presets/tooltip.md +20 -0
  257. package/src/motion/presets/tooltip.ts +37 -0
  258. package/src/motion/presets/utils.md +15 -0
  259. package/src/motion/presets/utils.ts +11 -0
  260. package/src/motion/primitives.md +22 -0
  261. package/src/motion/primitives.ts +46 -0
  262. package/src/motion/{defaults/replace.md → replace.md} +2 -2
  263. package/src/motion/{defaults/replace.ts → replace.ts} +4 -4
  264. package/src/motion/{defaults/rotate.md → rotate.md} +4 -4
  265. package/src/motion/{defaults/rotate.ts → rotate.ts} +4 -3
  266. package/src/motion/scale-in.md +40 -0
  267. package/src/motion/scale-in.ts +19 -0
  268. package/src/motion/spring.md +19 -0
  269. package/src/motion/spring.ts +96 -0
  270. package/src/motion/tokens.md +45 -0
  271. package/src/motion/tokens.ts +80 -0
  272. package/src/motion/{defaults/while-2xl.ts → while-2xl.ts} +1 -1
  273. package/src/motion/{defaults/while-active.ts → while-active.ts} +1 -1
  274. package/src/motion/while-appear.ts +10 -0
  275. package/src/motion/{defaults/while-click.ts → while-click.ts} +1 -1
  276. package/src/motion/{defaults/while-collapsed.ts → while-collapsed.ts} +1 -1
  277. package/src/motion/{defaults/while-disabled.ts → while-disabled.ts} +3 -2
  278. package/src/motion/while-disappear.ts +10 -0
  279. package/src/motion/{defaults/while-drag.ts → while-drag.ts} +1 -1
  280. package/src/motion/{defaults/while-editing.ts → while-editing.ts} +1 -1
  281. package/src/motion/{defaults/while-expanded.ts → while-expanded.ts} +1 -1
  282. package/src/motion/{defaults/while-focus.ts → while-focus.ts} +1 -1
  283. package/src/motion/{defaults/while-hover.ts → while-hover.ts} +1 -1
  284. package/src/motion/{defaults/while-idle.ts → while-idle.ts} +1 -1
  285. package/src/motion/{defaults/while-key.ts → while-key.ts} +1 -1
  286. package/src/motion/{defaults/while-lg.ts → while-lg.ts} +1 -1
  287. package/src/motion/{defaults/while-load.ts → while-load.ts} +3 -2
  288. package/src/motion/{defaults/while-md.ts → while-md.ts} +1 -1
  289. package/src/motion/{defaults/while-reload.ts → while-reload.ts} +1 -1
  290. package/src/motion/{defaults/while-scroll.ts → while-scroll.ts} +1 -1
  291. package/src/motion/{defaults/while-sm.ts → while-sm.ts} +1 -1
  292. package/src/motion/{defaults/while-uploading.ts → while-uploading.ts} +1 -1
  293. package/src/motion/{defaults/while-validating.ts → while-validating.ts} +1 -1
  294. package/src/motion/{defaults/while-xl.ts → while-xl.ts} +1 -1
  295. package/src/motion/{defaults/while-xs.ts → while-xs.ts} +1 -1
  296. package/src/styles/auto-layout.css +92 -10
  297. package/src/styles/layout.css +370 -30
  298. package/src/styles/scrollbar.css +72 -7
  299. package/src/App.svelte +0 -103
  300. package/src/components/QuickAction.md +0 -146
  301. package/src/components/QuickAction.svelte +0 -161
  302. package/src/components/QuickAction.test.ts +0 -299
  303. package/src/components/Test.md +0 -72
  304. package/src/components/Test.svelte +0 -106
  305. package/src/components/Test.test.ts +0 -27
  306. package/src/components/Toggle.svelte +0 -384
  307. package/src/components/Toggle.test.ts +0 -57
  308. package/src/logic/frame-profile.md +0 -156
  309. package/src/logic/frame-profile.ts +0 -130
  310. package/src/motion/NumberFlow.md +0 -16
  311. package/src/motion/defaults/fade-out.ts +0 -14
  312. package/src/motion/defaults/move.md +0 -81
  313. package/src/motion/defaults/move.ts +0 -31
  314. package/src/motion/defaults/number.md +0 -41
  315. package/src/motion/defaults/number.ts +0 -17
  316. package/src/motion/defaults/while-appear.ts +0 -12
  317. package/src/motion/defaults/while-disappear.ts +0 -12
  318. package/src//344/273/243/347/240/201.txt +0 -61
  319. /package/src/motion/{defaults/rotate.css → rotate.css} +0 -0
@@ -0,0 +1,80 @@
1
+ /**
2
+ * tokens.ts
3
+ * v1.3.0
4
+ * Motion 数值 token 单一来源。
5
+ */
6
+
7
+ export const MOTION_EASING_STANDARD = "cubic-bezier(0.22, 1, 0.36, 1)";
8
+ export const MOTION_EASING_IN_OUT = "easeInOut";
9
+ export const MOTION_EASING_OUT = "easeOut";
10
+ export const MOTION_EASING_LINEAR = "linear";
11
+ export const MOTION_EASING_BOUNCE_BADGE = "cubic-bezier(0.34, 1.36, 0.64, 1)";
12
+ export const MOTION_EASING_BOUNCE_NUMBER = "cubic-bezier(0.34, 1.45, 0.64, 1)";
13
+ export const MOTION_EASING_BOUNCE_CHECK = "cubic-bezier(0.34, 1.35, 0.64, 1)";
14
+ export const MOTION_EASING_BOUNCE_STRONG = "cubic-bezier(0.34, 3.85, 0.64, 1)";
15
+ export const MOTION_EASING_CLOSE = "cubic-bezier(0.4, 0, 0.2, 1)";
16
+ export const MOTION_EASING_TOOLTIP = "easeOut";
17
+ export const MOTION_EASING_REPLACEMENT = "easeOut";
18
+
19
+ export const MOTION_DURATION_BASE_MS = 250;
20
+ export const MOTION_DURATION_MOVE_MS = 500;
21
+ export const MOTION_DURATION_STANDARD_APPEAR_MS = MOTION_DURATION_BASE_MS;
22
+ export const MOTION_DURATION_STANDARD_DISAPPEAR_MS = 150;
23
+ export const MOTION_DURATION_RESIZE_MS = MOTION_DURATION_BASE_MS;
24
+ export const MOTION_DURATION_TAB_INDICATOR_MS = MOTION_DURATION_BASE_MS;
25
+ export const MOTION_DURATION_AVATAR_HOVER_MS = MOTION_DURATION_BASE_MS;
26
+ export const MOTION_DURATION_PANEL_APPEAR_MS = MOTION_DURATION_BASE_MS;
27
+ export const MOTION_DURATION_PANEL_DISAPPEAR_MS = MOTION_DURATION_BASE_MS;
28
+ export const MOTION_DURATION_EMPHASIS_MS = MOTION_DURATION_BASE_MS;
29
+ export const MOTION_DURATION_BADGE_SLIDE_MS = 260;
30
+ export const MOTION_DURATION_BADGE_CLOSE_MS = 180;
31
+ export const MOTION_DURATION_ERROR_SHAKE_A_MS = 80;
32
+ export const MOTION_DURATION_ERROR_SHAKE_B_MS = 60;
33
+ export const MOTION_STAGGER_TEXT_REVEAL_MS = 40;
34
+
35
+ export const MOTION_SPRING_MOVE_STIFFNESS = 300;
36
+ export const MOTION_SPRING_MOVE_DAMPING = 34.6410161514;
37
+ export const MOTION_SPRING_MOVE_MASS = 1;
38
+
39
+ export const MOTION_DURATION_TOOLTIP_APPEAR_MS = 150;
40
+ export const MOTION_DURATION_TOOLTIP_DISAPPEAR_MS = 50;
41
+ export const MOTION_DELAY_TOOLTIP_APPEAR_MS = 80;
42
+
43
+ export const MOTION_SCALE_GENERIC_APPEAR_FROM = 0.97;
44
+ export const MOTION_SCALE_GENERIC_APPEAR_TO = 1;
45
+ export const MOTION_SCALE_GENERIC_DISAPPEAR_FROM = 1;
46
+ export const MOTION_SCALE_GENERIC_DISAPPEAR_TO = 0.99;
47
+
48
+ export const MOTION_SCALE_DROPDOWN_APPEAR_FROM = 0.97;
49
+ export const MOTION_SCALE_DROPDOWN_APPEAR_TO = 1;
50
+ export const MOTION_SCALE_DROPDOWN_DISAPPEAR_FROM = 1;
51
+ export const MOTION_SCALE_DROPDOWN_DISAPPEAR_TO = 0.99;
52
+
53
+ export const MOTION_SCALE_TOOLTIP_APPEAR_FROM = 0.98;
54
+ export const MOTION_SCALE_TOOLTIP_APPEAR_TO = 1;
55
+ export const MOTION_SCALE_TOOLTIP_DISAPPEAR_FROM = 1;
56
+ export const MOTION_SCALE_TOOLTIP_DISAPPEAR_TO = 0.98;
57
+
58
+ export const MOTION_SCALE_DIALOG_APPEAR_FROM = 0.96;
59
+ export const MOTION_SCALE_DIALOG_APPEAR_TO = 1;
60
+ export const MOTION_SCALE_DIALOG_DISAPPEAR_FROM = 1;
61
+ export const MOTION_SCALE_DIALOG_DISAPPEAR_TO = 0.96;
62
+
63
+ export const MOTION_SCALE_ICON_SWAP_FROM = 0.25;
64
+ export const MOTION_SCALE_HOVER_FROM = 1;
65
+ export const MOTION_SCALE_HOVER_TO = 1.05;
66
+
67
+ export const MOTION_DISTANCE_AVATAR_LIFT_Y_PX = -4;
68
+ export const MOTION_DISTANCE_TEXT_SWAP_Y_PX = 4;
69
+ export const MOTION_DISTANCE_ERROR_SHAKE_X_PX = 6;
70
+ export const MOTION_DISTANCE_PAGE_SLIDE_X_PX = 8;
71
+ export const MOTION_DISTANCE_NUMBER_POP_Y_PX = 8;
72
+ export const MOTION_DISTANCE_TEXT_REVEAL_Y_PX = 12;
73
+ export const MOTION_DISTANCE_SUCCESS_CHECK_Y_PX = 40;
74
+ export const MOTION_DISTANCE_PANEL_REVEAL_Y_PX = 100;
75
+ export const MOTION_DISTANCE_BADGE_OFFSET_X_PX = -8.2;
76
+ export const MOTION_DISTANCE_BADGE_OFFSET_Y_PX = 12.4;
77
+
78
+ export const MOTION_BLUR_SMALL_PX = 2;
79
+ export const MOTION_BLUR_PAGE_PX = 3;
80
+ export const MOTION_BLUR_SUCCESS_CHECK_PX = 10;
@@ -4,6 +4,6 @@
4
4
  * while2xl 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_2XL_DEFAULT_MOTION: MotionConfig = {};
@@ -4,7 +4,7 @@
4
4
  * whileActive 默认动效:复用 morph(形态变化平滑过渡)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
  import { MORPH_MOTION } from "./morph";
9
9
 
10
10
  export const WHILE_ACTIVE_DEFAULT_MOTION: MotionConfig = {
@@ -0,0 +1,10 @@
1
+ /**
2
+ * while-appear.ts
3
+ * v1.2.0
4
+ * whileAppear 默认动效:仅渐显;缩放必须由消费方或组件族 preset 显式声明。
5
+ */
6
+
7
+ import type { MotionConfig } from "../logic/motion-config";
8
+ import { GENERIC_APPEAR_MOTION } from "./presets/generic";
9
+
10
+ export const WHILE_APPEAR_DEFAULT_MOTION: MotionConfig = GENERIC_APPEAR_MOTION;
@@ -4,6 +4,6 @@
4
4
  * whileClick 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_CLICK_DEFAULT_MOTION: MotionConfig = {};
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { EXPAND_OUT_MOTION } from "./expand";
8
- import type { MotionConfig } from "../../logic/motion-config";
8
+ import type { MotionConfig } from "../logic/motion-config";
9
9
 
10
10
  export const WHILE_COLLAPSED_DEFAULT_MOTION: MotionConfig = {
11
11
  ...EXPAND_OUT_MOTION,
@@ -4,10 +4,11 @@
4
4
  * whileDisabled 默认动效:透明度渐变至 0.2。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
+ import { MOTION_DURATION_BASE_MS } from "./tokens";
8
9
 
9
10
  export const WHILE_DISABLED_DEFAULT_MOTION: MotionConfig = {
10
11
  opacity: [1, 0.2],
11
- duration: 300,
12
+ duration: MOTION_DURATION_BASE_MS,
12
13
  easing: "easeOut",
13
14
  };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * while-disappear.ts
3
+ * v1.0.0
4
+ * whileDisappear 默认动效:由 fadeOut + scaleOut 原子动效组合得到。
5
+ */
6
+
7
+ import type { MotionConfig } from "../logic/motion-config";
8
+ import { GENERIC_DISAPPEAR_MOTION } from "./presets/generic";
9
+
10
+ export const WHILE_DISAPPEAR_DEFAULT_MOTION: MotionConfig = GENERIC_DISAPPEAR_MOTION;
@@ -4,6 +4,6 @@
4
4
  * whileDrag 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_DRAG_DEFAULT_MOTION: MotionConfig = {};
@@ -4,6 +4,6 @@
4
4
  * whileEditing 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_EDITING_DEFAULT_MOTION: MotionConfig = {};
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { EXPAND_IN_MOTION } from "./expand";
8
- import type { MotionConfig } from "../../logic/motion-config";
8
+ import type { MotionConfig } from "../logic/motion-config";
9
9
 
10
10
  export const WHILE_EXPANDED_DEFAULT_MOTION: MotionConfig = {
11
11
  ...EXPAND_IN_MOTION,
@@ -4,6 +4,6 @@
4
4
  * whileFocus 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_FOCUS_DEFAULT_MOTION: MotionConfig = {};
@@ -5,7 +5,7 @@
5
5
  * 不直接设置颜色属性値,只注入时序参数的 CSS 变量。
6
6
  */
7
7
 
8
- import type { MotionConfig } from "../../logic/motion-config";
8
+ import type { MotionConfig } from "../logic/motion-config";
9
9
 
10
10
  export const WHILE_HOVER_DEFAULT_MOTION: MotionConfig = {
11
11
  duration: 150,
@@ -4,6 +4,6 @@
4
4
  * whileIdle 默认动效:空配置。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_IDLE_DEFAULT_MOTION: MotionConfig = {};
@@ -4,6 +4,6 @@
4
4
  * whileKey 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_KEY_DEFAULT_MOTION: MotionConfig = {};
@@ -4,6 +4,6 @@
4
4
  * whileLg 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_LG_DEFAULT_MOTION: MotionConfig = {};
@@ -4,8 +4,9 @@
4
4
  * whileLoad 默认动效:加载中(skeleton 由 Frame 自动处理)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
+ import { MOTION_DURATION_BASE_MS } from "./tokens";
8
9
 
9
10
  export const WHILE_LOAD_DEFAULT_MOTION: MotionConfig = {
10
- duration: 300,
11
+ duration: MOTION_DURATION_BASE_MS,
11
12
  };
@@ -4,6 +4,6 @@
4
4
  * whileMd 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_MD_DEFAULT_MOTION: MotionConfig = {};
@@ -4,7 +4,7 @@
4
4
  * whileReload 默认动效:复用顺时针旋转。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
  import { ROTATE_CLOCKWISE_MOTION } from "./rotate";
9
9
 
10
10
  export const WHILE_RELOAD_DEFAULT_MOTION: MotionConfig = {
@@ -4,6 +4,6 @@
4
4
  * whileScroll 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_SCROLL_DEFAULT_MOTION: MotionConfig = {};
@@ -4,6 +4,6 @@
4
4
  * whileSm 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_SM_DEFAULT_MOTION: MotionConfig = {};
@@ -4,6 +4,6 @@
4
4
  * whileUploading 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_UPLOADING_DEFAULT_MOTION: MotionConfig = {};
@@ -4,6 +4,6 @@
4
4
  * whileValidating 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_VALIDATING_DEFAULT_MOTION: MotionConfig = {};
@@ -4,6 +4,6 @@
4
4
  * whileXl 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_XL_DEFAULT_MOTION: MotionConfig = {};
@@ -4,6 +4,6 @@
4
4
  * whileXs 默认动效:空配置(无视觉效果)。
5
5
  */
6
6
 
7
- import type { MotionConfig } from "../../logic/motion-config";
7
+ import type { MotionConfig } from "../logic/motion-config";
8
8
 
9
9
  export const WHILE_XS_DEFAULT_MOTION: MotionConfig = {};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Auto Layout Protocol
3
3
  * v1.0.0
4
- * Level 1: 三槽位布局模型的结构化原语
4
+ * Level 1: 三槽位布局模型与 Pin 布局的结构化原语
5
5
  * 规范来源: specs/LayoutProtocol.md
6
6
  *
7
7
  * 必须在 layout.css 之后加载(源码顺序依赖)
@@ -22,19 +22,11 @@
22
22
  flex-wrap: nowrap; /* column 方向不换列,确保 stretch 能拉满容器全宽 */
23
23
  }
24
24
 
25
- /* === 列模式:Content 填充剩余高度 === */
26
- /* 仅当 column 内存在 leading/trailing 槽位时,非槽位子元素才填充剩余高度 */
27
- /* 无槽时多个子元素各自 hug,不均等拉伸 */
28
- :where([data-auto-layout].snowui-direction-column:has(> [data-as]) > :not([data-as])),
29
- :where([data-auto-layout].snowui-direction-column-reverse:has(> [data-as]) > :not([data-as])) {
30
- flex: 1 1 0;
31
- min-height: 0;
32
- }
33
-
34
25
  /* === 槽位默认尺寸策略 === */
35
26
  :where([data-auto-layout] > [data-as="leading"]),
36
27
  :where([data-auto-layout] > [data-as="trailing"]) {
37
28
  flex: 0 0 auto;
29
+ align-items: inherit;
38
30
  }
39
31
 
40
32
  /* === 行模式:槽位感知 Grid 切换 === */
@@ -109,3 +101,93 @@
109
101
  :where([data-auto-layout][data-wrap="false"]) {
110
102
  flex-wrap: nowrap;
111
103
  }
104
+
105
+ /* === 普通内容子项宽度策略 === */
106
+ :where([data-auto-layout][data-content-width="fill"].snowui-direction-column > :not([data-as])),
107
+ :where([data-auto-layout][data-content-width="fill"].snowui-direction-column-reverse > :not([data-as])) {
108
+ width: 100%;
109
+ min-width: 0;
110
+ }
111
+
112
+ :where([data-auto-layout][data-content-width="hug"].snowui-direction-column > :not([data-as])),
113
+ :where([data-auto-layout][data-content-width="hug"].snowui-direction-column-reverse > :not([data-as])) {
114
+ width: fit-content;
115
+ max-width: 100%;
116
+ align-self: flex-start;
117
+ }
118
+
119
+ :where([data-auto-layout][data-content-width="fill"].snowui-direction-row:not(:has(> [data-as])) > :not([data-as])),
120
+ :where([data-auto-layout][data-content-width="fill"].snowui-direction-row-reverse:not(:has(> [data-as])) > :not([data-as])) {
121
+ flex: 1 1 0;
122
+ min-width: 0;
123
+ }
124
+
125
+ :where([data-auto-layout][data-content-width="hug"].snowui-direction-row:not(:has(> [data-as])) > :not([data-as])),
126
+ :where([data-auto-layout][data-content-width="hug"].snowui-direction-row-reverse:not(:has(> [data-as])) > :not([data-as])) {
127
+ flex: 0 0 auto;
128
+ min-width: 0;
129
+ }
130
+
131
+ /* === Pin 布局:父容器激活 === */
132
+ :where(:has(> [data-as^="pin-"])) {
133
+ position: relative;
134
+ }
135
+
136
+ /* === Pin 布局:子元素基础 === */
137
+ :where([data-as^="pin-"]) {
138
+ position: absolute;
139
+ z-index: 1;
140
+ }
141
+
142
+ /* 上排 */
143
+ :where([data-as="pin-top-left"]) {
144
+ top: var(--pin-offset-y, var(--pin-offset, var(--gap-2)));
145
+ left: var(--pin-offset-x, var(--pin-offset, var(--gap-2)));
146
+ }
147
+
148
+ :where([data-as="pin-top"]) {
149
+ top: var(--pin-offset-y, var(--pin-offset, var(--gap-2)));
150
+ left: 50%;
151
+ translate: -50% 0;
152
+ }
153
+
154
+ :where([data-as="pin-top-right"]) {
155
+ top: var(--pin-offset-y, var(--pin-offset, var(--gap-2)));
156
+ right: var(--pin-offset-x, var(--pin-offset, var(--gap-2)));
157
+ }
158
+
159
+ /* 中排 */
160
+ :where([data-as="pin-left"]) {
161
+ top: 50%;
162
+ left: var(--pin-offset-x, var(--pin-offset, var(--gap-2)));
163
+ translate: 0 -50%;
164
+ }
165
+
166
+ :where([data-as="pin-center"]) {
167
+ top: 50%;
168
+ left: 50%;
169
+ translate: -50% -50%;
170
+ }
171
+
172
+ :where([data-as="pin-right"]) {
173
+ top: 50%;
174
+ right: var(--pin-offset-x, var(--pin-offset, var(--gap-2)));
175
+ translate: 0 -50%;
176
+ }
177
+
178
+ /* 下排 */
179
+ :where([data-as="pin-bottom-left"]) {
180
+ bottom: var(--pin-offset-y, var(--pin-offset, var(--gap-2)));
181
+ left: var(--pin-offset-x, var(--pin-offset, var(--gap-2)));
182
+ }
183
+
184
+ :where([data-as="pin-bottom"]) {
185
+ bottom: var(--pin-offset-y, var(--pin-offset, var(--gap-2)));
186
+ left: 50%;
187
+ translate: -50% 0;
188
+ }
189
+
190
+ :where([data-as="pin-bottom-right"]) {
191
+ bottom: var(--pin-offset-y, var(--pin-offset, var(--gap-2)));
192
+ right: var(--pin-offset-x, var(--pin-offset, var(--gap-2)));
193
+ }