@snowui-design-system/components 0.3.0-alpha.1 → 0.3.0-alpha.12

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 (413) hide show
  1. package/AGENTS.md +39 -0
  2. package/LICENSE +152 -91
  3. package/README.md +41 -7
  4. package/THIRD_PARTY_NOTICES.md +41 -0
  5. package/component-catalog.json +531 -84
  6. package/dist/client/blocks/Sidebar.js +183 -141
  7. package/dist/client/blocks/SidebarItem.js +27 -13
  8. package/dist/client/blocks/SidebarSection.js +11 -3
  9. package/dist/client/blocks/index.js +2 -0
  10. package/dist/client/compat.js +2 -0
  11. package/dist/client/components/Accordion.d.ts +2 -0
  12. package/dist/client/components/Accordion.js +37 -16
  13. package/dist/client/components/AccordionItem.js +1 -1
  14. package/dist/client/components/BarChart.js +10 -3
  15. package/dist/client/components/Breadcrumb.d.ts +1 -0
  16. package/dist/client/components/Breadcrumb.js +44 -18
  17. package/dist/client/components/Button.d.ts +2 -0
  18. package/dist/client/components/Button.js +6 -1
  19. package/dist/client/components/ChartGroup.js +23 -10
  20. package/dist/client/components/Checkbox.d.ts +2 -0
  21. package/dist/client/components/Checkbox.js +19 -4
  22. package/dist/client/components/Chip.js +2 -2
  23. package/dist/client/components/CircularChart.js +10 -3
  24. package/dist/client/components/CodeBlock.js +283 -226
  25. package/dist/client/components/CopyButton.js +5 -2
  26. package/dist/client/components/CopyLink.js +1 -1
  27. package/dist/client/components/DataTable.d.ts +8 -2
  28. package/dist/client/components/DataTable.js +9 -3
  29. package/dist/client/components/Dialog.js +1 -1
  30. package/dist/client/components/ExpandButton.js +10 -3
  31. package/dist/client/components/Field.js +3 -2
  32. package/dist/client/components/Frame.js +24 -16
  33. package/dist/client/components/GaugeChart.js +10 -3
  34. package/dist/client/components/Icon.js +6 -3
  35. package/dist/client/components/Image.d.ts +2 -0
  36. package/dist/client/components/Image.js +14 -2
  37. package/dist/client/components/ImageViewer.js +51 -27
  38. package/dist/client/components/Indicator.js +5 -3
  39. package/dist/client/components/Input.d.ts +1 -0
  40. package/dist/client/components/Input.js +51 -24
  41. package/dist/client/components/LineChart.js +10 -3
  42. package/dist/client/components/Link.d.ts +1 -1
  43. package/dist/client/components/Link.js +58 -30
  44. package/dist/client/components/Listbox.d.ts +2 -0
  45. package/dist/client/components/Listbox.js +98 -43
  46. package/dist/client/components/MenuItem.d.ts +2 -0
  47. package/dist/client/components/MenuItem.js +15 -2
  48. package/dist/client/components/OTPInput.d.ts +32 -0
  49. package/dist/client/components/OTPInput.js +556 -0
  50. package/dist/client/components/OverflowAction.d.ts +2 -0
  51. package/dist/client/components/OverflowAction.js +146 -65
  52. package/dist/client/components/OverflowActions.d.ts +7 -1
  53. package/dist/client/components/OverflowActions.js +102 -26
  54. package/dist/client/components/Pagination.js +117 -68
  55. package/dist/client/components/Radio.d.ts +2 -0
  56. package/dist/client/components/Radio.js +20 -5
  57. package/dist/client/components/ScrambleText.js +4 -1
  58. package/dist/client/components/ScrollArea.js +11 -5
  59. package/dist/client/components/SearchBox.d.ts +1 -0
  60. package/dist/client/components/SearchBox.js +32 -7
  61. package/dist/client/components/SearchInput.js +43 -3
  62. package/dist/client/components/Select.d.ts +1 -0
  63. package/dist/client/components/Select.js +65 -27
  64. package/dist/client/components/SidePanel.js +81 -54
  65. package/dist/client/components/Slider.d.ts +1 -1
  66. package/dist/client/components/Slider.js +36 -13
  67. package/dist/client/components/SnowUILogo.js +1 -1
  68. package/dist/client/components/Spinner.js +9 -2
  69. package/dist/client/components/Switch.d.ts +2 -0
  70. package/dist/client/components/Switch.js +18 -3
  71. package/dist/client/components/Tab.js +90 -81
  72. package/dist/client/components/Table.js +30 -16
  73. package/dist/client/components/TableBody.js +10 -4
  74. package/dist/client/components/TableCell.d.ts +1 -0
  75. package/dist/client/components/TableCell.js +100 -50
  76. package/dist/client/components/TableHead.js +72 -39
  77. package/dist/client/components/TableToolbar.js +217 -141
  78. package/dist/client/components/Tag.js +21 -3
  79. package/dist/client/components/Text.js +163 -83
  80. package/dist/client/components/Textarea.js +8 -2
  81. package/dist/client/components/Toast.js +9 -2
  82. package/dist/client/components/Toaster.d.ts +2 -0
  83. package/dist/client/components/Toaster.js +51 -37
  84. package/dist/client/components/Tooltip.js +229 -201
  85. package/dist/client/context.js +2 -0
  86. package/dist/client/dev.js +2 -0
  87. package/dist/client/i18n/messages.d.ts +2 -2
  88. package/dist/client/i18n/messages.js +177 -1
  89. package/dist/client/index.d.ts +4 -1
  90. package/dist/client/index.js +5 -1
  91. package/dist/client/internal/code-block/prettier-svelte.d.ts +2 -0
  92. package/dist/client/internal/component-icon/index.js +2 -0
  93. package/dist/client/internal/snow-ui-logo/Wordmark.js +21 -9
  94. package/dist/client/internal/snow-ui-logo/emoji-metrics.js +2 -0
  95. package/dist/client/keys.d.ts +1 -0
  96. package/dist/client/keys.js +3 -0
  97. package/dist/client/lib/adaptive-contrast-renderer.js +2 -0
  98. package/dist/client/lib/chart/ChartHoverPanel.js +1 -1
  99. package/dist/client/lib/chart/appearance-timeline.js +2 -0
  100. package/dist/client/lib/chart/arc-path.js +2 -0
  101. package/dist/client/lib/chart/colors.js +2 -0
  102. package/dist/client/lib/chart/size.js +2 -0
  103. package/dist/client/lib/clipboard.js +2 -0
  104. package/dist/client/lib/color.js +2 -0
  105. package/dist/client/lib/date-format.js +2 -0
  106. package/dist/client/lib/edge-fade.js +2 -0
  107. package/dist/client/lib/media-loading.d.ts +7 -0
  108. package/dist/client/lib/media-loading.js +12 -0
  109. package/dist/client/lib/number-format.js +8 -0
  110. package/dist/client/lib/overflow-actions-motion.js +2 -0
  111. package/dist/client/lib/overlay-scrollbar.d.ts +1 -0
  112. package/dist/client/lib/overlay-scrollbar.js +9 -0
  113. package/dist/client/lib/overlay-trigger-timing.js +2 -0
  114. package/dist/client/lib/progressive-blur.d.ts +13 -0
  115. package/dist/client/lib/progressive-blur.js +54 -0
  116. package/dist/client/lib/responsive-exit.js +2 -0
  117. package/dist/client/lib/search-filter.js +2 -0
  118. package/dist/client/lib/side-panel.js +2 -0
  119. package/dist/client/lib/split-pane.js +2 -0
  120. package/dist/client/lib/table-column-motion.js +2 -0
  121. package/dist/client/lib/table-context.d.ts +5 -0
  122. package/dist/client/lib/table-context.js +4 -1
  123. package/dist/client/lib/table-responsive.d.ts +1 -1
  124. package/dist/client/lib/table-responsive.js +41 -7
  125. package/dist/client/lib/table-selection-fade.js +2 -0
  126. package/dist/client/lib/table-truncation.js +2 -0
  127. package/dist/client/lib/text-motion/animation.js +2 -0
  128. package/dist/client/lib/text-motion/character.js +2 -0
  129. package/dist/client/lib/text-motion/color.js +2 -0
  130. package/dist/client/lib/text-motion/layout.js +2 -0
  131. package/dist/client/lib/text-motion/preference.js +2 -0
  132. package/dist/client/lib/text-motion/sequence.js +2 -0
  133. package/dist/client/lib/text-motion/typography.js +2 -0
  134. package/dist/client/lib/tooltip-delay.js +2 -0
  135. package/dist/client/lib/tooltip-motion-dismiss.js +2 -0
  136. package/dist/client/lib/tooltip-pointer-speed.js +2 -0
  137. package/dist/client/lib/truncate.js +2 -0
  138. package/dist/client/logic/ComponentPartsBoundary.d.ts +7 -0
  139. package/dist/client/logic/ComponentPartsBoundary.js +15 -0
  140. package/dist/client/logic/content-line.d.ts +5 -0
  141. package/dist/client/logic/content-line.js +13 -0
  142. package/dist/client/logic/frame-dom-runtime.d.ts +3 -1
  143. package/dist/client/logic/frame-dom-runtime.js +5 -3
  144. package/dist/client/logic/frame-field-control.js +2 -0
  145. package/dist/client/logic/frame-inline-style.js +2 -3
  146. package/dist/client/logic/frame-layout.js +3 -0
  147. package/dist/client/logic/frame-motion-defaults.js +2 -0
  148. package/dist/client/logic/frame-prop-filter.d.ts +1 -1
  149. package/dist/client/logic/frame-prop-filter.js +3 -0
  150. package/dist/client/logic/frame-responsive.js +22 -6
  151. package/dist/client/logic/frame-types.d.ts +2 -0
  152. package/dist/client/logic/geometry-cache.js +2 -0
  153. package/dist/client/logic/layout-flip.js +2 -0
  154. package/dist/client/logic/morph.js +2 -0
  155. package/dist/client/logic/motion-engine.js +2 -0
  156. package/dist/client/logic/motion-orchestration.js +2 -0
  157. package/dist/client/logic/motion-types.js +2 -0
  158. package/dist/client/logic/overflow-actions.d.ts +11 -2
  159. package/dist/client/logic/overflow-actions.js +5 -0
  160. package/dist/client/logic/toast.js +7 -4
  161. package/dist/client/logic/wc-adapter.js +2 -0
  162. package/dist/client/motion/bridge.js +2 -0
  163. package/dist/client/motion/content-crossfade.js +2 -0
  164. package/dist/client/motion/expand.js +2 -0
  165. package/dist/client/motion/fade-in.js +2 -0
  166. package/dist/client/motion/fade-out.js +2 -0
  167. package/dist/client/motion/morph.js +2 -0
  168. package/dist/client/motion/move.js +2 -0
  169. package/dist/client/motion/number.js +2 -0
  170. package/dist/client/motion/replace.js +2 -0
  171. package/dist/client/motion/rotate.css +2 -0
  172. package/dist/client/motion/rotate.js +2 -0
  173. package/dist/client/motion/scale-in.js +2 -0
  174. package/dist/client/motion/tokens.js +2 -0
  175. package/dist/client/motion/while-2xl.js +2 -0
  176. package/dist/client/motion/while-active.js +2 -0
  177. package/dist/client/motion/while-appear.js +2 -0
  178. package/dist/client/motion/while-click.js +2 -0
  179. package/dist/client/motion/while-collapsed.js +2 -0
  180. package/dist/client/motion/while-disabled.js +2 -0
  181. package/dist/client/motion/while-disappear.js +2 -0
  182. package/dist/client/motion/while-drag.js +2 -0
  183. package/dist/client/motion/while-editing.js +2 -0
  184. package/dist/client/motion/while-expanded.js +2 -0
  185. package/dist/client/motion/while-focus.js +2 -0
  186. package/dist/client/motion/while-hover.js +2 -0
  187. package/dist/client/motion/while-idle.js +2 -0
  188. package/dist/client/motion/while-key.js +2 -0
  189. package/dist/client/motion/while-lg.js +2 -0
  190. package/dist/client/motion/while-load.js +2 -0
  191. package/dist/client/motion/while-md.js +2 -0
  192. package/dist/client/motion/while-reload.js +2 -0
  193. package/dist/client/motion/while-scroll.js +2 -0
  194. package/dist/client/motion/while-sm.js +2 -0
  195. package/dist/client/motion/while-uploading.js +2 -0
  196. package/dist/client/motion/while-validating.js +2 -0
  197. package/dist/client/motion/while-xl.js +2 -0
  198. package/dist/client/motion/while-xs.js +2 -0
  199. package/dist/client/styles/auto-layout.css +23 -1
  200. package/dist/client/styles/backdrop.css +2 -0
  201. package/dist/client/styles/components.css +14 -6
  202. package/dist/client/styles/index.css +2 -0
  203. package/dist/client/styles/layout.css +32 -6
  204. package/dist/client/styles/scale.css +2 -0
  205. package/dist/client/styles/scrollbar.css +16 -1
  206. package/dist/client/styles/themes.css +7 -4
  207. package/dist/client/styles/tokens.css +2 -0
  208. package/dist/client/vite-env.d.ts +2 -0
  209. package/dist/server/blocks/Sidebar.js +45 -25
  210. package/dist/server/blocks/SidebarItem.js +5 -3
  211. package/dist/server/blocks/SidebarSection.js +11 -3
  212. package/dist/server/blocks/index.js +2 -0
  213. package/dist/server/compat.js +2 -0
  214. package/dist/server/components/Accordion.d.ts +2 -0
  215. package/dist/server/components/Accordion.js +12 -1
  216. package/dist/server/components/AccordionItem.js +1 -1
  217. package/dist/server/components/BarChart.js +6 -3
  218. package/dist/server/components/Breadcrumb.d.ts +1 -0
  219. package/dist/server/components/Breadcrumb.js +26 -5
  220. package/dist/server/components/Button.d.ts +2 -0
  221. package/dist/server/components/Button.js +6 -1
  222. package/dist/server/components/ChartGroup.js +6 -3
  223. package/dist/server/components/Checkbox.d.ts +2 -0
  224. package/dist/server/components/Checkbox.js +16 -3
  225. package/dist/server/components/Chip.js +2 -2
  226. package/dist/server/components/CircularChart.js +6 -3
  227. package/dist/server/components/CodeBlock.js +27 -14
  228. package/dist/server/components/CopyButton.js +6 -2
  229. package/dist/server/components/CopyLink.js +1 -1
  230. package/dist/server/components/DataTable.d.ts +8 -2
  231. package/dist/server/components/DataTable.js +9 -3
  232. package/dist/server/components/Dialog.js +1 -1
  233. package/dist/server/components/ExpandButton.js +7 -3
  234. package/dist/server/components/Field.js +3 -2
  235. package/dist/server/components/Frame.js +19 -10
  236. package/dist/server/components/GaugeChart.js +6 -3
  237. package/dist/server/components/Icon.js +5 -4
  238. package/dist/server/components/Image.d.ts +2 -0
  239. package/dist/server/components/Image.js +11 -4
  240. package/dist/server/components/ImageViewer.js +6 -3
  241. package/dist/server/components/Indicator.js +5 -3
  242. package/dist/server/components/Input.d.ts +1 -0
  243. package/dist/server/components/Input.js +32 -22
  244. package/dist/server/components/LineChart.js +6 -3
  245. package/dist/server/components/Link.d.ts +1 -1
  246. package/dist/server/components/Link.js +22 -3
  247. package/dist/server/components/Listbox.d.ts +2 -0
  248. package/dist/server/components/Listbox.js +81 -22
  249. package/dist/server/components/MenuItem.d.ts +2 -0
  250. package/dist/server/components/MenuItem.js +9 -2
  251. package/dist/server/components/OTPInput.d.ts +32 -0
  252. package/dist/server/components/OTPInput.js +401 -0
  253. package/dist/server/components/OverflowAction.d.ts +2 -0
  254. package/dist/server/components/OverflowAction.js +70 -26
  255. package/dist/server/components/OverflowActions.d.ts +7 -1
  256. package/dist/server/components/OverflowActions.js +88 -30
  257. package/dist/server/components/Pagination.js +42 -22
  258. package/dist/server/components/Radio.d.ts +2 -0
  259. package/dist/server/components/Radio.js +15 -5
  260. package/dist/server/components/ScrambleText.js +4 -1
  261. package/dist/server/components/ScrollArea.js +5 -2
  262. package/dist/server/components/SearchBox.d.ts +1 -0
  263. package/dist/server/components/SearchBox.js +25 -5
  264. package/dist/server/components/SearchInput.js +12 -3
  265. package/dist/server/components/Select.d.ts +1 -0
  266. package/dist/server/components/Select.js +55 -20
  267. package/dist/server/components/SidePanel.js +33 -12
  268. package/dist/server/components/Slider.d.ts +1 -1
  269. package/dist/server/components/Slider.js +34 -11
  270. package/dist/server/components/SnowUILogo.js +1 -1
  271. package/dist/server/components/Spinner.js +4 -2
  272. package/dist/server/components/Switch.d.ts +2 -0
  273. package/dist/server/components/Switch.js +14 -3
  274. package/dist/server/components/Tab.js +62 -52
  275. package/dist/server/components/Table.js +16 -6
  276. package/dist/server/components/TableBody.js +9 -2
  277. package/dist/server/components/TableCell.d.ts +1 -0
  278. package/dist/server/components/TableCell.js +68 -25
  279. package/dist/server/components/TableHead.js +35 -8
  280. package/dist/server/components/TableToolbar.js +104 -55
  281. package/dist/server/components/Tag.js +17 -3
  282. package/dist/server/components/Text.js +64 -15
  283. package/dist/server/components/Textarea.js +5 -2
  284. package/dist/server/components/Toast.js +5 -2
  285. package/dist/server/components/Toaster.d.ts +2 -0
  286. package/dist/server/components/Toaster.js +17 -2
  287. package/dist/server/components/Tooltip.js +39 -16
  288. package/dist/server/context.js +2 -0
  289. package/dist/server/dev.js +2 -0
  290. package/dist/server/i18n/messages.d.ts +2 -2
  291. package/dist/server/i18n/messages.js +177 -1
  292. package/dist/server/index.d.ts +4 -1
  293. package/dist/server/index.js +5 -1
  294. package/dist/server/internal/code-block/prettier-svelte.d.ts +2 -0
  295. package/dist/server/internal/component-icon/index.js +2 -0
  296. package/dist/server/internal/snow-ui-logo/Wordmark.js +15 -7
  297. package/dist/server/internal/snow-ui-logo/emoji-metrics.js +2 -0
  298. package/dist/server/keys.d.ts +1 -0
  299. package/dist/server/keys.js +3 -0
  300. package/dist/server/lib/adaptive-contrast-renderer.js +2 -0
  301. package/dist/server/lib/chart/ChartHoverPanel.js +1 -1
  302. package/dist/server/lib/chart/appearance-timeline.js +2 -0
  303. package/dist/server/lib/chart/arc-path.js +2 -0
  304. package/dist/server/lib/chart/colors.js +2 -0
  305. package/dist/server/lib/chart/size.js +2 -0
  306. package/dist/server/lib/clipboard.js +2 -0
  307. package/dist/server/lib/color.js +2 -0
  308. package/dist/server/lib/date-format.js +2 -0
  309. package/dist/server/lib/edge-fade.js +2 -0
  310. package/dist/server/lib/media-loading.d.ts +7 -0
  311. package/dist/server/lib/media-loading.js +12 -0
  312. package/dist/server/lib/number-format.js +8 -0
  313. package/dist/server/lib/overflow-actions-motion.js +2 -0
  314. package/dist/server/lib/overlay-scrollbar.d.ts +1 -0
  315. package/dist/server/lib/overlay-scrollbar.js +9 -0
  316. package/dist/server/lib/overlay-trigger-timing.js +2 -0
  317. package/dist/server/lib/progressive-blur.d.ts +13 -0
  318. package/dist/server/lib/progressive-blur.js +54 -0
  319. package/dist/server/lib/responsive-exit.js +2 -0
  320. package/dist/server/lib/search-filter.js +2 -0
  321. package/dist/server/lib/side-panel.js +2 -0
  322. package/dist/server/lib/split-pane.js +2 -0
  323. package/dist/server/lib/table-column-motion.js +2 -0
  324. package/dist/server/lib/table-context.d.ts +5 -0
  325. package/dist/server/lib/table-context.js +4 -1
  326. package/dist/server/lib/table-responsive.d.ts +1 -1
  327. package/dist/server/lib/table-responsive.js +41 -7
  328. package/dist/server/lib/table-selection-fade.js +2 -0
  329. package/dist/server/lib/table-truncation.js +2 -0
  330. package/dist/server/lib/text-motion/animation.js +2 -0
  331. package/dist/server/lib/text-motion/character.js +2 -0
  332. package/dist/server/lib/text-motion/color.js +2 -0
  333. package/dist/server/lib/text-motion/layout.js +2 -0
  334. package/dist/server/lib/text-motion/preference.js +2 -0
  335. package/dist/server/lib/text-motion/sequence.js +2 -0
  336. package/dist/server/lib/text-motion/typography.js +2 -0
  337. package/dist/server/lib/tooltip-delay.js +2 -0
  338. package/dist/server/lib/tooltip-motion-dismiss.js +2 -0
  339. package/dist/server/lib/tooltip-pointer-speed.js +2 -0
  340. package/dist/server/lib/truncate.js +2 -0
  341. package/dist/server/logic/ComponentPartsBoundary.d.ts +7 -0
  342. package/dist/server/logic/ComponentPartsBoundary.js +12 -0
  343. package/dist/server/logic/content-line.d.ts +5 -0
  344. package/dist/server/logic/content-line.js +13 -0
  345. package/dist/server/logic/frame-dom-runtime.d.ts +3 -1
  346. package/dist/server/logic/frame-dom-runtime.js +5 -3
  347. package/dist/server/logic/frame-field-control.js +2 -0
  348. package/dist/server/logic/frame-inline-style.js +2 -3
  349. package/dist/server/logic/frame-layout.js +3 -0
  350. package/dist/server/logic/frame-motion-defaults.js +2 -0
  351. package/dist/server/logic/frame-prop-filter.d.ts +1 -1
  352. package/dist/server/logic/frame-prop-filter.js +3 -0
  353. package/dist/server/logic/frame-responsive.js +22 -6
  354. package/dist/server/logic/frame-types.d.ts +2 -0
  355. package/dist/server/logic/geometry-cache.js +2 -0
  356. package/dist/server/logic/layout-flip.js +2 -0
  357. package/dist/server/logic/morph.js +2 -0
  358. package/dist/server/logic/motion-engine.js +2 -0
  359. package/dist/server/logic/motion-orchestration.js +2 -0
  360. package/dist/server/logic/motion-types.js +2 -0
  361. package/dist/server/logic/overflow-actions.d.ts +11 -2
  362. package/dist/server/logic/overflow-actions.js +5 -0
  363. package/dist/server/logic/toast.js +7 -4
  364. package/dist/server/logic/wc-adapter.js +2 -0
  365. package/dist/server/motion/bridge.js +2 -0
  366. package/dist/server/motion/content-crossfade.js +2 -0
  367. package/dist/server/motion/expand.js +2 -0
  368. package/dist/server/motion/fade-in.js +2 -0
  369. package/dist/server/motion/fade-out.js +2 -0
  370. package/dist/server/motion/morph.js +2 -0
  371. package/dist/server/motion/move.js +2 -0
  372. package/dist/server/motion/number.js +2 -0
  373. package/dist/server/motion/replace.js +2 -0
  374. package/dist/server/motion/rotate.css +2 -0
  375. package/dist/server/motion/rotate.js +2 -0
  376. package/dist/server/motion/scale-in.js +2 -0
  377. package/dist/server/motion/tokens.js +2 -0
  378. package/dist/server/motion/while-2xl.js +2 -0
  379. package/dist/server/motion/while-active.js +2 -0
  380. package/dist/server/motion/while-appear.js +2 -0
  381. package/dist/server/motion/while-click.js +2 -0
  382. package/dist/server/motion/while-collapsed.js +2 -0
  383. package/dist/server/motion/while-disabled.js +2 -0
  384. package/dist/server/motion/while-disappear.js +2 -0
  385. package/dist/server/motion/while-drag.js +2 -0
  386. package/dist/server/motion/while-editing.js +2 -0
  387. package/dist/server/motion/while-expanded.js +2 -0
  388. package/dist/server/motion/while-focus.js +2 -0
  389. package/dist/server/motion/while-hover.js +2 -0
  390. package/dist/server/motion/while-idle.js +2 -0
  391. package/dist/server/motion/while-key.js +2 -0
  392. package/dist/server/motion/while-lg.js +2 -0
  393. package/dist/server/motion/while-load.js +2 -0
  394. package/dist/server/motion/while-md.js +2 -0
  395. package/dist/server/motion/while-reload.js +2 -0
  396. package/dist/server/motion/while-scroll.js +2 -0
  397. package/dist/server/motion/while-sm.js +2 -0
  398. package/dist/server/motion/while-uploading.js +2 -0
  399. package/dist/server/motion/while-validating.js +2 -0
  400. package/dist/server/motion/while-xl.js +2 -0
  401. package/dist/server/motion/while-xs.js +2 -0
  402. package/dist/server/styles/auto-layout.css +23 -1
  403. package/dist/server/styles/backdrop.css +2 -0
  404. package/dist/server/styles/components.css +14 -6
  405. package/dist/server/styles/index.css +2 -0
  406. package/dist/server/styles/layout.css +32 -6
  407. package/dist/server/styles/scale.css +2 -0
  408. package/dist/server/styles/scrollbar.css +16 -1
  409. package/dist/server/styles/themes.css +7 -4
  410. package/dist/server/styles/tokens.css +2 -0
  411. package/dist/server/vite-env.d.ts +2 -0
  412. package/llms.txt +8 -0
  413. package/package.json +15 -6
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * Context Keys
3
5
  *
@@ -11,6 +13,7 @@ export const SCROLL_CONTEXT_KEY = Symbol("SCROLL_CONTEXT");
11
13
  export const TEXT_CONTEXT_KEY = Symbol("TEXT_CONTEXT");
12
14
  export const ICON_CONTEXT_KEY = Symbol("ICON_CONTEXT");
13
15
  export const AVATAR_CONTEXT_KEY = Symbol("AVATAR_CONTEXT");
16
+ export const MEDIA_LOADING_CONTEXT_KEY = Symbol("MEDIA_LOADING_CONTEXT");
14
17
  export const IMAGE_CONTEXT_KEY = Symbol("IMAGE_CONTEXT");
15
18
  export const IMAGE_GROUP_CONTEXT_KEY = Symbol("IMAGE_GROUP_CONTEXT");
16
19
  export const IMAGE_VIEWER_CONTEXT_KEY = Symbol("IMAGE_VIEWER_CONTEXT");
@@ -1,2 +1,4 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /** 按需导入的 SVG 渲染入口;不注入 Frame,也不在模块顶层访问 DOM。 */
2
4
  export { default as AdaptiveContrastMask } from "./AdaptiveContrastMask.js";
@@ -5,7 +5,7 @@ import { clampFloatingPosition } from "../floating-position.js";
5
5
 
6
6
  const $$css = {
7
7
  hash: 'svelte-qoyt82',
8
- code: ':where(.snowui-chart-hover-panel) {position:absolute;left:0;top:0;translate:var(--snowui-chart-hover-panel-x)\n var(--snowui-chart-hover-panel-y);z-index:30;display:inline-flex;flex-direction:column;gap:calc(var(--gap-1) / 2);padding:calc(var(--padding-1) * 1.5) var(--padding-2);border:none;outline:none;border-radius:var(--radius-3);font-size:var(--text-12);line-height:var(--leading-12);font-weight:400;pointer-events:none;contain:layout style paint;will-change:translate, opacity;white-space:nowrap;background:linear-gradient(\n 0deg,\n var(--static-white-10, #ffffff1a),\n var(--static-white-10, #ffffff1a)\n ),\n var(--static-black-80, #000000cc);color:var(--static-white-100, #ffffffff);backdrop-filter:blur(1.25rem);-webkit-backdrop-filter:blur(1.25rem);box-shadow:none;}:where(.snowui-chart-hover-panel)[data-variant="light"] {background:var(--black-4, #0000000a);color:var(--black-100, #000000ff);border:none;box-shadow:none;}:where(.snowui-chart-hover-panel)[data-variant="surface"] {background:var(--snowui-background-quick-action);color:var(--black-100, #000000ff);backdrop-filter:var(--snowui-backdrop-quick-action);-webkit-backdrop-filter:var(--snowui-backdrop-quick-action);border:none;box-shadow:var(--snowui-shadow-quick-action);}:where(.snowui-chart-hover-panel-label) {color:var(--snowui-chart-hover-panel-label-color);}:where(.snowui-chart-hover-panel)[data-variant="dark"] {--snowui-chart-hover-panel-label-color: var(\n --static-white-100,\n #ffffffff\n );--snowui-chart-hover-panel-name-color: var(\n --static-white-40,\n #ffffff66\n );--snowui-chart-hover-panel-value-color: var(\n --static-white-100,\n #ffffffff\n );}:where(.snowui-chart-hover-panel)[data-variant="light"],\n :where(.snowui-chart-hover-panel)[data-variant="surface"] {--snowui-chart-hover-panel-label-color: var(--black-100, #000000ff);--snowui-chart-hover-panel-name-color: var(--black-40, #00000066);--snowui-chart-hover-panel-value-color: var(--black-100, #000000ff);}:where(.snowui-chart-hover-panel-rows) {display:grid;grid-template-columns:max-content max-content max-content;column-gap:0;row-gap:calc(var(--gap-1) / 2);align-items:center;}:where(.snowui-chart-hover-panel-row) {display:contents;}:where(.snowui-chart-hover-panel-dot) {width:calc(var(--size-4) * 3 / 8);height:calc(var(--size-4) * 3 / 8);border-radius:9999px;background:var(--snowui-chart-hover-panel-dot-color);opacity:var(--snowui-chart-hover-panel-dot-opacity);margin-right:var(--gap-1);}:where(.snowui-chart-hover-panel-name) {color:var(--snowui-chart-hover-panel-name-color);}:where(.snowui-chart-hover-panel-value) {color:var(--snowui-chart-hover-panel-value-color);text-align:right;margin-left:var(--gap-2);}'
8
+ code: ':where(.snowui-chart-hover-panel) {position:absolute;left:0;top:0;translate:var(--snowui-chart-hover-panel-x)\n var(--snowui-chart-hover-panel-y);z-index:30;display:inline-flex;flex-direction:column;gap:calc(var(--gap-1) / 2);padding:calc(var(--padding-1) * 1.5) var(--padding-2);border:none;outline:none;border-radius:var(--radius-3);font-size:var(--text-12);line-height:var(--leading-12);font-weight:400;pointer-events:none;contain:layout style paint;will-change:translate, opacity;white-space:nowrap;background:linear-gradient(\n 0deg,\n var(--static-white-10, #ffffff1a),\n var(--static-white-10, #ffffff1a)\n ),\n var(--static-black-80, #000000cc);color:var(--static-white-100, #ffffffff);backdrop-filter:blur(1.25rem);-webkit-backdrop-filter:blur(1.25rem);box-shadow:none;}:where(.snowui-chart-hover-panel)[data-variant="light"] {background:var(--black-4, #0000000a);color:var(--black-100, #000000ff);border:none;box-shadow:none;}:where(.snowui-chart-hover-panel)[data-variant="surface"] {background:var(--snowui-background-quick-action);color:var(--black-100, #000000ff);backdrop-filter:var(--snowui-backdrop-quick-action);-webkit-backdrop-filter:var(--snowui-backdrop-quick-action);border:none;box-shadow:var(--snowui-shadow-quick-action);}:where(.snowui-chart-hover-panel-label) {color:var(--snowui-chart-hover-panel-label-color);}:where(.snowui-chart-hover-panel)[data-variant="dark"] {--snowui-chart-hover-panel-label-color: var(\n --static-white-100,\n #ffffffff\n );--snowui-chart-hover-panel-name-color: var(\n --static-white-40,\n #ffffff66\n );--snowui-chart-hover-panel-value-color: var(\n --static-white-100,\n #ffffffff\n );}:where(.snowui-chart-hover-panel)[data-variant="light"],\n :where(.snowui-chart-hover-panel)[data-variant="surface"] {--snowui-chart-hover-panel-label-color: var(--black-100, #000000ff);--snowui-chart-hover-panel-name-color: var(--black-40, #00000066);--snowui-chart-hover-panel-value-color: var(--black-100, #000000ff);}:where(.snowui-chart-hover-panel-rows) {display:grid;grid-template-columns:max-content max-content max-content;column-gap:0;row-gap:calc(var(--gap-1) / 2);align-items:center;}:where(.snowui-chart-hover-panel-row) {display:contents;}:where(.snowui-chart-hover-panel-dot) {width:calc(var(--size-4) * 3 / 8);height:calc(var(--size-4) * 3 / 8);border-radius:9999px;background:var(--snowui-chart-hover-panel-dot-color);opacity:var(--snowui-chart-hover-panel-dot-opacity);margin-inline-end:max(4px, var(--gap-1));}:where(.snowui-chart-hover-panel-name) {color:var(--snowui-chart-hover-panel-name-color);}:where(.snowui-chart-hover-panel-value) {color:var(--snowui-chart-hover-panel-value-color);text-align:right;margin-inline-start:max(4px, var(--gap-2));}'
9
9
  };
10
10
 
11
11
  export default function ChartHoverPanel($$renderer, $$props) {
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { clamp } from "./geometry.js";
2
4
  export const SEGMENT_APPEARANCE_FILL_DURATION = 500;
3
5
  export const SEGMENT_APPEARANCE_OPACITY_DURATION = 750;
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { arc } from "d3-shape";
2
4
  import { clamp, formatPoint, normalizePositiveAngle } from "./geometry.js";
3
5
  export function buildArcPath(cx, cy, outer, inner, start, end, corner, separator = 0) {
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { resolveSnowUIColor, } from "../../index.js";
2
4
  export const DEFAULT_CHART_COLORS = [
3
5
  "var(--primary, #111111)",
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { resizeManager } from "../../index.js";
2
4
  import { toNumber } from "./geometry.js";
3
5
  export function watchCartesianChartSize(element, onChange) {
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  export async function writeClipboardText(text) {
2
4
  if (typeof navigator === "undefined" ||
3
5
  !navigator.clipboard ||
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  export const SNOWUI_COLOR_TOKENS = {
2
4
  StaticBlack100: "--static-black-100",
3
5
  StaticBlack80: "--static-black-80",
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  export const DEFAULT_DATE_LOCALE = "en-US";
2
4
  export const DEFAULT_DATE_EMPTY_VALUE = "—";
3
5
  export function mergeDateFormatOptions(...options) {
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  // 内容边缘渐隐遮罩(Edge Fade Mask)共享能力。
2
4
  //
3
5
  // 用途:当“悬浮操作层”(覆盖在内容之上的按钮 / 复选框 / 操作块)浮在内容之上时,
@@ -0,0 +1,7 @@
1
+ export type MediaLoading = "lazy" | "eager";
2
+ type MediaLoadingGetter = () => MediaLoading;
3
+ /** 在组件初始化时为后代 Image 设置默认策略;传 getter 可响应状态变化。 */
4
+ export declare function provideMediaLoading(value: MediaLoading | MediaLoadingGetter): void;
5
+ /** 仅供组件内部消费;没有 Provider 时保留原生懒加载默认值。 */
6
+ export declare function useMediaLoading(): MediaLoadingGetter;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
3
+ import { getContext, setContext } from "svelte";
4
+ import { MEDIA_LOADING_CONTEXT_KEY } from "../keys.js";
5
+ /** 在组件初始化时为后代 Image 设置默认策略;传 getter 可响应状态变化。 */
6
+ export function provideMediaLoading(value) {
7
+ setContext(MEDIA_LOADING_CONTEXT_KEY, typeof value === "function" ? value : () => value);
8
+ }
9
+ /** 仅供组件内部消费;没有 Provider 时保留原生懒加载默认值。 */
10
+ export function useMediaLoading() {
11
+ return getContext(MEDIA_LOADING_CONTEXT_KEY) ?? (() => "lazy");
12
+ }
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  export const DEFAULT_NUMBER_VALUE_LABEL_FRACTION_DIGITS = 2;
2
4
  export const DEFAULT_NUMBER_PERCENT_FRACTION_DIGITS = 1;
3
5
  export const DEFAULT_NUMBER_COMPACT_THRESHOLD = 1_000_000;
@@ -72,10 +74,16 @@ export function formatNumberLabel(value, options = {}) {
72
74
  });
73
75
  }
74
76
  export function formatPercentLabel(value, options = {}) {
77
+ if (typeof value !== "number" || !Number.isFinite(value)) {
78
+ return options.emptyValue ?? DEFAULT_NUMBER_EMPTY_VALUE;
79
+ }
80
+ const hasExplicitFractionDigits = options.fractionDigits !== undefined ||
81
+ options.percentFractionDigits !== undefined;
75
82
  return `${formatNumberLabel(value, {
76
83
  ...options,
77
84
  fractionDigits: options.fractionDigits ??
78
85
  options.percentFractionDigits ??
79
86
  DEFAULT_NUMBER_PERCENT_FRACTION_DIGITS,
87
+ preserveTrailingZeros: options.preserveTrailingZeros ?? hasExplicitFractionDigits,
80
88
  })}%`;
81
89
  }
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { RESIZE_MOTION } from '../motion/presets/resize.js';
2
4
  /** 操作组私有布局适配;Flex 决定终点,独立视觉壳只做平移,不缩放 Button。 */
3
5
  export function createOverflowActionsMotion(root) {
@@ -1,6 +1,7 @@
1
1
  type ElementGetter<T extends HTMLElement = HTMLElement> = () => T | undefined | null;
2
2
  export interface OverlayScrollbarState {
3
3
  readonly hasOverflow: boolean;
4
+ readonly scrollOffset: number;
4
5
  readonly thumbSize: number;
5
6
  readonly thumbOffset: number;
6
7
  readonly thumbHeight: number;
@@ -5,6 +5,7 @@ import { resizeManager } from "../logic/observer.js";
5
5
 
6
6
  export function useOverlayScrollbar(getViewport, getScrollbar, axis = "vertical") {
7
7
  let hasOverflow = false;
8
+ let viewportScrollOffset = 0;
8
9
  let thumbHeight = 0;
9
10
  let thumbY = 0;
10
11
  let cleanupViewportResize;
@@ -21,6 +22,7 @@ export function useOverlayScrollbar(getViewport, getScrollbar, axis = "vertical"
21
22
 
22
23
  if (!viewport || !scrollbar) {
23
24
  hasOverflow = false;
25
+ viewportScrollOffset = 0;
24
26
  thumbHeight = 0;
25
27
  thumbY = 0;
26
28
 
@@ -31,6 +33,9 @@ export function useOverlayScrollbar(getViewport, getScrollbar, axis = "vertical"
31
33
  const clientSize = axis === "vertical" ? viewport.clientHeight : viewport.clientWidth;
32
34
  const trackSize = axis === "vertical" ? scrollbar.clientHeight : scrollbar.clientWidth;
33
35
  const scrollOffset = axis === "vertical" ? viewport.scrollTop : viewport.scrollLeft;
36
+
37
+ viewportScrollOffset = scrollOffset;
38
+
34
39
  const overflow = scrollSize > clientSize + 1 && trackSize > 0;
35
40
 
36
41
  hasOverflow = overflow;
@@ -215,6 +220,10 @@ export function useOverlayScrollbar(getViewport, getScrollbar, axis = "vertical"
215
220
  return hasOverflow;
216
221
  },
217
222
 
223
+ get scrollOffset() {
224
+ return viewportScrollOffset;
225
+ },
226
+
218
227
  get thumbHeight() {
219
228
  return thumbHeight;
220
229
  },
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * overlay-trigger-timing.ts
3
5
  * v1.4.0
@@ -1,4 +1,12 @@
1
1
  export type ProgressiveBlurDirection = "left-to-right" | "right-to-left";
2
+ export type EdgeProgressiveBlurDirection = "top-to-bottom" | "bottom-to-top" | ProgressiveBlurDirection;
3
+ export interface EdgeProgressiveBlurOptions {
4
+ direction?: EdgeProgressiveBlurDirection;
5
+ /** Visible height for vertical directions or width for horizontal directions. */
6
+ extent?: string;
7
+ position?: "absolute" | "fixed";
8
+ zIndex?: number;
9
+ }
2
10
  export interface ProgressiveBlurOptions {
3
11
  direction?: ProgressiveBlurDirection;
4
12
  width?: string;
@@ -29,6 +37,11 @@ export interface ProgressiveBlurStyles {
29
37
  containerStyle: string;
30
38
  layers: ProgressiveBlurLayerStyle[];
31
39
  }
40
+ /**
41
+ * Decorative full-edge blur. The host supplies aria-hidden and owns its stacking context.
42
+ * Unsupported backdrop-filter leaves transparent layers and readable content.
43
+ */
44
+ export declare function createEdgeProgressiveBlurStyles(options?: EdgeProgressiveBlurOptions): ProgressiveBlurStyles;
32
45
  export declare const DEFAULT_PROGRESSIVE_BLUR_LAYER_COUNT = 16;
33
46
  export declare const DEFAULT_PROGRESSIVE_BLUR_WIDTH = "calc((var(--size-12, 3rem) + var(--size-14, 3.5rem)) / 3)";
34
47
  export declare const createProgressiveBlurContainerStyle: (options?: ProgressiveBlurOptions) => string;
@@ -1,3 +1,57 @@
1
+ /** Four layers match the established 80px Site edge treatment. */
2
+ const EDGE_BLUR_LAYERS = [
3
+ { blur: "2px", solid: "20%", fade: "100%" },
4
+ { blur: "6px", solid: "16%", fade: "72%" },
5
+ { blur: "12px", solid: "10%", fade: "48%" },
6
+ { blur: "24px", solid: "4%", fade: "28%" },
7
+ ];
8
+ /**
9
+ * Decorative full-edge blur. The host supplies aria-hidden and owns its stacking context.
10
+ * Unsupported backdrop-filter leaves transparent layers and readable content.
11
+ */
12
+ export function createEdgeProgressiveBlurStyles(options = {}) {
13
+ const direction = options.direction ?? "top-to-bottom";
14
+ const vertical = direction === "top-to-bottom" || direction === "bottom-to-top";
15
+ const edge = {
16
+ "top-to-bottom": "top: 0; left: 0; right: 0",
17
+ "bottom-to-top": "bottom: 0; left: 0; right: 0",
18
+ "left-to-right": "left: 0; top: 0; bottom: 0",
19
+ "right-to-left": "right: 0; top: 0; bottom: 0",
20
+ }[direction];
21
+ const gradient = {
22
+ "top-to-bottom": "to bottom",
23
+ "bottom-to-top": "to top",
24
+ "left-to-right": "to right",
25
+ "right-to-left": "to left",
26
+ }[direction];
27
+ const extent = options.extent ?? "80px";
28
+ const size = vertical ? `height: ${extent}` : `width: ${extent}`;
29
+ return {
30
+ containerStyle: [
31
+ `position: ${options.position ?? "absolute"}`,
32
+ edge,
33
+ size,
34
+ options.zIndex === undefined ? "" : `z-index: ${options.zIndex}`,
35
+ "pointer-events: none",
36
+ ].filter(Boolean).join("; "),
37
+ layers: EDGE_BLUR_LAYERS.map((layer, index) => {
38
+ const mask = `linear-gradient(${gradient}, #000 0%, #000 ${layer.solid}, transparent ${layer.fade})`;
39
+ return {
40
+ index,
41
+ style: [
42
+ "position: absolute",
43
+ "inset: 0",
44
+ "pointer-events: none",
45
+ "background-image: linear-gradient(transparent, transparent)",
46
+ `-webkit-backdrop-filter: blur(${layer.blur})`,
47
+ `backdrop-filter: blur(${layer.blur})`,
48
+ `-webkit-mask-image: ${mask}`,
49
+ `mask-image: ${mask}`,
50
+ ].join("; "),
51
+ };
52
+ }),
53
+ };
54
+ }
1
55
  export const DEFAULT_PROGRESSIVE_BLUR_LAYER_COUNT = 16;
2
56
  export const DEFAULT_PROGRESSIVE_BLUR_WIDTH = "calc((var(--size-12, 3rem) + var(--size-14, 3.5rem)) / 3)";
3
57
  const DEFAULT_OPTIONS = {
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { RESIZE_MOTION } from "../motion/presets/resize.js";
2
4
  /** 宽度驱动的退出进度;requiredWidth 是宿主下一次收起项目的宽度阈值。 */
3
5
  export function getResponsiveExitOpacity(availableWidth, requiredWidth, fadeDistance) {
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * 搜索过滤工具 (Search Filter Utilities)
3
5
  * v1.0.0
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { SIDE_PANEL_APPEAR_MOTION, SIDE_PANEL_DISAPPEAR_MOTION, } from "../motion/presets/effects.js";
2
4
  import { resolveMotionCssTiming } from "../motion/spring.js";
3
5
  export const SIDE_PANEL_INLINE_GAP_PX = 16;
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /**
2
4
  * 分割面板 Action (Split Pane Action)
3
5
  *
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { RESIZE_MOTION } from '../motion/presets/resize.js';
2
4
  const contentSelector = ':scope > .snowui-table-cell-content, :scope > .snowui-table-head-content, :scope > .snowui-table-sort';
3
5
  /** 原生网格始终保持自然布局,只有内容层做 FLIP 位移和宽度揭示。 */
@@ -2,6 +2,8 @@ import type { ResourceSize } from "../context";
2
2
  import type { MotionConfig } from "../logic/motion-config";
3
3
  import type { TableTruncationResult } from "./table-truncation";
4
4
  import type { OverflowActionsItem } from "../components/OverflowActions.js";
5
+ import type { ComponentProps } from "svelte";
6
+ import type OverflowActions from "../components/OverflowActions.js";
5
7
  export type TableSortDirection = "ascending" | "descending";
6
8
  export type TableRoleLayout = "auto" | "column" | "overlay";
7
9
  export type TableRoleOverlayBlurMode = "progressive" | "uniform";
@@ -49,6 +51,9 @@ export interface TableContext {
49
51
  getActionsCompact: () => "auto" | "none";
50
52
  getActionsOverflow: () => "all" | "progressive";
51
53
  getActionsOverflowFrom: () => "start" | "end";
54
+ getActionsMaxVisible: () => number;
55
+ getActionsProps: () => Pick<ComponentProps<typeof OverflowActions>, "buttonProps" | "parts" | "moreLabel">;
56
+ getActionsContentWidth: () => number | undefined;
52
57
  getActionsColumnWidth: () => number;
53
58
  getActionsMinWidth: () => number;
54
59
  getActionsMaxWidth: () => number;
@@ -22,8 +22,11 @@ const fallback = {
22
22
  getRowActions: () => [],
23
23
  runRowAction: () => {},
24
24
  getActionsCompact: () => "auto",
25
- getActionsOverflow: () => "all",
25
+ getActionsOverflow: () => "progressive",
26
26
  getActionsOverflowFrom: () => "end",
27
+ getActionsMaxVisible: () => 3,
28
+ getActionsProps: () => ({}),
29
+ getActionsContentWidth: () => undefined,
27
30
  getActionsColumnWidth: () => 160,
28
31
  getActionsMinWidth: () => 40,
29
32
  getActionsMaxWidth: () => 320,
@@ -3,7 +3,7 @@ interface Options {
3
3
  horizontalScroll: boolean;
4
4
  roleLayout: TableRoleLayout;
5
5
  actionsWidth: number;
6
- onLayout: (layout: "column" | "overlay", actionsWidth: number) => void;
6
+ onLayout: (layout: "column" | "overlay", actionsWidth: number, actionsContentWidth: number) => void;
7
7
  }
8
8
  /** 表格私有响应式控制器;每表统一测量,不为各 Cell 创建 Observer。 */
9
9
  export declare function observeTableResponsive(table: HTMLTableElement, viewport: HTMLElement, initial: Options): {
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { createResponsiveExit } from "./responsive-exit.js";
2
4
  import { createTableColumnMotion } from "./table-column-motion.js";
3
5
  import { resizeManager } from "../logic/observer.js";
@@ -22,6 +24,8 @@ export function observeTableResponsive(table, viewport, initial) {
22
24
  }
23
25
  });
24
26
  let measuredActionsWidth = 0;
27
+ let cachedActionsPadding = 0;
28
+ let cachedMoreWidth = 0;
25
29
  let complexGrid = false;
26
30
  const originalSpans = new WeakMap();
27
31
  const renderedSpans = new WeakMap();
@@ -89,20 +93,50 @@ export function observeTableResponsive(table, viewport, initial) {
89
93
  const hideable = !complexGrid && !role && !firstData && head.dataset.responsiveHide !== 'false' && head.colSpan === 1;
90
94
  if (!role)
91
95
  firstData = false;
92
- return { role, hideable, preferred: preferred[index], minimum: minimum[index] };
96
+ return { role, actions: head.dataset.as === 'actions', hideable, preferred: preferred[index], minimum: minimum[index] };
93
97
  });
98
+ measureActionChrome();
94
99
  copy.remove();
95
100
  }
101
+ function measureActionChrome() {
102
+ const actionCells = Array.from(table.querySelectorAll('.snowui-table-cell[data-as="actions"]'));
103
+ let padding = preferredPadding * 2;
104
+ let moreWidth = 0;
105
+ for (const cell of actionCells) {
106
+ const style = getComputedStyle(cell);
107
+ const content = cell.querySelector('.snowui-table-cell-content[data-actions="true"]');
108
+ const contentStyle = content ? getComputedStyle(content) : undefined;
109
+ padding = Math.max(padding, parseFloat(style.paddingLeft) + parseFloat(style.paddingRight), contentStyle ? parseFloat(contentStyle.paddingLeft) + parseFloat(contentStyle.paddingRight) : 0);
110
+ for (const more of cell.querySelectorAll('.snowui-overflow-actions-more-measure')) {
111
+ moreWidth = Math.max(moreWidth, more.getBoundingClientRect().width);
112
+ }
113
+ }
114
+ cachedActionsPadding = padding;
115
+ cachedMoreWidth = moreWidth;
116
+ }
96
117
  function flush() {
97
118
  frame = 0;
98
119
  if (disposed || !table.isConnected || viewport.clientWidth <= 0)
99
120
  return;
121
+ // 菜单存在时保留触发器几何;关闭属性变更会重新进入同一求解入口。
122
+ if (table.querySelector('.snowui-select-button-trigger[aria-expanded="true"]'))
123
+ return;
100
124
  if (!columns)
101
125
  measureColumns();
102
126
  const measured = columns;
103
127
  // clientWidth 会取整;慢速拖动时会让 padding 与渐隐每隔 1px 才跳一次。
104
128
  // 内部 viewport 无边框及 padding,计算样式保留未受 transform 影响的 CSS 小数宽度。
105
129
  const available = parseFloat(getComputedStyle(viewport).width) || viewport.clientWidth;
130
+ const padding = cachedActionsPadding;
131
+ const moreWidth = cachedMoreWidth;
132
+ const protectedWidth = measured.filter(column => !column.role && !column.hideable).reduce((sum, column) => sum + column.minimum, 0);
133
+ const selectionWidth = measured.filter(column => column.role && !column.actions).reduce((sum, column) => sum + column.minimum, 0);
134
+ const floor = moreWidth + padding + fadeDistance;
135
+ const budget = Math.max(floor, Math.min(available * .2, 14 * (parseFloat(getComputedStyle(document.documentElement).fontSize) || 16), options.actionsWidth, Math.max(0, available - protectedWidth - selectionWidth)));
136
+ measuredActionsWidth = budget;
137
+ for (const column of measured)
138
+ if (column.actions)
139
+ column.preferred = column.minimum = budget;
106
140
  const full = measured.reduce((sum, column) => sum + column.preferred, 0);
107
141
  const layout = options.roleLayout === 'auto' ? (full <= available + 0.5 ? 'column' : 'overlay') : options.roleLayout;
108
142
  const included = measured.filter(column => layout === 'column' || !column.role);
@@ -160,14 +194,14 @@ export function observeTableResponsive(table, viewport, initial) {
160
194
  table.classList.toggle('snowui-table-responsive-text-fit', textFit);
161
195
  // 容器改变时由同一次 CSS 布局同步调整 padding,不能等尺寸回调再补一次位移。
162
196
  // 显式固定列宽可能使首选与最小宽度相等,此时保留原来的边界选择。
163
- const padding = preferred > minimum
197
+ const responsivePadding = preferred > minimum
164
198
  ? `clamp(${minimumPadding}px, calc(${minimumPadding}px + (100cqw - ${minimum}px) * ${(preferredPadding - minimumPadding) / (preferred - minimum)}), ${preferredPadding}px)`
165
199
  : `${minimumPadding + (preferredPadding - minimumPadding) * ratio}px`;
166
200
  const paddingProperty = '--snowui-table-responsive-cell-padding-inline';
167
- if (table.style.getPropertyValue(paddingProperty) !== padding)
168
- table.style.setProperty(paddingProperty, padding);
201
+ if (table.style.getPropertyValue(paddingProperty) !== responsivePadding)
202
+ table.style.setProperty(paddingProperty, responsivePadding);
169
203
  table.dataset.responsiveLayout = layout;
170
- options.onLayout(layout, measuredActionsWidth);
204
+ options.onLayout(layout, measuredActionsWidth, Math.max(moreWidth, budget - padding - fadeDistance));
171
205
  for (const row of rows()) {
172
206
  let index = 0;
173
207
  const visible = [];
@@ -240,11 +274,11 @@ export function observeTableResponsive(table, viewport, initial) {
240
274
  originalSpans.set(record.target, record.target.colSpan);
241
275
  return true;
242
276
  }
243
- return record.type !== 'attributes' || record.attributeName !== 'style' || (record.target instanceof Element && record.target.matches('th, td'));
277
+ return record.type !== 'attributes' || record.attributeName !== 'style' || (record.target instanceof Element && (record.target.matches('th, td') || record.target.closest('.snowui-overflow-actions-more-measure')));
244
278
  }))
245
279
  refresh();
246
280
  });
247
- observer.observe(table, { childList: true, characterData: true, subtree: true, attributes: true, attributeOldValue: true, attributeFilter: ['data-responsive-hide', 'data-column-id', 'style', 'colspan', 'rowspan', 'class'] });
281
+ observer.observe(table, { childList: true, characterData: true, subtree: true, attributes: true, attributeOldValue: true, attributeFilter: ['data-responsive-hide', 'data-column-id', 'style', 'colspan', 'rowspan', 'class', 'aria-expanded'] });
248
282
  window.addEventListener('resize', refresh);
249
283
  table.addEventListener('load', refresh, true);
250
284
  document.fonts?.addEventListener('loadingdone', refresh);
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { createEdgeFadeMaskImage } from "./edge-fade.js";
2
4
  import { resizeManager } from "../logic/observer.js";
3
5
  /** Table 私有布局适配:遮住实际 Checkbox,向内容侧保留固定 Token 长度的过渡。 */
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { resizeManager } from "../logic/observer.js";
2
4
  /**
3
5
  * Batches single-line cell overflow reads for one semantic table.
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  /** 内部连续重定向:逻辑终点与仍在播放的差值分离。 */
2
4
  export function animateTextMotionDelta(element, property, from, to, timing) {
3
5
  const previous = Number.parseFloat(element.style.getPropertyValue(property));
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { animateSettledTextMotionColor, animateTextMotionColorSequence, cancelTextMotionColor, } from "./color.js";
2
4
  import { cancelTextMotionLayout, flipTextMotionElement, splitTextMotionGraphemes, TEXT_MOTION_LAYOUT_TRANSITION, } from "./layout.js";
3
5
  import { extractTextMotionNumber, getTextMotionNumberSign, resolveTextMotionTrend, } from "./numeric.js";
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { getTextMotionStagger } from "./sequence.js";
2
4
  import { resolveTextMotionColor } from "./typography.js";
3
5
  const colorAnimations = new WeakMap();
@@ -1,3 +1,5 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
1
3
  import { TEXT_MOTION_SPACE } from "./sequence.js";
2
4
  export const TEXT_MOTION_LAYOUT_TRANSITION = {
3
5
  duration: 550,
@@ -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
+ }