@snowui-design-system/components 0.3.0-alpha.14 → 0.3.0-alpha.16

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 (170) hide show
  1. package/AGENTS.md +2 -38
  2. package/README.md +19 -132
  3. package/dist/client/blocks/SearchPopup.js +1 -1
  4. package/dist/client/blocks/Sidebar.d.ts +4 -0
  5. package/dist/client/blocks/Sidebar.js +692 -335
  6. package/dist/client/blocks/SidebarItem.js +50 -88
  7. package/dist/client/blocks/SidebarSection.js +1 -1
  8. package/dist/client/components/Avatar.d.ts +1 -0
  9. package/dist/client/components/Avatar.js +5 -0
  10. package/dist/client/components/Breadcrumb.js +1 -1
  11. package/dist/client/components/Button.js +108 -34
  12. package/dist/client/components/Checkbox.d.ts +3 -0
  13. package/dist/client/components/Checkbox.js +137 -91
  14. package/dist/client/components/Chip.js +1 -1
  15. package/dist/client/components/CodeBlock.js +1 -1
  16. package/dist/client/components/ColorSchemeButton.d.ts +4 -1
  17. package/dist/client/components/ColorSchemeButton.js +30 -5
  18. package/dist/client/components/CopyButton.js +15 -10
  19. package/dist/client/components/DataTable.js +40 -5
  20. package/dist/client/components/Dialog.js +1 -1
  21. package/dist/client/components/Field.js +1 -1
  22. package/dist/client/components/Frame.js +4 -2
  23. package/dist/client/components/Input.js +135 -61
  24. package/dist/client/components/Link.js +11 -16
  25. package/dist/client/components/Listbox.d.ts +1 -1
  26. package/dist/client/components/Listbox.js +3 -1
  27. package/dist/client/components/MetricCard.js +22 -5
  28. package/dist/client/components/OTPInput.js +24 -5
  29. package/dist/client/components/Pagination.js +225 -208
  30. package/dist/client/components/PasswordStrength.js +7 -5
  31. package/dist/client/components/Radio.d.ts +3 -0
  32. package/dist/client/components/Radio.js +156 -112
  33. package/dist/client/components/SearchBox.js +1 -1
  34. package/dist/client/components/SearchInput.js +2 -1
  35. package/dist/client/components/Select.js +345 -298
  36. package/dist/client/components/SelectButton.js +2 -1
  37. package/dist/client/components/SidePanel.js +3 -1
  38. package/dist/client/components/Skeleton.d.ts +2 -0
  39. package/dist/client/components/Skeleton.js +115 -20
  40. package/dist/client/components/Slider.js +1 -1
  41. package/dist/client/components/Switch.d.ts +3 -0
  42. package/dist/client/components/Switch.js +126 -87
  43. package/dist/client/components/Tab.js +1 -1
  44. package/dist/client/components/Table.js +1 -1
  45. package/dist/client/components/TableBody.js +43 -10
  46. package/dist/client/components/TableHead.js +96 -67
  47. package/dist/client/components/TableToolbar.js +20 -16
  48. package/dist/client/components/Tag.js +2 -0
  49. package/dist/client/components/Textarea.d.ts +1 -0
  50. package/dist/client/components/Textarea.js +281 -207
  51. package/dist/client/components/Toast.js +14 -6
  52. package/dist/client/components/Tooltip.js +1 -1
  53. package/dist/client/i18n/messages.d.ts +1 -1
  54. package/dist/client/i18n/messages.js +4 -0
  55. package/dist/client/index.d.ts +1 -0
  56. package/dist/client/index.js +1 -0
  57. package/dist/client/lib/chart/ChartHoverPanel.js +1 -1
  58. package/dist/client/lib/number-format.d.ts +1 -1
  59. package/dist/client/lib/number-format.js +1 -1
  60. package/dist/client/lib/table-context.d.ts +1 -0
  61. package/dist/client/lib/table-context.js +1 -0
  62. package/dist/client/lib/text-motion/split.d.ts +7 -0
  63. package/dist/client/lib/text-motion/split.js +49 -0
  64. package/dist/client/logic/RequiredFeedback.d.ts +10 -0
  65. package/dist/client/logic/RequiredFeedback.js +71 -0
  66. package/dist/client/logic/color-scheme-preference.d.ts +5 -0
  67. package/dist/client/logic/color-scheme-preference.js +46 -0
  68. package/dist/client/logic/content-line.js +1 -1
  69. package/dist/client/logic/frame-inline-style.d.ts +1 -0
  70. package/dist/client/logic/frame-inline-style.js +1 -0
  71. package/dist/client/logic/frame-responsive.js +10 -8
  72. package/dist/client/logic/native-validation.d.ts +5 -0
  73. package/dist/client/logic/native-validation.js +60 -0
  74. package/dist/client/logic/required-feedback.d.ts +1 -0
  75. package/dist/client/logic/required-feedback.js +61 -0
  76. package/dist/client/motion/presets/effects.d.ts +1 -0
  77. package/dist/client/motion/presets/effects.js +12 -1
  78. package/dist/client/motion/presets/input-required.d.ts +2 -0
  79. package/dist/client/motion/presets/input-required.js +14 -0
  80. package/dist/client/motion/presets/sidebar-drawer.d.ts +1 -0
  81. package/dist/client/motion/presets/sidebar-drawer.js +13 -0
  82. package/dist/client/styles/auto-layout.css +6 -1
  83. package/dist/client/styles/backdrop.css +1 -1
  84. package/dist/client/styles/components.css +7 -2
  85. package/dist/client/styles/layout.css +20 -1
  86. package/dist/server/blocks/SearchPopup.js +1 -0
  87. package/dist/server/blocks/Sidebar.d.ts +4 -0
  88. package/dist/server/blocks/Sidebar.js +278 -24
  89. package/dist/server/blocks/SidebarItem.js +23 -47
  90. package/dist/server/blocks/SidebarSection.js +1 -1
  91. package/dist/server/components/Avatar.d.ts +1 -0
  92. package/dist/server/components/Avatar.js +5 -0
  93. package/dist/server/components/Breadcrumb.js +1 -1
  94. package/dist/server/components/Button.js +58 -6
  95. package/dist/server/components/Checkbox.d.ts +3 -0
  96. package/dist/server/components/Checkbox.js +70 -44
  97. package/dist/server/components/Chip.js +1 -1
  98. package/dist/server/components/CodeBlock.js +1 -1
  99. package/dist/server/components/ColorSchemeButton.d.ts +4 -1
  100. package/dist/server/components/ColorSchemeButton.js +18 -5
  101. package/dist/server/components/CopyButton.js +1 -0
  102. package/dist/server/components/DataTable.js +30 -2
  103. package/dist/server/components/Dialog.js +1 -1
  104. package/dist/server/components/Field.js +1 -1
  105. package/dist/server/components/Frame.js +4 -2
  106. package/dist/server/components/Input.js +82 -29
  107. package/dist/server/components/Link.js +3 -3
  108. package/dist/server/components/Listbox.d.ts +1 -1
  109. package/dist/server/components/Listbox.js +3 -1
  110. package/dist/server/components/MetricCard.js +13 -4
  111. package/dist/server/components/OTPInput.js +22 -5
  112. package/dist/server/components/Pagination.js +139 -129
  113. package/dist/server/components/PasswordStrength.js +7 -5
  114. package/dist/server/components/Radio.d.ts +3 -0
  115. package/dist/server/components/Radio.js +79 -51
  116. package/dist/server/components/SearchBox.js +1 -1
  117. package/dist/server/components/SearchInput.js +2 -1
  118. package/dist/server/components/Select.js +164 -139
  119. package/dist/server/components/SelectButton.js +2 -1
  120. package/dist/server/components/SidePanel.js +3 -1
  121. package/dist/server/components/Skeleton.d.ts +2 -0
  122. package/dist/server/components/Skeleton.js +62 -4
  123. package/dist/server/components/Slider.js +1 -1
  124. package/dist/server/components/Switch.d.ts +3 -0
  125. package/dist/server/components/Switch.js +61 -41
  126. package/dist/server/components/Tab.js +1 -1
  127. package/dist/server/components/Table.js +1 -1
  128. package/dist/server/components/TableBody.js +12 -1
  129. package/dist/server/components/TableHead.js +67 -45
  130. package/dist/server/components/TableToolbar.js +21 -15
  131. package/dist/server/components/Tag.js +2 -0
  132. package/dist/server/components/Textarea.d.ts +1 -0
  133. package/dist/server/components/Textarea.js +57 -8
  134. package/dist/server/components/Toast.js +3 -2
  135. package/dist/server/components/Tooltip.js +1 -1
  136. package/dist/server/i18n/messages.d.ts +1 -1
  137. package/dist/server/i18n/messages.js +4 -0
  138. package/dist/server/index.d.ts +1 -0
  139. package/dist/server/index.js +1 -0
  140. package/dist/server/lib/chart/ChartHoverPanel.js +1 -1
  141. package/dist/server/lib/number-format.d.ts +1 -1
  142. package/dist/server/lib/number-format.js +1 -1
  143. package/dist/server/lib/table-context.d.ts +1 -0
  144. package/dist/server/lib/table-context.js +1 -0
  145. package/dist/server/lib/text-motion/split.d.ts +7 -0
  146. package/dist/server/lib/text-motion/split.js +49 -0
  147. package/dist/server/logic/RequiredFeedback.d.ts +10 -0
  148. package/dist/server/logic/RequiredFeedback.js +45 -0
  149. package/dist/server/logic/color-scheme-preference.d.ts +5 -0
  150. package/dist/server/logic/color-scheme-preference.js +46 -0
  151. package/dist/server/logic/content-line.js +1 -1
  152. package/dist/server/logic/frame-inline-style.d.ts +1 -0
  153. package/dist/server/logic/frame-inline-style.js +1 -0
  154. package/dist/server/logic/frame-responsive.js +10 -8
  155. package/dist/server/logic/native-validation.d.ts +5 -0
  156. package/dist/server/logic/native-validation.js +12 -0
  157. package/dist/server/logic/required-feedback.d.ts +1 -0
  158. package/dist/server/logic/required-feedback.js +5 -0
  159. package/dist/server/motion/presets/effects.d.ts +1 -0
  160. package/dist/server/motion/presets/effects.js +12 -1
  161. package/dist/server/motion/presets/input-required.d.ts +2 -0
  162. package/dist/server/motion/presets/input-required.js +14 -0
  163. package/dist/server/motion/presets/sidebar-drawer.d.ts +1 -0
  164. package/dist/server/motion/presets/sidebar-drawer.js +13 -0
  165. package/dist/server/styles/auto-layout.css +6 -1
  166. package/dist/server/styles/backdrop.css +1 -1
  167. package/dist/server/styles/components.css +7 -2
  168. package/dist/server/styles/layout.css +20 -1
  169. package/llms.txt +3 -6
  170. package/package.json +1 -1
@@ -101,7 +101,7 @@ var root_4 = $.from_html(`<span class="snowui-tooltip-placeholder" style="displa
101
101
 
102
102
  const $$css = {
103
103
  hash: 'svelte-sj99h3',
104
- code: ':where(.snowui-tooltip-portal) {position:fixed;z-index:9999;pointer-events:none;}:where(.snowui-tooltip-portal)[data-ready="false"] {opacity:0;}:where(.snowui-tooltip-motion-shell) {position:relative;transform:translate3d(\n var(--snowui-tooltip-motion-x, 0),\n var(--snowui-tooltip-motion-y, 0),\n 0\n );}:where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"] {will-change:transform;}\n :where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"]\n :where(.snowui-tooltip-size-shell)\n {will-change:width, height;}\n :where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"]\n :where(.snowui-tooltip-content-layer)\n {will-change:transform;}:where(.snowui-tooltip-size-shell) {display:inline-block;position:relative;box-sizing:border-box;overflow:hidden;width:var(--snowui-tooltip-measured-width);height:var(--snowui-tooltip-measured-height);transition:width var(--snowui-frame-size-motion-duration, 300ms)\n var(--snowui-frame-size-motion-easing, ease-out),\n height var(--snowui-frame-size-motion-duration, 300ms)\n var(--snowui-frame-size-motion-easing, ease-out);}:where(.snowui-tooltip-size-shell)[data-size-motion="false"] {transition:none;}:where(.snowui-tooltip-size-shell).snowui-tooltip-pos-top,\n :where(.snowui-tooltip-size-shell).snowui-tooltip-pos-bottom {transform:translateX(-50%);}:where(.snowui-tooltip-size-shell).snowui-tooltip-pos-left,\n :where(.snowui-tooltip-size-shell).snowui-tooltip-pos-right {transform:translateY(-50%);}:where(.snowui-tooltip-content) {--snowui-tooltip-padding: var(--padding-1) var(--padding-2);--snowui-tooltip-gap: var(--gap-2);--snowui-tooltip-radius: var(--radius-3);--snowui-tooltip-font-size: var(--text-12);--snowui-tooltip-line-height: var(--leading-12);display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--snowui-tooltip-gap-override, var(--snowui-tooltip-gap));padding:var(\n --snowui-tooltip-padding-override,\n var(--snowui-tooltip-padding)\n );border-radius:var(\n --snowui-tooltip-radius-override,\n var(--snowui-tooltip-radius)\n );font-size:var(\n --snowui-tooltip-font-size-override,\n var(--snowui-tooltip-font-size)\n );line-height:var(\n --snowui-tooltip-line-height-override,\n var(--snowui-tooltip-line-height)\n );color:var(--static-white-100, #ffffffff);white-space:normal;pointer-events:none;}:where(.snowui-tooltip-content)[data-variant="light"] {color:var(--black-100, #000000ff);}:where(.snowui-tooltip-backdrop),\n :where(.snowui-tooltip-foreground) {position:absolute;inset:0;border-radius:inherit;corner-shape:inherit;pointer-events:none;}:where(.snowui-tooltip-backdrop) {z-index:0;\n /* 透明绘制面确保浏览器合成实际 backdrop 像素,不改变 Foreground 的颜色与动效。 */background-image:linear-gradient(transparent, transparent);backdrop-filter:blur(1.25rem);-webkit-backdrop-filter:blur(1.25rem);will-change:backdrop-filter;}:where(.snowui-tooltip-foreground) {z-index:1;display:inline-flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding:inherit;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:inherit;will-change:opacity, transform;}:where(.snowui-tooltip-shared-foreground) {display:block;padding:0;}:where(.snowui-tooltip-content-layer) {position:absolute;top:0;left:0;z-index:1;display:inline-flex;align-items:center;justify-content:flex-start;box-sizing:border-box;width:var(--snowui-tooltip-layer-width);height:var(--snowui-tooltip-layer-height);padding:var(\n --snowui-tooltip-padding-override,\n var(--snowui-tooltip-padding)\n );color:inherit;white-space:normal;pointer-events:none;transform:translate3d(\n var(--snowui-tooltip-layer-x, 0),\n var(--snowui-tooltip-layer-y, 0),\n 0\n );}\n :where(.snowui-tooltip-content-layer)[data-layer-ready="false"]\n {visibility:hidden;}\n :where(.snowui-tooltip-content)[data-variant="light"]\n :where(.snowui-tooltip-foreground)\n {background:var(--black-4, #0000000a);}:where(.snowui-tooltip-inner) {width:max-content;flex-shrink:0;overflow-wrap:anywhere;overflow:auto;display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--snowui-tooltip-gap-override, var(--snowui-tooltip-gap));white-space:normal;pointer-events:auto;}\n\n @media (prefers-reduced-motion: reduce) {:where(.snowui-tooltip-motion-shell),\n :where(.snowui-tooltip-content-layer),\n :where(.snowui-tooltip-size-shell) {transition:none;}\n }'
104
+ code: ':where(.snowui-tooltip-portal) {position:fixed;z-index:9999;pointer-events:none;}:where(.snowui-tooltip-portal)[data-ready="false"] {opacity:0;}:where(.snowui-tooltip-motion-shell) {position:relative;transform:translate3d(\n var(--snowui-tooltip-motion-x, 0),\n var(--snowui-tooltip-motion-y, 0),\n 0\n );}:where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"] {will-change:transform;}\n :where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"]\n :where(.snowui-tooltip-size-shell)\n {will-change:width, height;}\n :where(.snowui-tooltip-motion-shell)[data-switch-phase="moving"]\n :where(.snowui-tooltip-content-layer)\n {will-change:transform;}:where(.snowui-tooltip-size-shell) {display:inline-block;position:relative;box-sizing:border-box;overflow:hidden;width:var(--snowui-tooltip-measured-width);height:var(--snowui-tooltip-measured-height);transition:width var(--snowui-frame-size-motion-duration, 300ms)\n var(--snowui-frame-size-motion-easing, ease-out),\n height var(--snowui-frame-size-motion-duration, 300ms)\n var(--snowui-frame-size-motion-easing, ease-out);}:where(.snowui-tooltip-size-shell)[data-size-motion="false"] {transition:none;}:where(.snowui-tooltip-size-shell).snowui-tooltip-pos-top,\n :where(.snowui-tooltip-size-shell).snowui-tooltip-pos-bottom {transform:translateX(-50%);}:where(.snowui-tooltip-size-shell).snowui-tooltip-pos-left,\n :where(.snowui-tooltip-size-shell).snowui-tooltip-pos-right {transform:translateY(-50%);}:where(.snowui-tooltip-content) {--snowui-tooltip-padding: var(--padding-1) var(--padding-2);--snowui-tooltip-gap: var(--gap-2);--snowui-tooltip-radius: var(--radius-3);--snowui-tooltip-font-size: var(--text-12);--snowui-tooltip-line-height: var(--leading-12);display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--snowui-tooltip-gap-override, var(--snowui-tooltip-gap));padding:var(\n --snowui-tooltip-padding-override,\n var(--snowui-tooltip-padding)\n );border-radius:var(\n --snowui-tooltip-radius-override,\n var(--snowui-tooltip-radius)\n );font-size:var(\n --snowui-tooltip-font-size-override,\n var(--snowui-tooltip-font-size)\n );line-height:var(\n --snowui-tooltip-line-height-override,\n var(--snowui-tooltip-line-height)\n );color:var(--static-white-100, #ffffffff);white-space:normal;pointer-events:none;}:where(.snowui-tooltip-content)[data-variant="light"] {color:var(--black-100, #000000ff);}:where(.snowui-tooltip-backdrop),\n :where(.snowui-tooltip-foreground) {position:absolute;inset:0;border-radius:inherit;corner-shape:inherit;pointer-events:none;}:where(.snowui-tooltip-backdrop) {z-index:0;\n /* 透明绘制面确保浏览器合成实际 backdrop 像素,不改变 Foreground 的颜色与动效。 */background-image:linear-gradient(transparent, transparent);-webkit-backdrop-filter:blur(1.25rem);backdrop-filter:blur(1.25rem);will-change:backdrop-filter;}:where(.snowui-tooltip-foreground) {z-index:1;display:inline-flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding:inherit;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:inherit;will-change:opacity, transform;}:where(.snowui-tooltip-shared-foreground) {display:block;padding:0;}:where(.snowui-tooltip-content-layer) {position:absolute;top:0;left:0;z-index:1;display:inline-flex;align-items:center;justify-content:flex-start;box-sizing:border-box;width:var(--snowui-tooltip-layer-width);height:var(--snowui-tooltip-layer-height);padding:var(\n --snowui-tooltip-padding-override,\n var(--snowui-tooltip-padding)\n );color:inherit;white-space:normal;pointer-events:none;transform:translate3d(\n var(--snowui-tooltip-layer-x, 0),\n var(--snowui-tooltip-layer-y, 0),\n 0\n );}\n :where(.snowui-tooltip-content-layer)[data-layer-ready="false"]\n {visibility:hidden;}\n :where(.snowui-tooltip-content)[data-variant="light"]\n :where(.snowui-tooltip-foreground)\n {background:var(--black-4, #0000000a);}:where(.snowui-tooltip-inner) {width:max-content;flex-shrink:0;overflow-wrap:anywhere;overflow:auto;display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--snowui-tooltip-gap-override, var(--snowui-tooltip-gap));white-space:normal;pointer-events:auto;}\n\n @media (prefers-reduced-motion: reduce) {:where(.snowui-tooltip-motion-shell),\n :where(.snowui-tooltip-content-layer),\n :where(.snowui-tooltip-size-shell) {transition:none;}\n }'
105
105
  };
106
106
 
107
107
  export default function Tooltip($$anchor, $$props) {
@@ -1,6 +1,6 @@
1
1
  /** SnowUI 组件内置 UI 文案 catalog。文档: ../../../docs/standards/LocalizationSpec.md */
2
2
  export declare const DEFAULT_LOCALE = "zh-CN";
3
- export type SnowUIMessageKey = "copyButton.copy" | "copyButton.copied" | "codeBlock.copyCode" | "codeBlock.fullscreen" | "codeBlock.exitFullscreen" | "codeBlock.resize" | "codeBlock.fullscreenDialog" | "expandButton.expand" | "expandButton.collapse" | "sidebarSection.expand" | "sidebarSection.collapse" | "breadcrumb.navigation" | "pagination.navigation" | "spinner.loading" | "scrollArea.content" | "barChart.name" | "barChart.cells" | "lineChart.name" | "lineChart.cells" | "circularChart.name" | "gaugeChart.name" | "chartGroup.name" | "chartGroup.cells" | "chartGroup.cell" | "searchBox.placeholder" | "searchBox.clear" | "sidePanel.title" | "slider.title" | "menuItem.deleteCustom" | "listbox.search" | "tag.close" | "sidebar.navigation" | "sidebar.expand" | "sidebar.collapse" | "sidebarItem.updated" | "sidebar.resize" | "pagination.pageSize" | "pagination.previous" | "pagination.next" | "pagination.page" | "otpInput.invalidCode" | "input.clear" | "input.showPassword" | "input.hidePassword" | "passwordStrength.minimumLength" | "passwordStrength.requirements" | "passwordStrength.lowercase" | "passwordStrength.uppercase" | "passwordStrength.number" | "passwordStrength.symbol" | "input.increment" | "input.decrement" | "input.openTime" | "input.openDate" | "input.year" | "input.month" | "input.day" | "input.week" | "input.hour" | "input.minute" | "input.second" | "input.yearPlaceholder" | "input.monthPlaceholder" | "input.dayPlaceholder" | "input.weekPlaceholder" | "imageViewer.previous" | "imageViewer.next" | "imageViewer.close" | "toast.close" | "table.scrollRegion" | "table.scrollRegionNamed" | "tableHead.selectAll" | "tableHead.resizeColumn" | "tableHead.resizeColumnGeneric" | "tableCell.selectRow" | "text.expand" | "textarea.resize" | "indicator.resizeWidth" | "indicator.resizeHeight" | "indicator.resizeBoth" | "colorSchemeButton.toLight" | "colorSchemeButton.toDark" | "styleButton.toSnowUI" | "styleButton.toApple" | "sidePanel.placement.toInline" | "sidePanel.placement.toFloating" | "sidePanel.previous" | "sidePanel.next" | "sidePanel.copy" | "sidePanel.delete" | "sidePanel.cancel" | "sidePanel.save" | "sidePanel.close" | "sidePanel.resize" | "tableToolbar.name" | "tableToolbar.search" | "tableToolbar.sort" | "tableToolbar.filter" | "tableToolbar.clear" | "tableToolbar.copy" | "tableToolbar.delete" | "tableToolbar.selected" | "tableToolbar.deleting" | "tableToolbar.defaultSort" | "tableToolbar.ascending" | "tableToolbar.descending" | "tableToolbar.defaultFilter" | "overflowActions.more" | "dialog.close";
3
+ export type SnowUIMessageKey = "copyButton.copy" | "copyButton.copied" | "codeBlock.copyCode" | "codeBlock.fullscreen" | "codeBlock.exitFullscreen" | "codeBlock.resize" | "codeBlock.fullscreenDialog" | "expandButton.expand" | "expandButton.collapse" | "sidebarSection.expand" | "sidebarSection.collapse" | "breadcrumb.navigation" | "pagination.navigation" | "spinner.loading" | "scrollArea.content" | "barChart.name" | "barChart.cells" | "lineChart.name" | "lineChart.cells" | "circularChart.name" | "gaugeChart.name" | "chartGroup.name" | "chartGroup.cells" | "chartGroup.cell" | "searchBox.placeholder" | "searchBox.clear" | "sidePanel.title" | "slider.title" | "menuItem.deleteCustom" | "listbox.search" | "tag.close" | "sidebar.navigation" | "sidebar.expand" | "sidebar.collapse" | "sidebarItem.updated" | "sidebar.resize" | "pagination.pageSize" | "pagination.previous" | "pagination.next" | "pagination.page" | "otpInput.invalidCode" | "input.clear" | "input.showPassword" | "input.hidePassword" | "passwordStrength.minimumLength" | "passwordStrength.requirements" | "passwordStrength.lowercase" | "passwordStrength.uppercase" | "passwordStrength.number" | "passwordStrength.symbol" | "input.increment" | "input.decrement" | "input.openTime" | "input.openDate" | "input.year" | "input.month" | "input.day" | "input.week" | "input.hour" | "input.minute" | "input.second" | "input.yearPlaceholder" | "input.monthPlaceholder" | "input.dayPlaceholder" | "input.weekPlaceholder" | "imageViewer.previous" | "imageViewer.next" | "imageViewer.close" | "toast.close" | "table.noData" | "table.loadMore" | "table.scrollRegion" | "table.scrollRegionNamed" | "tableHead.selectAll" | "tableHead.resizeColumn" | "tableHead.resizeColumnGeneric" | "tableCell.selectRow" | "text.expand" | "textarea.resize" | "indicator.resizeWidth" | "indicator.resizeHeight" | "indicator.resizeBoth" | "colorSchemeButton.toLight" | "colorSchemeButton.toDark" | "styleButton.toSnowUI" | "styleButton.toApple" | "sidePanel.placement.toInline" | "sidePanel.placement.toFloating" | "sidePanel.previous" | "sidePanel.next" | "sidePanel.copy" | "sidePanel.delete" | "sidePanel.cancel" | "sidePanel.save" | "sidePanel.close" | "sidePanel.resize" | "tableToolbar.name" | "tableToolbar.search" | "tableToolbar.sort" | "tableToolbar.filter" | "tableToolbar.clear" | "tableToolbar.copy" | "tableToolbar.delete" | "tableToolbar.selected" | "tableToolbar.deleting" | "tableToolbar.defaultSort" | "tableToolbar.ascending" | "tableToolbar.descending" | "tableToolbar.defaultFilter" | "overflowActions.more" | "dialog.close";
4
4
  export type SnowUIMessageValues = Record<string, string | number>;
5
5
  export type SnowUIMessageOverrides = Partial<Record<SnowUIMessageKey, string>>;
6
6
  export declare const SNOWUI_MESSAGES: Record<string, Record<SnowUIMessageKey, string>>;
@@ -73,6 +73,8 @@ export const SNOWUI_MESSAGES = {
73
73
  "imageViewer.next": "下一张",
74
74
  "imageViewer.close": "关闭图片预览",
75
75
  "toast.close": "关闭通知",
76
+ "table.noData": "暂无数据",
77
+ "table.loadMore": "加载更多",
76
78
  "table.scrollRegion": "可横向滚动的表格",
77
79
  "table.scrollRegionNamed": "{{name}},可横向滚动",
78
80
  "tableHead.selectAll": "选择全部当前行",
@@ -184,6 +186,8 @@ export const SNOWUI_MESSAGES = {
184
186
  "imageViewer.next": "Next image",
185
187
  "imageViewer.close": "Close image viewer",
186
188
  "toast.close": "Close notification",
189
+ "table.noData": "No data",
190
+ "table.loadMore": "Load more",
187
191
  "table.scrollRegion": "Scrollable table",
188
192
  "table.scrollRegionNamed": "{{name}}, horizontally scrollable",
189
193
  "tableHead.selectAll": "Select all current rows",
@@ -128,3 +128,4 @@ export { default as SearchPopup, type SearchPopupItem } from "./blocks/SearchPop
128
128
  export { default as BlurText } from "./components/BlurText.js";
129
129
  export { default as MetricCard } from "./components/MetricCard.js";
130
130
  export { default as PasswordStrength, evaluatePasswordStrength, type PasswordStrengthLevel, type PasswordStrengthEvaluator } from "./components/PasswordStrength.js";
131
+ export { SIDEBAR_DRAWER_STYLE } from "./motion/presets/sidebar-drawer";
@@ -118,3 +118,4 @@ export { default as SearchPopup } from "./blocks/SearchPopup.js";
118
118
  export { default as BlurText } from "./components/BlurText.js";
119
119
  export { default as MetricCard } from "./components/MetricCard.js";
120
120
  export { default as PasswordStrength, evaluatePasswordStrength } from "./components/PasswordStrength.js";
121
+ export { SIDEBAR_DRAWER_STYLE } from "./motion/presets/sidebar-drawer.js";
@@ -10,7 +10,7 @@ var root_2 = $.from_html(`<!> <div class="snowui-chart-hover-panel-rows"></div>`
10
10
 
11
11
  const $$css = {
12
12
  hash: 'svelte-qoyt82',
13
- 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));}'
13
+ 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);-webkit-backdrop-filter:blur(1.25rem);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);-webkit-backdrop-filter:var(--snowui-backdrop-quick-action);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));}'
14
14
  };
15
15
 
16
16
  export default function ChartHoverPanel($$anchor, $$props) {
@@ -1,7 +1,7 @@
1
1
  export declare const DEFAULT_NUMBER_VALUE_LABEL_FRACTION_DIGITS = 2;
2
2
  export declare const DEFAULT_NUMBER_PERCENT_FRACTION_DIGITS = 1;
3
3
  export declare const DEFAULT_NUMBER_COMPACT_THRESHOLD = 1000000;
4
- export declare const DEFAULT_NUMBER_EMPTY_VALUE = "\u2014";
4
+ export declare const DEFAULT_NUMBER_EMPTY_VALUE = "-";
5
5
  export declare const DEFAULT_NUMBER_LOCALE = "en-US";
6
6
  export type NumberNotation = "standard" | "compact" | "auto";
7
7
  export interface NumberFormatOptions {
@@ -3,7 +3,7 @@
3
3
  export const DEFAULT_NUMBER_VALUE_LABEL_FRACTION_DIGITS = 2;
4
4
  export const DEFAULT_NUMBER_PERCENT_FRACTION_DIGITS = 1;
5
5
  export const DEFAULT_NUMBER_COMPACT_THRESHOLD = 1_000_000;
6
- export const DEFAULT_NUMBER_EMPTY_VALUE = "—";
6
+ export const DEFAULT_NUMBER_EMPTY_VALUE = "-";
7
7
  export const DEFAULT_NUMBER_LOCALE = "en-US";
8
8
  const ENGLISH_COMPACT_UNITS = [
9
9
  { value: 1_000_000_000_000, suffix: "t" },
@@ -68,6 +68,7 @@ export interface TableContext {
68
68
  setFilters: (filters: Record<string, unknown>) => void;
69
69
  getVariant: () => "striped" | "divided" | undefined;
70
70
  getLoading: () => boolean;
71
+ isEmpty: () => boolean;
71
72
  getLoadingMore: () => boolean;
72
73
  getLoadingRowCount: () => number;
73
74
  getLoadingSpinner: () => boolean;
@@ -41,6 +41,7 @@ const fallback = {
41
41
  setFilters: () => {},
42
42
  getVariant: () => undefined,
43
43
  getLoading: () => false,
44
+ isEmpty: () => false,
44
45
  getLoadingMore: () => false,
45
46
  getLoadingRowCount: () => 10,
46
47
  getLoadingSpinner: () => false,
@@ -0,0 +1,7 @@
1
+ /** Split text into word and separator segments without losing whitespace. */
2
+ export declare function splitTextMotionWords(value: string, locale?: string): string[];
3
+ /**
4
+ * Group graphemes of a rendered text node by their actual horizontal layout line.
5
+ * The caller must measure again after text, font, or layout changes.
6
+ */
7
+ export declare function splitTextMotionLines(node: Text): string[];
@@ -0,0 +1,49 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
3
+ import { splitTextMotionGraphemes } from "./layout.js";
4
+ /** Split text into word and separator segments without losing whitespace. */
5
+ export function splitTextMotionWords(value, locale) {
6
+ if (typeof Intl !== "undefined" && "Segmenter" in Intl) {
7
+ const segmenter = new Intl.Segmenter(locale, { granularity: "word" });
8
+ return Array.from(segmenter.segment(value), (part) => part.segment);
9
+ }
10
+ return value.match(/\s+|[^\s]+/gu) ?? [];
11
+ }
12
+ /**
13
+ * Group graphemes of a rendered text node by their actual horizontal layout line.
14
+ * The caller must measure again after text, font, or layout changes.
15
+ */
16
+ export function splitTextMotionLines(node) {
17
+ const range = node.ownerDocument.createRange();
18
+ const lines = [];
19
+ let offset = 0;
20
+ let previousTop;
21
+ let pending = "";
22
+ for (const grapheme of splitTextMotionGraphemes(node.data)) {
23
+ range.setStart(node, offset);
24
+ offset += grapheme.length;
25
+ range.setEnd(node, offset);
26
+ const rect = Array.from(range.getClientRects()).find((item) => item.height > 0);
27
+ if (!rect) {
28
+ pending += grapheme;
29
+ continue;
30
+ }
31
+ if (previousTop === undefined || Math.abs(rect.top - previousTop) > 1) {
32
+ lines.push(pending + grapheme);
33
+ pending = "";
34
+ previousTop = rect.top;
35
+ }
36
+ else {
37
+ lines[lines.length - 1] += pending + grapheme;
38
+ pending = "";
39
+ }
40
+ }
41
+ range.detach();
42
+ if (pending) {
43
+ if (lines.length)
44
+ lines[lines.length - 1] += pending;
45
+ else
46
+ lines.push(pending);
47
+ }
48
+ return lines;
49
+ }
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from "svelte";
2
+ type $$ComponentProps = {
3
+ enabled: boolean;
4
+ message: string;
5
+ id: string;
6
+ children: Snippet;
7
+ };
8
+ declare const RequiredFeedback: import("svelte").Component<$$ComponentProps, {}, "">;
9
+ type RequiredFeedback = ReturnType<typeof RequiredFeedback>;
10
+ export default RequiredFeedback;
@@ -0,0 +1,71 @@
1
+ import 'svelte/internal/disclose-version';
2
+ import * as $ from 'svelte/internal/client';
3
+ import Text from "../components/Text.js";
4
+
5
+ var root = $.from_html(`<div class="snowui-required-feedback svelte-1tekhsm"><!> <!></div>`);
6
+
7
+ const $$css = {
8
+ hash: 'svelte-1tekhsm',
9
+ code: '.snowui-required-feedback.svelte-1tekhsm {display:flex;flex-direction:column;gap:var(--size-0-5, 0.125rem);min-width:0;}[data-required-invalid="true"] {outline:var(--snowui-field-border-width, 0.03125rem) solid var(--secondary-red, #ff4747ff);outline-offset:calc(-1 * var(--snowui-field-border-width, 0.03125rem));}'
10
+ };
11
+
12
+ export default function RequiredFeedback($$anchor, $$props) {
13
+ $.append_styles($$anchor, $$css);
14
+
15
+ var fragment = $.comment();
16
+ var node = $.first_child(fragment);
17
+
18
+ {
19
+ var consequent_1 = ($$anchor) => {
20
+ var div = root();
21
+ var node_1 = $.child(div);
22
+
23
+ $.snippet(node_1, () => $$props.children);
24
+
25
+ var node_2 = $.sibling(node_1, 2);
26
+
27
+ {
28
+ var consequent = ($$anchor) => {
29
+ Text($$anchor, {
30
+ get id() {
31
+ return $$props.id;
32
+ },
33
+ as: 'error',
34
+ role: 'alert',
35
+ class: 'snowui-field-error-message',
36
+ children: ($$anchor, $$slotProps) => {
37
+ $.next();
38
+
39
+ var text = $.text();
40
+
41
+ $.template_effect(() => $.set_text(text, $$props.message));
42
+ $.append($$anchor, text);
43
+ },
44
+ $$slots: { default: true }
45
+ });
46
+ };
47
+
48
+ $.if(node_2, ($$render) => {
49
+ if ($$props.message) $$render(consequent);
50
+ });
51
+ }
52
+
53
+ $.reset(div);
54
+ $.append($$anchor, div);
55
+ };
56
+
57
+ var alternate = ($$anchor) => {
58
+ var fragment_3 = $.comment();
59
+ var node_3 = $.first_child(fragment_3);
60
+
61
+ $.snippet(node_3, () => $$props.children);
62
+ $.append($$anchor, fragment_3);
63
+ };
64
+
65
+ $.if(node, ($$render) => {
66
+ if ($$props.enabled) $$render(consequent_1); else $$render(alternate, -1);
67
+ });
68
+ }
69
+
70
+ $.append($$anchor, fragment);
71
+ }
@@ -0,0 +1,5 @@
1
+ export type PreferredColorScheme = 'light' | 'dark';
2
+ export declare const themePreferenceCookie = "snowui_theme";
3
+ export declare const themePreferenceMaxAge: number;
4
+ export declare function saveColorSchemePreference(scheme: PreferredColorScheme): void;
5
+ export declare function observeColorSchemePreference(update: (scheme: PreferredColorScheme) => void): () => void;
@@ -0,0 +1,46 @@
1
+ export const themePreferenceCookie = 'snowui_theme';
2
+ export const themePreferenceMaxAge = 365 * 24 * 60 * 60;
3
+ const changeEvent = 'snowui:color-scheme';
4
+ function savedPreference() {
5
+ const value = document.cookie.split('; ').find((part) => part.startsWith(`${themePreferenceCookie}=`))?.slice(themePreferenceCookie.length + 1);
6
+ if (!value)
7
+ return null;
8
+ const [scheme, expiration] = value.split('.');
9
+ const expires = Number(expiration);
10
+ return (scheme === 'light' || scheme === 'dark') && Number.isFinite(expires) && expires > Date.now()
11
+ ? { scheme, expires } : null;
12
+ }
13
+ export function saveColorSchemePreference(scheme) {
14
+ const expires = Date.now() + themePreferenceMaxAge * 1000;
15
+ document.cookie = `${themePreferenceCookie}=${scheme}.${expires}; Path=/; Max-Age=${themePreferenceMaxAge}; SameSite=Lax${location.protocol === 'https:' ? '; Secure' : ''}`;
16
+ window.dispatchEvent(new CustomEvent(changeEvent));
17
+ }
18
+ export function observeColorSchemePreference(update) {
19
+ const media = window.matchMedia('(prefers-color-scheme: dark)');
20
+ let timer;
21
+ function scheduleExpiration() {
22
+ clearTimeout(timer);
23
+ const preference = savedPreference();
24
+ if (preference)
25
+ timer = setTimeout(refresh, Math.min(preference.expires - Date.now(), 2_147_483_647));
26
+ }
27
+ function refresh() {
28
+ const preference = savedPreference();
29
+ update(preference?.scheme ?? (media.matches ? 'dark' : 'light'));
30
+ scheduleExpiration();
31
+ }
32
+ function resume() { if (document.visibilityState === 'visible')
33
+ refresh(); }
34
+ media.addEventListener('change', refresh);
35
+ window.addEventListener(changeEvent, refresh);
36
+ window.addEventListener('focus', refresh);
37
+ document.addEventListener('visibilitychange', resume);
38
+ refresh();
39
+ return () => {
40
+ clearTimeout(timer);
41
+ media.removeEventListener('change', refresh);
42
+ window.removeEventListener(changeEvent, refresh);
43
+ window.removeEventListener('focus', refresh);
44
+ document.removeEventListener('visibilitychange', resume);
45
+ };
46
+ }
@@ -9,5 +9,5 @@ export function contentLineGap(value, singleLine = false) {
9
9
  const preferred = value === 0 || value === "0" ? "0px" : typeof value === "number"
10
10
  ? `var(--gap-${value}, calc(4px * ${value} * var(--gap-scale, 1)))`
11
11
  : String(value);
12
- return singleLine ? `max(4px, ${preferred})` : preferred;
12
+ return singleLine ? `max(var(--snowui-single-line-gap-floor, 4px), ${preferred})` : preferred;
13
13
  }
@@ -21,6 +21,7 @@ export interface FrameInlineStyleRuntimeOptions {
21
21
  getIdentityId: () => string | undefined;
22
22
  getEffectiveLoading: () => boolean;
23
23
  getShouldRenderSkeleton: () => boolean;
24
+ getShouldRenderDirectSkeleton: () => boolean;
24
25
  getResolvedStateStyle: () => string;
25
26
  getOrchestratedStyle: () => string;
26
27
  }
@@ -374,6 +374,7 @@ export function createFrameInlineStyleRuntime(options) {
374
374
  shouldRenderSkeleton
375
375
  ? "background: transparent; border-color: transparent; box-shadow: none; color: transparent; background-image: none;"
376
376
  : "",
377
+ options.getShouldRenderDirectSkeleton() ? "padding: 0; border-width: 0;" : "",
377
378
  toJsonCssVariable("--snowui-frame-while-appear", $.get(resolvedWhile).whileAppear),
378
379
  toJsonCssVariable("--snowui-frame-while-disappear", $.get(resolvedWhile).whileDisappear),
379
380
  toJsonCssVariable("--snowui-frame-while-idle", $.get(resolvedWhile).whileIdle),
@@ -247,15 +247,16 @@ export class FrameResponsive {
247
247
  this.#restoreSpacing(node);
248
248
 
249
249
  const computed = getComputedStyle(node);
250
+ const lineGapFloor = px(computed.getPropertyValue("--snowui-single-line-gap-floor") || "4px");
250
251
  let gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
251
252
 
252
- if (isSingleLineLayout(this.#getProps()) && gap < 4) {
253
- gap = 4;
254
- node.style.setProperty("gap", "4px");
253
+ if (isSingleLineLayout(this.#getProps()) && gap < lineGapFloor) {
254
+ gap = lineGapFloor;
255
+ node.style.setProperty("gap", `${lineGapFloor}px`);
255
256
  }
256
257
 
257
258
  const gapFloor = isSingleLineLayout(this.#getProps())
258
- ? Math.max(4, resolveFloor(gap, this.config?.minGap))
259
+ ? Math.max(lineGapFloor, resolveFloor(gap, this.config?.minGap))
259
260
  : resolveFloor(gap, this.config?.minGap);
260
261
 
261
262
  node.style.setProperty("gap", `${gapFloor}px`);
@@ -277,15 +278,16 @@ export class FrameResponsive {
277
278
  this.#applyFallbackAttributes(node);
278
279
 
279
280
  const computed = getComputedStyle(node);
281
+ const lineGapFloor = px(computed.getPropertyValue("--snowui-single-line-gap-floor") || "4px");
280
282
  const direction = computed.flexDirection;
281
283
  const isFlex = computed.display === "flex" || computed.display === "inline-flex";
282
284
  const isRow = isFlex && (direction === "row" || direction === "row-reverse");
283
285
  const children = Array.from(node.children).filter(isMeasurableChild);
284
286
  let gap = px(computed.columnGap === "normal" ? "0" : computed.columnGap);
285
287
 
286
- if (isSingleLineLayout(this.#getProps()) && gap < 4) {
287
- gap = 4;
288
- node.style.setProperty("gap", "4px");
288
+ if (isSingleLineLayout(this.#getProps()) && gap < lineGapFloor) {
289
+ gap = lineGapFloor;
290
+ node.style.setProperty("gap", `${lineGapFloor}px`);
289
291
  }
290
292
 
291
293
  const padding = {
@@ -312,7 +314,7 @@ export class FrameResponsive {
312
314
  if (preferredWidth <= width + EPSILON) return;
313
315
 
314
316
  const gapFloor = isSingleLineLayout(this.#getProps())
315
- ? Math.max(4, resolveFloor(gap, this.config?.minGap))
317
+ ? Math.max(lineGapFloor, resolveFloor(gap, this.config?.minGap))
316
318
  : resolveFloor(gap, this.config?.minGap);
317
319
 
318
320
  const paddingFloor = {
@@ -0,0 +1,5 @@
1
+ type Control = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
2
+ export declare function useNativeValidation(getControl: () => Control | undefined, focus?: () => void): {
3
+ readonly message: string;
4
+ };
5
+ export {};
@@ -0,0 +1,60 @@
1
+ /* native-validation.svelte.js generated by Svelte v5.56.4 */
2
+ import * as $ from 'svelte/internal/client';
3
+
4
+ export function useNativeValidation(getControl, focus) {
5
+ let message = $.state("");
6
+
7
+ $.user_effect(() => {
8
+ const control = getControl();
9
+
10
+ if (!control) return;
11
+
12
+ const form = control.form;
13
+
14
+ function invalid(event) {
15
+ if (event.defaultPrevented) return;
16
+
17
+ event.preventDefault();
18
+ $.set(message, control.validity.valueMissing ? "" : control.validationMessage, true);
19
+
20
+ const first = form
21
+ ? Array.from(form.elements).find((item) => item.matches(":invalid"))
22
+ : control;
23
+
24
+ if (first === control) {
25
+ if (focus) focus(); else control.focus();
26
+ }
27
+ }
28
+
29
+ function update() {
30
+ if ($.get(message)) $.set(message, control.validity.valueMissing ? "" : control.validationMessage, true);
31
+ }
32
+
33
+ function reset() {
34
+ $.set(message, "");
35
+ }
36
+
37
+ control.addEventListener("invalid", invalid);
38
+ control.addEventListener("input", update);
39
+ control.addEventListener("change", update);
40
+
41
+ const radioForm = control instanceof HTMLInputElement && control.type === "radio" ? form : null;
42
+
43
+ radioForm?.addEventListener("change", update);
44
+ form?.addEventListener("reset", reset);
45
+
46
+ return () => {
47
+ control.removeEventListener("invalid", invalid);
48
+ control.removeEventListener("input", update);
49
+ control.removeEventListener("change", update);
50
+ radioForm?.removeEventListener("change", update);
51
+ form?.removeEventListener("reset", reset);
52
+ };
53
+ });
54
+
55
+ return {
56
+ get message() {
57
+ return $.get(message);
58
+ }
59
+ };
60
+ }
@@ -0,0 +1 @@
1
+ export declare function useRequiredFeedback(getInput: () => HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | undefined, getSurface: () => HTMLElement | readonly HTMLElement[] | undefined, focus?: () => void): void;
@@ -0,0 +1,61 @@
1
+ /* required-feedback.svelte.js generated by Svelte v5.56.4 */
2
+ import * as $ from 'svelte/internal/client';
3
+ import { INPUT_REQUIRED_KEYFRAMES, INPUT_REQUIRED_TIMING } from "../motion/presets/input-required.js";
4
+
5
+ export function useRequiredFeedback(getInput, getSurface, focus) {
6
+ $.user_effect(() => {
7
+ const input = getInput();
8
+ const surface = getSurface();
9
+
10
+ if (!input || !surface) return;
11
+
12
+ let feedback = [];
13
+
14
+ function stop() {
15
+ feedback.forEach((animation) => animation.cancel());
16
+ feedback = [];
17
+ }
18
+
19
+ function invalid() {
20
+ if (!input.validity.valueMissing) return;
21
+
22
+ const first = input.form
23
+ ? Array.from(input.form.elements).find((control) => control.matches("input:invalid, textarea:invalid, select:invalid"))
24
+ : input;
25
+
26
+ if (first !== input) return;
27
+
28
+ stop();
29
+
30
+ if (focus) focus(); else input.focus();
31
+
32
+ if (!window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
33
+ const current = getSurface();
34
+ const surfaces = Array.isArray(current) ? current : current ? [current] : [];
35
+
36
+ feedback = surfaces.map((target) => {
37
+ const animation = target.animate(INPUT_REQUIRED_KEYFRAMES, INPUT_REQUIRED_TIMING);
38
+
39
+ animation.id = "snowui-required-feedback";
40
+
41
+ return animation;
42
+ });
43
+ }
44
+ }
45
+
46
+ input.addEventListener("invalid", invalid);
47
+ input.addEventListener("input", stop);
48
+ input.addEventListener("change", stop);
49
+ input.addEventListener("blur", stop);
50
+ input.form?.addEventListener("reset", stop);
51
+
52
+ return () => {
53
+ stop();
54
+ input.removeEventListener("invalid", invalid);
55
+ input.removeEventListener("input", stop);
56
+ input.removeEventListener("change", stop);
57
+ input.removeEventListener("blur", stop);
58
+ input.form?.removeEventListener("reset", stop);
59
+ };
60
+ });
61
+ }
@@ -20,6 +20,7 @@ export declare const PANEL_REVEAL_APPEAR_MOTION: MotionConfig;
20
20
  export declare const PANEL_REVEAL_DISAPPEAR_MOTION: MotionConfig;
21
21
  export declare const PAGE_SLIDE_FROM_RIGHT_MOTION: MotionConfig;
22
22
  export declare const PAGE_SLIDE_FROM_LEFT_MOTION: MotionConfig;
23
+ export declare const PANEL_EXIT_TIMING: Pick<MotionConfig, "type" | "duration" | "easing" | "stiffness" | "damping" | "mass">;
23
24
  /** 右侧抽屉 / SidePanel 浮层与内嵌模式:复用 Frame 默认位移动效时序。 */
24
25
  export declare const SIDE_PANEL_APPEAR_MOTION: MotionConfig;
25
26
  /** 右侧抽屉 / SidePanel 浮层与内嵌模式:复用 Frame 默认位移动效时序。 */
@@ -81,6 +81,17 @@ export const PAGE_SLIDE_FROM_LEFT_MOTION = {
81
81
  ...PAGE_SLIDE_FROM_RIGHT_MOTION,
82
82
  x: [-MOTION_DISTANCE_PAGE_SLIDE_X_PX, 0],
83
83
  };
84
+ // Panel exit timing shared by SidePanel and Sidebar hidden mode.
85
+ // Keep direction, distance, entrance timing and toggle behavior in each consumer.
86
+ // Contract: docs/standards/MotionPresetSpec.md, section 5 (SnowUI workspace).
87
+ export const PANEL_EXIT_TIMING = {
88
+ type: MOVE_RIGHT_MOTION.type,
89
+ duration: MOVE_RIGHT_MOTION.duration ?? MOTION_DURATION_PANEL_DISAPPEAR_MS,
90
+ easing: MOVE_RIGHT_MOTION.easing,
91
+ stiffness: MOVE_RIGHT_MOTION.stiffness,
92
+ damping: MOVE_RIGHT_MOTION.damping,
93
+ mass: MOVE_RIGHT_MOTION.mass,
94
+ };
84
95
  /** 右侧抽屉 / SidePanel 浮层与内嵌模式:复用 Frame 默认位移动效时序。 */
85
96
  export const SIDE_PANEL_APPEAR_MOTION = {
86
97
  ...MOVE_LEFT_MOTION,
@@ -90,8 +101,8 @@ export const SIDE_PANEL_APPEAR_MOTION = {
90
101
  /** 右侧抽屉 / SidePanel 浮层与内嵌模式:复用 Frame 默认位移动效时序。 */
91
102
  export const SIDE_PANEL_DISAPPEAR_MOTION = {
92
103
  ...MOVE_RIGHT_MOTION,
104
+ ...PANEL_EXIT_TIMING,
93
105
  x: [0, "calc(100% + var(--padding-4))"],
94
- duration: MOVE_RIGHT_MOTION.duration ?? MOTION_DURATION_PANEL_DISAPPEAR_MS,
95
106
  };
96
107
  export const TEXT_REVEAL_APPEAR_MOTION = {
97
108
  opacity: [0, 1],
@@ -0,0 +1,2 @@
1
+ export declare const INPUT_REQUIRED_KEYFRAMES: Keyframe[];
2
+ export declare const INPUT_REQUIRED_TIMING: KeyframeAnimationOptions;
@@ -0,0 +1,14 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
3
+ import { MOTION_DURATION_EMPHASIS_MS, MOTION_EASING_STANDARD } from "../tokens.js";
4
+ const active = "inset 0 0 0 var(--snowui-field-border-width, 0.03125rem) var(--secondary-red, #ff4747ff), 0 0 0 var(--snowui-field-focus-ring-width, 0.25rem) var(--snowui-field-focus-ring-color, var(--black-4, #0000000a))";
5
+ const idle = "inset 0 0 0 var(--snowui-field-border-width, 0.03125rem) var(--secondary-red, #ff4747ff), 0 0 0 0 transparent";
6
+ export const INPUT_REQUIRED_KEYFRAMES = [
7
+ { boxShadow: active },
8
+ { boxShadow: idle },
9
+ { boxShadow: active },
10
+ ];
11
+ export const INPUT_REQUIRED_TIMING = {
12
+ duration: MOTION_DURATION_EMPHASIS_MS * 2,
13
+ easing: MOTION_EASING_STANDARD,
14
+ };
@@ -0,0 +1 @@
1
+ export declare const SIDEBAR_DRAWER_STYLE: string;
@@ -0,0 +1,13 @@
1
+ /* SnowUI source notice | LICENSE 2.3.0: ../../../../LICENSE
2
+ 复制或移植时随附该版本完整 LICENSE 与第三方声明;同任务、同版本、同已确认用途不逐组件重复检查。 */
3
+ import { PANEL_EXIT_TIMING } from "./effects.js";
4
+ import { resolveMotionCssTiming } from "../spring.js";
5
+ const closeTiming = resolveMotionCssTiming(PANEL_EXIT_TIMING);
6
+ // PANEL_EXIT_TIMING is shared with SidePanel; CSS is only an execution adapter.
7
+ // Preserve Sidebar entrance timing and its own slide geometry.
8
+ export const SIDEBAR_DRAWER_STYLE = [
9
+ "--snowui-sidebar-drawer-duration: 220ms",
10
+ "--snowui-sidebar-drawer-easing: ease",
11
+ `--snowui-sidebar-drawer-close-duration: ${closeTiming.duration}ms`,
12
+ `--snowui-sidebar-drawer-close-easing: ${closeTiming.easing}`,
13
+ ].join("; ");