@fibrae/semi-ui-svelte 0.9.0 → 0.10.0

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 (169) hide show
  1. package/README.md +8 -4
  2. package/README.zh-CN.md +8 -4
  3. package/dist/components/anchor/interface.d.ts +14 -0
  4. package/dist/components/audio-player/interface.d.ts +5 -0
  5. package/dist/components/auto-complete/interface.d.ts +29 -0
  6. package/dist/components/avatar/interface.d.ts +24 -0
  7. package/dist/components/backtop/interface.d.ts +2 -0
  8. package/dist/components/badge/interface.d.ts +7 -0
  9. package/dist/components/banner/interface.d.ts +7 -0
  10. package/dist/components/breadcrumb/interface.d.ts +10 -0
  11. package/dist/components/button/interface.d.ts +18 -0
  12. package/dist/components/calendar/interface.d.ts +16 -0
  13. package/dist/components/card/interface.d.ts +18 -0
  14. package/dist/components/carousel/interface.d.ts +16 -0
  15. package/dist/components/cascader/cascader.svelte +1 -0
  16. package/dist/components/cascader/interface.d.ts +57 -0
  17. package/dist/components/checkbox/interface.d.ts +19 -0
  18. package/dist/components/code-highlight/interface.d.ts +3 -0
  19. package/dist/components/collapse/interface.d.ts +16 -0
  20. package/dist/components/collapsible/interface.d.ts +10 -0
  21. package/dist/components/color-picker/interface.d.ts +10 -0
  22. package/dist/components/config-provider/interface.d.ts +7 -0
  23. package/dist/components/cropper/interface.d.ts +11 -0
  24. package/dist/components/date-picker/interface.d.ts +47 -0
  25. package/dist/components/descriptions/interface.d.ts +6 -0
  26. package/dist/components/divider/interface.d.ts +4 -0
  27. package/dist/components/dropdown/interface.d.ts +8 -0
  28. package/dist/components/empty/interface.d.ts +7 -0
  29. package/dist/components/feedback/interface.d.ts +16 -0
  30. package/dist/components/float-button/interface.d.ts +14 -0
  31. package/dist/components/form/interface.d.ts +47 -0
  32. package/dist/components/form/label.svelte +2 -2
  33. package/dist/components/grid/interface.d.ts +13 -0
  34. package/dist/components/highlight/interface.d.ts +7 -0
  35. package/dist/components/hot-keys/interface.d.ts +3 -0
  36. package/dist/components/image/interface.d.ts +59 -0
  37. package/dist/components/input/interface.d.ts +67 -0
  38. package/dist/components/input-number/interface.d.ts +24 -0
  39. package/dist/components/json-viewer/interface.d.ts +7 -0
  40. package/dist/components/layout/interface.d.ts +3 -0
  41. package/dist/components/list/interface.d.ts +18 -0
  42. package/dist/components/locale/interface.d.ts +4 -0
  43. package/dist/components/lottie/interface.d.ts +2 -0
  44. package/dist/components/markdown-render/interface.d.ts +5 -0
  45. package/dist/components/modal/interface.d.ts +29 -0
  46. package/dist/components/navigation/interface.d.ts +47 -0
  47. package/dist/components/overflow-list/interface.d.ts +11 -0
  48. package/dist/components/pagination/interface.d.ts +12 -0
  49. package/dist/components/pincode/interface.d.ts +8 -0
  50. package/dist/components/popconfirm/interface.d.ts +12 -0
  51. package/dist/components/popover/interface.d.ts +30 -0
  52. package/dist/components/progress/interface.d.ts +13 -0
  53. package/dist/components/radio/interface.d.ts +22 -0
  54. package/dist/components/rating/interface.d.ts +12 -0
  55. package/dist/components/resizable/interface.d.ts +30 -0
  56. package/dist/components/scroll-list/interface.d.ts +6 -0
  57. package/dist/components/select/interface.d.ts +63 -0
  58. package/dist/components/side-sheet/interface.d.ts +19 -0
  59. package/dist/components/skeleton/interface.d.ts +7 -0
  60. package/dist/components/slider/interface.d.ts +23 -0
  61. package/dist/components/space/interface.d.ts +4 -0
  62. package/dist/components/spin/interface.d.ts +7 -0
  63. package/dist/components/steps/interface.d.ts +9 -0
  64. package/dist/components/switch/interface.d.ts +7 -0
  65. package/dist/components/table/interface.d.ts +48 -0
  66. package/dist/components/tabs/interface.d.ts +29 -0
  67. package/dist/components/tag/interface.d.ts +22 -0
  68. package/dist/components/tag-input/interface.d.ts +29 -0
  69. package/dist/components/time-picker/interface.d.ts +31 -0
  70. package/dist/components/timeline/interface.d.ts +5 -0
  71. package/dist/components/tooltip/interface.d.ts +20 -0
  72. package/dist/components/tooltip/tooltip.svelte +3 -0
  73. package/dist/components/transfer/interface.d.ts +18 -0
  74. package/dist/components/tree/interface.d.ts +45 -0
  75. package/dist/components/tree-select/interface.d.ts +55 -0
  76. package/dist/components/typography/interface.d.ts +33 -0
  77. package/dist/components/upload/interface.d.ts +64 -0
  78. package/dist/components/user-guide/interface.d.ts +15 -0
  79. package/dist/components/video-player/interface.d.ts +22 -0
  80. package/dist/styles.css +1 -1
  81. package/docs/advanced/dark-mode.md +288 -0
  82. package/docs/basic/button.md +605 -0
  83. package/docs/basic/divider.md +103 -0
  84. package/docs/basic/float-button.md +246 -0
  85. package/docs/basic/grid.md +427 -0
  86. package/docs/basic/layout.md +459 -0
  87. package/docs/basic/resizable.md +584 -0
  88. package/docs/basic/space.md +163 -0
  89. package/docs/basic/tokens.md +425 -0
  90. package/docs/basic/typography.md +615 -0
  91. package/docs/changes-from-semi.md +105 -0
  92. package/docs/ecosystem/tailwind.md +210 -0
  93. package/docs/experience/accessibility.md +82 -0
  94. package/docs/experience/content-guidelines.md +819 -0
  95. package/docs/experience/internationalization.md +7 -0
  96. package/docs/feedback/banner.md +198 -0
  97. package/docs/feedback/feedback.md +294 -0
  98. package/docs/feedback/notification.md +401 -0
  99. package/docs/feedback/popconfirm.md +243 -0
  100. package/docs/feedback/progress.md +389 -0
  101. package/docs/feedback/skeleton.md +388 -0
  102. package/docs/feedback/spin.md +172 -0
  103. package/docs/feedback/toast.md +393 -0
  104. package/docs/input/auto-complete.md +399 -0
  105. package/docs/input/cascader.md +1558 -0
  106. package/docs/input/checkbox.md +408 -0
  107. package/docs/input/color-picker.md +175 -0
  108. package/docs/input/date-picker.md +942 -0
  109. package/docs/input/form.md +2550 -0
  110. package/docs/input/input-number.md +451 -0
  111. package/docs/input/input.md +640 -0
  112. package/docs/input/pincode.md +191 -0
  113. package/docs/input/radio.md +337 -0
  114. package/docs/input/rating.md +214 -0
  115. package/docs/input/select.md +1230 -0
  116. package/docs/input/slider.md +347 -0
  117. package/docs/input/switch.md +206 -0
  118. package/docs/input/tag-input.md +465 -0
  119. package/docs/input/time-picker.md +358 -0
  120. package/docs/input/transfer.md +1061 -0
  121. package/docs/input/tree-select.md +1300 -0
  122. package/docs/input/upload.md +1811 -0
  123. package/docs/llms.txt +147 -0
  124. package/docs/navigation/anchor.md +377 -0
  125. package/docs/navigation/backtop.md +100 -0
  126. package/docs/navigation/breadcrumb.md +284 -0
  127. package/docs/navigation/navigation.md +851 -0
  128. package/docs/navigation/pagination.md +217 -0
  129. package/docs/navigation/steps.md +315 -0
  130. package/docs/navigation/tabs.md +754 -0
  131. package/docs/navigation/tree.md +1956 -0
  132. package/docs/other/config-provider.md +599 -0
  133. package/docs/other/locale.md +353 -0
  134. package/docs/plus/audio-player.md +155 -0
  135. package/docs/plus/code-highlight.md +150 -0
  136. package/docs/plus/drag-move.md +214 -0
  137. package/docs/plus/hot-keys.md +174 -0
  138. package/docs/plus/json-viewer.md +392 -0
  139. package/docs/plus/lottie.md +176 -0
  140. package/docs/plus/markdown-render.md +240 -0
  141. package/docs/plus/video-player.md +325 -0
  142. package/docs/show/avatar.md +475 -0
  143. package/docs/show/badge.md +276 -0
  144. package/docs/show/calendar.md +352 -0
  145. package/docs/show/card.md +485 -0
  146. package/docs/show/carousel.md +592 -0
  147. package/docs/show/collapse.md +289 -0
  148. package/docs/show/collapsible.md +216 -0
  149. package/docs/show/cropper.md +285 -0
  150. package/docs/show/descriptions.md +325 -0
  151. package/docs/show/dropdown.md +466 -0
  152. package/docs/show/empty.md +225 -0
  153. package/docs/show/highlight.md +144 -0
  154. package/docs/show/image.md +433 -0
  155. package/docs/show/list.md +927 -0
  156. package/docs/show/modal.md +517 -0
  157. package/docs/show/overflow-list.md +272 -0
  158. package/docs/show/popover.md +534 -0
  159. package/docs/show/scroll-list.md +156 -0
  160. package/docs/show/side-sheet.md +274 -0
  161. package/docs/show/table.md +5437 -0
  162. package/docs/show/tag.md +428 -0
  163. package/docs/show/timeline.md +277 -0
  164. package/docs/show/tooltip.md +442 -0
  165. package/docs/show/user-guide.md +419 -0
  166. package/docs/start/getting-started.md +234 -0
  167. package/docs/start/introduction.md +57 -0
  168. package/docs/start/overview.md +21 -0
  169. package/package.json +5 -4
@@ -0,0 +1,615 @@
1
+ # Typography
2
+
3
+ > The basic format of text, images, paragraphs, and numeric.
4
+
5
+ Package: `@fibrae/semi-ui-svelte`. Web page: https://semi-design-next.pages.dev/en-US/svelte/basic/typography/
6
+
7
+ ## When to Use
8
+
9
+ - To display the text content of articles, blogs, logs, etc.
10
+ - To take basic operations such as copying and omitting text.
11
+
12
+ ## Demos
13
+
14
+ ### How to import
15
+
16
+ ```svelte
17
+ <script lang="ts">
18
+ import { Typography } from '@fibrae/semi-ui-svelte';
19
+ </script>
20
+ ```
21
+
22
+ Use `Typography.Text`, `Typography.Title`, `Typography.Paragraph` and `Typography.Numeral` in the template, or import `TypographyText`, `TypographyTitle`, `TypographyParagraph` and `TypographyNumeral` directly.
23
+
24
+ ### Title
25
+
26
+ Use `heading` to set different levels of headint title.
27
+
28
+ ```svelte
29
+ <script lang="ts">
30
+ import { Typography } from '@fibrae/semi-ui-svelte';
31
+ </script>
32
+
33
+ <div>
34
+ <Typography.Title style="margin: 8px 0">h1. Semi Design</Typography.Title>
35
+ <Typography.Title heading={2} style="margin: 8px 0">h2. Semi Design</Typography.Title>
36
+ <Typography.Title heading={3} style="margin: 8px 0">h3. Semi Design</Typography.Title>
37
+ <Typography.Title heading={4} style="margin: 8px 0">h4. Semi Design</Typography.Title>
38
+ <Typography.Title heading={5} style="margin: 8px 0">h5. Semi Design</Typography.Title>
39
+ <Typography.Title heading={6} style="margin: 8px 0">h6. Semi Design</Typography.Title>
40
+ </div>
41
+ ```
42
+
43
+ ### Text
44
+
45
+ Text component has different built-in styles.
46
+
47
+ You could also use the `icon` snippet to use the built-in styles for icon. Different from putting the icon in children, using `icon` for link will have no underline in compliance with Semi Design Next principles.
48
+
49
+ ```svelte
50
+ <script lang="ts">
51
+ import { Typography } from '@fibrae/semi-ui-svelte';
52
+ </script>
53
+
54
+ <div>
55
+ <Typography.Text>Text</Typography.Text>
56
+ <br />
57
+ <br />
58
+ <Typography.Text type="secondary">Secondary</Typography.Text>
59
+ <br />
60
+ <br />
61
+ <Typography.Text type="tertiary">Tertiary</Typography.Text>
62
+ <br />
63
+ <br />
64
+ <Typography.Text type="quaternary">Quaternary</Typography.Text>
65
+ <br />
66
+ <br />
67
+ <Typography.Text type="warning">Warning</Typography.Text>
68
+ <br />
69
+ <br />
70
+ <Typography.Text type="danger">Danger</Typography.Text>
71
+ <br />
72
+ <br />
73
+ <Typography.Text type="success">Success</Typography.Text>
74
+ <br />
75
+ <br />
76
+ <Typography.Text disabled>Disabled</Typography.Text>
77
+ <br />
78
+ <br />
79
+ <Typography.Text mark>Default Mark</Typography.Text>
80
+ <br />
81
+ <br />
82
+ <Typography.Text code>Example Code</Typography.Text>
83
+ <br />
84
+ <br />
85
+ <Typography.Text underline>Underline</Typography.Text>
86
+ <br />
87
+ <br />
88
+ <Typography.Text delete>Deleted</Typography.Text>
89
+ <br />
90
+ <br />
91
+ <Typography.Text strong>Strong</Typography.Text>
92
+ </div>
93
+ ```
94
+
95
+ You could pass object to `link`, which will be mounted on `<a>`.
96
+
97
+ ```svelte
98
+ <script lang="ts">
99
+ import { IconLink } from '@fibrae/semi-icons-svelte';
100
+ import { Typography } from '@fibrae/semi-ui-svelte';
101
+ </script>
102
+
103
+ <div>
104
+ <Typography.Text link={{ href: 'https://semi-design-next.pages.dev/' }}>链接文本</Typography.Text>
105
+ <br />
106
+ <br />
107
+ <Typography.Text link={{ href: 'https://semi-design-next.pages.dev/' }}>打开网站</Typography.Text>
108
+ <br />
109
+ <br />
110
+ <Typography.Text link underline>
111
+ {#snippet icon()}
112
+ <IconLink />
113
+ {/snippet}
114
+ 带下划线的网页链接
115
+ </Typography.Text>
116
+ </div>
117
+ ```
118
+
119
+ ### Paragraph
120
+
121
+ Paragraph component has two spacings. You could set`spacing='extended'` for a looser spacing.
122
+
123
+ ```svelte
124
+ <script lang="ts">
125
+ import { Typography } from '@fibrae/semi-ui-svelte';
126
+ </script>
127
+
128
+ <div>
129
+ <Typography.Title heading={5}>默认行距</Typography.Title>
130
+ <Typography.Paragraph>Semi Design Next 是 Semi Design 的社区版设计系统,一套组件在 React、Vue、Solid、Svelte 中原生可用。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。</Typography.Paragraph>
131
+ <br />
132
+ <Typography.Title heading={5}>宽松行距</Typography.Title>
133
+ <Typography.Paragraph spacing="extended">Semi Design Next 是 Semi Design 的社区版设计系统,一套组件在 React、Vue、Solid、Svelte 中原生可用。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。</Typography.Paragraph>
134
+ </div>
135
+ ```
136
+
137
+ ### Numeral
138
+
139
+ Based on Text component, added properties: `rule`, `precision`, `truncate`, `parser`, to provide the ability to handle Numeral in text separately.
140
+
141
+ > **Note**
142
+ >
143
+ > The Numeral component recursively traverses the text nodes rendered by `children` to detect all numeric text within them for conversion, so please control the rendering structure level.
144
+ >
145
+ > For Numeral components with a rule of `percentages`, the value is always converted as (num\*100)%.
146
+
147
+ `precision` allows you to set the number of decimal places to be retained, used to set precision\
148
+ `truncate` The truncation of the number of decimal places, optionally `ceil`, `floor`, `round`, aligned with Math.ceil, Math.floor, Math.round\
149
+ `rule` for setting the parsing rules
150
+
151
+ - set to `percentages` to automatically convert numbers to percentages
152
+ - set to `bytes-decimal` to automatically convert numbers to bytes, 1 KB is defined as 1000 bytes, (B, KB, MB, GB, TB, PB, EB, ZB, YB)
153
+ - Set to `bytes-binary` automatically converts the number to the unit of display corresponding to bytes, 1 KiB is defined as equal to 1024 bytes, (B, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB)
154
+ - When set to `text`, Automatic rounding of numbers only, based on the `precision` and `truncate` attributes
155
+ - When set to `numbers`, non-numeric characters will be filtered and only numbers will be displayed
156
+ - When set to `exponential`, numbers are automatically converted to scientific notation
157
+
158
+ Numeral renders a `span` by default. When the content has block elements such as `p`, use `component="div"` to render a block container.
159
+
160
+ ```svelte
161
+ <script lang="ts">
162
+ import { Typography } from '@fibrae/semi-ui-svelte';
163
+ </script>
164
+
165
+ <div>
166
+ <Typography.Numeral component="div" precision={1}>
167
+ <p>点赞量:1.6111e1 K</p>
168
+ </Typography.Numeral>
169
+
170
+ <p>播放量:<Typography.Numeral precision={1} rule="numbers">2.4444e2</Typography.Numeral>K</p>
171
+
172
+ <Typography.Numeral component="div" precision={2} rule="percentages" style="margin-block-end: 12px">
173
+ <p>好评率: 0.915</p>
174
+ </Typography.Numeral>
175
+
176
+ <Typography.Numeral rule="percentages" style="margin-block-end: 12px">这场比赛我的胜率是0.6,输的概率是0.4</Typography.Numeral>
177
+
178
+ <Typography.Numeral component="div" precision={2} rule="bytes-decimal" truncate="floor">
179
+ <p>已使用: 1000</p>
180
+ <p>未使用: {1024 * 1000}</p>
181
+ </Typography.Numeral>
182
+
183
+ <Typography.Numeral component="div" precision={2} rule="bytes-binary" truncate="floor">
184
+ <p>已使用: 1024</p>
185
+ <p>未使用: {2e12}</p>
186
+ </Typography.Numeral>
187
+ </div>
188
+ ```
189
+
190
+ Parsing rules can be customised via `parser`.
191
+
192
+ ```svelte
193
+ <script lang="ts">
194
+ import { Typography } from '@fibrae/semi-ui-svelte';
195
+
196
+ const parserTCH = (oldVal: string) => {
197
+ return oldVal
198
+ .split(' ')
199
+ .map((item) => (Number(item) ? `${item.replace(/(\d)(?=(?:\d{3})+(?:\.|$))/g, '$1,')}+` : item))
200
+ .join(' ');
201
+ };
202
+
203
+ const infos = [
204
+ { type: 'Stars', min: '7100' },
205
+ { type: 'Fork', min: '560' },
206
+ { type: 'Downloads', min: '5000000' },
207
+ { type: 'Contributors', min: '100' },
208
+ ];
209
+ </script>
210
+
211
+ <div>
212
+ <Typography.Numeral component="div" parser={parserTCH}>
213
+ Semi Design 重视我们的用户,加入并助力我们不断完善
214
+ {#each infos as item (item.min)}
215
+ <p>
216
+ {item.type}:<b style="color: var(--semi-violet-5)">{item.min}</b>
217
+ </p>
218
+ {/each}
219
+ </Typography.Numeral>
220
+ <br />
221
+ <Typography.Numeral link={{ href: 'https://semi-design-next.pages.dev/', target: '_blank' }} parser={parserTCH}>共计 {1e5} 条数据,前往官网 &gt;&gt;</Typography.Numeral>
222
+ </div>
223
+ ```
224
+
225
+ ### Size
226
+
227
+ Paragraph and Text component support two sizes, `small`(12px) and `normal`(14px), and `inherit` to take the outer size. By default it is set to `normal`.
228
+
229
+ When the paragraph component or text component are used nested, set the `size` property of the inner component to `inherit`, and the size of the inner component will inherit the size setting of the outer component.
230
+
231
+ ```svelte
232
+ <script lang="ts">
233
+ import { Typography } from '@fibrae/semi-ui-svelte';
234
+ </script>
235
+
236
+ <div>
237
+ <Typography.Text>正常文本</Typography.Text>
238
+ <Typography.Paragraph spacing="extended">Semi Design Next 是 Semi Design 的社区版设计系统,一套组件在 React、Vue、Solid、Svelte 中原生可用。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。</Typography.Paragraph>
239
+ <br />
240
+ <Typography.Text size="small">小文本</Typography.Text>
241
+ <Typography.Paragraph size="small">Semi Design Next 是 Semi Design 的社区版设计系统,一套组件在 React、Vue、Solid、Svelte 中原生可用。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。</Typography.Paragraph>
242
+ <br />
243
+ <Typography.Text size="small">
244
+ 这是一段文本,样式为 small
245
+ <Typography.Text link size="inherit">这是一段链接,设置 size 为 inherit 继承外部样式设置</Typography.Text>
246
+ </Typography.Text>
247
+ </div>
248
+ ```
249
+
250
+ ### Copyable text
251
+
252
+ Copying of text can be supported by configuring the `copyable` property.\
253
+ When copyable is configured as true, the default copied content is children itself. Note that at this time, children only support string type.\
254
+ When copyable is configured as object, you can specify the content copied to the clipboard through `copyable.content`, which is no longer strongly associated with children.\
255
+ At this time, children will no longer limit the type, but `copyable.content` still needs to be a string.
256
+
257
+ Use the `copyIcon` snippet for the content of the copy button, `copyTip` for its tooltip and `copySuccessTip` for the success tip; the `copyAction` snippet (argument `{ copied, copy, config }`) replaces the whole copy node, and `copy` takes the click event. The copy callback goes in the config object: `copyable={{ onCopy }}`.
258
+
259
+ ```svelte
260
+ <script lang="ts">
261
+ import { IconSetting } from '@fibrae/semi-icons-svelte';
262
+ import { Button, TextArea, Toast, Typography } from '@fibrae/semi-ui-svelte';
263
+
264
+ const timestamp = 1700000000;
265
+ </script>
266
+
267
+ <div>
268
+ <Typography.Paragraph copyable>点击右边的图标复制文本。</Typography.Paragraph>
269
+ <Typography.Paragraph copyable={{ content: 'Hello, Semi Design!' }}>点击复制文本。</Typography.Paragraph>
270
+ <Typography.Paragraph copyable={{ onCopy: () => Toast.success({ content: '复制文本成功' }) }}>点击右边的图标复制文本。</Typography.Paragraph>
271
+ 时间戳:
272
+ <Typography.Numeral copyable truncate="ceil" underline>{timestamp}s</Typography.Numeral>
273
+ <Typography.Paragraph copyable>
274
+ {#snippet copyIcon()}
275
+ <IconSetting style="color: var(--semi-color-link)" />
276
+ {/snippet}
277
+ 自定义复制节点
278
+ </Typography.Paragraph>
279
+ <Typography.Paragraph copyable={{ content: 'Custom render!' }}>
280
+ {#snippet copyAction({ copied, copy, config })}
281
+ <Button size="small" onclick={copy}>
282
+ <span>{copied ? '复制成功' : `点击复制:${config.content}`}</span>
283
+ </Button>
284
+ {/snippet}
285
+ 自定义复制渲染
286
+ </Typography.Paragraph>
287
+ <br />
288
+ <br />
289
+ <Typography.Text id="typography-copyable-paste" type="secondary">粘贴区域:</Typography.Text>
290
+ <br />
291
+ <TextArea aria-labelledby="typography-copyable-paste" autosize rows={3} style="width: 320px; margin-block-start: 4px" />
292
+ </div>
293
+ ```
294
+
295
+ ### Ellipsis
296
+
297
+ Show ellipsis if text is overflowed. Refer to [Ellipsis Config](#Ellipsis-Config) for detailed configuration.
298
+
299
+ > **Notice**
300
+ >
301
+ > 1. ellipsis only supports truncation of plain text, and does not support complex content such as ReactNode or Vue component nodes. Please ensure that the content is plain text
302
+ > 2. To achieve abbreviation, ellipsis needs to have a clear width or maxWidth limit for comparison and judgment. If the width is not set by itself (for example, purely relying on the flex property to expand), or the width is an indefinite value such as 100%, the parent needs to have a clear width or maxWidth
303
+ > 3. Ellipsis needs to obtain information such as the width and height of the DOM to make basic judgments. If there is a display:none style in itself or the parent, the value will be incorrect, and the abbreviation will be invalid at this time
304
+ > 4. For more information on ellipsis see [FAQ](#faq)
305
+
306
+ ```svelte
307
+ <script lang="ts">
308
+ import { Tooltip, Typography } from '@fibrae/semi-ui-svelte';
309
+ </script>
310
+
311
+ <div>
312
+ <Typography.Title ellipsis={{ showTooltip: true }} heading={5} style="width: 250px">是一个很长很长很长很长5号标题</Typography.Title>
313
+ <br />
314
+ <Typography.Text ellipsis={{ showTooltip: true }} style="width: 150px">
315
+ {#snippet ellipsisContent()}这是自定义要展示的内容{/snippet}
316
+ 可以自定义浮层里的展示内容试试看吧
317
+ </Typography.Text>
318
+ <br />
319
+ <Typography.Text ellipsis={{ showTooltip: true, pos: 'middle' }} link style="width: 150px">是一个很长很长很长很长的链接</Typography.Text>
320
+ <br />
321
+ <Typography.Paragraph ellipsis={{ suffix: '小尾巴' }} style="width: 300px">有后缀的情况:Semi Design Next 是 Semi Design 的社区版设计系统,一套组件在 React、Vue、Solid、Svelte 中原生可用。</Typography.Paragraph>
322
+ <br />
323
+ <Typography.Paragraph ellipsis={{ rows: 3 }} style="width: 300px"
324
+ >这是一个多行截断的例子:Semi Design Next 是 Semi Design 的社区版设计系统,一套组件在 React、Vue、Solid、Svelte 中原生可用。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。</Typography.Paragraph
325
+ >
326
+ <br />
327
+ <Typography.Paragraph ellipsis={{ rows: 3, showTooltip: { type: 'popover', opts: { style: 'width: 300px' } } }} style="width: 300px">
328
+ 多行截断,展示 Popover:Semi Design Next 是 Semi Design 的社区版设计系统,一套组件在 React、Vue、Solid、Svelte 中原生可用。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。
329
+ </Typography.Paragraph>
330
+ <br />
331
+ <Typography.Paragraph ellipsis={{ rows: 3, expandable: true, collapsible: true, collapseText: '折叠我吧', onExpand: (expanded, event) => console.log(expanded, event) }} style="width: 300px">
332
+ 支持展开和折叠:Semi Design Next 是 Semi Design 的社区版设计系统,一套组件在 React、Vue、Solid、Svelte 中原生可用。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。
333
+ </Typography.Paragraph>
334
+ <br />
335
+ <Typography.Text ellipsis={{ showTooltip: true, pos: 'middle' }} style="width: 150px; word-break: break-word">
336
+ {#snippet ellipsisContent()}全英文设置了word-break{/snippet}
337
+ sssssssssssssssssssssssss
338
+ </Typography.Text>
339
+ <br />
340
+ <br />
341
+ <Typography.Title ellipsis={{ showTooltip: true }} heading={5} style="width: 250px">
342
+ {#snippet ellipsisTooltip({ content: fullText, trigger })}
343
+ <Tooltip style="background-color: var(--semi-color-primary)">
344
+ {@render trigger()}
345
+ {#snippet content()}{fullText}{/snippet}
346
+ </Tooltip>
347
+ {/snippet}
348
+ 这是一个自定义弹出层组件的省略文本,背景色是蓝色
349
+ </Typography.Title>
350
+ </div>
351
+ ```
352
+
353
+ > **Tips**
354
+ >
355
+ > When the tooltip does not wrap in the pop-up tooltip when the long text occurs, please set it manually through
356
+ >
357
+ > [word-break](https://developer.mozilla.org/zh-CN/docs/Web/CSS/word-break)
358
+ >
359
+ > or
360
+ >
361
+ > [word-wrap](https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap)
362
+ >
363
+ > , more details can be found in the FAQ section of Tooltip
364
+
365
+ ```svelte
366
+ <script lang="ts">
367
+ import { Typography } from '@fibrae/semi-ui-svelte';
368
+ </script>
369
+
370
+ <div>
371
+ <Typography.Text ellipsis={{ showTooltip: true }} style="width: 150px">
372
+ {#snippet ellipsisContent()}架构|Semi-inf|graph.cheet.relation{/snippet}
373
+ 有问题的超长文本发生截断时可按需进行自定义配置
374
+ </Typography.Text>
375
+ <br />
376
+ <Typography.Text ellipsis={{ showTooltip: { opts: { class: 'components-typography-demo' } } }} style="width: 150px">
377
+ {#snippet ellipsisContent()}架构|Semi-inf|graph.cheet.relation{/snippet}
378
+ 覆盖类名超长文本发生截断时可使用类名覆盖进行自定义配置
379
+ </Typography.Text>
380
+ <br />
381
+ <Typography.Text ellipsis={{ showTooltip: { opts: { style: 'word-break: break-all' } } }} style="width: 150px">
382
+ {#snippet ellipsisContent()}架构|Semi-inf|graph.cheet.relation{/snippet}
383
+ 覆盖style超长文本发生截断时可使用style进行自定义配置
384
+ </Typography.Text>
385
+ </div>
386
+ ```
387
+
388
+ ```scss
389
+ // config word-break
390
+
391
+ .components-typography-demo {
392
+ word-break: break-word;
393
+ // or
394
+ word-break: break-all;
395
+ }
396
+ ```
397
+
398
+ ## API Reference
399
+
400
+ ### Typography.Text
401
+
402
+ **Props**
403
+
404
+ | Property | Description | Type | Default |
405
+ | - | - | - | - |
406
+ | code | Whether the text is wrapped in a code element. | `boolean` | - |
407
+ | component | Tag name of the element to render. Defaults to span. | `string` | `'span'` |
408
+ | copyable | Whether the text can be copied; pass an object for the Copyable Config. | `TypographyCopyableConfig \| boolean` | - |
409
+ | copyAction | Snippet that replaces the whole copy node, with the argument `{ copied, copy, config }`; `copy` takes the click event. | `Snippet<[TypographyCopyActionProps]>` | - |
410
+ | copyIcon | Snippet for the content of the copy button; a single node with an aria-label names the button, otherwise the locale's "Copy" does. | `Snippet` | - |
411
+ | copySuccessTip | Snippet for the content shown after a successful copy. | `Snippet` | - |
412
+ | copyTip | Snippet for the tooltip content of the copy button. | `Snippet` | - |
413
+ | delete | Adds a strikethrough. | `boolean` | - |
414
+ | disabled | Disables the text. | `boolean` | - |
415
+ | ellipsis | Truncates overflowing text; pass an object for the Ellipsis Config. | `Ellipsis \| boolean` | - |
416
+ | ellipsisContent | Snippet for the content of the floating layer when truncated; defaults to the full text. | `Snippet` | - |
417
+ | ellipsisTooltip | Snippet for a custom floating layer, rendered only when the text overflows; its argument is `{ content, trigger }`, where `content` is the full text and `trigger` is a snippet of the text element, to be placed in your own layer with `{@render trigger()}`. | `Snippet<[TypographyEllipsisTooltipProps]>` | - |
418
+ | icon | Snippet for the prefix icon; a Semi icon is set to small or default according to size. | `Snippet` | - |
419
+ | link | Whether the text is a link; with an object, its attributes (href, target, class, style, onclick and so on) are applied to the a element. | `LinkType` | - |
420
+ | mark | Adds a highlight. | `boolean` | - |
421
+ | size | Text size; inherit takes the size of the enclosing Text or Paragraph. | `TypographyBaseSize` | - |
422
+ | strong | Whether the text is bold. | `boolean` | - |
423
+ | type | Text type. | `TypographyBaseType` | - |
424
+ | underline | Adds an underline. | `boolean` | - |
425
+ | weight | Font weight as a number. | `number` | - |
426
+
427
+ The content inside the tag is `children` (a snippet). `class`, `style`, `id`, `aria-*` and other native attributes and events land on the text element.
428
+
429
+ ### Typography.Title
430
+
431
+ **Props**
432
+
433
+ | Property | Description | Type | Default |
434
+ | - | - | - | - |
435
+ | component | Tag name of the element to render. Defaults to h1 to h6 by heading. | `string` | - |
436
+ | copyable | Whether the text can be copied; pass an object for the Copyable Config. | `TypographyCopyableConfig \| boolean` | - |
437
+ | copyAction | Snippet that replaces the whole copy node, with the argument `{ copied, copy, config }`; `copy` takes the click event. | `Snippet<[TypographyCopyActionProps]>` | - |
438
+ | copyIcon | Snippet for the content of the copy button; a single node with an aria-label names the button, otherwise the locale's "Copy" does. | `Snippet` | - |
439
+ | copySuccessTip | Snippet for the content shown after a successful copy. | `Snippet` | - |
440
+ | copyTip | Snippet for the tooltip content of the copy button. | `Snippet` | - |
441
+ | delete | Adds a strikethrough. | `boolean` | - |
442
+ | disabled | Disables the text. | `boolean` | - |
443
+ | ellipsis | Truncates overflowing text; pass an object for the Ellipsis Config. | `Ellipsis \| boolean` | - |
444
+ | ellipsisContent | Snippet for the content of the floating layer when truncated; defaults to the full text. | `Snippet` | - |
445
+ | ellipsisTooltip | Snippet for a custom floating layer, rendered only when the text overflows; its argument is `{ content, trigger }`, where `content` is the full text and `trigger` is a snippet of the text element, to be placed in your own layer with `{@render trigger()}`. | `Snippet<[TypographyEllipsisTooltipProps]>` | - |
446
+ | heading | Heading level, matching h1 to h6. | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `1` |
447
+ | link | Whether the text is a link; with an object, its attributes (href, target, class, style, onclick and so on) are applied to the a element. | `LinkType` | - |
448
+ | mark | Adds a highlight. | `boolean` | - |
449
+ | strong | Whether the text is bold. | `boolean` | - |
450
+ | type | Text type. | `TypographyBaseType` | - |
451
+ | underline | Adds an underline. | `boolean` | - |
452
+ | weight | Font weight: light, regular, medium, semibold, bold, default, or a number. | `'bold' \| 'default' \| 'light' \| 'medium' \| 'regular' \| 'semibold' \| number` | - |
453
+
454
+ The content inside the tag is `children` (a snippet). `class`, `style`, `id`, `aria-*` and other native attributes and events land on the heading element.
455
+
456
+ ### Typography.Paragraph
457
+
458
+ **Props**
459
+
460
+ | Property | Description | Type | Default |
461
+ | - | - | - | - |
462
+ | component | Tag name of the element to render. Defaults to p. | `string` | `'p'` |
463
+ | copyable | Whether the text can be copied; pass an object for the Copyable Config. | `TypographyCopyableConfig \| boolean` | - |
464
+ | copyAction | Snippet that replaces the whole copy node, with the argument `{ copied, copy, config }`; `copy` takes the click event. | `Snippet<[TypographyCopyActionProps]>` | - |
465
+ | copyIcon | Snippet for the content of the copy button; a single node with an aria-label names the button, otherwise the locale's "Copy" does. | `Snippet` | - |
466
+ | copySuccessTip | Snippet for the content shown after a successful copy. | `Snippet` | - |
467
+ | copyTip | Snippet for the tooltip content of the copy button. | `Snippet` | - |
468
+ | delete | Adds a strikethrough. | `boolean` | - |
469
+ | disabled | Disables the text. | `boolean` | - |
470
+ | ellipsis | Truncates overflowing text; pass an object for the Ellipsis Config. | `Ellipsis \| boolean` | - |
471
+ | ellipsisContent | Snippet for the content of the floating layer when truncated; defaults to the full text. | `Snippet` | - |
472
+ | ellipsisTooltip | Snippet for a custom floating layer, rendered only when the text overflows; its argument is `{ content, trigger }`, where `content` is the full text and `trigger` is a snippet of the text element, to be placed in your own layer with `{@render trigger()}`. | `Snippet<[TypographyEllipsisTooltipProps]>` | - |
473
+ | link | Whether the text is a link; with an object, its attributes (href, target, class, style, onclick and so on) are applied to the a element. | `LinkType` | - |
474
+ | mark | Adds a highlight. | `boolean` | - |
475
+ | size | Text size; inherit takes the size of the enclosing Text or Paragraph. | `TypographyBaseSize` | - |
476
+ | spacing | Line spacing; extended is looser. | `TypographyBaseSpacing` | - |
477
+ | strong | Whether the text is bold. | `boolean` | - |
478
+ | type | Text type. | `TypographyBaseType` | - |
479
+ | underline | Adds an underline. | `boolean` | - |
480
+
481
+ The content inside the tag is `children` (a snippet). `class`, `style`, `id`, `aria-*` and other native attributes and events land on the paragraph element.
482
+
483
+ ### Typography.Numeral
484
+
485
+ **Props**
486
+
487
+ | Property | Description | Type | Default |
488
+ | - | - | - | - |
489
+ | code | Whether the text is wrapped in a code element. | `boolean` | - |
490
+ | component | Tag name of the element to render. Defaults to span; use div when the content has block elements such as p. | `string` | `'span'` |
491
+ | copyable | Whether the text can be copied; pass an object for the Copyable Config. | `TypographyCopyableConfig \| boolean` | - |
492
+ | copyAction | Snippet that replaces the whole copy node, with the argument `{ copied, copy, config }`; `copy` takes the click event. | `Snippet<[TypographyCopyActionProps]>` | - |
493
+ | copyIcon | Snippet for the content of the copy button; a single node with an aria-label names the button, otherwise the locale's "Copy" does. | `Snippet` | - |
494
+ | copySuccessTip | Snippet for the content shown after a successful copy. | `Snippet` | - |
495
+ | copyTip | Snippet for the tooltip content of the copy button. | `Snippet` | - |
496
+ | delete | Adds a strikethrough. | `boolean` | - |
497
+ | disabled | Disables the text. | `boolean` | - |
498
+ | icon | Snippet for the prefix icon; a Semi icon is set to small or default according to size. | `Snippet` | - |
499
+ | link | Whether the text is a link; with an object, its attributes (href, target, class, style, onclick and so on) are applied to the a element. | `LinkType` | - |
500
+ | mark | Adds a highlight. | `boolean` | - |
501
+ | parser | Custom number parser. | `(value: string) => string` | - |
502
+ | precision | Number of decimal places to keep. | `number` | `0` |
503
+ | rule | Parsing rule: text only rounds, numbers filters out non-numeric characters, bytes-decimal and bytes-binary convert byte units, percentages converts to percent, exponential converts to scientific notation. | `TypographyBaseRule` | `"text"` |
504
+ | size | Text size; inherit takes the size of the enclosing Text or Paragraph. | `TypographyBaseSize` | - |
505
+ | strong | Whether the text is bold. | `boolean` | - |
506
+ | truncate | How the kept decimals are rounded, matching Math.round, Math.ceil and Math.floor. | `TypographyBaseTruncate` | `"round"` |
507
+ | type | Text type. | `TypographyBaseType` | - |
508
+ | underline | Adds an underline. | `boolean` | - |
509
+
510
+ The content inside the tag is `children` (a snippet); text and elements in it are processed recursively, text inside components is not. `class`, `style`, `id`, `aria-*` and other native attributes and events land on the text element.
511
+
512
+ ### Ellipsis Config
513
+
514
+ | Properties | Instructions | type | Default |
515
+ | - | - | - | - |
516
+ | collapseText | Displayed text to collapse | `string` | `Collapse` |
517
+ | collapsible | Toggle whether text is collapsible | `boolean` | false |
518
+ | expandText | Displayed text to expand | `string` | `Expand` |
519
+ | expandable | Toggle whether text is expandable | `boolean` | false |
520
+ | onExpand | Callback when expand or collapse, with the expanded state after the action and the click event | `(expanded: boolean, event: MouseEvent) => void` | - |
521
+ | pos | Position to start ellipsis, one of `end`, `middle` | `'end' \| 'middle'` | `end` |
522
+ | rows | Number of rows that should not be truncated | `number` | 1 |
523
+ | showTooltip | Toggle whether to show tooltip, if passed in as object: type, type of component to show tooltip, one of `tooltip`, `popover`; opts, props passed through to the floating layer, where `class` lands on the layer and `style` is a string. The layer content comes from the `ellipsisContent` snippet, and a custom layer from the `ellipsisTooltip` snippet. When `expandable` is true or `expandText` is set, `showTooltip` does not take effect; the two are mutually exclusive | `boolean \| { type?: 'tooltip' \| 'popover', opts?: object }` | false |
524
+ | suffix | Text suffix that will not be truncated | `string` | - |
525
+
526
+ ### Copyable Config
527
+
528
+ | Properties | Instructions | Type | Default |
529
+ | - | - | - | - |
530
+ | content | Copied content | `string` | - |
531
+ | class | Class name of the copy action's wrapping span | `ClassValue` | - |
532
+ | duration | Seconds the copied state lasts | `number` | 3 |
533
+ | onCopy | Copy callback, with the click event, the copied content and whether the write succeeded; false means the write was rejected and the copied state is not entered | `(event: MouseEvent, content: string, success: boolean) => void` | - |
534
+ | style | Style string of the copy action's wrapping span | `string` | - |
535
+
536
+ Use the `copyIcon`, `copyTip` and `copySuccessTip` snippets for the content of the copy button, its tooltip and the success tip; the `copyAction` snippet (argument `{ copied, copy, config }`) replaces the whole copy node, and `config` is the resolved config.
537
+
538
+ ## Content Guidelines
539
+
540
+ - Link
541
+ - Text links need to be clear and predictable, users should be able to predict what will happen when they click on the link
542
+ - Do not mislead users by mislabeling links
543
+ - Avoid using "Click here" or "Here" as stand-alone links
544
+
545
+ | ✅ Recommended usage | ❌ Deprecated usage |
546
+ | - | - |
547
+ | No spaces yet? Create space | No spaces yet? Click here |
548
+
549
+ - Avoid using entire sentences as clickable text links, and instead use text that describes where to go as the link content
550
+
551
+ | ✅ Recommended usage | ❌ Deprecated usage |
552
+ | - | - |
553
+ | Views user documentation for details | View user documentation for details |
554
+
555
+ - Using short terms or words as link text is more conducive to internationalization, to avoid the problem of link text being split due to different grammar and word order in different languages
556
+
557
+ | ✅ Recommended usage | ❌ Deprecated usage |
558
+ | - | - |
559
+ | Manage notifications to | Manage notifications to |
560
+
561
+ - When ending with a text link, there is no need to follow punctuation, except for the question mark "?"
562
+
563
+ | ✅ Recommended usage | ❌ Deprecated usage |
564
+ | - | - |
565
+ | No spaces yet? Create space | No spaces yet? Click here |
566
+ | Forgot password ? | Forgot password |
567
+
568
+ - Link text does not contain the articles "the, a, an"
569
+
570
+ | ✅ Recommended usage | ❌ Deprecated usage |
571
+ | - | - |
572
+ | View user documentation for details | View the user documentation for details |
573
+
574
+ ## Design Tokens
575
+
576
+ The design token table of this component is on the web page: <https://semi-design-next.pages.dev/en-US/svelte/basic/typography/>
577
+
578
+ ## FAQ
579
+
580
+ - **What are the specific mechanism and precautions of Typography ellipsis?**
581
+
582
+ Semi ellipsis has two strategies, CSS ellipsis and JS ellipsis. When setting middle truncation (pos='middle')、 expandable、 expandText is set (not undefined)、 suffix is not empty string、copyable, the JS ellipsis strategy is enabled. Otherwise, enable the CSS ellipsis strategy.
583
+
584
+ In general CSS truncation performance is better than JS truncation. when the children and container size remain unchanged, CSS truncation only involves 1\~2 calculations, while js truncation is based on dichotomy and may require multiple calculations.
585
+
586
+ Pay attention to performance consumption when using a large number of Typography with ellipsis. For example, in Table, you can reduce performance loss by setting a reasonable pageSize for paging.
587
+
588
+ ## Changes from Semi Design
589
+
590
+ From the project release notes (written in Chinese). Your knowledge of Semi Design does not cover these.
591
+
592
+ - ScrollList:滚动列(TimePicker 的时间列同用)的键盘处理放行带 Alt、Ctrl、Meta 的按键(如 Alt+ArrowDown),不再 `preventDefault`、不改选中项。
593
+ - Carousel:`ref.stop()` 后手动切换、焦点离开、幻灯片增加等都不再恢复自动播放,直到 `ref.play()`;`prefers-reduced-motion: reduce` 时不自动播放且无切换动画;键盘焦点进入时暂停自动播放;非当前幻灯片带 `inert`。
594
+ - Carousel 箭头改为原生 `<button type="button">`(`arrowProps.*.props` 类型改为 `ButtonHTMLAttributes<HTMLButtonElement>`),指示点改为 `role="tab"` 的 button;新增语言包键 `Carousel.indicators`、`Carousel.slideN`、`Carousel.carousel`、`Carousel.slide`(自定义语言包需补齐)与主题变量 `$radius-carousel_arrow`,箭头高度由 39px 改为 32px。
595
+ - Typography 的复制按钮与展开、收起控件改为原生 `<button type="button">`,`ellipsis.onExpand` 事件类型改为 `React.MouseEvent<HTMLButtonElement>`,复制按钮不再带内联 `margin-left`;`ellipsis` 对象中写成 `undefined` 的 `rows`、`pos`、`suffix` 取默认值(`1`、`'end'`、`''`);无 `href` 的 `link` 有点击监听时获得 `role="link"`;`disabled` 的 `link` 不再触发 `link.onClick`。
596
+ - 修复(Vue、Svelte):`link` 里写成 `undefined` 的 `aria-describedby` 不再覆盖省略提示的关联,链接仍以 Tooltip 作描述,与 React、Solid 一致。
597
+ - 破坏性:Numeral 不再支持函数 children;`CopyableConfig`、`LinkType` 的深路径从 `typography/title` 移到 `typography/interface`;`BaseTypographyProps` 不再从入口导出;类型上 `ScrollItemProps` 不再包含 `children`,ScrollItem 的 `motion` 收为 `boolean`,`onSelect` 参数收窄为 `T & { type?: string | number; index: number }`。
598
+ - 破坏性(类型):React、Solid 的 `CopyableProps` 的 `content`、`duration` 必填,经 `Typography` 的 `copyable` 使用不受影响。
599
+ - React、Solid 破坏性(深路径导入):`typography/copyable` 只有默认导出,删除同名的具名导出 `Copyable`。
600
+ - ScrollList 的各列不显示滚动条(原来随系统设置显示),用滚轮、拖动或方向键滚动。
601
+ - ScrollItem wheel 模式的高亮行(`.semi-scrolllist-item-selected`)由渲染输出,重新渲染改写类名时不再丢失;React、Solid 的 `transform` 参数 `value` 类型为 `T['value']`(原为 `any`),与 Vue、Svelte 一致。
602
+ - Solid 破坏性:箭头内容由 `arrowProps.leftArrow.children`、`arrowProps.rightArrow.children` 改为 Carousel 的 `leftArrow`、`rightArrow` 属性(`JSX.Element`,`null` 时按钮为空,与 Vue 的 `#leftArrow`、`#rightArrow` 一致),只在显示箭头时创建,`ArrowButton` 只剩 `props`;箭头按钮的 `x-semi-prop` 改为 `leftArrow`、`rightArrow`。
603
+ - Solid 破坏性(类型):`copyable` 配置的 `copyTip`、`successTip` 改为 `string | (() => JSX.Element)`,`icon` 改为 `() => JSX.Element`(`icon: () => <X />`),只在对应内容显示时调用。
604
+ - Solid 破坏性:Numeral 只格式化字符串与数字 children,每个分别格式化(动态插值 `{price()}` 单独成段,与 React 一致);元素 children(含子组件渲染出的元素)原样输出,其中的文字不格式化。copyable 按钮的可访问名称只取字符串的 `copyTip`(未复制时)与 `successTip`(已复制时),否则用语言包的 `copy`、`copied`;`icon`、`successTip` 渲染出的元素上的 `aria-label` 不再参与命名。
605
+ - Svelte 破坏性:Carousel 的幻灯片用 `items` 数据 prop 加 `slide` snippet(参数 `{ item, index }`),不接受 children 形式,Carousel 给每张包一层带 role、`inert` 的元素;箭头内容为 `leftArrow`、`rightArrow` snippet;`activeIndex` 可绑定,回调 `onChange(activeIndex, preIndex)`;`play`、`stop`、`goTo`、`prev`、`next` 经 `bind:this` 调用。
606
+ - Svelte:Typography 的 `Text`、`Title`、`Paragraph`、`Numeral` 与根组件 `Typography` 均为具名导出,平铺在包根;`copyable` 配置对象只含 `content`、`duration`、`class`、`style`(字符串)、`onCopy`,图标、提示、自定义渲染改用 snippet `copyIcon`、`copyTip`、`copySuccessTip`、`copyAction`(参数 `{ copied, copy, config }`);`ellipsis` 的 `onExpand` 写在 `ellipsis` 配置里。
607
+ - Svelte:`showTooltip` 的 `opts` 同时接受 Tooltip 与 Popover 属性(`type` 为 `'popover'` 时渲染带箭头的 Popover,类名含 `semi-typography-ellipsis-popover`),提示内容用 `ellipsisContent` snippet,整体接管提示用 `ellipsisTooltip` snippet(参数 `{ content, trigger }`);`icon` 为 snippet;`component` 只接受字符串标签名。
608
+ - Svelte:省略截断时,完整文本留在 DOM 中并设 `hidden`,根元素的 `textContent` 含全文;Numeral 格式化与图标 small 尺寸在挂载后才应用,服务端输出原始文本与默认图标尺寸。
609
+ - Svelte:ScrollList 的 `header`、`footer` 接受字符串或 snippet,传了就渲染;ScrollItem 的 `selectedIndex` 可绑定,配 `onSelect(data)`;`ScrollList.Item` 与具名导出 `ScrollItem` 是同一组件;`scrollToIndex` 经 `bind:this` 调用。
610
+ - 破坏性(Solid):Carousel 给每张幻灯片外包一层 `div.semi-carousel-content-item`,class、`role`、`aria-*`、`id`、`inert` 与切换动画写在包装元素上,使用方的幻灯片元素原样保留,要撑满轮播区域需自己设置 `height: 100%`(同 Svelte);按幻灯片元素写的 `.semi-carousel-content-item` 选择器改为选包装元素;幻灯片自带的 `id`、`aria-label` 不再用作 tab 的 `aria-controls` 目标与幻灯片名称。服务端 HTML 已带这些 class 与属性。
611
+ - Typography(React):`showTooltip.type` 显式为 `undefined` 时按默认 Tooltip 渲染,不再抛错。
612
+ - Typography:Numeral 不接受 `ellipsis`(类型与文档本就未声明),经透传带上也不截断(四个框架一致)。
613
+ - Typography:展开后按钮消失(可展开且不可收起)时,只在按钮持有焦点的情况下,于按钮移除后把焦点交给文字根元素(`tabindex="-1"`);按钮保留时焦点留在按钮上。React、Solid 不再在点击时无条件同步聚焦根元素(四个框架一致)。
614
+ - Typography(Vue):JS 省略的首帧按原插槽渲染,测量后再截断,放得下的内容不再先压成纯文本再恢复。
615
+ - ScrollList:cycled wheel 不再移动 `<li>`,DOM 顺序就是渲染顺序,列表长度变化后顺序、选中定位与点击回调值都正确,选中项立即定位且无动画。隐藏状态下挂载或隐藏后再显示的列,显示时定位到选中项,不触发 `onSelect`。任何定位都取消进行中的滚动动画,包括 `scrollToIndex(_, 0)`。删除 `ItemFoundation` 的 `shouldAppend`、`shouldPrepend`。