@fibrae/semi-ui-svelte 0.2.0 → 0.3.1

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 (288) hide show
  1. package/LICENSE +0 -62
  2. package/README.md +40 -38
  3. package/README.zh-CN.md +91 -0
  4. package/dist/_base/create-context.js +0 -1
  5. package/dist/_base/css-animation.js +0 -1
  6. package/dist/_base/group-role.d.ts +0 -1
  7. package/dist/_base/group-role.js +0 -1
  8. package/dist/_base/slot-kind.d.ts +0 -1
  9. package/dist/_base/slot-kind.js +0 -1
  10. package/dist/_base/teleport.d.ts +0 -2
  11. package/dist/_base/teleport.js +0 -2
  12. package/dist/_base/use-click-outside.svelte.d.ts +2 -2
  13. package/dist/_base/use-click-outside.svelte.js +2 -2
  14. package/dist/_base/use-foundation.svelte.js +2 -5
  15. package/dist/_base/virtual-list.svelte +2 -3
  16. package/dist/_base/virtual-list.svelte.d.ts +0 -1
  17. package/dist/_sortable/interface.d.ts +0 -1
  18. package/dist/anchor/interface.d.ts +0 -3
  19. package/dist/anchor/link-item.svelte +0 -1
  20. package/dist/anchor/links.d.ts +0 -1
  21. package/dist/anchor/links.js +0 -1
  22. package/dist/audio-player/audio-player.svelte +0 -2
  23. package/dist/audio-player/audio-slider.svelte +0 -3
  24. package/dist/auto-complete/auto-complete.svelte +0 -5
  25. package/dist/auto-complete/interface.d.ts +0 -9
  26. package/dist/avatar/avatar-group-more.svelte +0 -1
  27. package/dist/avatar/avatar.svelte +0 -4
  28. package/dist/avatar/context.d.ts +0 -1
  29. package/dist/avatar/interface.d.ts +0 -4
  30. package/dist/backtop/backtop.svelte +0 -2
  31. package/dist/backtop/interface.d.ts +0 -1
  32. package/dist/badge/interface.d.ts +0 -1
  33. package/dist/banner/banner.svelte +1 -1
  34. package/dist/banner/interface.d.ts +1 -3
  35. package/dist/breadcrumb/breadcrumb-item.svelte +0 -1
  36. package/dist/breadcrumb/breadcrumb.svelte +0 -1
  37. package/dist/breadcrumb/interface.d.ts +0 -7
  38. package/dist/calendar/calendar.svelte +0 -1
  39. package/dist/calendar/day-calendar.svelte +0 -3
  40. package/dist/calendar/interface.d.ts +0 -8
  41. package/dist/calendar/month-calendar.svelte +0 -4
  42. package/dist/calendar/time-grid.svelte +0 -2
  43. package/dist/calendar/time-grid.svelte.d.ts +0 -1
  44. package/dist/calendar/use-today.svelte.d.ts +0 -1
  45. package/dist/calendar/use-today.svelte.js +0 -1
  46. package/dist/card/index.js +0 -1
  47. package/dist/card/interface.d.ts +0 -3
  48. package/dist/carousel/carousel.svelte +0 -4
  49. package/dist/carousel/interface.d.ts +0 -3
  50. package/dist/cascader/cascader.svelte +0 -6
  51. package/dist/cascader/interface.d.ts +0 -19
  52. package/dist/cascader/item.svelte +0 -4
  53. package/dist/cascader/item.svelte.d.ts +0 -4
  54. package/dist/checkbox/checkbox-group.svelte +0 -3
  55. package/dist/checkbox/checkbox.svelte +0 -4
  56. package/dist/checkbox/index.js +0 -1
  57. package/dist/checkbox/interface.d.ts +0 -1
  58. package/dist/code-highlight/interface.d.ts +0 -1
  59. package/dist/collapse/collapse.svelte +0 -2
  60. package/dist/collapse/index.js +0 -1
  61. package/dist/collapse/interface.d.ts +0 -2
  62. package/dist/collapse/panel.svelte +0 -1
  63. package/dist/collapsible/collapsible.svelte +0 -2
  64. package/dist/color-picker/alpha-slider.svelte +0 -1
  65. package/dist/color-picker/color-choose-area.svelte +0 -1
  66. package/dist/color-picker/color-slider.svelte +0 -1
  67. package/dist/color-picker/data-part.svelte +0 -1
  68. package/dist/cropper/cropper.svelte +0 -1
  69. package/dist/cropper/interface.d.ts +0 -6
  70. package/dist/date-picker/date-input.svelte +0 -4
  71. package/dist/date-picker/date-picker.svelte +0 -7
  72. package/dist/date-picker/inset-input.svelte +0 -1
  73. package/dist/date-picker/interface.d.ts +0 -7
  74. package/dist/date-picker/internal.d.ts +0 -7
  75. package/dist/date-picker/month.svelte +0 -1
  76. package/dist/date-picker/months-grid.svelte +0 -6
  77. package/dist/date-picker/navigation.svelte +0 -1
  78. package/dist/descriptions/interface.d.ts +0 -1
  79. package/dist/divider/divider.svelte +0 -1
  80. package/dist/divider/interface.d.ts +0 -4
  81. package/dist/drag-move/drag-move.js +0 -1
  82. package/dist/drag-move/interface.d.ts +0 -3
  83. package/dist/dropdown/context.d.ts +0 -6
  84. package/dist/dropdown/context.js +0 -1
  85. package/dist/dropdown/dropdown-item.svelte +0 -1
  86. package/dist/dropdown/dropdown.svelte +0 -7
  87. package/dist/dropdown/interface.d.ts +0 -4
  88. package/dist/empty/empty.svelte +0 -1
  89. package/dist/empty/interface.d.ts +0 -3
  90. package/dist/feedback/feedback.svelte +0 -1
  91. package/dist/feedback/interface.d.ts +0 -8
  92. package/dist/float-button/float-button-action.svelte +0 -2
  93. package/dist/float-button/interface.d.ts +0 -2
  94. package/dist/form/array-field.svelte +0 -2
  95. package/dist/form/context.d.ts +0 -2
  96. package/dist/form/error-message.svelte +0 -1
  97. package/dist/form/field-grid.svelte +0 -2
  98. package/dist/form/field-grid.svelte.d.ts +0 -2
  99. package/dist/form/field-inner.svelte +0 -2
  100. package/dist/form/field.svelte +0 -1
  101. package/dist/form/form.svelte +0 -1
  102. package/dist/form/hooks.d.ts +1 -2
  103. package/dist/form/hooks.js +1 -2
  104. package/dist/form/interface.d.ts +0 -7
  105. package/dist/form/utils.d.ts +0 -1
  106. package/dist/form/utils.js +0 -2
  107. package/dist/highlight/interface.d.ts +0 -1
  108. package/dist/hot-keys/interface.d.ts +0 -1
  109. package/dist/image/context.d.ts +0 -1
  110. package/dist/image/footer.d.ts +0 -1
  111. package/dist/image/interface.d.ts +0 -8
  112. package/dist/image/preview-image.svelte +0 -3
  113. package/dist/image/preview-image.svelte.d.ts +0 -1
  114. package/dist/image/preview-inner.svelte +0 -3
  115. package/dist/image/preview-inner.svelte.d.ts +0 -1
  116. package/dist/input/context.d.ts +0 -1
  117. package/dist/input/interface.d.ts +0 -3
  118. package/dist/input/textarea.svelte +0 -3
  119. package/dist/input-number/input-number.svelte +0 -2
  120. package/dist/input-number/interface.d.ts +0 -1
  121. package/dist/json-viewer/interface.d.ts +0 -4
  122. package/dist/json-viewer/json-viewer.svelte +0 -3
  123. package/dist/layout/interface.d.ts +0 -2
  124. package/dist/list/interface.d.ts +0 -2
  125. package/dist/lottie/interface.d.ts +1 -1
  126. package/dist/markdown-render/code-text.js +0 -1
  127. package/dist/markdown-render/components/code.svelte +0 -1
  128. package/dist/markdown-render/components/heading.svelte +0 -1
  129. package/dist/markdown-render/components/p.svelte +0 -1
  130. package/dist/markdown-render/components/table.svelte +0 -1
  131. package/dist/markdown-render/components/tree.d.ts +0 -4
  132. package/dist/markdown-render/components/tree.js +0 -2
  133. package/dist/markdown-render/interface.d.ts +0 -1
  134. package/dist/markdown-render/markdown-children.svelte +0 -2
  135. package/dist/markdown-render/markdown-render.svelte +0 -1
  136. package/dist/markdown-render/runtime.js +0 -1
  137. package/dist/modal/confirm-modal.svelte +0 -1
  138. package/dist/modal/confirm.svelte.d.ts +0 -1
  139. package/dist/modal/confirm.svelte.js +0 -1
  140. package/dist/modal/index.js +0 -1
  141. package/dist/modal/interface.d.ts +0 -6
  142. package/dist/modal/modal-content.svelte +0 -4
  143. package/dist/modal/modal.svelte +0 -1
  144. package/dist/modal/use-show-hide.svelte.d.ts +0 -2
  145. package/dist/modal/use-show-hide.svelte.js +0 -4
  146. package/dist/navigation/context.d.ts +0 -2
  147. package/dist/navigation/index.js +0 -1
  148. package/dist/navigation/interface.d.ts +1 -17
  149. package/dist/navigation/item-shell.svelte +0 -4
  150. package/dist/navigation/item-shell.svelte.d.ts +0 -3
  151. package/dist/navigation/nav-footer.svelte +0 -2
  152. package/dist/navigation/nav-items.svelte +0 -1
  153. package/dist/navigation/nav.svelte +0 -1
  154. package/dist/navigation/sub-nav.svelte +0 -5
  155. package/dist/navigation/wrapper-outlet.svelte +0 -1
  156. package/dist/notification/context.d.ts +0 -3
  157. package/dist/notification/interface.d.ts +0 -5
  158. package/dist/notification/notice-list.svelte +0 -2
  159. package/dist/notification/notice-list.svelte.d.ts +0 -1
  160. package/dist/notification/notice.svelte +0 -2
  161. package/dist/notification/notification-list.svelte +0 -1
  162. package/dist/notification/static-api.js +0 -1
  163. package/dist/overflow-list/interface.d.ts +0 -2
  164. package/dist/overflow-list/overflow-list.svelte +0 -2
  165. package/dist/pagination/interface.d.ts +0 -1
  166. package/dist/pagination/pagination.svelte +0 -2
  167. package/dist/pagination/step-button.svelte +0 -3
  168. package/dist/pagination/step-button.svelte.d.ts +0 -1
  169. package/dist/pincode/interface.d.ts +0 -1
  170. package/dist/pincode/pincode.svelte +0 -3
  171. package/dist/popconfirm/interface.d.ts +0 -1
  172. package/dist/popconfirm/popconfirm.svelte +0 -2
  173. package/dist/popover/interface.d.ts +0 -1
  174. package/dist/popover/popover.svelte +0 -1
  175. package/dist/radio/index.js +0 -1
  176. package/dist/radio/radio-group.svelte +0 -1
  177. package/dist/radio/radio.svelte +0 -1
  178. package/dist/rating/interface.d.ts +0 -2
  179. package/dist/rating/item.svelte +0 -1
  180. package/dist/rating/rating.svelte +0 -7
  181. package/dist/resizable/interface.d.ts +0 -2
  182. package/dist/resizable/resizable.svelte +0 -1
  183. package/dist/resizable/resize-group.svelte +0 -1
  184. package/dist/resizable/resize-handler.svelte +0 -1
  185. package/dist/resize-observer/observe-resize.d.ts +1 -5
  186. package/dist/resize-observer/observe-resize.js +1 -5
  187. package/dist/scroll-list/index.js +0 -1
  188. package/dist/scroll-list/interface.d.ts +0 -2
  189. package/dist/scroll-list/scroll-item.svelte +0 -2
  190. package/dist/select/interface.d.ts +0 -14
  191. package/dist/select/option.svelte +0 -5
  192. package/dist/select/option.svelte.d.ts +0 -5
  193. package/dist/select/select.svelte +0 -14
  194. package/dist/side-sheet/interface.d.ts +0 -1
  195. package/dist/side-sheet/side-sheet.svelte +0 -9
  196. package/dist/skeleton/index.js +0 -1
  197. package/dist/skeleton/interface.d.ts +0 -2
  198. package/dist/skeleton/skeleton-item.svelte +0 -1
  199. package/dist/slider/interface.d.ts +0 -5
  200. package/dist/slider/slider.svelte +0 -7
  201. package/dist/space/interface.d.ts +0 -1
  202. package/dist/space/space.svelte +0 -1
  203. package/dist/steps/context.d.ts +0 -1
  204. package/dist/steps/interface.d.ts +0 -2
  205. package/dist/steps/step.svelte +0 -3
  206. package/dist/switch/switch.svelte +0 -2
  207. package/dist/table/body/base-row.svelte +0 -4
  208. package/dist/table/body/base-row.svelte.d.ts +0 -4
  209. package/dist/table/body/body.svelte +0 -7
  210. package/dist/table/body/body.svelte.d.ts +0 -5
  211. package/dist/table/body/expanded-row.svelte +0 -1
  212. package/dist/table/body/expanded-row.svelte.d.ts +0 -1
  213. package/dist/table/body/section-row.svelte +0 -2
  214. package/dist/table/body/section-row.svelte.d.ts +0 -2
  215. package/dist/table/column-filter-menu.svelte +0 -3
  216. package/dist/table/column-filter-menu.svelte.d.ts +0 -3
  217. package/dist/table/column-filter.svelte +0 -2
  218. package/dist/table/column-filter.svelte.d.ts +0 -2
  219. package/dist/table/column-selection.svelte +1 -2
  220. package/dist/table/column-selection.svelte.d.ts +0 -1
  221. package/dist/table/column-sorter.svelte +1 -6
  222. package/dist/table/column-sorter.svelte.d.ts +1 -6
  223. package/dist/table/context.d.ts +0 -10
  224. package/dist/table/context.js +0 -1
  225. package/dist/table/custom-expand-icon.svelte +0 -2
  226. package/dist/table/custom-expand-icon.svelte.d.ts +0 -2
  227. package/dist/table/head-table.svelte +0 -1
  228. package/dist/table/head-table.svelte.d.ts +0 -1
  229. package/dist/table/interface.d.ts +2 -21
  230. package/dist/table/table-cell.svelte +0 -7
  231. package/dist/table/table-cell.svelte.d.ts +0 -7
  232. package/dist/table/table-header-row.svelte +0 -2
  233. package/dist/table/table-header-row.svelte.d.ts +0 -2
  234. package/dist/table/table-pagination.svelte +0 -2
  235. package/dist/table/table-pagination.svelte.d.ts +0 -2
  236. package/dist/table/table.svelte +0 -5
  237. package/dist/table/utils.d.ts +1 -13
  238. package/dist/table/utils.js +1 -11
  239. package/dist/tabs/index.js +0 -1
  240. package/dist/tabs/interface.d.ts +0 -13
  241. package/dist/tabs/tab-bar.svelte +0 -3
  242. package/dist/tabs/tab-bar.svelte.d.ts +0 -1
  243. package/dist/tabs/tab-pane.svelte +0 -2
  244. package/dist/tabs/tabs.svelte +0 -1
  245. package/dist/tag-input/interface.d.ts +0 -5
  246. package/dist/tag-input/tag-input.svelte +0 -3
  247. package/dist/tag-input/tag-item.svelte +0 -1
  248. package/dist/tag-input/tag-item.svelte.d.ts +0 -1
  249. package/dist/time-picker/combobox.svelte +0 -1
  250. package/dist/time-picker/interface.d.ts +0 -9
  251. package/dist/time-picker/time-picker.svelte +0 -2
  252. package/dist/timeline/interface.d.ts +0 -4
  253. package/dist/timeline/timeline.svelte +0 -1
  254. package/dist/toast/context.d.ts +0 -2
  255. package/dist/toast/interface.d.ts +0 -2
  256. package/dist/toast/static-api.js +0 -1
  257. package/dist/toast/toast.svelte +0 -1
  258. package/dist/toast/use-toast.js +0 -1
  259. package/dist/tooltip/context.d.ts +0 -2
  260. package/dist/tooltip/interface.d.ts +0 -2
  261. package/dist/tooltip/tooltip.svelte +0 -5
  262. package/dist/transfer/interface.d.ts +1 -8
  263. package/dist/transfer/transfer-selected-item.svelte +0 -1
  264. package/dist/transfer/transfer-selected-item.svelte.d.ts +0 -1
  265. package/dist/transfer/transfer.svelte +0 -1
  266. package/dist/tree/auto-sizer.svelte +0 -1
  267. package/dist/tree/context.d.ts +0 -1
  268. package/dist/tree/interface.d.ts +0 -9
  269. package/dist/tree/node-collapsible.svelte +0 -1
  270. package/dist/tree/node-list.svelte +0 -4
  271. package/dist/tree/tree-node.svelte +0 -1
  272. package/dist/tree/tree.svelte +0 -3
  273. package/dist/tree/use-tree-keyboard.svelte.d.ts +1 -8
  274. package/dist/tree/use-tree-keyboard.svelte.js +1 -6
  275. package/dist/tree-select/interface.d.ts +0 -11
  276. package/dist/tree-select/tree-select.svelte +0 -2
  277. package/dist/typography/base.svelte +0 -2
  278. package/dist/typography/index.js +0 -1
  279. package/dist/typography/interface.d.ts +0 -1
  280. package/dist/typography/internal.d.ts +0 -2
  281. package/dist/upload/file-card.svelte +0 -1
  282. package/dist/upload/index.js +0 -1
  283. package/dist/upload/interface.d.ts +0 -4
  284. package/dist/upload/upload.svelte +0 -1
  285. package/dist/user-guide/interface.d.ts +0 -1
  286. package/dist/user-guide/user-guide.svelte +0 -1
  287. package/dist/video-player/video-progress.svelte +0 -2
  288. package/package.json +4 -4
package/LICENSE CHANGED
@@ -20,65 +20,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
20
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
21
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  SOFTWARE.
23
-
24
- The code implementation of the external library is referenced by DouyinFe are:
25
-
26
- - animate.css
27
-
28
- The MIT License (MIT)
29
-
30
- Copyright (c) 2020 Daniel Eden
31
-
32
- Permission is hereby granted, free of charge, to any person obtaining a copy
33
- of this software and associated documentation files (the "Software"), to deal
34
- in the Software without restriction, including without limitation the rights
35
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
- copies of the Software, and to permit persons to whom the Software is
37
- furnished to do so, subject to the following conditions:
38
-
39
- The above copyright notice and this permission notice shall be included in all
40
- copies or substantial portions of the Software.
41
-
42
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
- SOFTWARE.
49
-
50
- - Ant Design
51
- MIT LICENSE
52
-
53
- Copyright (c) 2015-present Ant UED, https://xtech.antfin.com/
54
-
55
- Permission is hereby granted, free of charge, to any person obtaining
56
- a copy of this software and associated documentation files (the
57
- "Software"), to deal in the Software without restriction, including
58
- without limitation the rights to use, copy, modify, merge, publish,
59
- distribute, sublicense, and/or sell copies of the Software, and to
60
- permit persons to whom the Software is furnished to do so, subject to
61
- the following conditions:
62
-
63
- The above copyright notice and this permission notice shall be
64
- included in all copies or substantial portions of the Software.
65
-
66
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
67
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
68
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
69
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
70
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
71
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
72
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
73
-
74
- - rc-tree
75
-
76
- MIT LICENSE
77
-
78
- Copyright (c) 2015-present Alipay.com, https://www.alipay.com/
79
-
80
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
81
-
82
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
83
-
84
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,16 +1,18 @@
1
1
  # @fibrae/semi-ui-svelte
2
2
 
3
- Semi Design Next 的 Svelte 组件库,面向 Svelte 5.57+ 应用。它是上游 [Semi Design](https://github.com/DouyinFE/semi-design) 的社区 fork,与字节跳动及 Semi Design 官方团队无关,与各框架的 UI 包共用同一份 foundation 的逻辑和样式。
3
+ [简体中文](README.zh-CN.md)
4
4
 
5
- ## 安装
5
+ The Svelte component library of Semi Design Next, for Svelte 5.57+ applications. It is a community fork of [Semi Design](https://github.com/DouyinFE/semi-design), unaffiliated with ByteDance and the Semi Design team, and shares the logic and styles of one foundation with the UI packages of other frameworks.
6
+
7
+ ## Installation
6
8
 
7
9
  ```sh
8
10
  pnpm add svelte @fibrae/semi-ui-svelte @fibrae/semi-icons-svelte
9
11
  ```
10
12
 
11
- peer 依赖:`svelte` ^5.57.0。浏览器、模块格式、Node.js 与构建插件的版本要求见[快速开始的环境要求](../../website/content/start/getting-started/index.zh-CN.mdx#环境要求)。
13
+ Peer dependency: `svelte` ^5.57.0. For browser, module format, Node.js and build plugin requirements, see the [requirements in Getting Started](../../website/content/start/getting-started/index.en-US.mdx#requirements).
12
14
 
13
- ## 使用
15
+ ## Usage
14
16
 
15
17
  ```svelte
16
18
  <script lang="ts">
@@ -20,36 +22,36 @@ peer 依赖:`svelte` ^5.57.0。浏览器、模块格式、Node.js 与构建插
20
22
  </script>
21
23
 
22
24
  <Button theme="solid" type="primary">Hello Semi</Button>
23
- <Switch bind:checked aria-label="开关" />
25
+ <Switch bind:checked aria-label="Switch" />
24
26
  ```
25
27
 
26
- 样式与主题 token 随组件一起加载,不需要手动引入基础样式,也不需要 reset.css。
28
+ Styles and theme tokens load with the components. You do not need to import base styles or reset.css.
27
29
 
28
- ### 入口
30
+ ### Entry points
29
31
 
30
- | 入口 | 说明 |
31
- | --------------------------------------------- | ----------------------------------------------------------------------------------------------- |
32
- | `@fibrae/semi-ui-svelte` | 全部组件、类型、`ConfigProvider`、`LocaleProvider`、`LocaleConsumer`、`useLocale`、`semiGlobal` |
33
- | `@fibrae/semi-ui-svelte/<目录>/index` | 逐文件深路径,与 `src/` 下的目录一一对应;组件文件是 `<目录>/<名>.svelte` |
34
- | `@fibrae/semi-ui-svelte/hooks` | `useLocale`、`useClickOutside`、`useCopied`,以及 attachment `observeResize` |
35
- | `@fibrae/semi-ui-svelte/tokens` | 主题 token 与 base 规则,在应用入口文件最先导入,首个组件懒加载时 token 仍随入口加载 |
36
- | `@fibrae/semi-ui-svelte/styles.css` | 整包样式,需要一次性加载全部组件样式时使用 |
37
- | `@fibrae/semi-ui-svelte/tailwind.css` | Tailwind v4 的 `@theme inline` 映射 |
38
- | `@fibrae/semi-ui-svelte/locale/source/<语言>` | 内置语言包,重导出 `@fibrae/semi-foundation/locale/source/<语言>` |
32
+ | Entry | Description |
33
+ | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
34
+ | `@fibrae/semi-ui-svelte` | All components and types, `ConfigProvider`, `LocaleProvider`, `LocaleConsumer`, `useLocale` and `semiGlobal` |
35
+ | `@fibrae/semi-ui-svelte/<directory>/index` | Deep file paths that map one-to-one to the directories under `src/`; component files are `<directory>/<name>.svelte` |
36
+ | `@fibrae/semi-ui-svelte/hooks` | `useLocale`, `useClickOutside`, `useCopied` and the attachment `observeResize` |
37
+ | `@fibrae/semi-ui-svelte/tokens` | Theme tokens and base rules. Import it first in the application entry so tokens still load with the entry when the first component is lazy-loaded |
38
+ | `@fibrae/semi-ui-svelte/styles.css` | The full stylesheet, for loading all component styles at once |
39
+ | `@fibrae/semi-ui-svelte/tailwind.css` | The Tailwind v4 `@theme inline` mapping |
40
+ | `@fibrae/semi-ui-svelte/locale/source/<locale>` | Built-in locale packs, re-exporting `@fibrae/semi-foundation/locale/source/<locale>` |
39
41
 
40
- 包里发布的是 `.svelte` 源码与 `.d.ts`,不是编译产物:`exports` 带 `svelte` 条件,由 `@sveltejs/vite-plugin-svelte`(SvelteKit 已内置)按应用的目标(DOM 或服务端)编译。不认 `svelte` 条件、也不编译 `.svelte` 的工具无法使用本包。
42
+ The package ships `.svelte` source and `.d.ts` files, not compiled output. `exports` carries the `svelte` condition, and `@sveltejs/vite-plugin-svelte` (built into SvelteKit) compiles for the application's target (DOM or server). Tools that neither honor the `svelte` condition nor compile `.svelte` cannot use this package.
41
43
 
42
- 使用整包 `styles.css` 时,需要开启 `@fibrae/semi-vite-plugin` 的 `omitCss`,否则组件自带的样式导入会被再打包一份。整包样式已含 token,`omitCss` 下 `tokens` 入口和组件样式一起被移除。
44
+ To use the full `styles.css`, turn on `omitCss` in `@fibrae/semi-vite-plugin`; otherwise the style imports inside the components are bundled a second time. The full stylesheet already includes tokens, and under `omitCss` the `tokens` entry is removed along with the component styles.
43
45
 
44
- 与 `@fibrae/semi-ai-svelte` 同用并加载整包样式时,在 `styles.css` 之后引入 `@fibrae/semi-ai-svelte/styles.css`。
46
+ When using `@fibrae/semi-ai-svelte` with the full stylesheet, import `@fibrae/semi-ai-svelte/styles.css` after `styles.css`.
45
47
 
46
- ### 样式定制
48
+ ### Customizing styles
47
49
 
48
- 覆写 `--semi-*` CSS 变量即可改变全局颜色、圆角、字号和间距;Semi 的样式位于 `@layer semi`,应用中不分层的 CSS 规则总是优先。没有主题包,也没有编译期的 Sass 覆写。发布的 `.scss` 含有 `semi:` 地址,需要通过构建插件(`@fibrae/semi-vite-plugin` 等)或 `@fibrae/semi-scss-compile` 使用。
50
+ Override `--semi-*` CSS variables to change global colors, radii, font sizes and spacing. Semi's styles sit in `@layer semi`, so unlayered CSS rules in your application always win. There are no theme packages and no compile-time Sass overrides. The published `.scss` contains `semi:` addresses and must go through a build plugin (such as `@fibrae/semi-vite-plugin`) or `@fibrae/semi-scss-compile`.
49
51
 
50
- ### 多语言
52
+ ### Internationalization
51
53
 
52
- 默认语言为 `zh_CN`。用 `LocaleProvider` 传入语言包;`useLocale(组件名)` 在组件初始化时调用,返回一个函数,读作 `locale().locale.xxx`,语言切换后随之更新:
54
+ The default locale is `zh_CN`. Pass a locale pack with `LocaleProvider`. Call `useLocale(componentName)` during component initialization. It returns a function, read as `locale().locale.xxx`, that updates when the locale changes:
53
55
 
54
56
  ```svelte
55
57
  <script lang="ts">
@@ -62,28 +64,28 @@ peer 依赖:`svelte` ^5.57.0。浏览器、模块格式、Node.js 与构建插
62
64
  </LocaleProvider>
63
65
  ```
64
66
 
65
- 语言包的结构见 [@fibrae/semi-foundation](../semi-foundation/README.md#语言包)。
67
+ For the structure of a locale pack, see [@fibrae/semi-foundation](../semi-foundation/README.md#locale-packs).
66
68
 
67
- ### 服务端渲染
69
+ ### Server rendering
68
70
 
69
- 组件可在 `svelte/server` 的 `render` 与 SvelteKit 中输出服务端 HTML,浏览器用 `hydrate` 注水。注意:
71
+ Components output server HTML with `render` from `svelte/server` and in SvelteKit, and the browser hydrates with `hydrate`. Keep in mind:
70
72
 
71
- - 组件内的 id 来自 `$props.id()`,服务端与浏览器一致。
72
- - `onMount` 与 `$effect` 不在服务端执行,依赖它们的状态(如测量尺寸)在注水后才出现。
73
- - `semiGlobal.config` 只在应用启动时设置,服务端与浏览器使用同一份配置。
73
+ - Ids inside components come from `$props.id()`, so the server and browser agree.
74
+ - `onMount` and `$effect` do not run on the server, and state that depends on them (such as measured sizes) appears after hydration.
75
+ - Set `semiGlobal.config` only at application startup. The server and browser use the same config.
74
76
 
75
- ### 文档
77
+ ### Documentation
76
78
 
77
- 组件文档在 [website/content](../../website/content),入门见 [快速开始](../../website/content/start/getting-started/index.zh-CN.mdx)。
79
+ Component docs are in [website/content](../../website/content). To get started, read [Getting Started](../../website/content/start/getting-started/index.en-US.mdx).
78
80
 
79
- ## 与其他包的关系
81
+ ## Related packages
80
82
 
81
- - 依赖 `@fibrae/semi-foundation`(逻辑与样式)、`@fibrae/semi-icons-svelte`。
82
- - 被 `@fibrae/semi-ai-svelte` 和文档站 `website` 使用。
83
- - 各框架的 UI 包(`semi-ui-<框架>`)共用同一份 foundation,Vue 版见 [@fibrae/semi-ui-vue](../semi-ui-vue/README.md),它是 Svelte 版能力对齐的参照。
83
+ - Depends on `@fibrae/semi-foundation` (logic and styles) and `@fibrae/semi-icons-svelte`.
84
+ - Used by `@fibrae/semi-ai-svelte` and the docs site `website`.
85
+ - The UI package of each framework (`semi-ui-<framework>`) shares the same foundation.
84
86
 
85
- ## 开发
87
+ ## Development
86
88
 
87
- `pnpm --filter @fibrae/semi-ui-svelte build` 执行 `scripts/svelte-package.ts`:用 `svelte-package` 把 `src` 输出到 `dist`(`.svelte` 原样、`.ts` 编译为 `.js` 与 `.d.ts`),把样式导入改为 foundation 的 `.css`,去掉 `__tests__`,并写出整包 `styles.css`、`tailwind.css` 与 `locale/source/` 的重导出。
89
+ `pnpm --filter @fibrae/semi-ui-svelte build` runs `scripts/svelte-package.ts`: `svelte-package` outputs `src` to `dist` (`.svelte` files as they are, `.ts` compiled to `.js` and `.d.ts`). The script changes style imports to the foundation's `.css`, removes `__tests__`, and writes the full `styles.css`, `tailwind.css` and the re-exports under `locale/source/`.
88
90
 
89
- 通用命令见根目录 [README.md](../../README.md#常用命令)。组件写法见 [components](../../.agents/references/svelte/components.md),相对上游的变化见 [release-notes](../../docs/release-notes.md)。
91
+ For general commands, see [CONTRIBUTING.md](../../CONTRIBUTING.md#常用命令) at the repository root. For how to write components, see [components](../../.agents/references/svelte/components.md). For changes relative to upstream, see [release-notes](../../docs/release-notes.md).
@@ -0,0 +1,91 @@
1
+ # @fibrae/semi-ui-svelte
2
+
3
+ [English](README.md)
4
+
5
+ Semi Design Next 的 Svelte 组件库,面向 Svelte 5.57+ 应用。它是上游 [Semi Design](https://github.com/DouyinFE/semi-design) 的社区 fork,与字节跳动及 Semi Design 官方团队无关,与各框架的 UI 包共用同一份 foundation 的逻辑和样式。
6
+
7
+ ## 安装
8
+
9
+ ```sh
10
+ pnpm add svelte @fibrae/semi-ui-svelte @fibrae/semi-icons-svelte
11
+ ```
12
+
13
+ peer 依赖:`svelte` ^5.57.0。浏览器、模块格式、Node.js 与构建插件的版本要求见[快速开始的环境要求](../../website/content/start/getting-started/index.zh-CN.mdx#环境要求)。
14
+
15
+ ## 使用
16
+
17
+ ```svelte
18
+ <script lang="ts">
19
+ import { Button, Switch } from '@fibrae/semi-ui-svelte';
20
+
21
+ let checked = $state(false);
22
+ </script>
23
+
24
+ <Button theme="solid" type="primary">Hello Semi</Button>
25
+ <Switch bind:checked aria-label="开关" />
26
+ ```
27
+
28
+ 样式与主题 token 随组件一起加载,不需要手动引入基础样式,也不需要 reset.css。
29
+
30
+ ### 入口
31
+
32
+ | 入口 | 说明 |
33
+ | --------------------------------------------- | ----------------------------------------------------------------------------------------------- |
34
+ | `@fibrae/semi-ui-svelte` | 全部组件、类型、`ConfigProvider`、`LocaleProvider`、`LocaleConsumer`、`useLocale`、`semiGlobal` |
35
+ | `@fibrae/semi-ui-svelte/<目录>/index` | 逐文件深路径,与 `src/` 下的目录一一对应;组件文件是 `<目录>/<名>.svelte` |
36
+ | `@fibrae/semi-ui-svelte/hooks` | `useLocale`、`useClickOutside`、`useCopied`,以及 attachment `observeResize` |
37
+ | `@fibrae/semi-ui-svelte/tokens` | 主题 token 与 base 规则,在应用入口文件最先导入,首个组件懒加载时 token 仍随入口加载 |
38
+ | `@fibrae/semi-ui-svelte/styles.css` | 整包样式,需要一次性加载全部组件样式时使用 |
39
+ | `@fibrae/semi-ui-svelte/tailwind.css` | Tailwind v4 的 `@theme inline` 映射 |
40
+ | `@fibrae/semi-ui-svelte/locale/source/<语言>` | 内置语言包,重导出 `@fibrae/semi-foundation/locale/source/<语言>` |
41
+
42
+ 包里发布的是 `.svelte` 源码与 `.d.ts`,不是编译产物:`exports` 带 `svelte` 条件,由 `@sveltejs/vite-plugin-svelte`(SvelteKit 已内置)按应用的目标(DOM 或服务端)编译。不认 `svelte` 条件、也不编译 `.svelte` 的工具无法使用本包。
43
+
44
+ 使用整包 `styles.css` 时,需要开启 `@fibrae/semi-vite-plugin` 的 `omitCss`,否则组件自带的样式导入会被再打包一份。整包样式已含 token,`omitCss` 下 `tokens` 入口和组件样式一起被移除。
45
+
46
+ 与 `@fibrae/semi-ai-svelte` 同用并加载整包样式时,在 `styles.css` 之后引入 `@fibrae/semi-ai-svelte/styles.css`。
47
+
48
+ ### 样式定制
49
+
50
+ 覆写 `--semi-*` CSS 变量即可改变全局颜色、圆角、字号和间距;Semi 的样式位于 `@layer semi`,应用中不分层的 CSS 规则总是优先。没有主题包,也没有编译期的 Sass 覆写。发布的 `.scss` 含有 `semi:` 地址,需要通过构建插件(`@fibrae/semi-vite-plugin` 等)或 `@fibrae/semi-scss-compile` 使用。
51
+
52
+ ### 多语言
53
+
54
+ 默认语言为 `zh_CN`。用 `LocaleProvider` 传入语言包;`useLocale(组件名)` 在组件初始化时调用,返回一个函数,读作 `locale().locale.xxx`,语言切换后随之更新:
55
+
56
+ ```svelte
57
+ <script lang="ts">
58
+ import { LocaleProvider } from '@fibrae/semi-ui-svelte';
59
+ import en_GB from '@fibrae/semi-ui-svelte/locale/source/en_GB';
60
+ </script>
61
+
62
+ <LocaleProvider locale={en_GB}>
63
+ <App />
64
+ </LocaleProvider>
65
+ ```
66
+
67
+ 语言包的结构见 [@fibrae/semi-foundation](../semi-foundation/README.zh-CN.md#语言包)。
68
+
69
+ ### 服务端渲染
70
+
71
+ 组件可在 `svelte/server` 的 `render` 与 SvelteKit 中输出服务端 HTML,浏览器用 `hydrate` 注水。注意:
72
+
73
+ - 组件内的 id 来自 `$props.id()`,服务端与浏览器一致。
74
+ - `onMount` 与 `$effect` 不在服务端执行,依赖它们的状态(如测量尺寸)在注水后才出现。
75
+ - `semiGlobal.config` 只在应用启动时设置,服务端与浏览器使用同一份配置。
76
+
77
+ ### 文档
78
+
79
+ 组件文档在 [website/content](../../website/content),入门见 [快速开始](../../website/content/start/getting-started/index.zh-CN.mdx)。
80
+
81
+ ## 与其他包的关系
82
+
83
+ - 依赖 `@fibrae/semi-foundation`(逻辑与样式)、`@fibrae/semi-icons-svelte`。
84
+ - 被 `@fibrae/semi-ai-svelte` 和文档站 `website` 使用。
85
+ - 各框架的 UI 包(`semi-ui-<框架>`)共用同一份 foundation。
86
+
87
+ ## 开发
88
+
89
+ `pnpm --filter @fibrae/semi-ui-svelte build` 执行 `scripts/svelte-package.ts`:用 `svelte-package` 把 `src` 输出到 `dist`(`.svelte` 原样、`.ts` 编译为 `.js` 与 `.d.ts`),把样式导入改为 foundation 的 `.css`,去掉 `__tests__`,并写出整包 `styles.css`、`tailwind.css` 与 `locale/source/` 的重导出。
90
+
91
+ 通用命令见根目录 [CONTRIBUTING.md](../../CONTRIBUTING.md#常用命令)。组件写法见 [components](../../.agents/references/svelte/components.md),相对上游的变化见 [release-notes](../../docs/release-notes.md)。
@@ -1,7 +1,6 @@
1
1
  import { createContext as createSvelteContext } from 'svelte';
2
2
  export function createContext(name, { optional = false, defaultValue } = {}) {
3
3
  const [get, set, has] = createSvelteContext();
4
- // `caller` names the child in the error, e.g. getCollapseContext('Collapse.Panel')
5
4
  const getContext = (caller = 'This component') => {
6
5
  if (has()) {
7
6
  return get();
@@ -1,4 +1,3 @@
1
- /** The longest `animation-duration` + `animation-delay` pair on `node`, in ms */
2
1
  function animationTime(node) {
3
2
  const style = getComputedStyle(node);
4
3
  const seconds = (value) => value.split(',').map((item) => (item.trim().endsWith('ms') ? parseFloat(item) / 1000 : parseFloat(item)) || 0);
@@ -1,4 +1,3 @@
1
1
  /** A generic div cannot carry a name, so a labelled one becomes a group */
2
2
  export declare function isLabelled(attrs: Record<string, unknown>): boolean;
3
- /** An explicit role wins; otherwise a labelled wrapper is a group */
4
3
  export declare function groupRole(attrs: Record<string, unknown>): string | undefined;
@@ -2,7 +2,6 @@
2
2
  export function isLabelled(attrs) {
3
3
  return Boolean(attrs['aria-label'] || attrs['aria-labelledby']);
4
4
  }
5
- /** An explicit role wins; otherwise a labelled wrapper is a group */
6
5
  export function groupRole(attrs) {
7
6
  return attrs.role ?? (isLabelled(attrs) ? 'group' : undefined);
8
7
  }
@@ -1,5 +1,4 @@
1
1
  import type { Attachment } from 'svelte/attachments';
2
2
  export type SlotKind = 'text' | 'icon' | 'node';
3
3
  export declare function getSlotKind(container: Element): SlotKind | undefined;
4
- /** Reports the slot kind of the element's content after mount and whenever its child nodes change */
5
4
  export declare function trackSlotKind(report: (kind?: SlotKind) => void): Attachment<Element>;
@@ -17,7 +17,6 @@ export function getSlotKind(container) {
17
17
  // nodeType rather than instanceof: the slot may sit in another document, whose Element differs from this realm's
18
18
  return node.classList?.contains(`${BASE_CLASS_PREFIX}-icon`) ? 'icon' : 'node';
19
19
  }
20
- /** Reports the slot kind of the element's content after mount and whenever its child nodes change */
21
20
  export function trackSlotKind(report) {
22
21
  return (container) => {
23
22
  const update = () => report(getSlotKind(container));
@@ -1,7 +1,5 @@
1
1
  import type { Attachment } from 'svelte/attachments';
2
2
  /**
3
- * Moves the element into `target` once it mounts and removes it on teardown.
4
- *
5
3
  * Svelte removes a block's DOM by walking `nextSibling` from its first to its last node, so the moved element must be
6
4
  * the only node of its block (`{#if open}<div {@attach teleport(target)}>...</div>{/if}`): as a block's sole node it is
7
5
  * still removed wherever it sits, while as an edge of a longer range the walk would continue into the target's
@@ -1,6 +1,4 @@
1
1
  /**
2
- * Moves the element into `target` once it mounts and removes it on teardown.
3
- *
4
2
  * Svelte removes a block's DOM by walking `nextSibling` from its first to its last node, so the moved element must be
5
3
  * the only node of its block (`{#if open}<div {@attach teleport(target)}>...</div>{/if}`): as a block's sole node it is
6
4
  * still removed wherever it sits, while as an edge of a longer range the walk would continue into the target's
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Calls `onOutside` for a mousedown outside every target. Each getter is read on every press, so targets may mount
3
- * later. `nested`: more nodes that count as inside, the popups `useNestedPopups` collects.
2
+ * Each getter is read on every press, so targets may mount later. `nested`: more nodes that count as inside, the
3
+ * popups `useNestedPopups` collects.
4
4
  */
5
5
  export default function useClickOutside(targets: (() => Node | null | undefined)[], onOutside: (event: MouseEvent) => void, enabled?: () => boolean, nested?: () => readonly (Node | null | undefined)[]): void;
@@ -1,8 +1,8 @@
1
1
  import { on } from 'svelte/events';
2
2
  import { isEventInside } from '@fibrae/semi-foundation/utils/dom';
3
3
  /**
4
- * Calls `onOutside` for a mousedown outside every target. Each getter is read on every press, so targets may mount
5
- * later. `nested`: more nodes that count as inside, the popups `useNestedPopups` collects.
4
+ * Each getter is read on every press, so targets may mount later. `nested`: more nodes that count as inside, the
5
+ * popups `useNestedPopups` collects.
6
6
  */
7
7
  export default function useClickOutside(targets, onOutside, enabled = () => true, nested) {
8
8
  $effect(() => {
@@ -1,6 +1,5 @@
1
1
  import { onMount, untrack } from 'svelte';
2
2
  import { SvelteMap } from 'svelte/reactivity';
3
- /** A counter readers subscribe to; `bump` re-runs them even when the written value is equal */
4
3
  class Version {
5
4
  value = $state(0);
6
5
  bump() {
@@ -8,10 +7,8 @@ class Version {
8
7
  }
9
8
  }
10
9
  /**
11
- * The foundation's state: a plain object the adapter reads and writes synchronously, plus one version per key, so a
12
- * reader of `view.x` re-runs only for writes to `x`. Every write notifies, equal value or not, because React and Vue
13
- * re-render on every `setState` and a foundation may write back a Set it mutated in place; a `$state` proxy would
14
- * skip an equal write and wrap the Set.
10
+ * Every write notifies, equal value or not, because React and Vue re-render on every `setState` and a foundation may
11
+ * write back a Set it mutated in place; a `$state` proxy would skip an equal write and wrap the Set.
15
12
  */
16
13
  function createStateMirror(initial) {
17
14
  // replaced on every write, never mutated: an object the foundation got from getStates() keeps its values
@@ -17,7 +17,6 @@
17
17
  itemSize: number | ((index: number) => number);
18
18
  /** Key of a row; the index when absent */
19
19
  itemKey?: (index: number) => PropertyKey;
20
- /** Rows rendered beyond each edge of the viewport */
21
20
  overscan?: number;
22
21
  /** Attributes of the element that holds the rows */
23
22
  innerAttrs?: HTMLAttributes<HTMLElement>;
@@ -32,8 +31,8 @@
32
31
  }
33
32
 
34
33
  /**
35
- * Fixed or per-row-height vertical list that renders only the rows in view. Attributes land on the scroll container;
36
- * lists whose rows take no focus pass `tabindex={-1}` so Chrome does not make the container a second tab stop.
34
+ * Attributes land on the scroll container; lists whose rows take no focus pass `tabindex={-1}` so Chrome does not
35
+ * make the container a second tab stop.
37
36
  */
38
37
  let { height, width = '100%', itemCount, itemSize, itemKey, overscan = 2, innerAttrs, innerTag = 'div', wrapperAttrs, after, children, ...rest }: VirtualListProps = $props();
39
38
 
@@ -10,7 +10,6 @@ interface VirtualListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'childre
10
10
  itemSize: number | ((index: number) => number);
11
11
  /** Key of a row; the index when absent */
12
12
  itemKey?: (index: number) => PropertyKey;
13
- /** Rows rendered beyond each edge of the viewport */
14
13
  overscan?: number;
15
14
  /** Attributes of the element that holds the rows */
16
15
  innerAttrs?: HTMLAttributes<HTMLElement>;
@@ -25,7 +25,6 @@ export interface SortableProps extends HTMLAttributes<HTMLDivElement> {
25
25
  /** Builds `${prefix}-sortable-item`, `-over`, `-active` and `${prefix}-sortable-handle` */
26
26
  prefix?: string;
27
27
  transition?: SortableTransition;
28
- /** Class of the copy of the item that follows the pointer during a drag */
29
28
  dragOverlayClass?: string;
30
29
  onSortEnd?: (payload: SortEndPayload) => void;
31
30
  /** A drag starts (true) or ends, dropped or canceled (false) */
@@ -5,7 +5,6 @@ import type { strings } from '@fibrae/semi-foundation/anchor/constants';
5
5
  import type { ArrayElement } from '@fibrae/semi-foundation/utils/type';
6
6
  import type { Position } from '../tooltip/interface.js';
7
7
  import type { ShowTooltip } from '../typography/interface.js';
8
- /** A link is activated by a click or by Enter */
9
8
  export type AnchorClickEvent = MouseEvent | KeyboardEvent;
10
9
  export interface AnchorLinkItem {
11
10
  /** A fragment such as `#intro` is looked up by element id, anything else is a selector; defaults to `#` */
@@ -13,7 +12,6 @@ export interface AnchorLinkItem {
13
12
  /** Plain-text title, also the native tooltip without showTooltip; the `title` snippet wins when given */
14
13
  title?: string;
15
14
  disabled?: boolean;
16
- /** Nested links */
17
15
  children?: AnchorLinkItem[];
18
16
  }
19
17
  export interface AnchorTitleContext {
@@ -41,7 +39,6 @@ export interface AnchorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title
41
39
  onChange?: (currentLink: string, previousLink: string) => void;
42
40
  /** Only when a link is activated, so a click elsewhere on the root does not reach it */
43
41
  onClick?: (event: AnchorClickEvent, currentLink: string) => void;
44
- /** Renders every link's title */
45
42
  title?: Snippet<[AnchorTitleContext]>;
46
43
  }
47
44
  export interface AnchorState {
@@ -20,7 +20,6 @@
20
20
  const tooltip = $derived.by(() => {
21
21
  const { showTooltip, position } = anchor;
22
22
  const config = typeof showTooltip === 'object' ? showTooltip : {};
23
- // The position can be set through showTooltip; a copy keeps the caller's object as it was
24
23
  return { ...config, opts: position ? { ...config.opts, position } : { ...config.opts } };
25
24
  });
26
25
 
@@ -1,5 +1,4 @@
1
1
  import type { AnchorNode } from '@fibrae/semi-foundation/anchor/foundation';
2
2
  import type { AnchorLinkItem } from './interface.js';
3
- /** Depth-first, so the order is the order on the page */
4
3
  export declare const hrefsOf: (items: AnchorLinkItem[]) => string[];
5
4
  export declare const nodesOf: (items: AnchorLinkItem[]) => AnchorNode[];
@@ -1,3 +1,2 @@
1
- /** Depth-first, so the order is the order on the page */
2
1
  export const hrefsOf = (items) => items.flatMap((item) => [item.href ?? '#', ...hrefsOf(item.children ?? [])]);
3
2
  export const nodesOf = (items) => items.map((item) => ({ href: item.href ?? '#', children: nodesOf(item.children ?? []) }));
@@ -62,8 +62,6 @@
62
62
  // the Tooltip text only describes the icon-only button, so the same text is also its name
63
63
  const backwardLabel = $derived(texts.backward.replace('${skipDuration}', String(skipDuration)));
64
64
  const forwardLabel = $derived(texts.forward.replace('${skipDuration}', String(skipDuration)));
65
-
66
- // the visible rate alone does not say what the menu sets
67
65
  const speedLabel = $derived([texts.playbackRate, states().currentRate.label].join(' '));
68
66
 
69
67
  const changeTrack = (direction: 'next' | 'prev') => {
@@ -19,8 +19,6 @@
19
19
 
20
20
  // $size-audio-player-slider-dot
21
21
  const dotSize = 16;
22
-
23
- // the duration is 0 until the metadata loads
24
22
  const percent = $derived(max ? (value / max) * 100 : 0);
25
23
 
26
24
  // the popup is anchored to the slider's center, so only a translate moves it to the pointer; the vertical offset
@@ -53,7 +51,6 @@
53
51
  onPointer(event, true);
54
52
  };
55
53
 
56
- // the preview belongs to the pointer; a keyboard use shows the value
57
54
  const clearPreview = () => {
58
55
  movingInfo = null;
59
56
  };
@@ -96,7 +96,6 @@
96
96
  const prefixCls = cssClasses.PREFIX;
97
97
  const listId = `${uid}-listbox`;
98
98
 
99
- // $bindable needs destructuring, so the foundation reads the props through getters
100
99
  const foundationProps: AutoCompleteBaseProps = {
101
100
  get data() {
102
101
  return data;
@@ -131,7 +130,6 @@
131
130
  (base) => ({
132
131
  updateFocusIndex: (focusIndex) => base.setState({ focusIndex }),
133
132
  updateScrollTop: (index) => {
134
- // the rows are the listbox's direct children
135
133
  const destNode = listbox?.children[index];
136
134
  if (listbox && destNode instanceof HTMLElement) {
137
135
  centerInScroller(destNode, listbox);
@@ -143,7 +141,6 @@
143
141
  updateSelection: (selection) => base.setState({ selection }),
144
142
  notifySearch: (inputValue) => onSearch?.(inputValue),
145
143
  notifyChange: (next) => {
146
- // the bindable prop is the source of truth: bound, the write reaches the parent; unbound, it overrides locally
147
144
  value = next;
148
145
  onChange?.(next);
149
146
  },
@@ -269,7 +266,6 @@
269
266
  useClickOutside(
270
267
  [() => root, () => listbox],
271
268
  (event) => {
272
- // without a rendered list there is nothing to close
273
269
  if (listbox) {
274
270
  foundation.handleClickOutside(event);
275
271
  }
@@ -286,7 +282,6 @@
286
282
  input?.blur();
287
283
  }
288
284
 
289
- /** The root div, which wraps the input or the custom trigger */
290
285
  export function getNativeElement() {
291
286
  return root;
292
287
  }
@@ -3,15 +3,12 @@ import type { ClassValue, HTMLAttributes, HTMLInputAttributes } from 'svelte/ele
3
3
  import type { Size } from '@fibrae/semi-foundation/utils/type';
4
4
  import type { ValidateStatus } from '../input/index.js';
5
5
  import type { Position } from '../tooltip/index.js';
6
- /** An object item of `data`; markup for its row goes in the `item` snippet */
7
6
  export interface AutoCompleteDataItem {
8
7
  [key: string]: any;
9
8
  value?: string | number;
10
9
  label?: string | number;
11
10
  disabled?: boolean;
12
- /** On the item's row */
13
11
  class?: ClassValue;
14
- /** On the item's row */
15
12
  style?: string;
16
13
  }
17
14
  export type AutoCompleteItems = AutoCompleteDataItem | string | number;
@@ -20,11 +17,9 @@ export type AutoCompleteSelectedItem<T extends AutoCompleteItems> = T extends st
20
17
  export interface AutoCompleteItemSnippetProps<T extends AutoCompleteItems = AutoCompleteItems> {
21
18
  /** The data item as given: a string item stays a string */
22
19
  item: T;
23
- /** Position among the rendered items */
24
20
  index: number;
25
21
  }
26
22
  export interface AutoCompleteTriggerSnippetProps {
27
- /** The selected item, if any */
28
23
  value: AutoCompleteDataItem[];
29
24
  inputValue?: string | number;
30
25
  placeholder?: string;
@@ -39,7 +34,6 @@ export interface AutoCompleteTriggerSnippetProps {
39
34
  onClear: () => void;
40
35
  onFocus: (event: FocusEvent) => void;
41
36
  onBlur: (event: FocusEvent) => void;
42
- /** The aria-* attributes given to the AutoComplete, for the custom trigger's focusable element */
43
37
  controlAttrs: Record<string, unknown>;
44
38
  }
45
39
  type NativeKeys = 'children' | 'prefix' | 'placeholder' | 'onchange' | 'onselect' | 'onfocus' | 'onblur';
@@ -84,11 +78,8 @@ export interface AutoCompleteProps<T extends AutoCompleteItems = AutoCompleteIte
84
78
  suffix?: Snippet;
85
79
  insetLabel?: Snippet;
86
80
  clearIcon?: Snippet;
87
- /** Shown in the list when `data` is empty */
88
81
  emptyContent?: Snippet;
89
- /** Content of an item row; without it the row shows the item's label */
90
82
  item?: Snippet<[AutoCompleteItemSnippetProps<T>]>;
91
- /** Replaces the input */
92
83
  trigger?: Snippet<[AutoCompleteTriggerSnippetProps]>;
93
84
  }
94
85
  export {};
@@ -3,7 +3,6 @@
3
3
  import { getPopupLayerContext } from '../_base/popup-layer.js';
4
4
  import { type AvatarGroupMoreValue, setAvatarGroupMoreContext } from './context.js';
5
5
 
6
- // setContext covers this component's subtree, so the `more` content gets its own component scope
7
6
  let { children, ...value }: Omit<AvatarGroupMoreValue, 'layer'> & { children: Snippet } = $props();
8
7
 
9
8
  const layer = getPopupLayerContext();