@snowui-design-system/components 0.3.0-alpha.0 → 0.3.0-alpha.11

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 (455) hide show
  1. package/AGENTS.md +39 -0
  2. package/LICENSE +152 -91
  3. package/README.md +52 -11
  4. package/THIRD_PARTY_NOTICES.md +41 -0
  5. package/component-catalog.json +532 -106
  6. package/dist/client/blocks/Sidebar.js +185 -143
  7. package/dist/client/blocks/SidebarItem.js +29 -15
  8. package/dist/client/blocks/SidebarSection.js +13 -5
  9. package/dist/client/blocks/index.js +2 -0
  10. package/dist/client/compat.d.ts +1 -1
  11. package/dist/client/compat.js +3 -1
  12. package/dist/client/components/Accordion.d.ts +2 -0
  13. package/dist/client/components/Accordion.js +37 -16
  14. package/dist/client/components/AccordionItem.js +1 -1
  15. package/dist/client/components/BarChart.js +10 -3
  16. package/dist/client/components/BlurText.js +2 -2
  17. package/dist/client/components/Breadcrumb.d.ts +1 -0
  18. package/dist/client/components/Breadcrumb.js +44 -18
  19. package/dist/client/components/Button.d.ts +2 -0
  20. package/dist/client/components/Button.js +6 -1
  21. package/dist/client/components/ChartGroup.js +23 -10
  22. package/dist/client/components/Checkbox.d.ts +2 -0
  23. package/dist/client/components/Checkbox.js +19 -4
  24. package/dist/client/components/Chip.js +2 -2
  25. package/dist/client/components/CircularChart.js +10 -3
  26. package/dist/client/components/CodeBlock.js +283 -226
  27. package/dist/client/components/CopyButton.js +5 -2
  28. package/dist/client/components/CopyLink.js +1 -1
  29. package/dist/client/components/DataTable.d.ts +8 -2
  30. package/dist/client/components/DataTable.js +11 -5
  31. package/dist/client/components/Dialog.js +1 -1
  32. package/dist/client/components/ExpandButton.js +10 -3
  33. package/dist/client/components/Field.js +3 -2
  34. package/dist/client/components/FlowText.js +2 -2
  35. package/dist/client/components/Frame.d.ts +9 -0
  36. package/dist/client/components/Frame.js +106 -40
  37. package/dist/client/components/GaugeChart.js +10 -3
  38. package/dist/client/components/GradientMotion.d.ts +1 -1
  39. package/dist/client/components/GradientMotion.js +2 -2
  40. package/dist/client/components/Icon.js +6 -3
  41. package/dist/client/components/Image.d.ts +2 -0
  42. package/dist/client/components/Image.js +14 -2
  43. package/dist/client/components/ImageViewer.js +51 -27
  44. package/dist/client/components/Indicator.js +5 -3
  45. package/dist/client/components/Input.d.ts +1 -0
  46. package/dist/client/components/Input.js +51 -24
  47. package/dist/client/components/LineChart.js +10 -3
  48. package/dist/client/components/Link.d.ts +1 -1
  49. package/dist/client/components/Link.js +58 -30
  50. package/dist/client/components/Listbox.d.ts +2 -0
  51. package/dist/client/components/Listbox.js +98 -43
  52. package/dist/client/components/MenuItem.d.ts +2 -0
  53. package/dist/client/components/MenuItem.js +15 -2
  54. package/dist/client/components/NumberFlow.js +4 -4
  55. package/dist/client/components/NumericText.js +2 -2
  56. package/dist/client/components/OTPInput.d.ts +32 -0
  57. package/dist/client/components/OTPInput.js +556 -0
  58. package/dist/client/components/OverflowAction.d.ts +2 -0
  59. package/dist/client/components/OverflowAction.js +146 -65
  60. package/dist/client/components/OverflowActions.d.ts +7 -1
  61. package/dist/client/components/OverflowActions.js +102 -26
  62. package/dist/client/components/Pagination.js +117 -68
  63. package/dist/client/components/Radio.d.ts +2 -0
  64. package/dist/client/components/Radio.js +20 -5
  65. package/dist/client/components/ScrambleText.js +6 -3
  66. package/dist/client/components/ScrollArea.js +11 -5
  67. package/dist/client/components/SearchBox.d.ts +1 -0
  68. package/dist/client/components/SearchBox.js +32 -7
  69. package/dist/client/components/SearchInput.js +43 -3
  70. package/dist/client/components/Select.d.ts +1 -0
  71. package/dist/client/components/Select.js +65 -27
  72. package/dist/client/components/SidePanel.js +84 -57
  73. package/dist/client/components/Slider.d.ts +1 -1
  74. package/dist/client/components/Slider.js +36 -13
  75. package/dist/client/components/SlotText.js +2 -2
  76. package/dist/client/components/SnowUILogo.js +1 -1
  77. package/dist/client/components/Spinner.js +9 -2
  78. package/dist/client/components/Switch.d.ts +2 -0
  79. package/dist/client/components/Switch.js +18 -3
  80. package/dist/client/components/Tab.js +90 -81
  81. package/dist/client/components/Table.js +30 -16
  82. package/dist/client/components/TableBody.js +10 -4
  83. package/dist/client/components/TableCell.d.ts +1 -0
  84. package/dist/client/components/TableCell.js +100 -50
  85. package/dist/client/components/TableHead.js +72 -39
  86. package/dist/client/components/TableToolbar.js +217 -141
  87. package/dist/client/components/Tag.js +21 -3
  88. package/dist/client/components/Text.js +163 -83
  89. package/dist/client/components/Textarea.js +8 -2
  90. package/dist/client/components/Toast.js +9 -2
  91. package/dist/client/components/Toaster.d.ts +2 -0
  92. package/dist/client/components/Toaster.js +52 -38
  93. package/dist/client/components/Tooltip.js +229 -201
  94. package/dist/client/context.js +2 -0
  95. package/dist/client/dev.js +2 -0
  96. package/dist/client/i18n/messages.d.ts +2 -2
  97. package/dist/client/i18n/messages.js +177 -1
  98. package/dist/client/index.d.ts +4 -2
  99. package/dist/client/index.js +8 -6
  100. package/dist/client/internal/code-block/prettier-svelte.d.ts +2 -0
  101. package/dist/client/internal/component-icon/index.js +2 -0
  102. package/dist/client/internal/snow-ui-logo/Wordmark.js +22 -10
  103. package/dist/client/internal/snow-ui-logo/emoji-metrics.js +2 -0
  104. package/dist/client/keys.d.ts +1 -0
  105. package/dist/client/keys.js +3 -0
  106. package/dist/client/lib/adaptive-contrast-renderer.js +2 -0
  107. package/dist/client/lib/chart/ChartHoverPanel.js +1 -1
  108. package/dist/client/lib/chart/appearance-timeline.js +2 -0
  109. package/dist/client/lib/chart/arc-path.js +2 -0
  110. package/dist/client/lib/chart/colors.js +2 -0
  111. package/dist/client/lib/chart/size.js +2 -0
  112. package/dist/client/lib/clipboard.js +2 -0
  113. package/dist/client/lib/color.js +2 -0
  114. package/dist/client/lib/date-format.js +2 -0
  115. package/dist/client/lib/edge-fade.js +3 -1
  116. package/dist/client/lib/media-loading.d.ts +7 -0
  117. package/dist/client/lib/media-loading.js +12 -0
  118. package/dist/client/lib/number-format.js +8 -0
  119. package/dist/client/lib/overflow-actions-motion.js +2 -0
  120. package/dist/client/lib/overlay-scrollbar.d.ts +1 -0
  121. package/dist/client/lib/overlay-scrollbar.js +9 -0
  122. package/dist/client/lib/overlay-trigger-timing.js +2 -0
  123. package/dist/client/lib/progressive-blur.d.ts +13 -0
  124. package/dist/client/lib/progressive-blur.js +54 -0
  125. package/dist/client/lib/resizable.d.ts +1 -1
  126. package/dist/client/lib/responsive-exit.js +2 -0
  127. package/dist/client/lib/search-filter.js +2 -0
  128. package/dist/client/lib/side-panel.js +2 -0
  129. package/dist/client/lib/split-pane.js +2 -0
  130. package/dist/client/lib/table-column-motion.js +2 -0
  131. package/dist/client/lib/table-context.d.ts +5 -0
  132. package/dist/client/lib/table-context.js +4 -1
  133. package/dist/client/lib/table-responsive.d.ts +1 -1
  134. package/dist/client/lib/table-responsive.js +41 -7
  135. package/dist/client/lib/table-selection-fade.js +2 -0
  136. package/dist/client/lib/table-truncation.js +2 -0
  137. package/dist/client/lib/text-motion/animation.js +2 -0
  138. package/dist/client/lib/text-motion/character.js +2 -0
  139. package/dist/client/lib/text-motion/color.js +2 -0
  140. package/dist/client/lib/text-motion/layout.js +2 -0
  141. package/dist/client/lib/text-motion/preference.js +2 -0
  142. package/dist/client/lib/text-motion/sequence.js +2 -0
  143. package/dist/client/lib/text-motion/typography.js +2 -0
  144. package/dist/client/lib/tooltip-delay.js +2 -0
  145. package/dist/client/lib/tooltip-motion-dismiss.js +2 -0
  146. package/dist/client/lib/tooltip-pointer-speed.js +2 -0
  147. package/dist/client/lib/truncate.js +2 -0
  148. package/dist/client/logic/ComponentPartsBoundary.d.ts +7 -0
  149. package/dist/client/logic/ComponentPartsBoundary.js +15 -0
  150. package/dist/client/logic/content-line.d.ts +5 -0
  151. package/dist/client/logic/content-line.js +13 -0
  152. package/dist/client/logic/frame-dom-runtime.d.ts +3 -1
  153. package/dist/client/logic/frame-dom-runtime.js +5 -3
  154. package/dist/client/logic/frame-field-control.js +2 -0
  155. package/dist/client/logic/frame-inline-style.js +2 -3
  156. package/dist/client/logic/frame-layout.js +3 -0
  157. package/dist/client/logic/frame-motion-defaults.js +2 -0
  158. package/dist/client/logic/frame-motion.d.ts +15 -23
  159. package/dist/client/logic/frame-motion.js +196 -30
  160. package/dist/client/logic/frame-prop-filter.d.ts +1 -1
  161. package/dist/client/logic/frame-prop-filter.js +3 -0
  162. package/dist/client/logic/frame-responsive.js +22 -6
  163. package/dist/client/logic/frame-state.d.ts +2 -14
  164. package/dist/client/logic/frame-state.js +60 -9
  165. package/dist/client/logic/frame-types.d.ts +2 -0
  166. package/dist/client/logic/geometry-cache.js +2 -0
  167. package/dist/client/logic/layout-flip.js +2 -0
  168. package/dist/client/logic/morph.js +2 -0
  169. package/dist/client/logic/motion-engine.js +2 -0
  170. package/dist/client/logic/motion-orchestration.js +2 -0
  171. package/dist/client/logic/motion-types.js +2 -0
  172. package/dist/client/logic/overflow-actions.d.ts +11 -2
  173. package/dist/client/logic/overflow-actions.js +5 -0
  174. package/dist/client/logic/toast.js +7 -4
  175. package/dist/client/logic/wc-adapter.js +2 -0
  176. package/dist/client/motion/bridge.js +2 -0
  177. package/dist/client/motion/content-crossfade.js +2 -0
  178. package/dist/client/motion/expand.js +2 -0
  179. package/dist/client/motion/fade-in.js +2 -0
  180. package/dist/client/motion/fade-out.js +2 -0
  181. package/dist/client/motion/morph.js +2 -0
  182. package/dist/client/motion/move.js +2 -0
  183. package/dist/client/motion/number.d.ts +3 -3
  184. package/dist/client/motion/number.js +5 -3
  185. package/dist/client/motion/replace.js +2 -0
  186. package/dist/client/motion/rotate.css +2 -0
  187. package/dist/client/motion/rotate.js +2 -0
  188. package/dist/client/motion/scale-in.js +2 -0
  189. package/dist/client/motion/tokens.js +2 -0
  190. package/dist/client/motion/while-2xl.js +2 -0
  191. package/dist/client/motion/while-active.js +2 -0
  192. package/dist/client/motion/while-appear.js +2 -0
  193. package/dist/client/motion/while-click.js +2 -0
  194. package/dist/client/motion/while-collapsed.js +2 -0
  195. package/dist/client/motion/while-disabled.js +2 -0
  196. package/dist/client/motion/while-disappear.js +2 -0
  197. package/dist/client/motion/while-drag.js +2 -0
  198. package/dist/client/motion/while-editing.js +2 -0
  199. package/dist/client/motion/while-expanded.js +2 -0
  200. package/dist/client/motion/while-focus.js +2 -0
  201. package/dist/client/motion/while-hover.js +2 -0
  202. package/dist/client/motion/while-idle.js +2 -0
  203. package/dist/client/motion/while-key.js +2 -0
  204. package/dist/client/motion/while-lg.js +2 -0
  205. package/dist/client/motion/while-load.js +2 -0
  206. package/dist/client/motion/while-md.js +2 -0
  207. package/dist/client/motion/while-reload.js +2 -0
  208. package/dist/client/motion/while-scroll.js +2 -0
  209. package/dist/client/motion/while-sm.js +2 -0
  210. package/dist/client/motion/while-uploading.js +2 -0
  211. package/dist/client/motion/while-validating.js +2 -0
  212. package/dist/client/motion/while-xl.js +2 -0
  213. package/dist/client/motion/while-xs.js +2 -0
  214. package/dist/client/styles/auto-layout.css +23 -1
  215. package/dist/client/styles/backdrop.css +2 -0
  216. package/dist/client/styles/components.css +28 -20
  217. package/dist/client/styles/index.css +2 -0
  218. package/dist/client/styles/layout.css +33 -7
  219. package/dist/client/styles/scale.css +2 -0
  220. package/dist/client/styles/scrollbar.css +16 -1
  221. package/dist/client/styles/themes.css +7 -4
  222. package/dist/client/styles/tokens.css +2 -0
  223. package/dist/client/vite-env.d.ts +2 -0
  224. package/dist/server/blocks/Sidebar.js +47 -27
  225. package/dist/server/blocks/SidebarItem.js +7 -5
  226. package/dist/server/blocks/SidebarSection.js +13 -5
  227. package/dist/server/blocks/index.js +2 -0
  228. package/dist/server/compat.d.ts +1 -1
  229. package/dist/server/compat.js +3 -1
  230. package/dist/server/components/Accordion.d.ts +2 -0
  231. package/dist/server/components/Accordion.js +12 -1
  232. package/dist/server/components/AccordionItem.js +1 -1
  233. package/dist/server/components/BarChart.js +6 -3
  234. package/dist/server/components/BlurText.js +2 -2
  235. package/dist/server/components/Breadcrumb.d.ts +1 -0
  236. package/dist/server/components/Breadcrumb.js +26 -5
  237. package/dist/server/components/Button.d.ts +2 -0
  238. package/dist/server/components/Button.js +6 -1
  239. package/dist/server/components/ChartGroup.js +6 -3
  240. package/dist/server/components/Checkbox.d.ts +2 -0
  241. package/dist/server/components/Checkbox.js +16 -3
  242. package/dist/server/components/Chip.js +2 -2
  243. package/dist/server/components/CircularChart.js +6 -3
  244. package/dist/server/components/CodeBlock.js +27 -14
  245. package/dist/server/components/CopyButton.js +6 -2
  246. package/dist/server/components/CopyLink.js +1 -1
  247. package/dist/server/components/DataTable.d.ts +8 -2
  248. package/dist/server/components/DataTable.js +11 -5
  249. package/dist/server/components/Dialog.js +1 -1
  250. package/dist/server/components/ExpandButton.js +7 -3
  251. package/dist/server/components/Field.js +3 -2
  252. package/dist/server/components/FlowText.js +2 -2
  253. package/dist/server/components/Frame.d.ts +9 -0
  254. package/dist/server/components/Frame.js +71 -34
  255. package/dist/server/components/GaugeChart.js +6 -3
  256. package/dist/server/components/GradientMotion.d.ts +1 -1
  257. package/dist/server/components/GradientMotion.js +2 -2
  258. package/dist/server/components/Icon.js +5 -4
  259. package/dist/server/components/Image.d.ts +2 -0
  260. package/dist/server/components/Image.js +11 -4
  261. package/dist/server/components/ImageViewer.js +6 -3
  262. package/dist/server/components/Indicator.js +5 -3
  263. package/dist/server/components/Input.d.ts +1 -0
  264. package/dist/server/components/Input.js +32 -22
  265. package/dist/server/components/LineChart.js +6 -3
  266. package/dist/server/components/Link.d.ts +1 -1
  267. package/dist/server/components/Link.js +22 -3
  268. package/dist/server/components/Listbox.d.ts +2 -0
  269. package/dist/server/components/Listbox.js +81 -22
  270. package/dist/server/components/MenuItem.d.ts +2 -0
  271. package/dist/server/components/MenuItem.js +9 -2
  272. package/dist/server/components/NumberFlow.js +4 -4
  273. package/dist/server/components/NumericText.js +2 -2
  274. package/dist/server/components/OTPInput.d.ts +32 -0
  275. package/dist/server/components/OTPInput.js +401 -0
  276. package/dist/server/components/OverflowAction.d.ts +2 -0
  277. package/dist/server/components/OverflowAction.js +70 -26
  278. package/dist/server/components/OverflowActions.d.ts +7 -1
  279. package/dist/server/components/OverflowActions.js +88 -30
  280. package/dist/server/components/Pagination.js +42 -22
  281. package/dist/server/components/Radio.d.ts +2 -0
  282. package/dist/server/components/Radio.js +15 -5
  283. package/dist/server/components/ScrambleText.js +6 -3
  284. package/dist/server/components/ScrollArea.js +5 -2
  285. package/dist/server/components/SearchBox.d.ts +1 -0
  286. package/dist/server/components/SearchBox.js +25 -5
  287. package/dist/server/components/SearchInput.js +12 -3
  288. package/dist/server/components/Select.d.ts +1 -0
  289. package/dist/server/components/Select.js +55 -20
  290. package/dist/server/components/SidePanel.js +36 -15
  291. package/dist/server/components/Slider.d.ts +1 -1
  292. package/dist/server/components/Slider.js +34 -11
  293. package/dist/server/components/SlotText.js +2 -2
  294. package/dist/server/components/SnowUILogo.js +1 -1
  295. package/dist/server/components/Spinner.js +4 -2
  296. package/dist/server/components/Switch.d.ts +2 -0
  297. package/dist/server/components/Switch.js +14 -3
  298. package/dist/server/components/Tab.js +62 -52
  299. package/dist/server/components/Table.js +16 -6
  300. package/dist/server/components/TableBody.js +9 -2
  301. package/dist/server/components/TableCell.d.ts +1 -0
  302. package/dist/server/components/TableCell.js +68 -25
  303. package/dist/server/components/TableHead.js +35 -8
  304. package/dist/server/components/TableToolbar.js +104 -55
  305. package/dist/server/components/Tag.js +17 -3
  306. package/dist/server/components/Text.js +64 -15
  307. package/dist/server/components/Textarea.js +5 -2
  308. package/dist/server/components/Toast.js +5 -2
  309. package/dist/server/components/Toaster.d.ts +2 -0
  310. package/dist/server/components/Toaster.js +18 -3
  311. package/dist/server/components/Tooltip.js +39 -16
  312. package/dist/server/context.js +2 -0
  313. package/dist/server/dev.js +2 -0
  314. package/dist/server/i18n/messages.d.ts +2 -2
  315. package/dist/server/i18n/messages.js +177 -1
  316. package/dist/server/index.d.ts +4 -2
  317. package/dist/server/index.js +8 -6
  318. package/dist/server/internal/code-block/prettier-svelte.d.ts +2 -0
  319. package/dist/server/internal/component-icon/index.js +2 -0
  320. package/dist/server/internal/snow-ui-logo/Wordmark.js +16 -8
  321. package/dist/server/internal/snow-ui-logo/emoji-metrics.js +2 -0
  322. package/dist/server/keys.d.ts +1 -0
  323. package/dist/server/keys.js +3 -0
  324. package/dist/server/lib/adaptive-contrast-renderer.js +2 -0
  325. package/dist/server/lib/chart/ChartHoverPanel.js +1 -1
  326. package/dist/server/lib/chart/appearance-timeline.js +2 -0
  327. package/dist/server/lib/chart/arc-path.js +2 -0
  328. package/dist/server/lib/chart/colors.js +2 -0
  329. package/dist/server/lib/chart/size.js +2 -0
  330. package/dist/server/lib/clipboard.js +2 -0
  331. package/dist/server/lib/color.js +2 -0
  332. package/dist/server/lib/date-format.js +2 -0
  333. package/dist/server/lib/edge-fade.js +3 -1
  334. package/dist/server/lib/media-loading.d.ts +7 -0
  335. package/dist/server/lib/media-loading.js +12 -0
  336. package/dist/server/lib/number-format.js +8 -0
  337. package/dist/server/lib/overflow-actions-motion.js +2 -0
  338. package/dist/server/lib/overlay-scrollbar.d.ts +1 -0
  339. package/dist/server/lib/overlay-scrollbar.js +9 -0
  340. package/dist/server/lib/overlay-trigger-timing.js +2 -0
  341. package/dist/server/lib/progressive-blur.d.ts +13 -0
  342. package/dist/server/lib/progressive-blur.js +54 -0
  343. package/dist/server/lib/resizable.d.ts +1 -1
  344. package/dist/server/lib/responsive-exit.js +2 -0
  345. package/dist/server/lib/search-filter.js +2 -0
  346. package/dist/server/lib/side-panel.js +2 -0
  347. package/dist/server/lib/split-pane.js +2 -0
  348. package/dist/server/lib/table-column-motion.js +2 -0
  349. package/dist/server/lib/table-context.d.ts +5 -0
  350. package/dist/server/lib/table-context.js +4 -1
  351. package/dist/server/lib/table-responsive.d.ts +1 -1
  352. package/dist/server/lib/table-responsive.js +41 -7
  353. package/dist/server/lib/table-selection-fade.js +2 -0
  354. package/dist/server/lib/table-truncation.js +2 -0
  355. package/dist/server/lib/text-motion/animation.js +2 -0
  356. package/dist/server/lib/text-motion/character.js +2 -0
  357. package/dist/server/lib/text-motion/color.js +2 -0
  358. package/dist/server/lib/text-motion/layout.js +2 -0
  359. package/dist/server/lib/text-motion/preference.js +2 -0
  360. package/dist/server/lib/text-motion/sequence.js +2 -0
  361. package/dist/server/lib/text-motion/typography.js +2 -0
  362. package/dist/server/lib/tooltip-delay.js +2 -0
  363. package/dist/server/lib/tooltip-motion-dismiss.js +2 -0
  364. package/dist/server/lib/tooltip-pointer-speed.js +2 -0
  365. package/dist/server/lib/truncate.js +2 -0
  366. package/dist/server/logic/ComponentPartsBoundary.d.ts +7 -0
  367. package/dist/server/logic/ComponentPartsBoundary.js +12 -0
  368. package/dist/server/logic/content-line.d.ts +5 -0
  369. package/dist/server/logic/content-line.js +13 -0
  370. package/dist/server/logic/frame-dom-runtime.d.ts +3 -1
  371. package/dist/server/logic/frame-dom-runtime.js +5 -3
  372. package/dist/server/logic/frame-field-control.js +2 -0
  373. package/dist/server/logic/frame-inline-style.js +2 -3
  374. package/dist/server/logic/frame-layout.js +3 -0
  375. package/dist/server/logic/frame-motion-defaults.js +2 -0
  376. package/dist/server/logic/frame-motion.d.ts +15 -23
  377. package/dist/server/logic/frame-motion.js +75 -29
  378. package/dist/server/logic/frame-prop-filter.d.ts +1 -1
  379. package/dist/server/logic/frame-prop-filter.js +3 -0
  380. package/dist/server/logic/frame-responsive.js +22 -6
  381. package/dist/server/logic/frame-state.d.ts +2 -14
  382. package/dist/server/logic/frame-state.js +60 -9
  383. package/dist/server/logic/frame-types.d.ts +2 -0
  384. package/dist/server/logic/geometry-cache.js +2 -0
  385. package/dist/server/logic/layout-flip.js +2 -0
  386. package/dist/server/logic/morph.js +2 -0
  387. package/dist/server/logic/motion-engine.js +2 -0
  388. package/dist/server/logic/motion-orchestration.js +2 -0
  389. package/dist/server/logic/motion-types.js +2 -0
  390. package/dist/server/logic/overflow-actions.d.ts +11 -2
  391. package/dist/server/logic/overflow-actions.js +5 -0
  392. package/dist/server/logic/toast.js +7 -4
  393. package/dist/server/logic/wc-adapter.js +2 -0
  394. package/dist/server/motion/bridge.js +2 -0
  395. package/dist/server/motion/content-crossfade.js +2 -0
  396. package/dist/server/motion/expand.js +2 -0
  397. package/dist/server/motion/fade-in.js +2 -0
  398. package/dist/server/motion/fade-out.js +2 -0
  399. package/dist/server/motion/morph.js +2 -0
  400. package/dist/server/motion/move.js +2 -0
  401. package/dist/server/motion/number.d.ts +3 -3
  402. package/dist/server/motion/number.js +5 -3
  403. package/dist/server/motion/replace.js +2 -0
  404. package/dist/server/motion/rotate.css +2 -0
  405. package/dist/server/motion/rotate.js +2 -0
  406. package/dist/server/motion/scale-in.js +2 -0
  407. package/dist/server/motion/tokens.js +2 -0
  408. package/dist/server/motion/while-2xl.js +2 -0
  409. package/dist/server/motion/while-active.js +2 -0
  410. package/dist/server/motion/while-appear.js +2 -0
  411. package/dist/server/motion/while-click.js +2 -0
  412. package/dist/server/motion/while-collapsed.js +2 -0
  413. package/dist/server/motion/while-disabled.js +2 -0
  414. package/dist/server/motion/while-disappear.js +2 -0
  415. package/dist/server/motion/while-drag.js +2 -0
  416. package/dist/server/motion/while-editing.js +2 -0
  417. package/dist/server/motion/while-expanded.js +2 -0
  418. package/dist/server/motion/while-focus.js +2 -0
  419. package/dist/server/motion/while-hover.js +2 -0
  420. package/dist/server/motion/while-idle.js +2 -0
  421. package/dist/server/motion/while-key.js +2 -0
  422. package/dist/server/motion/while-lg.js +2 -0
  423. package/dist/server/motion/while-load.js +2 -0
  424. package/dist/server/motion/while-md.js +2 -0
  425. package/dist/server/motion/while-reload.js +2 -0
  426. package/dist/server/motion/while-scroll.js +2 -0
  427. package/dist/server/motion/while-sm.js +2 -0
  428. package/dist/server/motion/while-uploading.js +2 -0
  429. package/dist/server/motion/while-validating.js +2 -0
  430. package/dist/server/motion/while-xl.js +2 -0
  431. package/dist/server/motion/while-xs.js +2 -0
  432. package/dist/server/styles/auto-layout.css +23 -1
  433. package/dist/server/styles/backdrop.css +2 -0
  434. package/dist/server/styles/components.css +28 -20
  435. package/dist/server/styles/index.css +2 -0
  436. package/dist/server/styles/layout.css +33 -7
  437. package/dist/server/styles/scale.css +2 -0
  438. package/dist/server/styles/scrollbar.css +16 -1
  439. package/dist/server/styles/themes.css +7 -4
  440. package/dist/server/styles/tokens.css +2 -0
  441. package/dist/server/vite-env.d.ts +2 -0
  442. package/llms.txt +8 -0
  443. package/package.json +16 -7
  444. package/dist/client/components/FramePro.d.ts +0 -23
  445. package/dist/client/components/FramePro.js +0 -412
  446. package/dist/client/logic/frame-pro-motion.d.ts +0 -26
  447. package/dist/client/logic/frame-pro-motion.js +0 -310
  448. package/dist/client/logic/frame-pro-state.d.ts +0 -39
  449. package/dist/client/logic/frame-pro-state.js +0 -538
  450. package/dist/server/components/FramePro.d.ts +0 -23
  451. package/dist/server/components/FramePro.js +0 -301
  452. package/dist/server/logic/frame-pro-motion.d.ts +0 -26
  453. package/dist/server/logic/frame-pro-motion.js +0 -176
  454. package/dist/server/logic/frame-pro-state.d.ts +0 -39
  455. package/dist/server/logic/frame-pro-state.js +0 -445
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  export function shouldReduceTextMotion(respectMotionPreference) {
2
4
  return (respectMotionPreference &&
3
5
  typeof window !== "undefined" &&
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  export const TEXT_MOTION_STAGGER_MS = 25;
2
4
  export const TEXT_MOTION_SPACE = "\u00A0";
3
5
  export const TEXT_MOTION_STAGGER_RATIO = 0.3;
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { resolveSnowUIColor } from "../color.js";
2
4
  function resolveCssValue(value, numberUnit = "unitless") {
3
5
  if (value === undefined || value === null || value === "")
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * Tooltip hover 延迟协调器。
3
5
  *
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * Tooltip 动效感知关闭协调器。
3
5
  *
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /** 仅由可见的共享 Tooltip 宿主持有;事件只更新数值,不读布局或驱动渲染。 */
2
4
  export function trackTooltipPointerSpeed(document) {
3
5
  const clock = () => document.defaultView.performance.now();
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * 文本截断 Action (Truncate Action)
3
5
  *
@@ -0,0 +1,7 @@
1
+ import type { Snippet } from "svelte";
2
+ type $$ComponentProps = {
3
+ children?: Snippet;
4
+ };
5
+ declare const ComponentPartsBoundary: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type ComponentPartsBoundary = ReturnType<typeof ComponentPartsBoundary>;
7
+ export default ComponentPartsBoundary;
@@ -0,0 +1,12 @@
1
+ import * as $ from 'svelte/internal/server';
2
+ import { provideComponentParts } from "./component-parts.js";
3
+
4
+ export default function ComponentPartsBoundary($$renderer, $$props) {
5
+ $$renderer.component(($$renderer) => {
6
+ let { children } = $$props;
7
+
8
+ provideComponentParts(() => undefined);
9
+ children?.($$renderer);
10
+ $$renderer.push(`<!---->`);
11
+ });
12
+ }
@@ -0,0 +1,5 @@
1
+ import type { FrameProps } from "./frame-types";
2
+ /** 单行组合复用现有Frame自动布局;显式关闭协议时一并关闭预设。 */
3
+ export declare function isSingleLineLayout(props: FrameProps): boolean;
4
+ /** 间距仍消费原Token,只对显式单行组合应用Owner要求的4 CSS px下限。 */
5
+ export declare function contentLineGap(value: number | string | undefined, singleLine?: boolean): string | undefined;
@@ -0,0 +1,13 @@
1
+ /** 单行组合复用现有Frame自动布局;显式关闭协议时一并关闭预设。 */
2
+ export function isSingleLineLayout(props) {
3
+ return props.singleLine === true && props.enableAutoLayout !== false;
4
+ }
5
+ /** 间距仍消费原Token,只对显式单行组合应用Owner要求的4 CSS px下限。 */
6
+ export function contentLineGap(value, singleLine = false) {
7
+ if (value === undefined || value === null)
8
+ return undefined;
9
+ const preferred = value === 0 || value === "0" ? "0px" : typeof value === "number"
10
+ ? `var(--gap-${value}, calc(4px * ${value} * var(--gap-scale, 1)))`
11
+ : String(value);
12
+ return singleLine ? `max(4px, ${preferred})` : preferred;
13
+ }
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * frame-dom-runtime.svelte.ts
3
- * v1.0.0
3
+ * v1.0.1
4
4
  * 职责:统一拼装 Frame 根节点的 DOM props、事件包装器与运行时 data 属性。
5
5
  *
6
6
  * Log:
7
+ * - [2026-10-18] Fix: 事件包装器改读稳定源状态,避免同步卸载后读取已销毁派生状态,并保留同一事件中的实时禁用/加载语义。
7
8
  * - [2026-03-09] Init: 从 Frame.svelte 抽离 DOM 透传过滤、disabled/aria 补齐、readonly capture、原生事件包装与 data-* 运行时属性组装。
8
9
  */
9
10
  import type { FrameProps } from "./frame-types";
@@ -71,6 +72,7 @@ export declare function createFrameDomRuntime(options: FrameDomRuntimeOptions):
71
72
  "data-content-width": string;
72
73
  "data-state": import("./frame-types").CoreState | undefined;
73
74
  "data-first-line": string | undefined;
75
+ "data-single-line": string | undefined;
74
76
  "data-auto-layout": string | undefined;
75
77
  };
76
78
  };
@@ -1,5 +1,6 @@
1
1
  /* frame-dom-runtime.svelte.js generated by Svelte v5.56.4 */
2
2
  import * as $ from 'svelte/internal/server';
3
+ import { isSingleLineLayout } from "./content-line.js";
3
4
  import { filterFrameDomProps } from "./frame-prop-filter.js";
4
5
  import { createReadonlyHandler } from "./frame-utils.js";
5
6
 
@@ -93,7 +94,7 @@ export function createFrameDomRuntime(options) {
93
94
 
94
95
  function wrap(handler, internal) {
95
96
  return (e) => {
96
- if (filteredProps().disabled || options.frameState.currentState === "Disabled" || options.getEffectiveLoading()) {
97
+ if (!!options.getFrameProps().disabled || options.frameState.currentState === "Disabled" || options.getEffectiveLoading()) {
97
98
  e.preventDefault();
98
99
  e.stopPropagation();
99
100
 
@@ -167,8 +168,9 @@ export function createFrameDomRuntime(options) {
167
168
  // 暴露 currentState 供组件 CSS 与消费方按状态着色(如 [data-state="Active"])。
168
169
  // 命名沿用 FrameState 的 PascalCase("Idle" / "Active" / "Hover" / "Pending" / "Load" / "StartLoad" / "Disabled")。
169
170
  "data-state": options.frameState.currentState || undefined,
170
- "data-first-line": frameProps.firstLine === true ? "true" : undefined,
171
- "data-auto-layout": (frameProps.row || frameProps.column || frameProps.enableAutoLayout === true) && frameProps.enableAutoLayout !== false ? "true" : undefined
171
+ "data-first-line": frameProps.firstLine === true && !isSingleLineLayout(frameProps) ? "true" : undefined,
172
+ "data-single-line": isSingleLineLayout(frameProps) ? "true" : undefined,
173
+ "data-auto-layout": (frameProps.row || frameProps.column || isSingleLineLayout(frameProps) || frameProps.enableAutoLayout === true) && frameProps.enableAutoLayout !== false ? "true" : undefined
172
174
  };
173
175
  });
174
176
 
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * Frame Field Control
3
5
  * v1.0.0
@@ -1,5 +1,6 @@
1
1
  /* frame-inline-style.svelte.js generated by Svelte v5.56.4 */
2
2
  import * as $ from 'svelte/internal/server';
3
+ import { contentLineGap, isSingleLineLayout } from "./content-line.js";
3
4
  import { motionConfigToStyle } from "./frame-utils.js";
4
5
  import { FRAME_MOTION_DEFAULTS, resolveFrameWhileMotionConfigs } from "./frame-motion-defaults.js";
5
6
  import { resolveScaleStyleVars } from "./frame-scale-resolver.js";
@@ -182,9 +183,7 @@ function buildDirectLayoutStyle(frameProps) {
182
183
  const styles = [
183
184
  gap === undefined || gap === null
184
185
  ? ""
185
- : typeof gap === "number"
186
- ? `gap: var(--gap-${gap}, calc(4px * ${gap} * var(--gap-scale, 1)))`
187
- : `gap: ${gap}`,
186
+ : `gap: ${contentLineGap(gap, isSingleLineLayout(frameProps))}`,
188
187
 
189
188
  frameProps.width === undefined || frameProps.width === null
190
189
  ? ""
@@ -1,5 +1,6 @@
1
1
  /* frame-layout.svelte.js generated by Svelte v5.56.4 */
2
2
  import * as $ from 'svelte/internal/server';
3
+ import { isSingleLineLayout } from "./content-line.js";
3
4
 
4
5
  const BREAKPOINTS = ["xs", "sm", "md", "lg", "xl", "2xl"];
5
6
 
@@ -14,6 +15,8 @@ export class FrameLayout {
14
15
  }
15
16
 
16
17
  get direction() {
18
+ if (isSingleLineLayout(this.#props)) return this.#props.reverse ? "row-reverse" : "row";
19
+
17
20
  // 1. 获取基础方向
18
21
  let activeDir = this.#getBaseDirection();
19
22
 
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * frame-motion-defaults.ts
3
5
  * v1.8.0
@@ -1,34 +1,26 @@
1
- /**
2
- * OSS Frame 动效控制器(v1.0.0 起在 OSS)
3
- *
4
- * 与 PRO 版本(components/src/logic/frame-pro-motion.svelte.ts)的差异:
5
- * - 不依赖 Motion 编排器(PRO `motion.svelte.ts`)
6
- * - 不向 Motion 注册自身(无 `register` / `notify` 调用)
7
- * - 不实现 `orchestrate*` 编排触发(4 处 $effect 已剥离)
8
- * - controller 仅暴露 FLIP 自身转场方法(`captureFlip` / `playFlipTo`),不暴露 `play` / `reset` / `captureLayout` / `playLayoutTo` 等需要 Motion 上下文的方法
9
- *
10
- * OSS 支持的能力:
11
- * - layoutId / itemId 自身 FLIP 进场(自动从 layout-flip 模块注册表读取起点)
12
- * - whileScroll 自身滚动联动
13
- * - whileAppear / whileHover / whileActive 等通过 CSS bridge 变量(由 frame-motion-defaults.ts 注入)由浏览器原生 transition 执行
14
- *
15
- * 作用半径:1 个 Frame
16
- *
17
- * PRO 版本独立维护一份完整实现,FramePro 使用 PRO 版本。
18
- * 详见 ../components/Frame.md §1 切割原则与 /Frame-Refactor-Plan.md §3.4。
19
- */
20
1
  import type { FrameProps } from "./frame-types";
2
+ import type { LayoutTransitionOptions } from "./motion-types";
3
+ import type { Motion } from "./motion.js";
21
4
  import type { FrameState } from "./frame-state.js";
5
+ import type { FrameResponsive } from "./frame-responsive.js";
22
6
  import { type FlipTransitionOptions } from "./layout-flip";
23
7
  export declare class FrameMotion {
24
8
  #private;
25
- constructor(props: FrameProps, state: FrameState, getId: () => string | undefined, getElement: () => HTMLElement | undefined);
26
- /** OSS 不需要 shouldRegister 概念,但保留 getter 以兼容旧调用方(始终返回 false) */
9
+ constructor(props: FrameProps, motion: Motion | undefined, state: FrameState, responsive: FrameResponsive | null, getId: () => string | undefined, getElement: () => HTMLElement | undefined);
27
10
  get shouldRegister(): boolean;
28
11
  get controller(): {
29
- /** 捕获当前 Frame 位置写入模块级 FLIP 注册表,无需 Motion 上下文。 */
12
+ play: (options?: {
13
+ reverse?: boolean;
14
+ }) => void;
15
+ captureLayout: (layoutId?: string) => void;
16
+ playLayoutTo: (target?: HTMLElement | DOMRect, options?: LayoutTransitionOptions & {
17
+ layoutId?: string;
18
+ }) => void;
19
+ /** 捕获当前 Frame 位置写入模块级 FLIP 注册表,无需 initMotion 上下文。 */
30
20
  captureFlip: (layoutId?: string) => void;
31
- /** 将当前 Frame 以 FLIP 方式过渡到目标位置,无需 Motion 上下文。 */
21
+ /** 将当前 Frame 以 FLIP 方式过渡到目标位置,无需 initMotion 上下文。 */
32
22
  playFlipTo: (target?: HTMLElement | DOMRect, options?: FlipTransitionOptions) => void;
23
+ reset: () => void;
24
+ pause: () => void;
33
25
  };
34
26
  }
@@ -1,47 +1,80 @@
1
1
  /* frame-motion.svelte.js generated by Svelte v5.56.4 */
2
2
  import * as $ from 'svelte/internal/server';
3
+ import { hasMotionConfig } from "./frame-utils.js";
3
4
  import { captureFlipRect, beginFlipEnter, applyFlipExit } from "./layout-flip.js";
4
5
 
5
6
  export class FrameMotion {
6
7
  #props;
8
+ #motion;
7
9
  #state;
10
+ #responsive;
8
11
  #getId;
9
12
  #getElement;
10
13
 
11
- constructor(props, state, getId, getElement) {
14
+ constructor(props, motion, state, responsive, getId, getElement) {
12
15
  this.#props = props;
16
+ this.#motion = motion;
13
17
  this.#state = state;
18
+ this.#responsive = responsive;
14
19
  this.#getId = getId;
15
20
  this.#getElement = getElement;
16
- // 注:OSS 不接受 FrameResponsive 参数(PRO 用它做 whileXs/Sm/... 断点 notify,
17
- // OSS 不向编排器 notify,断点动效由 frame-motion-defaults 写入 CSS bridge 完成)
18
- // === 独立 FLIP 进场 ===
19
- // layoutId/itemId 存在时尝试从模块注册表(layout-flip.ts)读取起点并播放进场动效。
20
- // 与 PRO 不同:OSS 不向 Motion 编排器注册,所以这是唯一的 FLIP 进场路径。
21
- // === whileScroll 触发器 ===
22
- // 注:OSS 不实现 PRO 的以下能力
23
- // - 注册到 Motion 编排器(PRO line 49-58)
24
- // - 状态→Motion notify 差量更新(PRO line 67-111)
25
- // - 生命周期 whileAppear/whileDisappear notify(PRO line 114-132)
26
- // - orchestrateTrigger: appear/hover/click/scroll(PRO line 121-165)
27
- // - 响应式断点 whileXs/Sm/Md/Lg/Xl/2xl notify(PRO line 168-185)
28
- //
29
- // 在 OSS 中:
30
- // - 状态驱动的视觉变化(hover/focus/active 等)通过 frame-inline-style 注入的 CSS bridge
31
- // 变量配合组件 CSS 的 transition 实现,由浏览器原生执行
32
- // - whileAppear 生命周期进入组合动效通过 frame-motion-defaults 写入 CSS 变量后
33
- // 组件 CSS / Frame 默认 CSS 完成
34
- // - 跨组件编排(orchestrate*)属 PRO,OSS 静默忽略相关 props
21
+
22
+ // 注册到编排器,并触发独立 FLIP 进场(无需 Motion 上下文)
23
+ // 独立 FLIP 进场:layoutId/itemId 存在时尝试从模块注册表读取起点
24
+ // === 状态变化 -> 动效通知 (合并优化) ===
25
+ // 使用单一 effect 替代多个独立 effect,减少响应式订阅开销
26
+ // 缓存上一次的触发器状态,用于差量更新
27
+ let prevTriggerStates = {};
28
+
29
+ // 收集所有触发器状态
30
+ // 仅通知发生变化的触发器
31
+ // 生命周期通知 (单独保留,因为需要 cleanup)
32
+ // === 编排触发逻辑 ===
33
+ // 根据 orchestrateTrigger 决定何时触发编排
34
+ // 使用微任务或下一帧确保子组件已挂载并注册
35
+ // === orchestrateTrigger: hover ===
36
+ // === orchestrateTrigger: click ===
37
+ // === orchestrateTrigger: scroll ===
38
+ // 响应式断点通知
39
+ let prevBreakpoint;
40
+ // Setup whileScroll trigger
35
41
  }
36
42
 
37
- /** OSS 不需要 shouldRegister 概念,但保留 getter 以兼容旧调用方(始终返回 false) */
38
43
  get shouldRegister() {
39
- return false;
44
+ const id = this.#getId();
45
+
46
+ return !!id || hasMotionConfig(this.#props);
40
47
  }
41
48
 
42
49
  get controller() {
43
50
  return {
44
- /** 捕获当前 Frame 位置写入模块级 FLIP 注册表,无需 Motion 上下文。 */
51
+ play: (options) => {
52
+ const id = this.#getId();
53
+
54
+ if (id && this.#motion) this.#motion.Play(id, options);
55
+ },
56
+
57
+ captureLayout: (layoutId) => {
58
+ const id = layoutId ?? this.#props.itemId ?? this.#props.layoutId ?? this.#getId();
59
+ const element = this.#getElement();
60
+
61
+ if (id && element && this.#motion) {
62
+ this.#motion.captureLayout(id, element);
63
+ }
64
+ },
65
+
66
+ playLayoutTo: (target, options) => {
67
+ const id = options?.layoutId ?? this.#props.itemId ?? this.#props.layoutId ?? this.#getId();
68
+ const element = this.#getElement();
69
+
70
+ if (id && element && this.#motion) {
71
+ this.#motion.playLayoutTo(id, element, target, options);
72
+ } else {
73
+ options?.onComplete?.();
74
+ }
75
+ },
76
+
77
+ /** 捕获当前 Frame 位置写入模块级 FLIP 注册表,无需 initMotion 上下文。 */
45
78
  captureFlip: (layoutId) => {
46
79
  const id = layoutId ?? this.#props.itemId ?? this.#props.layoutId ?? this.#getId();
47
80
  const element = this.#getElement();
@@ -49,7 +82,7 @@ export class FrameMotion {
49
82
  if (id && element) captureFlipRect(id, element);
50
83
  },
51
84
 
52
- /** 将当前 Frame 以 FLIP 方式过渡到目标位置,无需 Motion 上下文。 */
85
+ /** 将当前 Frame 以 FLIP 方式过渡到目标位置,无需 initMotion 上下文。 */
53
86
  playFlipTo: (target, options) => {
54
87
  const element = this.#getElement();
55
88
 
@@ -58,15 +91,28 @@ export class FrameMotion {
58
91
  } else {
59
92
  options?.onComplete?.();
60
93
  }
61
- }
94
+ },
95
+
96
+ reset: () => {
97
+ const id = this.#getId();
62
98
 
63
- // 以下方法在 OSS 中不可用(需要 Motion 编排器):
64
- // - play / reset / pause(需要 Motion.Play/Reset/pause)
65
- // - captureLayout / playLayoutTo(需要 Motion.captureLayout/playLayoutTo)
66
- // 如需以上能力请使用 FramePro。
99
+ if (id && this.#motion) this.#motion.Reset(id);
100
+ },
101
+
102
+ pause: () => {
103
+ // TODO
104
+ }
67
105
  };
68
106
  }
69
107
 
108
+ #notify(event, detail) {
109
+ const id = this.#getId();
110
+
111
+ if (!this.#motion || !this.shouldRegister || !id) return;
112
+
113
+ this.#motion.notify(id, event, detail);
114
+ }
115
+
70
116
  #setupWhileScroll() {
71
117
  const element = this.#getElement();
72
118
 
@@ -4,7 +4,7 @@
4
4
  * - 过滤内部关键字,避免透传到 DOM
5
5
  * - 为 Input / Textarea 这类“Frame 外壳 + 原生宿主元素”组件提供共享的 props 分发能力
6
6
  */
7
- export declare const FRAME_INTERNAL_PROP_KEYS: readonly ["enableResponsive", "enableContext", "enableScaleObserver", "enableDefaultMotion", "enableAutoLayout", "componentParts", "contentFill", "contentHug", "pinOffset", "pinOffsetX", "pinOffsetY", "scope", "lines", "onTruncate", "access", "responsive", "scaleHeightVar", "scaleWidthVar", "scaleAspectRatioVar", "scaleSizeVar", "scaleObserverTarget", "scaleBasis", "scaleMixHeightWeight", "scaleAspectBaseRatio", "sizeRatio", "iconSizeRatio", "avatarSizeRatio", "loopMotion", "loading", "disabled", "skeleton", "renderHints", "customStates", "stateContent", "styles", "padding", "gap", "radius", "border", "innerBorder", "fontSize", "minWidth", "minHeight", "width", "height", "opacity", "size", "iconSize", "avatarSize", "collapsed", "expanded", "row", "firstLine", "column", "grid", "reverse", "whileHover", "whileClick", "whileFocus", "whileDrag", "whileScroll", "whileKey", "whileLoad", "whileReload", "whileActive", "whileDisabled", "whileAppear", "whileDisappear", "whileIdle", "whileValidating", "whileUploading", "whileEditing", "whileCollapsed", "whileExpanded", "whileXs", "whileSm", "whileMd", "whileLg", "whileXl", "while2xl", "variants", "scroll", "timeline", "layoutId", "itemId", "orchestrate", "orchestrateMode", "orchestrateDelay", "orchestrateOrder", "orchestrateTrigger", "orchestrateTarget", "orchestrateGroup", "morph", "tag", "as", "element", "use", "currentState", "Click", "Hover", "Focus", "Key", "Drag", "Scroll", "Active", "Load", "Reload", "StartLoad", "Appear", "Disappear", "Idle", "Disabled", "Validating", "Uploading", "Editing", "onReload", "stateVars", "stateClass", "stateStyle"];
7
+ export declare const FRAME_INTERNAL_PROP_KEYS: readonly ["enableResponsive", "enableContext", "enableScaleObserver", "enableDefaultMotion", "enableAutoLayout", "componentParts", "contentFill", "contentHug", "pinOffset", "pinOffsetX", "pinOffsetY", "scope", "lines", "onTruncate", "access", "responsive", "scaleHeightVar", "scaleWidthVar", "scaleAspectRatioVar", "scaleSizeVar", "scaleObserverTarget", "scaleBasis", "scaleMixHeightWeight", "scaleAspectBaseRatio", "sizeRatio", "iconSizeRatio", "avatarSizeRatio", "loopMotion", "loading", "disabled", "skeleton", "renderHints", "customStates", "stateContent", "styles", "padding", "gap", "radius", "border", "innerBorder", "fontSize", "minWidth", "minHeight", "width", "height", "opacity", "size", "iconSize", "avatarSize", "collapsed", "expanded", "row", "firstLine", "singleLine", "column", "grid", "reverse", "whileHover", "whileClick", "whileFocus", "whileDrag", "whileScroll", "whileKey", "whileLoad", "whileReload", "whileActive", "whileDisabled", "whileAppear", "whileDisappear", "whileIdle", "whileValidating", "whileUploading", "whileEditing", "whileCollapsed", "whileExpanded", "whileXs", "whileSm", "whileMd", "whileLg", "whileXl", "while2xl", "variants", "scroll", "timeline", "layoutId", "itemId", "orchestrate", "orchestrateMode", "orchestrateDelay", "orchestrateOrder", "orchestrateTrigger", "orchestrateTarget", "orchestrateGroup", "morph", "tag", "as", "element", "use", "currentState", "Click", "Hover", "Focus", "Key", "Drag", "Scroll", "Active", "Load", "Reload", "StartLoad", "Appear", "Disappear", "Idle", "Disabled", "Validating", "Uploading", "Editing", "onReload", "stateVars", "stateClass", "stateStyle"];
8
8
  export declare const FRAME_INTERNAL_PROP_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp];
9
9
  export interface FrameEventHandlers {
10
10
  [key: string]: any;
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * Frame 属性过滤器
3
5
  * - 分离原生事件处理器
@@ -81,6 +83,7 @@ export const FRAME_INTERNAL_PROP_KEYS = [
81
83
  "expanded",
82
84
  "row",
83
85
  "firstLine",
86
+ "singleLine",
84
87
  "column",
85
88
  "grid",
86
89
  "reverse",
@@ -2,6 +2,7 @@
2
2
  import * as $ from 'svelte/internal/server';
3
3
  import { getContext } from "svelte";
4
4
  import { FRAME_BREAKPOINTS_CONTEXT_KEY } from "../keys.js";
5
+ import { isSingleLineLayout } from "./content-line.js";
5
6
  import { resizeManager } from "./observer.js";
6
7
 
7
8
  const DEFAULT_MIN_SPACING = 4;
@@ -108,7 +109,7 @@ export class FrameResponsive {
108
109
  }
109
110
 
110
111
  get fitDirection() {
111
- return this.fitActive ? this.config?.direction : undefined;
112
+ return this.fitActive && !isSingleLineLayout(this.#getProps()) ? this.config?.direction : undefined;
112
113
  }
113
114
 
114
115
  get breakpoint() {
@@ -184,7 +185,7 @@ export class FrameResponsive {
184
185
  #applyFallbackAttributes(node) {
185
186
  const config = this.config;
186
187
 
187
- if (!this.fitActive || !config) {
188
+ if (!this.fitActive || !config || isSingleLineLayout(this.#getProps())) {
188
189
  node.removeAttribute("data-responsive-layout");
189
190
  node.removeAttribute("data-responsive-align");
190
191
  node.removeAttribute("data-responsive-justify");
@@ -228,8 +229,16 @@ export class FrameResponsive {
228
229
  this.#restoreSpacing(node);
229
230
 
230
231
  const computed = getComputedStyle(node);
231
- const gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
232
- const gapFloor = resolveFloor(gap, this.config?.minGap);
232
+ let gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
233
+
234
+ if (isSingleLineLayout(this.#getProps()) && gap < 4) {
235
+ gap = 4;
236
+ node.style.setProperty("gap", "4px");
237
+ }
238
+
239
+ const gapFloor = isSingleLineLayout(this.#getProps())
240
+ ? Math.max(4, resolveFloor(gap, this.config?.minGap))
241
+ : resolveFloor(gap, this.config?.minGap);
233
242
 
234
243
  node.style.setProperty("gap", `${gapFloor}px`);
235
244
 
@@ -254,7 +263,12 @@ export class FrameResponsive {
254
263
  const isFlex = computed.display === "flex" || computed.display === "inline-flex";
255
264
  const isRow = isFlex && (direction === "row" || direction === "row-reverse");
256
265
  const children = Array.from(node.children).filter(isMeasurableChild);
257
- const gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
266
+ let gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
267
+
268
+ if (isSingleLineLayout(this.#getProps()) && gap < 4) {
269
+ gap = 4;
270
+ node.style.setProperty("gap", "4px");
271
+ }
258
272
 
259
273
  const padding = {
260
274
  top: px(computed.paddingTop),
@@ -279,7 +293,9 @@ export class FrameResponsive {
279
293
 
280
294
  if (preferredWidth <= width + EPSILON) return;
281
295
 
282
- const gapFloor = resolveFloor(gap, this.config?.minGap);
296
+ const gapFloor = isSingleLineLayout(this.#getProps())
297
+ ? Math.max(4, resolveFloor(gap, this.config?.minGap))
298
+ : resolveFloor(gap, this.config?.minGap);
283
299
 
284
300
  const paddingFloor = {
285
301
  top: resolvePaddingFloor(padding.top, this.config?.minPadding, "top"),
@@ -1,17 +1,5 @@
1
- /**
2
- * OSS Frame 状态机(v1.0.0 起在 OSS)
3
- *
4
- * 与 PRO 版本(components/src/logic/frame-pro-state.svelte.ts)的差异:
5
- * - 不含 §8 联动控制(linkageControl / Motion 依赖)
6
- * - 构造函数不接收 motion 参数
7
- * - 事件处理器中的 `if ("target" in config) { ... }` 分支被剥离
8
- *
9
- * 作用半径:1 个 Frame(仅修改自身 currentState 与交互状态)
10
- *
11
- * PRO 版本独立维护一份完整实现,FramePro 使用 PRO 版本。
12
- * 详见 ../components/Frame.md §1 切割原则与 /Frame-Refactor-Plan.md §3.4。
13
- */
14
1
  import type { FrameProps, CoreState } from "./frame-types";
2
+ import type { Motion } from "./motion.js";
15
3
  export declare class FrameState {
16
4
  #private;
17
5
  hovered: boolean;
@@ -21,7 +9,7 @@ export declare class FrameState {
21
9
  isScrolling: boolean;
22
10
  isKeyActive: boolean;
23
11
  currentState: CoreState;
24
- constructor(props: FrameProps);
12
+ constructor(props: FrameProps, motion?: Motion | undefined);
25
13
  get interactionState(): (string & {}) | "StartLoad" | "Load" | "Reload" | "Appear" | "Disappear" | "Idle" | "Active" | "Disabled" | "Validating" | "Uploading" | "Editing" | "Click" | "Hover" | "Focus" | "Drag" | "Scroll";
26
14
  get isAnyTriggerActive(): boolean | undefined;
27
15
  handleClick: (e: MouseEvent) => void;
@@ -4,6 +4,7 @@ import { resolveFrameWhileMotionConfig } from "./frame-motion-defaults.js";
4
4
 
5
5
  export class FrameState {
6
6
  #props;
7
+ #motion;
7
8
 
8
9
  // === 交互状态 (Internal Interaction States) ===
9
10
  hovered = false;
@@ -17,8 +18,9 @@ export class FrameState {
17
18
  // === 核心状态 (Core State) ===
18
19
  currentState = "Idle";
19
20
 
20
- constructor(props) {
21
+ constructor(props, motion = undefined) {
21
22
  this.#props = props;
23
+ this.#motion = motion;
22
24
  // 状态变化时处理链式转变
23
25
  // 执行回调
24
26
  // Reload 状态时调用 onReload 回调
@@ -137,7 +139,7 @@ export class FrameState {
137
139
  return false;
138
140
  }
139
141
 
140
- // 这些字段属于普通 Trigger/Linkage 配置,不视为"按状态映射"
142
+ // 这些字段属于普通 Trigger/Linkage 配置,不视为“按状态映射”
141
143
  const reservedKeys = [
142
144
  "run",
143
145
  "target",
@@ -196,8 +198,9 @@ export class FrameState {
196
198
  this.currentState = config.next;
197
199
  }
198
200
 
199
- // OSS Frame 不支持 §8 联动控制 (Click={{target, action}})。
200
- // 配置中带 target 字段时,OSS 会忽略;如需联动控制请使用 FramePro。
201
+ if ("target" in config) {
202
+ this.#handleLinkageControl(config);
203
+ }
201
204
  }
202
205
  }
203
206
 
@@ -248,7 +251,9 @@ export class FrameState {
248
251
  Hover.run(e);
249
252
  }
250
253
 
251
- // OSS 忽略 target/action(§8 联动控制属 PRO)
254
+ if ("target" in Hover) {
255
+ this.#handleLinkageControl(Hover);
256
+ }
252
257
  }
253
258
  }
254
259
  };
@@ -307,7 +312,9 @@ export class FrameState {
307
312
  Focus.run(e);
308
313
  }
309
314
 
310
- // OSS 忽略 target/action(§8 联动控制属 PRO)
315
+ if ("target" in Focus) {
316
+ this.#handleLinkageControl(Focus);
317
+ }
311
318
  }
312
319
  }
313
320
  };
@@ -329,9 +336,9 @@ export class FrameState {
329
336
  Key.run(e);
330
337
  } else if ("state" in Key) {
331
338
  this.currentState = Key.state;
339
+ } else if ("target" in Key) {
340
+ this.#handleLinkageControl(Key);
332
341
  }
333
-
334
- // OSS 忽略 target/action(§8 联动控制属 PRO)
335
342
  }
336
343
  };
337
344
 
@@ -374,7 +381,9 @@ export class FrameState {
374
381
  Drag.run(e);
375
382
  }
376
383
 
377
- // OSS 忽略 target/action(§8 联动控制属 PRO)
384
+ if ("target" in Drag) {
385
+ this.#handleLinkageControl(Drag);
386
+ }
378
387
  }
379
388
  }
380
389
  };
@@ -391,4 +400,46 @@ export class FrameState {
391
400
  handleScroll = (_e) => {
392
401
  // Reserved
393
402
  };
403
+
404
+ #handleLinkageControl(config) {
405
+ if (config.target) {
406
+ // 1. Resolve Target Controller
407
+ let controller;
408
+
409
+ if (typeof config.target === 'string') {
410
+ // String ID -> Use internal motion instance
411
+ // No controller object for string IDs, handled in step 2 directly via this.#motion
412
+ } else if (typeof config.target === 'object') {
413
+ // Object Ref -> Try to get controller
414
+ // Case A: Svelte 5 bind:this instance with exported getController
415
+ if ('getController' in config.target && typeof config.target.getController === 'function') {
416
+ controller = config.target.getController();
417
+ } else // Case B: Maybe it IS the controller?
418
+ {
419
+ controller = config.target;
420
+ }
421
+ }
422
+
423
+ // 2. Execute Action
424
+ if (typeof config.target === 'string' && this.#motion) {
425
+ // Legacy String ID Logic
426
+ if (config.action === "play") {
427
+ this.#motion.Play(config.target, { reverse: config.reverse });
428
+ } else if (config.action === "reset") {
429
+ this.#motion.Reset(config.target);
430
+ } else if (config.action === "pause") {
431
+ this.#motion.pause(config.target);
432
+ }
433
+ } else if (controller) {
434
+ // Object Controller Logic
435
+ if (config.action === "play" && controller.play) {
436
+ controller.play({ reverse: config.reverse });
437
+ } else if (config.action === "reset" && controller.reset) {
438
+ controller.reset();
439
+ } else if (config.action === "pause" && controller.pause) {
440
+ controller.pause();
441
+ }
442
+ }
443
+ }
444
+ }
394
445
  }