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

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 (280) hide show
  1. package/AGENTS.md +21 -0
  2. package/LICENSE +133 -89
  3. package/README.md +21 -7
  4. package/component-catalog.json +505 -84
  5. package/dist/client/blocks/Sidebar.js +75 -46
  6. package/dist/client/blocks/SidebarSection.js +3 -1
  7. package/dist/client/blocks/index.js +2 -0
  8. package/dist/client/compat.js +2 -0
  9. package/dist/client/components/BarChart.js +1 -1
  10. package/dist/client/components/Breadcrumb.js +17 -11
  11. package/dist/client/components/CircularChart.js +2 -2
  12. package/dist/client/components/CodeBlock.js +278 -225
  13. package/dist/client/components/CopyButton.js +5 -2
  14. package/dist/client/components/ExpandButton.js +10 -3
  15. package/dist/client/components/Frame.js +15 -9
  16. package/dist/client/components/GaugeChart.js +2 -2
  17. package/dist/client/components/ImageViewer.js +51 -27
  18. package/dist/client/components/Indicator.js +5 -3
  19. package/dist/client/components/Input.js +27 -17
  20. package/dist/client/components/LineChart.js +1 -1
  21. package/dist/client/components/Link.d.ts +1 -1
  22. package/dist/client/components/Link.js +43 -22
  23. package/dist/client/components/Listbox.js +26 -15
  24. package/dist/client/components/OverflowAction.d.ts +2 -0
  25. package/dist/client/components/OverflowAction.js +146 -65
  26. package/dist/client/components/OverflowActions.d.ts +2 -0
  27. package/dist/client/components/OverflowActions.js +67 -16
  28. package/dist/client/components/Pagination.js +71 -48
  29. package/dist/client/components/Select.js +29 -18
  30. package/dist/client/components/SidePanel.js +76 -50
  31. package/dist/client/components/Tab.js +30 -31
  32. package/dist/client/components/TableBody.js +10 -4
  33. package/dist/client/components/TableCell.js +57 -32
  34. package/dist/client/components/TableHead.js +69 -38
  35. package/dist/client/components/TableToolbar.js +112 -79
  36. package/dist/client/components/Text.js +103 -47
  37. package/dist/client/components/Textarea.js +7 -1
  38. package/dist/client/components/Toast.js +8 -1
  39. package/dist/client/components/Tooltip.js +200 -195
  40. package/dist/client/context.js +2 -0
  41. package/dist/client/dev.js +2 -0
  42. package/dist/client/i18n/messages.d.ts +2 -2
  43. package/dist/client/i18n/messages.js +117 -1
  44. package/dist/client/index.d.ts +1 -1
  45. package/dist/client/index.js +3 -1
  46. package/dist/client/internal/code-block/prettier-svelte.d.ts +2 -0
  47. package/dist/client/internal/component-icon/index.js +2 -0
  48. package/dist/client/internal/snow-ui-logo/emoji-metrics.js +2 -0
  49. package/dist/client/keys.js +2 -0
  50. package/dist/client/lib/adaptive-contrast-renderer.js +2 -0
  51. package/dist/client/lib/chart/appearance-timeline.js +2 -0
  52. package/dist/client/lib/chart/arc-path.js +2 -0
  53. package/dist/client/lib/chart/colors.js +2 -0
  54. package/dist/client/lib/chart/size.js +2 -0
  55. package/dist/client/lib/clipboard.js +2 -0
  56. package/dist/client/lib/color.js +2 -0
  57. package/dist/client/lib/date-format.js +2 -0
  58. package/dist/client/lib/edge-fade.js +2 -0
  59. package/dist/client/lib/number-format.js +8 -0
  60. package/dist/client/lib/overflow-actions-motion.js +2 -0
  61. package/dist/client/lib/overlay-trigger-timing.js +2 -0
  62. package/dist/client/lib/progressive-blur.d.ts +13 -0
  63. package/dist/client/lib/progressive-blur.js +54 -0
  64. package/dist/client/lib/responsive-exit.js +2 -0
  65. package/dist/client/lib/search-filter.js +2 -0
  66. package/dist/client/lib/side-panel.js +2 -0
  67. package/dist/client/lib/split-pane.js +2 -0
  68. package/dist/client/lib/table-column-motion.js +2 -0
  69. package/dist/client/lib/table-responsive.js +2 -0
  70. package/dist/client/lib/table-selection-fade.js +2 -0
  71. package/dist/client/lib/table-truncation.js +2 -0
  72. package/dist/client/lib/text-motion/animation.js +2 -0
  73. package/dist/client/lib/text-motion/character.js +2 -0
  74. package/dist/client/lib/text-motion/color.js +2 -0
  75. package/dist/client/lib/text-motion/layout.js +2 -0
  76. package/dist/client/lib/text-motion/preference.js +2 -0
  77. package/dist/client/lib/text-motion/sequence.js +2 -0
  78. package/dist/client/lib/text-motion/typography.js +2 -0
  79. package/dist/client/lib/tooltip-delay.js +2 -0
  80. package/dist/client/lib/tooltip-motion-dismiss.js +2 -0
  81. package/dist/client/lib/tooltip-pointer-speed.js +2 -0
  82. package/dist/client/lib/truncate.js +2 -0
  83. package/dist/client/logic/ComponentPartsBoundary.d.ts +7 -0
  84. package/dist/client/logic/ComponentPartsBoundary.js +15 -0
  85. package/dist/client/logic/frame-field-control.js +2 -0
  86. package/dist/client/logic/frame-motion-defaults.js +2 -0
  87. package/dist/client/logic/frame-prop-filter.js +2 -0
  88. package/dist/client/logic/geometry-cache.js +2 -0
  89. package/dist/client/logic/layout-flip.js +2 -0
  90. package/dist/client/logic/morph.js +2 -0
  91. package/dist/client/logic/motion-engine.js +2 -0
  92. package/dist/client/logic/motion-orchestration.js +2 -0
  93. package/dist/client/logic/motion-types.js +2 -0
  94. package/dist/client/logic/overflow-actions.d.ts +3 -2
  95. package/dist/client/logic/wc-adapter.js +2 -0
  96. package/dist/client/motion/bridge.js +2 -0
  97. package/dist/client/motion/content-crossfade.js +2 -0
  98. package/dist/client/motion/expand.js +2 -0
  99. package/dist/client/motion/fade-in.js +2 -0
  100. package/dist/client/motion/fade-out.js +2 -0
  101. package/dist/client/motion/morph.js +2 -0
  102. package/dist/client/motion/move.js +2 -0
  103. package/dist/client/motion/number.js +2 -0
  104. package/dist/client/motion/replace.js +2 -0
  105. package/dist/client/motion/rotate.css +2 -0
  106. package/dist/client/motion/rotate.js +2 -0
  107. package/dist/client/motion/scale-in.js +2 -0
  108. package/dist/client/motion/tokens.js +2 -0
  109. package/dist/client/motion/while-2xl.js +2 -0
  110. package/dist/client/motion/while-active.js +2 -0
  111. package/dist/client/motion/while-appear.js +2 -0
  112. package/dist/client/motion/while-click.js +2 -0
  113. package/dist/client/motion/while-collapsed.js +2 -0
  114. package/dist/client/motion/while-disabled.js +2 -0
  115. package/dist/client/motion/while-disappear.js +2 -0
  116. package/dist/client/motion/while-drag.js +2 -0
  117. package/dist/client/motion/while-editing.js +2 -0
  118. package/dist/client/motion/while-expanded.js +2 -0
  119. package/dist/client/motion/while-focus.js +2 -0
  120. package/dist/client/motion/while-hover.js +2 -0
  121. package/dist/client/motion/while-idle.js +2 -0
  122. package/dist/client/motion/while-key.js +2 -0
  123. package/dist/client/motion/while-lg.js +2 -0
  124. package/dist/client/motion/while-load.js +2 -0
  125. package/dist/client/motion/while-md.js +2 -0
  126. package/dist/client/motion/while-reload.js +2 -0
  127. package/dist/client/motion/while-scroll.js +2 -0
  128. package/dist/client/motion/while-sm.js +2 -0
  129. package/dist/client/motion/while-uploading.js +2 -0
  130. package/dist/client/motion/while-validating.js +2 -0
  131. package/dist/client/motion/while-xl.js +2 -0
  132. package/dist/client/motion/while-xs.js +2 -0
  133. package/dist/client/styles/auto-layout.css +3 -1
  134. package/dist/client/styles/backdrop.css +2 -0
  135. package/dist/client/styles/components.css +6 -4
  136. package/dist/client/styles/index.css +2 -0
  137. package/dist/client/styles/layout.css +20 -4
  138. package/dist/client/styles/scale.css +2 -0
  139. package/dist/client/styles/scrollbar.css +3 -1
  140. package/dist/client/styles/tokens.css +2 -0
  141. package/dist/client/vite-env.d.ts +2 -0
  142. package/dist/server/blocks/Sidebar.js +41 -21
  143. package/dist/server/blocks/SidebarSection.js +3 -1
  144. package/dist/server/blocks/index.js +2 -0
  145. package/dist/server/compat.js +2 -0
  146. package/dist/server/components/BarChart.js +1 -1
  147. package/dist/server/components/Breadcrumb.js +9 -2
  148. package/dist/server/components/CircularChart.js +2 -2
  149. package/dist/server/components/CodeBlock.js +25 -13
  150. package/dist/server/components/CopyButton.js +6 -2
  151. package/dist/server/components/ExpandButton.js +7 -3
  152. package/dist/server/components/Frame.js +10 -3
  153. package/dist/server/components/GaugeChart.js +2 -2
  154. package/dist/server/components/ImageViewer.js +6 -3
  155. package/dist/server/components/Indicator.js +5 -3
  156. package/dist/server/components/Input.js +14 -17
  157. package/dist/server/components/LineChart.js +1 -1
  158. package/dist/server/components/Link.d.ts +1 -1
  159. package/dist/server/components/Link.js +20 -3
  160. package/dist/server/components/Listbox.js +17 -4
  161. package/dist/server/components/OverflowAction.d.ts +2 -0
  162. package/dist/server/components/OverflowAction.js +70 -26
  163. package/dist/server/components/OverflowActions.d.ts +2 -0
  164. package/dist/server/components/OverflowActions.js +49 -14
  165. package/dist/server/components/Pagination.js +21 -10
  166. package/dist/server/components/Select.js +23 -11
  167. package/dist/server/components/SidePanel.js +28 -8
  168. package/dist/server/components/Tab.js +61 -52
  169. package/dist/server/components/TableBody.js +9 -2
  170. package/dist/server/components/TableCell.js +28 -7
  171. package/dist/server/components/TableHead.js +31 -7
  172. package/dist/server/components/TableToolbar.js +57 -30
  173. package/dist/server/components/Text.js +52 -12
  174. package/dist/server/components/Textarea.js +4 -1
  175. package/dist/server/components/Toast.js +4 -1
  176. package/dist/server/components/Tooltip.js +10 -10
  177. package/dist/server/context.js +2 -0
  178. package/dist/server/dev.js +2 -0
  179. package/dist/server/i18n/messages.d.ts +2 -2
  180. package/dist/server/i18n/messages.js +117 -1
  181. package/dist/server/index.d.ts +1 -1
  182. package/dist/server/index.js +3 -1
  183. package/dist/server/internal/code-block/prettier-svelte.d.ts +2 -0
  184. package/dist/server/internal/component-icon/index.js +2 -0
  185. package/dist/server/internal/snow-ui-logo/emoji-metrics.js +2 -0
  186. package/dist/server/keys.js +2 -0
  187. package/dist/server/lib/adaptive-contrast-renderer.js +2 -0
  188. package/dist/server/lib/chart/appearance-timeline.js +2 -0
  189. package/dist/server/lib/chart/arc-path.js +2 -0
  190. package/dist/server/lib/chart/colors.js +2 -0
  191. package/dist/server/lib/chart/size.js +2 -0
  192. package/dist/server/lib/clipboard.js +2 -0
  193. package/dist/server/lib/color.js +2 -0
  194. package/dist/server/lib/date-format.js +2 -0
  195. package/dist/server/lib/edge-fade.js +2 -0
  196. package/dist/server/lib/number-format.js +8 -0
  197. package/dist/server/lib/overflow-actions-motion.js +2 -0
  198. package/dist/server/lib/overlay-trigger-timing.js +2 -0
  199. package/dist/server/lib/progressive-blur.d.ts +13 -0
  200. package/dist/server/lib/progressive-blur.js +54 -0
  201. package/dist/server/lib/responsive-exit.js +2 -0
  202. package/dist/server/lib/search-filter.js +2 -0
  203. package/dist/server/lib/side-panel.js +2 -0
  204. package/dist/server/lib/split-pane.js +2 -0
  205. package/dist/server/lib/table-column-motion.js +2 -0
  206. package/dist/server/lib/table-responsive.js +2 -0
  207. package/dist/server/lib/table-selection-fade.js +2 -0
  208. package/dist/server/lib/table-truncation.js +2 -0
  209. package/dist/server/lib/text-motion/animation.js +2 -0
  210. package/dist/server/lib/text-motion/character.js +2 -0
  211. package/dist/server/lib/text-motion/color.js +2 -0
  212. package/dist/server/lib/text-motion/layout.js +2 -0
  213. package/dist/server/lib/text-motion/preference.js +2 -0
  214. package/dist/server/lib/text-motion/sequence.js +2 -0
  215. package/dist/server/lib/text-motion/typography.js +2 -0
  216. package/dist/server/lib/tooltip-delay.js +2 -0
  217. package/dist/server/lib/tooltip-motion-dismiss.js +2 -0
  218. package/dist/server/lib/tooltip-pointer-speed.js +2 -0
  219. package/dist/server/lib/truncate.js +2 -0
  220. package/dist/server/logic/ComponentPartsBoundary.d.ts +7 -0
  221. package/dist/server/logic/ComponentPartsBoundary.js +12 -0
  222. package/dist/server/logic/frame-field-control.js +2 -0
  223. package/dist/server/logic/frame-motion-defaults.js +2 -0
  224. package/dist/server/logic/frame-prop-filter.js +2 -0
  225. package/dist/server/logic/geometry-cache.js +2 -0
  226. package/dist/server/logic/layout-flip.js +2 -0
  227. package/dist/server/logic/morph.js +2 -0
  228. package/dist/server/logic/motion-engine.js +2 -0
  229. package/dist/server/logic/motion-orchestration.js +2 -0
  230. package/dist/server/logic/motion-types.js +2 -0
  231. package/dist/server/logic/overflow-actions.d.ts +3 -2
  232. package/dist/server/logic/wc-adapter.js +2 -0
  233. package/dist/server/motion/bridge.js +2 -0
  234. package/dist/server/motion/content-crossfade.js +2 -0
  235. package/dist/server/motion/expand.js +2 -0
  236. package/dist/server/motion/fade-in.js +2 -0
  237. package/dist/server/motion/fade-out.js +2 -0
  238. package/dist/server/motion/morph.js +2 -0
  239. package/dist/server/motion/move.js +2 -0
  240. package/dist/server/motion/number.js +2 -0
  241. package/dist/server/motion/replace.js +2 -0
  242. package/dist/server/motion/rotate.css +2 -0
  243. package/dist/server/motion/rotate.js +2 -0
  244. package/dist/server/motion/scale-in.js +2 -0
  245. package/dist/server/motion/tokens.js +2 -0
  246. package/dist/server/motion/while-2xl.js +2 -0
  247. package/dist/server/motion/while-active.js +2 -0
  248. package/dist/server/motion/while-appear.js +2 -0
  249. package/dist/server/motion/while-click.js +2 -0
  250. package/dist/server/motion/while-collapsed.js +2 -0
  251. package/dist/server/motion/while-disabled.js +2 -0
  252. package/dist/server/motion/while-disappear.js +2 -0
  253. package/dist/server/motion/while-drag.js +2 -0
  254. package/dist/server/motion/while-editing.js +2 -0
  255. package/dist/server/motion/while-expanded.js +2 -0
  256. package/dist/server/motion/while-focus.js +2 -0
  257. package/dist/server/motion/while-hover.js +2 -0
  258. package/dist/server/motion/while-idle.js +2 -0
  259. package/dist/server/motion/while-key.js +2 -0
  260. package/dist/server/motion/while-lg.js +2 -0
  261. package/dist/server/motion/while-load.js +2 -0
  262. package/dist/server/motion/while-md.js +2 -0
  263. package/dist/server/motion/while-reload.js +2 -0
  264. package/dist/server/motion/while-scroll.js +2 -0
  265. package/dist/server/motion/while-sm.js +2 -0
  266. package/dist/server/motion/while-uploading.js +2 -0
  267. package/dist/server/motion/while-validating.js +2 -0
  268. package/dist/server/motion/while-xl.js +2 -0
  269. package/dist/server/motion/while-xs.js +2 -0
  270. package/dist/server/styles/auto-layout.css +3 -1
  271. package/dist/server/styles/backdrop.css +2 -0
  272. package/dist/server/styles/components.css +6 -4
  273. package/dist/server/styles/index.css +2 -0
  274. package/dist/server/styles/layout.css +20 -4
  275. package/dist/server/styles/scale.css +2 -0
  276. package/dist/server/styles/scrollbar.css +3 -1
  277. package/dist/server/styles/tokens.css +2 -0
  278. package/dist/server/vite-env.d.ts +2 -0
  279. package/llms.txt +5 -0
  280. package/package.json +14 -6
@@ -5,6 +5,7 @@ import Frame from "./Frame.js";
5
5
  import Button from "./Button.js";
6
6
  import Tooltip from "./Tooltip.js";
7
7
  import { ComponentIcon } from "../internal/component-icon/index.js";
8
+ import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
8
9
  import { fitTextToElement } from "../lib/truncate.js";
9
10
  import { TextTruncation } from "../logic/frame-truncation.js";
10
11
  import { collapse, findConstraintHost } from "../logic/text-collapse.js";
@@ -18,6 +19,7 @@ import {
18
19
  import { resolveParentStateValue } from "../logic/frame-state-value.js";
19
20
  import { useOverlayScrollbar } from "../lib/overlay-scrollbar.js";
20
21
  import { resizeManager } from "../logic/observer.js";
22
+ import { useLocale } from "../i18n/locale.js";
21
23
 
22
24
  var rest_excludes = new Set([
23
25
  '$$slots',
@@ -60,6 +62,8 @@ export default function Text($$anchor, $$props) {
60
62
  $.append_styles($$anchor, $$css);
61
63
 
62
64
  // SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
65
+ const localeContext = useLocale();
66
+
63
67
  const isTooltipConfigObject = (value) => {
64
68
  return typeof value === "object" && value !== null && typeof value !== "function";
65
69
  };
@@ -543,7 +547,17 @@ export default function Text($$anchor, $$props) {
543
547
  var div = root_1();
544
548
  var node_2 = $.child(div);
545
549
 
546
- $.snippet(node_2, () => $$props.children, () => ({ breakpoint: "md" }));
550
+ ComponentPartsBoundary(node_2, {
551
+ children: ($$anchor, $$slotProps) => {
552
+ var fragment_1 = $.comment();
553
+ var node_3 = $.first_child(fragment_1);
554
+
555
+ $.snippet(node_3, () => $$props.children, () => ({ breakpoint: "md" }));
556
+ $.append($$anchor, fragment_1);
557
+ },
558
+ $$slots: { default: true }
559
+ });
560
+
547
561
  $.reset(div);
548
562
  $.bind_this(div, ($$value) => $.set(skeletonProbe, $$value), () => $.get(skeletonProbe));
549
563
  $.append($$anchor, div);
@@ -554,19 +568,19 @@ export default function Text($$anchor, $$props) {
554
568
  });
555
569
  }
556
570
 
557
- var node_3 = $.sibling(node_1, 2);
571
+ var node_4 = $.sibling(node_1, 2);
558
572
 
559
573
  {
560
574
  const children = ($$anchor, $$arg0) => {
561
575
  let breakpoint = () => ($$arg0?.()).breakpoint;
562
- var fragment_1 = root_7();
563
- var node_4 = $.first_child(fragment_1);
576
+ var fragment_2 = root_7();
577
+ var node_5 = $.first_child(fragment_2);
564
578
 
565
579
  {
566
580
  var consequent_5 = ($$anchor) => {
567
- var fragment_2 = root_3();
568
- var div_1 = $.first_child(fragment_2);
569
- var node_5 = $.child(div_1);
581
+ var fragment_3 = root_3();
582
+ var div_1 = $.first_child(fragment_3);
583
+ var node_6 = $.child(div_1);
570
584
 
571
585
  {
572
586
  var consequent_1 = ($$anchor) => {
@@ -577,32 +591,47 @@ export default function Text($$anchor, $$props) {
577
591
  };
578
592
 
579
593
  var consequent_2 = ($$anchor) => {
580
- $$props.children($$anchor, () => ({ breakpoint: breakpoint() }));
594
+ ComponentPartsBoundary($$anchor, {
595
+ children: ($$anchor, $$slotProps) => {
596
+ var fragment_6 = $.comment();
597
+ var node_7 = $.first_child(fragment_6);
598
+
599
+ $.snippet(node_7, () => $$props.children, () => ({ breakpoint: breakpoint() }));
600
+ $.append($$anchor, fragment_6);
601
+ },
602
+ $$slots: { default: true }
603
+ });
581
604
  };
582
605
 
583
- $.if(node_5, ($$render) => {
606
+ $.if(node_6, ($$render) => {
584
607
  if ($.get(resolvedStateText) !== undefined) $$render(consequent_1); else if ($$props.children) $$render(consequent_2, 1);
585
608
  });
586
609
  }
587
610
 
588
- var node_6 = $.sibling(node_5, 2);
611
+ var node_8 = $.sibling(node_6, 2);
589
612
 
590
613
  {
591
614
  var consequent_3 = ($$anchor) => {
592
- Button($$anchor, $.spread_props(() => parts()?.Button, {
593
- as: 'more',
594
- iconOnly: true,
595
- 'aria-label': '展开',
596
- backgroundBlur: true,
597
- class: 'snowui-text-built-in-more',
598
- children: ($$anchor, $$slotProps) => {
599
- ComponentIcon($$anchor, { name: 'arrow-line-down', 'aria-hidden': 'true' });
600
- },
601
- $$slots: { default: true }
602
- }));
615
+ {
616
+ let $0 = $.derived(() => localeContext.t("text.expand"));
617
+
618
+ Button($$anchor, $.spread_props(() => parts()?.Button, {
619
+ as: 'more',
620
+ iconOnly: true,
621
+ get 'aria-label'() {
622
+ return $.get($0);
623
+ },
624
+ backgroundBlur: true,
625
+ class: 'snowui-text-built-in-more',
626
+ children: ($$anchor, $$slotProps) => {
627
+ ComponentIcon($$anchor, { name: 'arrow-line-down', 'aria-hidden': 'true' });
628
+ },
629
+ $$slots: { default: true }
630
+ }));
631
+ }
603
632
  };
604
633
 
605
- $.if(node_6, ($$render) => {
634
+ $.if(node_8, ($$render) => {
606
635
  if (more()) $$render(consequent_3);
607
636
  });
608
637
  }
@@ -610,7 +639,7 @@ export default function Text($$anchor, $$props) {
610
639
  $.reset(div_1);
611
640
  $.bind_this(div_1, ($$value) => $.set(truncateWrapperElement, $$value), () => $.get(truncateWrapperElement));
612
641
 
613
- var node_7 = $.sibling(div_1, 2);
642
+ var node_9 = $.sibling(div_1, 2);
614
643
 
615
644
  {
616
645
  var consequent_4 = ($$anchor) => {
@@ -628,7 +657,7 @@ export default function Text($$anchor, $$props) {
628
657
  $.append($$anchor, div_2);
629
658
  };
630
659
 
631
- $.if(node_7, ($$render) => {
660
+ $.if(node_9, ($$render) => {
632
661
  if ($.get(scrollMode)) $$render(consequent_4);
633
662
  });
634
663
  }
@@ -645,13 +674,13 @@ export default function Text($$anchor, $$props) {
645
674
  ]
646
675
  );
647
676
 
648
- $.append($$anchor, fragment_2);
677
+ $.append($$anchor, fragment_3);
649
678
  };
650
679
 
651
680
  var consequent_9 = ($$anchor) => {
652
681
  var span = root_5();
653
682
  var span_1 = $.child(span);
654
- var node_8 = $.child(span_1);
683
+ var node_10 = $.child(span_1);
655
684
 
656
685
  {
657
686
  var consequent_6 = ($$anchor) => {
@@ -662,10 +691,19 @@ export default function Text($$anchor, $$props) {
662
691
  };
663
692
 
664
693
  var consequent_7 = ($$anchor) => {
665
- $$props.children($$anchor, () => ({ breakpoint: breakpoint() }));
694
+ ComponentPartsBoundary($$anchor, {
695
+ children: ($$anchor, $$slotProps) => {
696
+ var fragment_11 = $.comment();
697
+ var node_11 = $.first_child(fragment_11);
698
+
699
+ $.snippet(node_11, () => $$props.children, () => ({ breakpoint: breakpoint() }));
700
+ $.append($$anchor, fragment_11);
701
+ },
702
+ $$slots: { default: true }
703
+ });
666
704
  };
667
705
 
668
- $.if(node_8, ($$render) => {
706
+ $.if(node_10, ($$render) => {
669
707
  if ($.get(resolvedStateText) !== undefined) $$render(consequent_6); else if ($$props.children) $$render(consequent_7, 1);
670
708
  });
671
709
  }
@@ -675,7 +713,7 @@ export default function Text($$anchor, $$props) {
675
713
 
676
714
  var span_2 = $.sibling(span_1, 2);
677
715
  var text_2 = $.child(span_2, true);
678
- var node_9 = $.sibling(text_2);
716
+ var node_12 = $.sibling(text_2);
679
717
 
680
718
  {
681
719
  var consequent_8 = ($$anchor) => {
@@ -684,7 +722,7 @@ export default function Text($$anchor, $$props) {
684
722
  $.append($$anchor, span_3);
685
723
  };
686
724
 
687
- $.if(node_9, ($$render) => {
725
+ $.if(node_12, ($$render) => {
688
726
  if (truncation.isTruncated) $$render(consequent_8);
689
727
  });
690
728
  }
@@ -697,7 +735,7 @@ export default function Text($$anchor, $$props) {
697
735
 
698
736
  var consequent_12 = ($$anchor) => {
699
737
  var span_4 = root_6();
700
- var node_10 = $.child(span_4);
738
+ var node_13 = $.child(span_4);
701
739
 
702
740
  {
703
741
  var consequent_10 = ($$anchor) => {
@@ -708,10 +746,19 @@ export default function Text($$anchor, $$props) {
708
746
  };
709
747
 
710
748
  var consequent_11 = ($$anchor) => {
711
- $$props.children($$anchor, () => ({ breakpoint: breakpoint() }));
749
+ ComponentPartsBoundary($$anchor, {
750
+ children: ($$anchor, $$slotProps) => {
751
+ var fragment_14 = $.comment();
752
+ var node_14 = $.first_child(fragment_14);
753
+
754
+ $.snippet(node_14, () => $$props.children, () => ({ breakpoint: breakpoint() }));
755
+ $.append($$anchor, fragment_14);
756
+ },
757
+ $$slots: { default: true }
758
+ });
712
759
  };
713
760
 
714
- $.if(node_10, ($$render) => {
761
+ $.if(node_13, ($$render) => {
715
762
  if ($.get(resolvedStateText) !== undefined) $$render(consequent_10); else if ($$props.children) $$render(consequent_11, 1);
716
763
  });
717
764
  }
@@ -736,22 +783,31 @@ export default function Text($$anchor, $$props) {
736
783
  };
737
784
 
738
785
  var consequent_14 = ($$anchor) => {
739
- $$props.children($$anchor, () => ({ breakpoint: breakpoint() }));
786
+ ComponentPartsBoundary($$anchor, {
787
+ children: ($$anchor, $$slotProps) => {
788
+ var fragment_17 = $.comment();
789
+ var node_15 = $.first_child(fragment_17);
790
+
791
+ $.snippet(node_15, () => $$props.children, () => ({ breakpoint: breakpoint() }));
792
+ $.append($$anchor, fragment_17);
793
+ },
794
+ $$slots: { default: true }
795
+ });
740
796
  };
741
797
 
742
- $.if(node_4, ($$render) => {
798
+ $.if(node_5, ($$render) => {
743
799
  if (lines() === 0) $$render(consequent_5); else if (lines() === 1) $$render(consequent_9, 1); else if (lines() === 2 || lines() === 3) $$render(consequent_12, 2); else if ($.get(resolvedStateText) !== undefined) $$render(consequent_13, 3); else if ($$props.children) $$render(consequent_14, 4);
744
800
  });
745
801
  }
746
802
 
747
- var node_11 = $.sibling(node_4, 2);
803
+ var node_16 = $.sibling(node_5, 2);
748
804
 
749
805
  {
750
806
  var consequent_17 = ($$anchor) => {
751
807
  Tooltip($$anchor, $.spread_props(() => $.get(tooltipConfig), {
752
808
  children: ($$anchor, $$slotProps) => {
753
- var fragment_14 = $.comment();
754
- var node_12 = $.first_child(fragment_14);
809
+ var fragment_19 = $.comment();
810
+ var node_17 = $.first_child(fragment_19);
755
811
 
756
812
  {
757
813
  var consequent_15 = ($$anchor) => {
@@ -762,30 +818,30 @@ export default function Text($$anchor, $$props) {
762
818
  };
763
819
 
764
820
  var consequent_16 = ($$anchor) => {
765
- var fragment_16 = $.comment();
766
- var node_13 = $.first_child(fragment_16);
821
+ var fragment_21 = $.comment();
822
+ var node_18 = $.first_child(fragment_21);
767
823
 
768
- $.snippet(node_13, () => $.get(tooltipContent));
769
- $.append($$anchor, fragment_16);
824
+ $.snippet(node_18, () => $.get(tooltipContent));
825
+ $.append($$anchor, fragment_21);
770
826
  };
771
827
 
772
- $.if(node_12, ($$render) => {
828
+ $.if(node_17, ($$render) => {
773
829
  if (typeof $.get(tooltipContent) === "string") $$render(consequent_15); else if (typeof $.get(tooltipContent) === "function") $$render(consequent_16, 1);
774
830
  });
775
831
  }
776
832
 
777
- $.append($$anchor, fragment_14);
833
+ $.append($$anchor, fragment_19);
778
834
  },
779
835
  $$slots: { default: true }
780
836
  }));
781
837
  };
782
838
 
783
- $.if(node_11, ($$render) => {
839
+ $.if(node_16, ($$render) => {
784
840
  if ($.get(needTooltip)) $$render(consequent_17);
785
841
  });
786
842
  }
787
843
 
788
- $.append($$anchor, fragment_1);
844
+ $.append($$anchor, fragment_2);
789
845
  };
790
846
 
791
847
  let $0 = $.derived(() => $.get(shouldTruncate) ? String(lines()) : undefined);
@@ -794,7 +850,7 @@ export default function Text($$anchor, $$props) {
794
850
  let $3 = $.derived(() => lines() === 0 ? $.get(isExpanding) ? "true" : "false" : undefined);
795
851
  let $4 = $.derived(() => $.get(scrollMode) ? "true" : undefined);
796
852
 
797
- Frame(node_3, $.spread_props(
853
+ Frame(node_4, $.spread_props(
798
854
  {
799
855
  get enableResponsive() {
800
856
  return enableResponsive();
@@ -13,6 +13,7 @@ import {
13
13
  import { resizeManager } from "../logic/observer.js";
14
14
  import { splitFrameHostProps } from "../logic/frame-prop-filter.js";
15
15
  import { useOverlayScrollbar } from "../lib/overlay-scrollbar.js";
16
+ import { useLocale } from "../i18n/locale.js";
16
17
 
17
18
  var rest_excludes = new Set([
18
19
  '$$slots',
@@ -77,6 +78,8 @@ export default function Textarea($$anchor, $$props) {
77
78
  $.append_styles($$anchor, $$css);
78
79
 
79
80
  // SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
81
+ const localeContext = useLocale();
82
+
80
83
  let value = $.prop($$props, 'value', 15),
81
84
  defaultValue = $.prop($$props, 'defaultValue', 3, undefined),
82
85
  placeholder = $.prop($$props, 'placeholder', 3, undefined),
@@ -429,6 +432,7 @@ export default function Textarea($$anchor, $$props) {
429
432
  var consequent_1 = ($$anchor) => {
430
433
  {
431
434
  let $0 = $.derived(() => $.get(indicatorAxis) === "width" ? $.get(resizeWidth) : $.get(resizeHeight));
435
+ let $1 = $.derived(() => localeContext.t("textarea.resize"));
432
436
 
433
437
  Indicator($$anchor, {
434
438
  as: 'resize-handle',
@@ -450,7 +454,9 @@ export default function Textarea($$anchor, $$props) {
450
454
  minWidth: 120,
451
455
  minHeight: 60,
452
456
  applySize: false,
453
- ariaLabel: '调整文本域大小',
457
+ get ariaLabel() {
458
+ return $.get($1);
459
+ },
454
460
  onSizeChange: handleIndicatorSize
455
461
  });
456
462
  }
@@ -5,6 +5,7 @@ import { onMount, onDestroy } from "svelte";
5
5
  import { Frame } from "../index.js";
6
6
  import { GENERIC_SCALE_APPEAR_MOTION } from "../motion/presets/generic.js";
7
7
  import { ComponentIcon } from "../internal/component-icon/index.js";
8
+ import { useLocale } from "../i18n/locale.js";
8
9
  import { registerToastTemplate, unregisterToastTemplate, showToast } from "../logic/toast.js";
9
10
  import { mergeComponentPartProps, useComponentPart } from "../logic/component-parts.js";
10
11
 
@@ -23,6 +24,8 @@ export default function Toast($$anchor, $$props) {
23
24
  $.append_styles($$anchor, $$css);
24
25
 
25
26
  // SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
27
+ const localeContext = useLocale();
28
+
26
29
  /** 内置图标按钮配置;事件与角色由所属组件控制。 */
27
30
  /** 模版模式 id;配合 template=true 后可通过 showToast(id) 触发;Inline 模式自动生成 */
28
31
  /** 模版模式:只注册为命令式 Toast 模板,不直接渲染 */
@@ -287,13 +290,17 @@ export default function Toast($$anchor, $$props) {
287
290
  var consequent_3 = ($$anchor) => {
288
291
  {
289
292
  let $0 = $.derived(() => `snowui-clear-icon-btn snowui-toast-close-btn${$.get(parts)?.Button?.class ? ` ${$.get(parts).Button.class}` : ""}`);
293
+ let $1 = $.derived(() => localeContext.t("toast.close"));
290
294
 
291
295
  Button($$anchor, $.spread_props({ bare: true, emphasis: 'muted', size: 'sm' }, () => $.get(parts)?.Button, {
292
296
  type: 'button',
293
297
  get class() {
294
298
  return $.get($0);
295
299
  },
296
- 'aria-label': '关闭通知',
300
+
301
+ get 'aria-label'() {
302
+ return $.get($1);
303
+ },
297
304
  onclick: () => $.get(onDismiss)?.(),
298
305
  onmousedown: (e) => e.preventDefault(),
299
306
  tabindex: -1,