@snowui-design-system/components 0.3.0-alpha.2 → 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 (87) hide show
  1. package/dist/client/blocks/Sidebar.js +56 -41
  2. package/dist/client/blocks/SidebarSection.js +3 -1
  3. package/dist/client/components/BarChart.js +1 -1
  4. package/dist/client/components/Breadcrumb.js +17 -11
  5. package/dist/client/components/CircularChart.js +2 -2
  6. package/dist/client/components/CodeBlock.js +278 -225
  7. package/dist/client/components/CopyButton.js +5 -2
  8. package/dist/client/components/ExpandButton.js +10 -3
  9. package/dist/client/components/Frame.js +15 -9
  10. package/dist/client/components/GaugeChart.js +2 -2
  11. package/dist/client/components/ImageViewer.js +51 -27
  12. package/dist/client/components/Indicator.js +5 -3
  13. package/dist/client/components/Input.js +27 -17
  14. package/dist/client/components/LineChart.js +1 -1
  15. package/dist/client/components/Link.d.ts +1 -1
  16. package/dist/client/components/Link.js +43 -22
  17. package/dist/client/components/Listbox.js +26 -15
  18. package/dist/client/components/OverflowAction.d.ts +2 -0
  19. package/dist/client/components/OverflowAction.js +146 -65
  20. package/dist/client/components/OverflowActions.d.ts +2 -0
  21. package/dist/client/components/OverflowActions.js +67 -16
  22. package/dist/client/components/Pagination.js +71 -48
  23. package/dist/client/components/Select.js +29 -18
  24. package/dist/client/components/SidePanel.js +76 -50
  25. package/dist/client/components/Tab.js +30 -31
  26. package/dist/client/components/TableBody.js +10 -4
  27. package/dist/client/components/TableCell.js +57 -32
  28. package/dist/client/components/TableHead.js +69 -38
  29. package/dist/client/components/TableToolbar.js +112 -79
  30. package/dist/client/components/Text.js +99 -59
  31. package/dist/client/components/Textarea.js +7 -1
  32. package/dist/client/components/Toast.js +8 -1
  33. package/dist/client/i18n/messages.d.ts +1 -1
  34. package/dist/client/i18n/messages.js +114 -0
  35. package/dist/client/index.d.ts +1 -1
  36. package/dist/client/index.js +1 -1
  37. package/dist/client/lib/number-format.js +6 -0
  38. package/dist/client/lib/progressive-blur.d.ts +13 -0
  39. package/dist/client/lib/progressive-blur.js +54 -0
  40. package/dist/client/logic/ComponentPartsBoundary.d.ts +7 -0
  41. package/dist/client/logic/ComponentPartsBoundary.js +15 -0
  42. package/dist/client/logic/overflow-actions.d.ts +3 -2
  43. package/dist/client/styles/layout.css +12 -2
  44. package/dist/server/blocks/Sidebar.js +19 -5
  45. package/dist/server/blocks/SidebarSection.js +3 -1
  46. package/dist/server/components/BarChart.js +1 -1
  47. package/dist/server/components/Breadcrumb.js +9 -2
  48. package/dist/server/components/CircularChart.js +2 -2
  49. package/dist/server/components/CodeBlock.js +25 -13
  50. package/dist/server/components/CopyButton.js +6 -2
  51. package/dist/server/components/ExpandButton.js +7 -3
  52. package/dist/server/components/Frame.js +10 -3
  53. package/dist/server/components/GaugeChart.js +2 -2
  54. package/dist/server/components/ImageViewer.js +6 -3
  55. package/dist/server/components/Indicator.js +5 -3
  56. package/dist/server/components/Input.js +14 -17
  57. package/dist/server/components/LineChart.js +1 -1
  58. package/dist/server/components/Link.d.ts +1 -1
  59. package/dist/server/components/Link.js +20 -3
  60. package/dist/server/components/Listbox.js +17 -4
  61. package/dist/server/components/OverflowAction.d.ts +2 -0
  62. package/dist/server/components/OverflowAction.js +70 -26
  63. package/dist/server/components/OverflowActions.d.ts +2 -0
  64. package/dist/server/components/OverflowActions.js +49 -14
  65. package/dist/server/components/Pagination.js +21 -10
  66. package/dist/server/components/Select.js +23 -11
  67. package/dist/server/components/SidePanel.js +28 -8
  68. package/dist/server/components/Tab.js +61 -52
  69. package/dist/server/components/TableBody.js +9 -2
  70. package/dist/server/components/TableCell.js +28 -7
  71. package/dist/server/components/TableHead.js +31 -7
  72. package/dist/server/components/TableToolbar.js +57 -30
  73. package/dist/server/components/Text.js +46 -10
  74. package/dist/server/components/Textarea.js +4 -1
  75. package/dist/server/components/Toast.js +4 -1
  76. package/dist/server/i18n/messages.d.ts +1 -1
  77. package/dist/server/i18n/messages.js +114 -0
  78. package/dist/server/index.d.ts +1 -1
  79. package/dist/server/index.js +1 -1
  80. package/dist/server/lib/number-format.js +6 -0
  81. package/dist/server/lib/progressive-blur.d.ts +13 -0
  82. package/dist/server/lib/progressive-blur.js +54 -0
  83. package/dist/server/logic/ComponentPartsBoundary.d.ts +7 -0
  84. package/dist/server/logic/ComponentPartsBoundary.js +12 -0
  85. package/dist/server/logic/overflow-actions.d.ts +3 -2
  86. package/dist/server/styles/layout.css +12 -2
  87. package/package.json +4 -3
@@ -12,6 +12,7 @@ import {
12
12
 
13
13
  import Frame from "./Frame.js";
14
14
  import { writeClipboardText } from "../lib/clipboard.js";
15
+ import { useLocale } from "../i18n/locale.js";
15
16
  import { mergeComponentPartProps, useComponentPart } from "../logic/component-parts.js";
16
17
 
17
18
  var rest_excludes = new Set(['$$slots', '$$events', '$$legacy']);
@@ -86,6 +87,7 @@ export default function CopyButton($$anchor, $$props) {
86
87
  };
87
88
 
88
89
  const inheritedCopyButtonPart = useComponentPart("CopyButton");
90
+ const localeContext = useLocale();
89
91
  let explicitProps = $.rest_props($$props, rest_excludes);
90
92
 
91
93
  let $$d = $.derived(() => mergeComponentPartProps(inheritedCopyButtonPart.current, explicitProps)),
@@ -167,7 +169,7 @@ export default function CopyButton($$anchor, $$props) {
167
169
 
168
170
  let $2 = $.derived(() => $.get(ariaLabel) ?? ($.get(showText)
169
171
  ? undefined
170
- : $.get(status) === "success" ? "已复制" : "复制"));
172
+ : localeContext.t($.get(status) === "success" ? "copyButton.copied" : "copyButton.copy")));
171
173
 
172
174
  let $3 = $.derived(() => $.get(status) === "pending" ? "true" : undefined);
173
175
  let $4 = $.derived(() => $.get(status) === "idle" ? $.get(userWhileClick) : false);
@@ -257,8 +259,9 @@ export default function CopyButton($$anchor, $$props) {
257
259
  };
258
260
 
259
261
  var alternate_3 = ($$anchor) => {
260
- var text_1 = $.text('复制');
262
+ var text_1 = $.text();
261
263
 
264
+ $.template_effect(($0) => $.set_text(text_1, $0), [() => localeContext.t("copyButton.copy")]);
262
265
  $.append($$anchor, text_1);
263
266
  };
264
267
 
@@ -2,6 +2,7 @@ import 'svelte/internal/disclose-version';
2
2
  import * as $ from 'svelte/internal/client';
3
3
  import { ComponentIcon } from "../internal/component-icon/index.js";
4
4
  import Button from "./Button.js";
5
+ import { useLocale } from "../i18n/locale.js";
5
6
 
6
7
  import {
7
8
  CONTROL_BUTTON_REPLACEMENT_MOTION,
@@ -21,13 +22,15 @@ export default function ExpandButton($$anchor, $$props) {
21
22
  // SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
22
23
  const inheritedExpandButtonPart = useComponentPart("ExpandButton");
23
24
 
25
+ const localeContext = useLocale();
26
+
24
27
  let expanded = $.prop($$props, 'expanded', 15),
25
28
  explicitProps = $.rest_props($$props, rest_excludes);
26
29
 
27
30
  let $$d = $.derived(() => mergeComponentPartProps(inheritedExpandButtonPart.current, explicitProps)),
28
31
  defaultExpanded = $.derived(() => $.fallback($.get($$d).defaultExpanded, false)),
29
- ariaLabel = $.derived(() => $.fallback($.get($$d).ariaLabel, "展开")),
30
- collapseAriaLabel = $.derived(() => $.fallback($.get($$d).collapseAriaLabel, "收起")),
32
+ ariaLabel = $.derived(() => $.fallback($.get($$d).ariaLabel, undefined)),
33
+ collapseAriaLabel = $.derived(() => $.fallback($.get($$d).collapseAriaLabel, undefined)),
31
34
  icon = $.derived(() => $.get($$d).icon),
32
35
  collapseIcon = $.derived(() => $.get($$d).collapseIcon),
33
36
  children = $.derived(() => $.get($$d).children),
@@ -71,7 +74,11 @@ export default function ExpandButton($$anchor, $$props) {
71
74
  {
72
75
  let $0 = $.derived(() => `${controlButtonMotionStyle(`var(--snowui-expand-button-motion-duration-override, ${CONTROL_BUTTON_MOTION_DURATION_MS}ms)`)} ${$.get(userStyle)}`);
73
76
  let $1 = $.derived(() => !$.get(rest).bare && !$.get(children));
74
- let $2 = $.derived(() => $.get(resolvedExpanded) ? $.get(collapseAriaLabel) : $.get(ariaLabel));
77
+
78
+ let $2 = $.derived(() => $.get(resolvedExpanded)
79
+ ? $.get(collapseAriaLabel) ?? localeContext.t("expandButton.collapse")
80
+ : $.get(ariaLabel) ?? localeContext.t("expandButton.expand"));
81
+
75
82
  let $3 = $.derived(() => $.get(resolvedExpanded) ? "true" : "false");
76
83
 
77
84
  Button($$anchor, $.spread_props(() => $.get(rest), {
@@ -24,6 +24,7 @@ import { createFrameDomRuntime } from "../logic/frame-dom-runtime.js";
24
24
  import { createFrameSkeletonRuntime } from "../logic/frame-skeleton-runtime.js";
25
25
  import { createFrameClassStateRuntime } from "../logic/frame-class-state.js";
26
26
  import { provideComponentParts } from "../logic/component-parts.js";
27
+ import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
27
28
  import { initOrchestrator, getOrchestrator } from "../logic/frame-orchestrator.js";
28
29
  import Skeleton from "./Skeleton.js";
29
30
 
@@ -31,7 +32,7 @@ export * from "../logic/frame-types.js";
31
32
 
32
33
  var rest_excludes = new Set(['$$slots', '$$events', '$$legacy', 'element']);
33
34
  var root = $.from_html(`<div aria-hidden="true" style="display: none;"><!></div>`);
34
- var root_1 = $.from_html(`<div><!></div>`);
35
+ var root_1 = $.from_html(`<div class="snowui-frame-state-content-layer"><!></div>`);
35
36
  var root_2 = $.from_html(`<div style="display: grid; align-items: inherit; justify-content: inherit; gap: inherit; width: 100%; height: 100%;"></div>`);
36
37
  var root_3 = $.from_html(`<!> <!>`, 1);
37
38
 
@@ -362,11 +363,16 @@ export default function Frame($$anchor, $$props) {
362
363
 
363
364
  {
364
365
  var consequent_3 = ($$anchor) => {
365
- var fragment_5 = $.comment();
366
- var node_7 = $.first_child(fragment_5);
367
-
368
- $.snippet(node_7, snippet);
369
- $.append($$anchor, fragment_5);
366
+ ComponentPartsBoundary($$anchor, {
367
+ children: ($$anchor, $$slotProps) => {
368
+ var fragment_6 = $.comment();
369
+ var node_7 = $.first_child(fragment_6);
370
+
371
+ $.snippet(node_7, snippet);
372
+ $.append($$anchor, fragment_6);
373
+ },
374
+ $$slots: { default: true }
375
+ });
370
376
  };
371
377
 
372
378
  $.if(node_6, ($$render) => {
@@ -388,11 +394,11 @@ export default function Frame($$anchor, $$props) {
388
394
  };
389
395
 
390
396
  var consequent_5 = ($$anchor) => {
391
- var fragment_6 = $.comment();
392
- var node_8 = $.first_child(fragment_6);
397
+ var fragment_7 = $.comment();
398
+ var node_8 = $.first_child(fragment_7);
393
399
 
394
400
  $.snippet(node_8, () => $.get(frameProps).children, () => $.get(childrenRenderContext));
395
- $.append($$anchor, fragment_6);
401
+ $.append($$anchor, fragment_7);
396
402
  };
397
403
 
398
404
  $.if(node_4, ($$render) => {
@@ -103,7 +103,7 @@ var root_12 = $.from_svg(`<path class="snowui-gauge-chart-segment-hit-area" fill
103
103
  var root_13 = $.from_html(`<span data-role="value"> </span>`);
104
104
  var root_14 = $.from_html(`<span data-role="name"> </span>`);
105
105
  var root_15 = $.from_html(`<!> <!>`, 1);
106
- var root_16 = $.from_html(`<div class="snowui-gauge-chart-body"><svg class="snowui-gauge-chart-svg" aria-hidden="true"><defs></defs><!><g class="snowui-gauge-chart-fill-layer"></g><!><!></svg> <!></div> <!>`, 1);
106
+ var root_16 = $.from_html(`<div class="snowui-gauge-chart-body"><svg class="snowui-gauge-chart-svg" role="presentation"><defs></defs><!><g class="snowui-gauge-chart-fill-layer"></g><!><!></svg> <!></div> <!>`, 1);
107
107
 
108
108
  const $$css = {
109
109
  hash: 'svelte-1lmsunj',
@@ -1002,7 +1002,7 @@ export default function GaugeChart($$anchor, $$props) {
1002
1002
  get style() {
1003
1003
  return $.get(rootStyle);
1004
1004
  },
1005
- role: 'img',
1005
+ role: 'group',
1006
1006
  'aria-label': '仪表图',
1007
1007
  get element() {
1008
1008
  return $.get(rootElement);
@@ -16,6 +16,7 @@ import {
16
16
 
17
17
  import { ComponentIcon } from "../internal/component-icon/index.js";
18
18
  import { DIALOG_BACKDROP_MOTION_STYLE } from "../motion/presets/dialog.js";
19
+ import { useLocale } from "../i18n/locale.js";
19
20
 
20
21
  var rest_excludes = new Set([
21
22
  '$$slots',
@@ -54,6 +55,8 @@ export default function ImageViewer($$anchor, $$props) {
54
55
  $.append_styles($$anchor, $$css);
55
56
 
56
57
  // SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
58
+ const localeContext = useLocale();
59
+
57
60
  let open = $.prop($$props, 'open', 3, undefined),
58
61
  items = $.prop($$props, 'items', 3, undefined),
59
62
  index = $.prop($$props, 'index', 3, undefined),
@@ -585,41 +588,62 @@ export default function ImageViewer($$anchor, $$props) {
585
588
  var div_7 = root_5();
586
589
  var node_9 = $.child(div_7);
587
590
 
588
- Button(node_9, $.spread_props(() => $.get(builtInButtonProps), {
589
- as: 'prev',
590
- iconOnly: true,
591
- 'aria-label': '上一张',
592
- children: ($$anchor, $$slotProps) => {
593
- ComponentIcon($$anchor, { name: 'arrow-line-left', 'aria-hidden': 'true' });
594
- },
595
- $$slots: { default: true }
596
- }));
591
+ {
592
+ let $0 = $.derived(() => localeContext.t("imageViewer.previous"));
593
+
594
+ Button(node_9, $.spread_props(() => $.get(builtInButtonProps), {
595
+ as: 'prev',
596
+ iconOnly: true,
597
+ get 'aria-label'() {
598
+ return $.get($0);
599
+ },
600
+
601
+ children: ($$anchor, $$slotProps) => {
602
+ ComponentIcon($$anchor, { name: 'arrow-line-left', 'aria-hidden': 'true' });
603
+ },
604
+ $$slots: { default: true }
605
+ }));
606
+ }
597
607
 
598
608
  var node_10 = $.sibling(node_9, 2);
599
609
 
600
- Button(node_10, $.spread_props(() => $.get(builtInButtonProps), {
601
- as: 'next',
602
- iconOnly: true,
603
- 'aria-label': '下一张',
604
- children: ($$anchor, $$slotProps) => {
605
- ComponentIcon($$anchor, { name: 'arrow-line-right', 'aria-hidden': 'true' });
606
- },
607
- $$slots: { default: true }
608
- }));
610
+ {
611
+ let $0 = $.derived(() => localeContext.t("imageViewer.next"));
612
+
613
+ Button(node_10, $.spread_props(() => $.get(builtInButtonProps), {
614
+ as: 'next',
615
+ iconOnly: true,
616
+ get 'aria-label'() {
617
+ return $.get($0);
618
+ },
619
+
620
+ children: ($$anchor, $$slotProps) => {
621
+ ComponentIcon($$anchor, { name: 'arrow-line-right', 'aria-hidden': 'true' });
622
+ },
623
+ $$slots: { default: true }
624
+ }));
625
+ }
609
626
 
610
627
  var node_11 = $.sibling(node_10, 2);
611
628
 
612
629
  {
613
630
  var consequent_5 = ($$anchor) => {
614
- Button($$anchor, $.spread_props(() => $.get(builtInButtonProps), {
615
- as: 'close',
616
- iconOnly: true,
617
- 'aria-label': '关闭图片预览',
618
- children: ($$anchor, $$slotProps) => {
619
- ComponentIcon($$anchor, { name: 'close', 'aria-hidden': 'true' });
620
- },
621
- $$slots: { default: true }
622
- }));
631
+ {
632
+ let $0 = $.derived(() => localeContext.t("imageViewer.close"));
633
+
634
+ Button($$anchor, $.spread_props(() => $.get(builtInButtonProps), {
635
+ as: 'close',
636
+ iconOnly: true,
637
+ get 'aria-label'() {
638
+ return $.get($0);
639
+ },
640
+
641
+ children: ($$anchor, $$slotProps) => {
642
+ ComponentIcon($$anchor, { name: 'close', 'aria-hidden': 'true' });
643
+ },
644
+ $$slots: { default: true }
645
+ }));
646
+ }
623
647
  };
624
648
 
625
649
  $.if(node_11, ($$render) => {
@@ -4,6 +4,7 @@ import ComponentIcon from "../internal/component-icon/ComponentIcon.js";
4
4
  import Frame from "./Frame.js";
5
5
  import { resizable } from "../lib/resizable.js";
6
6
  import { untrack } from "svelte";
7
+ import { useLocale } from "../i18n/locale.js";
7
8
  import { mergeComponentPartProps, useComponentPart } from "../logic/component-parts.js";
8
9
 
9
10
  let indicatorSeed = 0;
@@ -21,6 +22,7 @@ export default function Indicator($$anchor, $$props) {
21
22
  $.append_styles($$anchor, $$css);
22
23
 
23
24
  const inheritedIndicatorPart = useComponentPart("Indicator");
25
+ const localeContext = useLocale();
24
26
  let explicitProps = $.rest_props($$props, rest_excludes);
25
27
 
26
28
  let $$d = $.derived(() => mergeComponentPartProps(inheritedIndicatorPart.current, explicitProps)),
@@ -113,9 +115,9 @@ export default function Indicator($$anchor, $$props) {
113
115
  const resolvedRevealTarget = $.derived(() => $.get(revealTarget) ?? $.get(resolvedTarget));
114
116
  const isVisible = $.derived(() => $.get(hostHovered) || $.get(focused) || $.get(dragging));
115
117
 
116
- const resolvedAriaLabel = $.derived(() => $.get(ariaLabel) ?? ($.get(resolvedAxis) === "width"
117
- ? "调整宽度"
118
- : $.get(resolvedAxis) === "height" ? "调整高度" : "调整宽度和高度"));
118
+ const resolvedAriaLabel = $.derived(() => $.get(ariaLabel) ?? localeContext.t($.get(resolvedAxis) === "width"
119
+ ? "indicator.resizeWidth"
120
+ : $.get(resolvedAxis) === "height" ? "indicator.resizeHeight" : "indicator.resizeBoth"));
119
121
 
120
122
  const rootClass = $.derived(() => [
121
123
  "snowui-indicator",
@@ -15,6 +15,7 @@ import {
15
15
  import { splitFrameHostProps } from "../logic/frame-prop-filter.js";
16
16
  import { mergeComponentPartProps, useComponentPart } from "../logic/component-parts.js";
17
17
  import { resizeManager } from "../logic/observer.js";
18
+ import { useLocale } from "../i18n/locale.js";
18
19
 
19
20
  var rest_excludes = new Set(['$$slots', '$$events', '$$legacy', 'value', 'element']);
20
21
  var root = $.from_html(`<span class="snowui-input-warning-icon snowui-role-trailing text-secondary-red" aria-hidden="true"><!></span>`);
@@ -134,6 +135,7 @@ export default function Input($$anchor, $$props) {
134
135
  var consequent = ($$anchor) => {
135
136
  {
136
137
  let $0 = $.derived(() => `snowui-clear-icon-btn snowui-input-clear-btn${$.get(parts)?.Button?.class ? ` ${$.get(parts).Button.class}` : ""}`);
138
+ let $1 = $.derived(() => localeContext.t("input.clear"));
137
139
 
138
140
  Button($$anchor, $.spread_props({ bare: true, emphasis: 'muted', size: 'sm' }, () => $.get(parts)?.Button, {
139
141
  type: 'button',
@@ -141,7 +143,9 @@ export default function Input($$anchor, $$props) {
141
143
  return $.get($0);
142
144
  },
143
145
  as: 'trailing',
144
- 'aria-label': '清除输入',
146
+ get 'aria-label'() {
147
+ return $.get($1);
148
+ },
145
149
  onclick: handleClear,
146
150
  onmousedown: (e) => e.preventDefault(),
147
151
  tabindex: -1,
@@ -634,6 +638,7 @@ export default function Input($$anchor, $$props) {
634
638
  var consequent_7 = ($$anchor) => {
635
639
  {
636
640
  let $0 = $.derived(() => `snowui-input-stepper-btn${$.get(parts)?.Button?.class ? ` ${$.get(parts).Button.class}` : ""}`);
641
+ let $1 = $.derived(() => localeContext.t("input.increment"));
637
642
 
638
643
  Button($$anchor, $.spread_props({ bare: true, emphasis: 'muted', size: 'sm' }, () => $.get(parts)?.Button, {
639
644
  type: 'button',
@@ -641,7 +646,10 @@ export default function Input($$anchor, $$props) {
641
646
  return $.get($0);
642
647
  },
643
648
  as: 'up',
644
- 'aria-label': '增加数值',
649
+ get 'aria-label'() {
650
+ return $.get($1);
651
+ },
652
+
645
653
  get disabled() {
646
654
  return $.get(stepUpDisabled);
647
655
  },
@@ -666,6 +674,7 @@ export default function Input($$anchor, $$props) {
666
674
  var consequent_8 = ($$anchor) => {
667
675
  {
668
676
  let $0 = $.derived(() => `snowui-input-stepper-btn${$.get(parts)?.Button?.class ? ` ${$.get(parts).Button.class}` : ""}`);
677
+ let $1 = $.derived(() => localeContext.t("input.decrement"));
669
678
 
670
679
  Button($$anchor, $.spread_props({ bare: true, emphasis: 'muted', size: 'sm' }, () => $.get(parts)?.Button, {
671
680
  type: 'button',
@@ -673,7 +682,10 @@ export default function Input($$anchor, $$props) {
673
682
  return $.get($0);
674
683
  },
675
684
  as: 'down',
676
- 'aria-label': '减少数值',
685
+ get 'aria-label'() {
686
+ return $.get($1);
687
+ },
688
+
677
689
  get disabled() {
678
690
  return $.get(stepDownDisabled);
679
691
  },
@@ -735,6 +747,7 @@ export default function Input($$anchor, $$props) {
735
747
  var consequent_11 = ($$anchor) => {
736
748
  {
737
749
  let $0 = $.derived(() => `snowui-clear-icon-btn snowui-input-clear-btn${$.get(parts)?.Button?.class ? ` ${$.get(parts).Button.class}` : ""}`);
750
+ let $1 = $.derived(() => localeContext.t("input.clear"));
738
751
 
739
752
  Button($$anchor, $.spread_props({ bare: true, emphasis: 'muted', size: 'sm' }, () => $.get(parts)?.Button, {
740
753
  type: 'button',
@@ -742,7 +755,9 @@ export default function Input($$anchor, $$props) {
742
755
  return $.get($0);
743
756
  },
744
757
  as: 'trailing',
745
- 'aria-label': '清除输入',
758
+ get 'aria-label'() {
759
+ return $.get($1);
760
+ },
746
761
  onclick: handleClear,
747
762
  onmousedown: (e) => e.preventDefault(),
748
763
  tabindex: -1,
@@ -805,6 +820,7 @@ export default function Input($$anchor, $$props) {
805
820
  $.append($$anchor, fragment);
806
821
  };
807
822
 
823
+ const localeContext = useLocale();
808
824
  const inheritedInputPart = useComponentPart("Input");
809
825
 
810
826
  let value = $.prop($$props, 'value', 15),
@@ -1206,27 +1222,21 @@ export default function Input($$anchor, $$props) {
1206
1222
  }
1207
1223
 
1208
1224
  function getTemporalTriggerLabel(inputType) {
1209
- return inputType === "time" ? "打开时间选择" : "打开日期选择";
1225
+ return localeContext.t(inputType === "time" ? "input.openTime" : "input.openDate");
1210
1226
  }
1211
1227
 
1212
1228
  function getTemporalAriaLabel(segment) {
1213
- return segment === "year"
1214
- ? "年"
1215
- : segment === "month"
1216
- ? "月"
1217
- : segment === "day"
1218
- ? "日"
1219
- : segment === "week"
1220
- ? "周"
1221
- : segment === "hour" ? "时" : segment === "minute" ? "分" : "秒";
1229
+ return localeContext.t(`input.${segment}`);
1222
1230
  }
1223
1231
 
1224
1232
  function getTemporalPlaceholder(segment) {
1225
1233
  return segment === "year"
1226
- ? "年"
1234
+ ? localeContext.t("input.yearPlaceholder")
1227
1235
  : segment === "month"
1228
- ? "月"
1229
- : segment === "day" ? "日" : segment === "week" ? "周" : "00";
1236
+ ? localeContext.t("input.monthPlaceholder")
1237
+ : segment === "day"
1238
+ ? localeContext.t("input.dayPlaceholder")
1239
+ : segment === "week" ? localeContext.t("input.weekPlaceholder") : "00";
1230
1240
  }
1231
1241
 
1232
1242
  function getTemporalSegmentLength(segment) {
@@ -1507,7 +1507,7 @@ export default function LineChart($$anchor, $$props) {
1507
1507
  get style() {
1508
1508
  return $.get(rootStyle);
1509
1509
  },
1510
- role: 'img',
1510
+ role: 'group',
1511
1511
  'aria-label': '折线图'
1512
1512
  },
1513
1513
  () => rest,
@@ -4,7 +4,7 @@ import Tooltip from "./Tooltip.js";
4
4
  import { type SnowUIColor } from "../lib/color";
5
5
  import type { ComponentPartsOf } from "../logic/component-parts.js";
6
6
  type LinkVariant = "default" | "arrow" | "external";
7
- type LinkUnderline = "none" | "always" | "hover";
7
+ type LinkUnderline = "none" | "always" | "hover" | "until-hover";
8
8
  type TooltipProp = boolean | string | Snippet | Record<string, any>;
9
9
  interface Props extends Omit<FrameProps, "children" | "tag"> {
10
10
  variant?: LinkVariant;
@@ -6,6 +6,7 @@ import Tooltip from "./Tooltip.js";
6
6
  import { resolveSnowUIColor } from "../lib/color.js";
7
7
  import { fitTextToElement, measureTextForElement } from "../lib/truncate.js";
8
8
  import { TruncationController } from "../logic/frame-truncation.js";
9
+ import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
9
10
 
10
11
  var rest_excludes = new Set([
11
12
  '$$slots',
@@ -43,7 +44,7 @@ var root_4 = $.from_html(`<span class="snowui-link-content"><span class="snowui-
43
44
 
44
45
  const $$css = {
45
46
  hash: 'svelte-96nnl8',
46
- code: ':where(.snowui-link) {--snowui-link-font-size: var(--text-14);--snowui-link-line-height: var(--leading-14);--snowui-link-gap: calc(var(--gap-1) / 2);--snowui-link-icon-size: var(--size-3);--snowui-link-color: var(--black-40, #00000066);--snowui-link-hover-color: var(--black-100, #000000ff);--snowui-link-decoration-opacity: var(--snowui-state-opacity, 0.4);--snowui-link-decoration-hover-opacity: var(--snowui-state-opacity, 1);color:var(--snowui-link-color-override, var(--snowui-link-color));text-decoration:none;width:fit-content;max-width:100%;gap:var(--snowui-link-gap-override, var(--snowui-link-gap));font-size:var(\n --snowui-link-font-size-override,\n var(--snowui-link-font-size)\n );line-height:var(\n --snowui-link-line-height-override,\n var(--snowui-link-line-height)\n );cursor:var(--snowui-state-cursor, pointer);--snowui-frame-component-transition:\n color var(--snowui-frame-color-motion-duration, 0.15s)\n var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-link)[data-auto-layout] {gap:var(--snowui-link-gap-override, var(--snowui-link-gap));}:where(.snowui-link):hover:not(.snowui-disabled),\n :where(.snowui-link):active:not(.snowui-disabled) {color:var(--snowui-link-hover-color);}:where(.snowui-link):focus-visible {outline:var(--border-1) solid currentColor;outline-offset:var(--border-2);}:where(.snowui-link-content) {min-width:0;max-width:100%;}:where(.snowui-link)[data-lines="1"] > .snowui-link-content {width:var(--snowui-link-truncated-content-width, auto);overflow:hidden;}:where(.snowui-link)[data-lines="1"] {width:fit-content;}:where(.snowui-link-label) {min-width:0;max-width:100%;}:where(.snowui-link-label)[data-lines="1"] {display:grid;grid-template-columns:minmax(0, 1fr);}:where(.snowui-link-label-text) {display:block;min-width:0;max-width:100%;text-decoration-line:none;text-decoration-color:currentColor;}:where(.snowui-link-label)[data-lines="1"] > .snowui-link-label-text {grid-column:1;grid-row:1;overflow:hidden;text-overflow:clip;white-space:nowrap;}:where(.snowui-link-label-measure) {visibility:hidden;}:where(.snowui-link-label-visible) {grid-column:1;grid-row:1;min-width:0;overflow:hidden;white-space:nowrap;}:where(.snowui-link-ellipsis) {text-decoration:none;}:where(.snowui-link)[data-underline="always"] > .snowui-link-content > .snowui-link-label > .snowui-link-label-text,\n :where(.snowui-link)[data-underline="always"] > .snowui-link-content > .snowui-link-label > .snowui-link-label-visible,\n :where(.snowui-link)[data-underline="hover"]:hover:not(.snowui-disabled) > .snowui-link-content > .snowui-link-label > .snowui-link-label-text,\n :where(.snowui-link)[data-underline="hover"]:hover:not(.snowui-disabled) > .snowui-link-content > .snowui-link-label > .snowui-link-label-visible {text-decoration-line:underline;}:where(.snowui-link > [data-as="leading"]),\n :where(.snowui-link > [data-as="trailing"]) {display:inline-flex;align-items:inherit;text-decoration:none;}:where(.snowui-link > [data-as="trailing"]:not(.snowui-link-default-trailing)) {color:currentColor;opacity:var(\n --snowui-link-decoration-opacity-override,\n var(--snowui-link-decoration-opacity)\n );text-decoration:none;transition:opacity var(--snowui-frame-color-motion-duration, 0.15s)\n var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-link-default-trailing) {display:inline-flex;flex-shrink:0;color:currentColor;opacity:var(\n --snowui-link-decoration-opacity-override,\n var(--snowui-link-decoration-opacity)\n );text-decoration:none;transition:opacity var(--snowui-frame-color-motion-duration, 0.15s)\n var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-link):hover:not(.snowui-disabled) > .snowui-link-default-trailing,\n :where(.snowui-link):active:not(.snowui-disabled) > .snowui-link-default-trailing,\n :where(.snowui-link):hover:not(.snowui-disabled) > [data-as="trailing"]:not(.snowui-link-default-trailing),\n :where(.snowui-link):active:not(.snowui-disabled) > [data-as="trailing"]:not(.snowui-link-default-trailing) {opacity:var(\n --snowui-link-decoration-hover-opacity-override,\n var(--snowui-link-decoration-hover-opacity)\n );}:where(.snowui-link-default-icon) {--snowui-icon-size-override: var(\n --snowui-link-icon-size-override,\n var(--snowui-link-icon-size)\n );}'
47
+ code: ':where(.snowui-link) {--snowui-link-font-size: var(--text-14);--snowui-link-line-height: var(--leading-14);--snowui-link-gap: calc(var(--gap-1) / 2);--snowui-link-icon-size: var(--size-3);--snowui-link-color: var(--black-40, #00000066);--snowui-link-hover-color: var(--black-100, #000000ff);--snowui-link-decoration-opacity: var(--snowui-state-opacity, 0.4);--snowui-link-decoration-hover-opacity: var(--snowui-state-opacity, 1);color:var(--snowui-link-color-override, var(--snowui-link-color));text-decoration:none;width:fit-content;max-width:100%;gap:var(--snowui-link-gap-override, var(--snowui-link-gap));font-size:var(\n --snowui-link-font-size-override,\n var(--snowui-link-font-size)\n );line-height:var(\n --snowui-link-line-height-override,\n var(--snowui-link-line-height)\n );cursor:var(--snowui-state-cursor, pointer);--snowui-frame-component-transition:\n color var(--snowui-frame-color-motion-duration, 0.15s)\n var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-link)[data-auto-layout] {gap:var(--snowui-link-gap-override, var(--snowui-link-gap));}:where(.snowui-link):hover:not(.snowui-disabled),\n :where(.snowui-link):active:not(.snowui-disabled) {color:var(--snowui-link-hover-color);}:where(.snowui-link):focus-visible {outline:var(--border-1) solid currentColor;outline-offset:var(--border-2);}:where(.snowui-link-content) {min-width:0;max-width:100%;}:where(.snowui-link)[data-lines="1"] > .snowui-link-content {width:var(--snowui-link-truncated-content-width, auto);overflow:hidden;}:where(.snowui-link)[data-lines="1"] {width:fit-content;}:where(.snowui-link-label) {min-width:0;max-width:100%;}:where(.snowui-link-label)[data-lines="1"] {display:grid;grid-template-columns:minmax(0, 1fr);}:where(.snowui-link-label-text) {display:block;min-width:0;max-width:100%;text-decoration-line:none;text-decoration-color:currentColor;}:where(.snowui-link-label)[data-lines="1"] > .snowui-link-label-text {grid-column:1;grid-row:1;overflow:hidden;text-overflow:clip;white-space:nowrap;}:where(.snowui-link-label-measure) {visibility:hidden;}:where(.snowui-link-label-visible) {grid-column:1;grid-row:1;min-width:0;overflow:hidden;white-space:nowrap;}:where(.snowui-link-ellipsis) {text-decoration:none;}:where(.snowui-link)[data-underline="always"] > .snowui-link-content > .snowui-link-label > .snowui-link-label-text,\n :where(.snowui-link)[data-underline="always"] > .snowui-link-content > .snowui-link-label > .snowui-link-label-visible,\n :where(.snowui-link)[data-underline="until-hover"] > .snowui-link-content > .snowui-link-label > .snowui-link-label-text,\n :where(.snowui-link)[data-underline="until-hover"] > .snowui-link-content > .snowui-link-label > .snowui-link-label-visible,\n :where(.snowui-link)[data-underline="hover"]:hover:not(.snowui-disabled) > .snowui-link-content > .snowui-link-label > .snowui-link-label-text,\n :where(.snowui-link)[data-underline="hover"]:hover:not(.snowui-disabled) > .snowui-link-content > .snowui-link-label > .snowui-link-label-visible {text-decoration-line:underline;}:where(.snowui-link)[data-underline="until-hover"]:hover:not(.snowui-disabled) > .snowui-link-content > .snowui-link-label > .snowui-link-label-text,\n :where(.snowui-link)[data-underline="until-hover"]:hover:not(.snowui-disabled) > .snowui-link-content > .snowui-link-label > .snowui-link-label-visible {text-decoration-line:none;}:where(.snowui-link > [data-as="leading"]),\n :where(.snowui-link > [data-as="trailing"]) {display:inline-flex;align-items:inherit;text-decoration:none;}:where(.snowui-link > [data-as="trailing"]:not(.snowui-link-default-trailing)) {color:currentColor;opacity:var(\n --snowui-link-decoration-opacity-override,\n var(--snowui-link-decoration-opacity)\n );text-decoration:none;transition:opacity var(--snowui-frame-color-motion-duration, 0.15s)\n var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-link-default-trailing) {display:inline-flex;flex-shrink:0;color:currentColor;opacity:var(\n --snowui-link-decoration-opacity-override,\n var(--snowui-link-decoration-opacity)\n );text-decoration:none;transition:opacity var(--snowui-frame-color-motion-duration, 0.15s)\n var(--snowui-frame-color-motion-easing, ease-out);}:where(.snowui-link):hover:not(.snowui-disabled) > .snowui-link-default-trailing,\n :where(.snowui-link):active:not(.snowui-disabled) > .snowui-link-default-trailing,\n :where(.snowui-link):hover:not(.snowui-disabled) > [data-as="trailing"]:not(.snowui-link-default-trailing),\n :where(.snowui-link):active:not(.snowui-disabled) > [data-as="trailing"]:not(.snowui-link-default-trailing) {opacity:var(\n --snowui-link-decoration-hover-opacity-override,\n var(--snowui-link-decoration-hover-opacity)\n );}:where(.snowui-link-default-icon) {--snowui-icon-size-override: var(\n --snowui-link-icon-size-override,\n var(--snowui-link-icon-size)\n );}'
47
48
  };
48
49
 
49
50
  export default function Link($$anchor, $$props) {
@@ -322,13 +323,23 @@ export default function Link($$anchor, $$props) {
322
323
  var span_2 = $.first_child(fragment_2);
323
324
  var node_1 = $.child(span_2);
324
325
 
325
- $.snippet(node_1, () => $$props.children ?? $.noop);
326
+ ComponentPartsBoundary(node_1, {
327
+ children: ($$anchor, $$slotProps) => {
328
+ var fragment_3 = $.comment();
329
+ var node_2 = $.first_child(fragment_3);
330
+
331
+ $.snippet(node_2, () => $$props.children ?? $.noop);
332
+ $.append($$anchor, fragment_3);
333
+ },
334
+ $$slots: { default: true }
335
+ });
336
+
326
337
  $.reset(span_2);
327
338
  $.bind_this(span_2, ($$value) => $.set(contentElement, $$value), () => $.get(contentElement));
328
339
 
329
340
  var span_3 = $.sibling(span_2, 2);
330
341
  var text = $.child(span_3, true);
331
- var node_2 = $.sibling(text);
342
+ var node_3 = $.sibling(text);
332
343
 
333
344
  {
334
345
  var consequent = ($$anchor) => {
@@ -337,7 +348,7 @@ export default function Link($$anchor, $$props) {
337
348
  $.append($$anchor, span_4);
338
349
  };
339
350
 
340
- $.if(node_2, ($$render) => {
351
+ $.if(node_3, ($$render) => {
341
352
  if (truncation.isTruncated) $$render(consequent);
342
353
  });
343
354
  }
@@ -349,9 +360,19 @@ export default function Link($$anchor, $$props) {
349
360
 
350
361
  var alternate = ($$anchor) => {
351
362
  var span_5 = root_2();
352
- var node_3 = $.child(span_5);
363
+ var node_4 = $.child(span_5);
364
+
365
+ ComponentPartsBoundary(node_4, {
366
+ children: ($$anchor, $$slotProps) => {
367
+ var fragment_4 = $.comment();
368
+ var node_5 = $.first_child(fragment_4);
369
+
370
+ $.snippet(node_5, () => $$props.children ?? $.noop);
371
+ $.append($$anchor, fragment_4);
372
+ },
373
+ $$slots: { default: true }
374
+ });
353
375
 
354
- $.snippet(node_3, () => $$props.children ?? $.noop);
355
376
  $.reset(span_5);
356
377
  $.bind_this(span_5, ($$value) => $.set(contentElement, $$value), () => $.get(contentElement));
357
378
  $.append($$anchor, span_5);
@@ -364,14 +385,14 @@ export default function Link($$anchor, $$props) {
364
385
 
365
386
  $.reset(span_1);
366
387
 
367
- var node_4 = $.sibling(span_1, 2);
388
+ var node_6 = $.sibling(span_1, 2);
368
389
 
369
390
  {
370
391
  var consequent_4 = ($$anchor) => {
371
392
  Tooltip($$anchor, $.spread_props(() => $.get(tooltipConfig), {
372
393
  children: ($$anchor, $$slotProps) => {
373
- var fragment_4 = $.comment();
374
- var node_5 = $.first_child(fragment_4);
394
+ var fragment_6 = $.comment();
395
+ var node_7 = $.first_child(fragment_6);
375
396
 
376
397
  {
377
398
  var consequent_2 = ($$anchor) => {
@@ -382,39 +403,39 @@ export default function Link($$anchor, $$props) {
382
403
  };
383
404
 
384
405
  var consequent_3 = ($$anchor) => {
385
- var fragment_6 = $.comment();
386
- var node_6 = $.first_child(fragment_6);
406
+ var fragment_8 = $.comment();
407
+ var node_8 = $.first_child(fragment_8);
387
408
 
388
- $.snippet(node_6, () => $.get(tooltipContent));
389
- $.append($$anchor, fragment_6);
409
+ $.snippet(node_8, () => $.get(tooltipContent));
410
+ $.append($$anchor, fragment_8);
390
411
  };
391
412
 
392
- $.if(node_5, ($$render) => {
413
+ $.if(node_7, ($$render) => {
393
414
  if (typeof $.get(tooltipContent) === "string") $$render(consequent_2); else if (typeof $.get(tooltipContent) === "function") $$render(consequent_3, 1);
394
415
  });
395
416
  }
396
417
 
397
- $.append($$anchor, fragment_4);
418
+ $.append($$anchor, fragment_6);
398
419
  },
399
420
  $$slots: { default: true }
400
421
  }));
401
422
  };
402
423
 
403
- $.if(node_4, ($$render) => {
424
+ $.if(node_6, ($$render) => {
404
425
  if ($.get(needTooltip)) $$render(consequent_4);
405
426
  });
406
427
  }
407
428
 
408
429
  $.reset(span);
409
430
 
410
- var node_7 = $.sibling(span, 2);
431
+ var node_9 = $.sibling(span, 2);
411
432
 
412
433
  {
413
434
  var consequent_5 = ($$anchor) => {
414
435
  var span_6 = root_3();
415
- var node_8 = $.child(span_6);
436
+ var node_10 = $.child(span_6);
416
437
 
417
- ComponentIcon(node_8, {
438
+ ComponentIcon(node_10, {
418
439
  name: 'arrow-up-right',
419
440
  class: 'snowui-link-default-icon',
420
441
  size: 'var(--snowui-link-icon-size-override, var(--snowui-link-icon-size))',
@@ -427,9 +448,9 @@ export default function Link($$anchor, $$props) {
427
448
 
428
449
  var consequent_6 = ($$anchor) => {
429
450
  var span_7 = root_3();
430
- var node_9 = $.child(span_7);
451
+ var node_11 = $.child(span_7);
431
452
 
432
- ComponentIcon(node_9, {
453
+ ComponentIcon(node_11, {
433
454
  name: 'arrow-square-out',
434
455
  class: 'snowui-link-default-icon',
435
456
  size: 'var(--snowui-link-icon-size-override, var(--snowui-link-icon-size))',
@@ -440,7 +461,7 @@ export default function Link($$anchor, $$props) {
440
461
  $.append($$anchor, span_7);
441
462
  };
442
463
 
443
- $.if(node_7, ($$render) => {
464
+ $.if(node_9, ($$render) => {
444
465
  if (variant() === "arrow" && !$.get(hasCustomTrailing)) $$render(consequent_5); else if (variant() === "external" && !$.get(hasCustomTrailing)) $$render(consequent_6, 1);
445
466
  });
446
467
  }