fluentui-svelte 0.5.0 → 0.7.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 (259) hide show
  1. package/dist/components/app-surface/app-surface.svelte +96 -0
  2. package/dist/components/app-surface/app-surface.svelte.d.ts +22 -0
  3. package/dist/components/app-surface/docs/llms.md +73 -0
  4. package/dist/components/app-surface/types.d.ts +19 -0
  5. package/dist/components/app-surface/types.js +1 -0
  6. package/dist/components/app-window/app-window.d.ts +3 -0
  7. package/dist/components/app-window/app-window.js +3 -0
  8. package/dist/components/app-window/app-window.svelte +193 -0
  9. package/dist/components/app-window/app-window.svelte.d.ts +25 -0
  10. package/dist/components/app-window/docs/llms.md +119 -0
  11. package/dist/components/app-window/types.d.ts +66 -0
  12. package/dist/components/app-window/types.js +1 -0
  13. package/dist/components/auto-suggest-box/auto-suggest-box.svelte +47 -31
  14. package/dist/components/auto-suggest-box/auto-suggest-box.svelte.d.ts +2 -2
  15. package/dist/components/auto-suggest-box/docs/llms.md +34 -33
  16. package/dist/components/auto-suggest-box/option.svelte +6 -4
  17. package/dist/components/auto-suggest-box/types.d.ts +13 -16
  18. package/dist/components/avatar/avatar.svelte +4 -3
  19. package/dist/components/avatar/docs/llms.md +1 -1
  20. package/dist/components/avatar/type.d.ts +1 -1
  21. package/dist/components/badge/badge-icon.svelte +2 -2
  22. package/dist/components/badge/badge.svelte +2 -2
  23. package/dist/components/badge/docs/llms.md +2 -2
  24. package/dist/components/badge/types.d.ts +2 -2
  25. package/dist/components/breadcrumb/breadcrumb-button.svelte +2 -2
  26. package/dist/components/breadcrumb/breadcrumb-divider.svelte +2 -2
  27. package/dist/components/breadcrumb/breadcrumb-item.svelte +2 -2
  28. package/dist/components/breadcrumb/breadcrumb.svelte +10 -5
  29. package/dist/components/breadcrumb/docs/llms.md +11 -11
  30. package/dist/components/breadcrumb/types.d.ts +7 -7
  31. package/dist/components/button/button.svelte +2 -2
  32. package/dist/components/button/docs/llms.md +17 -17
  33. package/dist/components/button/split-button.svelte +7 -7
  34. package/dist/components/button/types.d.ts +5 -5
  35. package/dist/components/calendar-date-picker/calendar-date-picker.svelte +98 -10
  36. package/dist/components/calendar-date-picker/calendar-date-picker.svelte.d.ts +1 -1
  37. package/dist/components/calendar-date-picker/docs/llms.md +19 -14
  38. package/dist/components/calendar-date-picker/types.d.ts +22 -8
  39. package/dist/components/calendar-view/calendar-view-days.svelte +3 -2
  40. package/dist/components/calendar-view/calendar-view-grid.js +8 -3
  41. package/dist/components/calendar-view/calendar-view-item.svelte +10 -4
  42. package/dist/components/calendar-view/calendar-view-months.svelte +3 -2
  43. package/dist/components/calendar-view/calendar-view-years.svelte +3 -2
  44. package/dist/components/calendar-view/calendar-view.svelte +11 -4
  45. package/dist/components/calendar-view/calendar-view.svelte.js +5 -0
  46. package/dist/components/calendar-view/docs/llms.md +20 -19
  47. package/dist/components/calendar-view/types.d.ts +6 -1
  48. package/dist/components/card/card-footer.svelte +2 -2
  49. package/dist/components/card/card-header.svelte +5 -4
  50. package/dist/components/card/card-preview.svelte +13 -2
  51. package/dist/components/card/card.svelte +5 -5
  52. package/dist/components/card/docs/llms.md +22 -21
  53. package/dist/components/card/types.d.ts +8 -4
  54. package/dist/components/checkbox/checkbox.svelte +47 -26
  55. package/dist/components/checkbox/checkbox.svelte.d.ts +3 -24
  56. package/dist/components/checkbox/docs/llms.md +24 -23
  57. package/dist/components/checkbox/types.d.ts +10 -23
  58. package/dist/components/date-picker/date-picker.svelte +98 -27
  59. package/dist/components/date-picker/date-picker.svelte.d.ts +1 -1
  60. package/dist/components/date-picker/docs/llms.md +23 -20
  61. package/dist/components/date-picker/types.d.ts +24 -15
  62. package/dist/components/dialog/dialog-actions.svelte +17 -2
  63. package/dist/components/dialog/dialog-content.svelte +2 -2
  64. package/dist/components/dialog/dialog-content.svelte.d.ts +1 -1
  65. package/dist/components/dialog/dialog-surface.svelte +130 -8
  66. package/dist/components/dialog/dialog-title.svelte +23 -6
  67. package/dist/components/dialog/dialog-trigger.svelte +8 -2
  68. package/dist/components/dialog/dialog-trigger.svelte.d.ts +1 -1
  69. package/dist/components/dialog/dialog.svelte +22 -11
  70. package/dist/components/dialog/docs/llms.md +56 -19
  71. package/dist/components/dialog/types.d.ts +31 -9
  72. package/dist/components/dialog/utils.d.ts +2 -0
  73. package/dist/components/dialog/utils.js +1 -0
  74. package/dist/components/divider/divider.svelte +6 -4
  75. package/dist/components/divider/types.d.ts +1 -1
  76. package/dist/components/dropdown/docs/llms.md +30 -28
  77. package/dist/components/dropdown/dropdown-option.svelte +17 -5
  78. package/dist/components/dropdown/dropdown.svelte +182 -84
  79. package/dist/components/dropdown/dropdown.svelte.d.ts +1 -1
  80. package/dist/components/dropdown/types.d.ts +26 -20
  81. package/dist/components/dropdown-select/docs/llms.md +24 -22
  82. package/dist/components/dropdown-select/dropdown-select-option.svelte +2 -2
  83. package/dist/components/dropdown-select/dropdown-select.svelte +42 -7
  84. package/dist/components/dropdown-select/types.d.ts +4 -4
  85. package/dist/components/expander/docs/llms.md +3 -3
  86. package/dist/components/expander/expander.svelte +13 -8
  87. package/dist/components/expander/types.d.ts +5 -5
  88. package/dist/components/flyout/docs/llms.md +1 -1
  89. package/dist/components/flyout/flyout.svelte +17 -6
  90. package/dist/components/flyout/types.d.ts +1 -1
  91. package/dist/components/hyperlink/docs/llms.md +6 -6
  92. package/dist/components/hyperlink/hyperlink.svelte +13 -4
  93. package/dist/components/hyperlink/types.d.ts +1 -1
  94. package/dist/components/info-bar/docs/llms.md +11 -10
  95. package/dist/components/info-bar/info-bar.svelte +3 -2
  96. package/dist/components/info-bar/types.d.ts +4 -0
  97. package/dist/components/label/docs/llms.md +75 -22
  98. package/dist/components/label/label-context.d.ts +14 -0
  99. package/dist/components/label/label-context.js +10 -0
  100. package/dist/components/label/label.svelte +153 -30
  101. package/dist/components/label/label.svelte.d.ts +1 -1
  102. package/dist/components/label/types.d.ts +48 -4
  103. package/dist/components/list-view/docs/llms.md +103 -33
  104. package/dist/components/list-view/list-view-item-branch.svelte +257 -0
  105. package/dist/components/list-view/list-view-item-branch.svelte.d.ts +4 -0
  106. package/dist/components/list-view/list-view-item.svelte +164 -46
  107. package/dist/components/list-view/list-view-item.svelte.d.ts +5 -5
  108. package/dist/components/list-view/list-view.svelte +73 -25
  109. package/dist/components/list-view/types.d.ts +71 -8
  110. package/dist/components/list-view/utils.d.ts +10 -0
  111. package/dist/components/list-view/utils.js +17 -1
  112. package/dist/components/menu/docs/llms.md +98 -15
  113. package/dist/components/menu/menu-command-bar-item.svelte +61 -0
  114. package/dist/components/menu/menu-command-bar-item.svelte.d.ts +14 -0
  115. package/dist/components/menu/menu-command-bar.svelte +218 -0
  116. package/dist/components/menu/menu-command-bar.svelte.d.ts +21 -0
  117. package/dist/components/menu/menu-group.svelte +6 -3
  118. package/dist/components/menu/menu-item-checkbox.svelte +5 -4
  119. package/dist/components/menu/menu-item-radio.svelte +5 -4
  120. package/dist/components/menu/menu-item-switch.svelte +5 -4
  121. package/dist/components/menu/menu-item.svelte +5 -5
  122. package/dist/components/menu/menu-item.svelte.d.ts +2 -3
  123. package/dist/components/menu/menu-list.svelte +10 -1
  124. package/dist/components/menu/menu-popover.svelte +9 -5
  125. package/dist/components/menu/menu-trigger.svelte +2 -1
  126. package/dist/components/menu/menu.svelte.js +1 -0
  127. package/dist/components/menu/types.d.ts +62 -7
  128. package/dist/components/number-box/docs/llms.md +6 -4
  129. package/dist/components/number-box/number-box.svelte +35 -29
  130. package/dist/components/number-box/number-box.svelte.d.ts +1 -1
  131. package/dist/components/number-box/types.d.ts +1 -1
  132. package/dist/components/persona/docs/llms.md +29 -25
  133. package/dist/components/persona/persona.svelte +8 -6
  134. package/dist/components/persona/types.d.ts +4 -3
  135. package/dist/components/progress-bar/docs/llms.md +13 -13
  136. package/dist/components/progress-bar/progress-bar.svelte +6 -6
  137. package/dist/components/progress-bar/types.d.ts +4 -4
  138. package/dist/components/progress-ring/docs/llms.md +14 -14
  139. package/dist/components/progress-ring/progress-ring.svelte +5 -5
  140. package/dist/components/progress-ring/types.d.ts +3 -3
  141. package/dist/components/radio-button/docs/llms.md +11 -8
  142. package/dist/components/radio-button/radio-button.svelte +38 -12
  143. package/dist/components/radio-button/radio-button.svelte.d.ts +1 -1
  144. package/dist/components/radio-button/types.d.ts +11 -8
  145. package/dist/components/rating/docs/llms.md +111 -0
  146. package/dist/components/rating/rating.svelte +247 -0
  147. package/dist/components/rating/rating.svelte.d.ts +19 -0
  148. package/dist/components/rating/types.d.ts +44 -0
  149. package/dist/components/rating/types.js +1 -0
  150. package/dist/components/side-nav/docs/llms.md +110 -0
  151. package/dist/components/side-nav/side-nav-branch.svelte +43 -0
  152. package/dist/components/side-nav/side-nav-branch.svelte.d.ts +4 -0
  153. package/dist/components/side-nav/side-nav-item.svelte +75 -0
  154. package/dist/components/side-nav/side-nav-item.svelte.d.ts +25 -0
  155. package/dist/components/side-nav/side-nav-list.svelte +32 -0
  156. package/dist/components/side-nav/side-nav-list.svelte.d.ts +7 -0
  157. package/dist/components/side-nav/side-nav.d.ts +2 -0
  158. package/dist/components/side-nav/side-nav.js +2 -0
  159. package/dist/components/side-nav/side-nav.svelte +355 -0
  160. package/dist/components/side-nav/side-nav.svelte.d.ts +24 -0
  161. package/dist/components/side-nav/types.d.ts +149 -0
  162. package/dist/components/side-nav/types.js +1 -0
  163. package/dist/components/skeleton/docs/llms.md +1 -1
  164. package/dist/components/skeleton/skeleton.svelte +2 -2
  165. package/dist/components/skeleton/types.d.ts +1 -1
  166. package/dist/components/slider/docs/llms.md +31 -28
  167. package/dist/components/slider/slider.svelte +126 -61
  168. package/dist/components/slider/slider.svelte.d.ts +1 -3
  169. package/dist/components/slider/types.d.ts +21 -14
  170. package/dist/components/tab-view/docs/llms.md +7 -7
  171. package/dist/components/tab-view/tab-view-tab.svelte +16 -14
  172. package/dist/components/tab-view/tab-view.svelte +16 -9
  173. package/dist/components/tab-view/types.d.ts +6 -6
  174. package/dist/components/table/docs/llms.md +38 -33
  175. package/dist/components/table/table-body.svelte +2 -2
  176. package/dist/components/table/table-cell-actions.svelte +8 -2
  177. package/dist/components/table/table-cell-layout.svelte +2 -2
  178. package/dist/components/table/table-cell.svelte +2 -2
  179. package/dist/components/table/table-header-cell.svelte +2 -2
  180. package/dist/components/table/table-header.svelte +2 -2
  181. package/dist/components/table/table-row.svelte +2 -2
  182. package/dist/components/table/table-selection-cell.svelte +6 -6
  183. package/dist/components/table/table.svelte +2 -2
  184. package/dist/components/table/types.d.ts +11 -11
  185. package/dist/components/tag/docs/llms.md +383 -0
  186. package/dist/components/tag/tag-group.d.ts +2 -0
  187. package/dist/components/tag/tag-group.js +2 -0
  188. package/dist/components/tag/tag-group.svelte +117 -0
  189. package/dist/components/tag/tag-group.svelte.d.ts +20 -0
  190. package/dist/components/tag/tag.svelte +459 -0
  191. package/dist/components/tag/tag.svelte.d.ts +19 -0
  192. package/dist/components/tag/types.d.ts +137 -0
  193. package/dist/components/tag/types.js +1 -0
  194. package/dist/components/tag-picker/docs/llms.md +298 -0
  195. package/dist/components/tag-picker/option-group.svelte +51 -0
  196. package/dist/components/tag-picker/option-group.svelte.d.ts +4 -0
  197. package/dist/components/tag-picker/option.svelte +82 -0
  198. package/dist/components/tag-picker/option.svelte.d.ts +4 -0
  199. package/dist/components/tag-picker/tag-picker.d.ts +2 -0
  200. package/dist/components/tag-picker/tag-picker.js +2 -0
  201. package/dist/components/tag-picker/tag-picker.svelte +716 -0
  202. package/dist/components/tag-picker/tag-picker.svelte.d.ts +21 -0
  203. package/dist/components/tag-picker/types.d.ts +142 -0
  204. package/dist/components/tag-picker/types.js +1 -0
  205. package/dist/components/text-box/docs/llms.md +31 -4
  206. package/dist/components/text-box/text-box-button.svelte +3 -3
  207. package/dist/components/text-box/text-box-button.svelte.d.ts +1 -1
  208. package/dist/components/text-box/text-box.svelte +41 -14
  209. package/dist/components/text-box/types.d.ts +5 -5
  210. package/dist/components/textarea/docs/llms.md +4 -3
  211. package/dist/components/textarea/textarea.svelte +14 -6
  212. package/dist/components/textarea/types.d.ts +2 -4
  213. package/dist/components/time-picker/docs/llms.md +18 -15
  214. package/dist/components/time-picker/time-picker.svelte +133 -33
  215. package/dist/components/time-picker/time-picker.svelte.d.ts +1 -1
  216. package/dist/components/time-picker/types.d.ts +23 -13
  217. package/dist/components/title-bar/docs/llms.md +382 -0
  218. package/dist/components/title-bar/title-bar-left-controls.svelte +215 -0
  219. package/dist/components/title-bar/title-bar-left-controls.svelte.d.ts +22 -0
  220. package/dist/components/title-bar/title-bar-right-controls.svelte +190 -0
  221. package/dist/components/title-bar/title-bar-right-controls.svelte.d.ts +27 -0
  222. package/dist/components/title-bar/title-bar.d.ts +3 -0
  223. package/dist/components/title-bar/title-bar.js +4 -0
  224. package/dist/components/title-bar/title-bar.svelte +224 -0
  225. package/dist/components/title-bar/title-bar.svelte.d.ts +26 -0
  226. package/dist/components/title-bar/types.d.ts +165 -0
  227. package/dist/components/title-bar/types.js +1 -0
  228. package/dist/components/toggle-switch/docs/llms.md +11 -9
  229. package/dist/components/toggle-switch/toggle-switch.svelte +23 -14
  230. package/dist/components/toggle-switch/toggle-switch.svelte.d.ts +1 -1
  231. package/dist/components/toggle-switch/types.d.ts +12 -10
  232. package/dist/components/tooltip/docs/llms.md +1 -1
  233. package/dist/components/tooltip/tooltip.svelte +5 -4
  234. package/dist/components/tooltip/types.d.ts +1 -1
  235. package/dist/components/top-nav/docs/llms.md +1 -1
  236. package/dist/components/top-nav/top-nav-item.svelte +2 -2
  237. package/dist/components/top-nav/top-nav.svelte +2 -2
  238. package/dist/components/top-nav/types.d.ts +2 -2
  239. package/dist/components/tree-view/docs/llms.md +11 -11
  240. package/dist/components/tree-view/tree-view-item-content.svelte +3 -3
  241. package/dist/components/tree-view/tree-view-item.svelte +13 -5
  242. package/dist/components/tree-view/tree-view.svelte +20 -5
  243. package/dist/components/tree-view/tree-view.svelte.d.ts +1 -1
  244. package/dist/components/tree-view/tree-view.svelte.js +31 -3
  245. package/dist/components/tree-view/types.d.ts +7 -3
  246. package/dist/index.d.ts +25 -0
  247. package/dist/index.js +32 -0
  248. package/dist/internal/components/dynamic-carousel/dynamic-carousel.svelte +26 -5
  249. package/dist/internal/components/dynamic-carousel/dynamic-carousel.svelte.d.ts +2 -0
  250. package/dist/internal/constants.d.ts +0 -4
  251. package/dist/internal/constants.js +0 -4002
  252. package/dist/internal/index.d.ts +1 -0
  253. package/dist/internal/index.js +1 -0
  254. package/dist/internal/native-field.svelte.d.ts +44 -0
  255. package/dist/internal/native-field.svelte.js +85 -0
  256. package/dist/internal/utils.d.ts +16 -2
  257. package/dist/internal/utils.js +25 -3
  258. package/dist/types/index.d.ts +3 -3
  259. package/package.json +51 -37
@@ -1,8 +1,10 @@
1
1
  <script lang="ts">
2
+ import { claimLabel } from '../label/label-context.js';
2
3
  import { onMount, tick } from 'svelte';
3
4
  import { SvelteMap } from 'svelte/reactivity';
4
5
  import { on } from 'svelte/events';
5
6
  import { onClickOutside } from 'runed';
7
+ import { invokeHandlers } from '../../internal/index.js';
6
8
  import { PREFIX } from '../../internal/constants.js';
7
9
  import { setAutoSuggestBoxContext } from './auto-suggest-box.js';
8
10
  import { Flyout, TextBox, ListView, ListViewItem } from '../../index.js';
@@ -19,23 +21,29 @@
19
21
 
20
22
  const FALLBACK_ID = $props.id();
21
23
  const ID = `${PREFIX}autosuggestbox-${FALLBACK_ID}`;
22
- const INPUT_ID = `${ID}-input`;
24
+
25
+ const labelContext = claimLabel(() => id);
23
26
 
24
27
  let {
28
+ id = labelContext?.fieldId ?? `${ID}-input`,
29
+ name = id,
30
+ wrapperAttributes,
31
+ onfocus,
32
+ onClear,
25
33
  placeholder,
26
34
  hideActionButtons,
27
35
  type = 'search',
28
36
  open = $bindable(false),
29
37
  multiselect,
30
- ref = $bindable(),
38
+ wrapperRef = $bindable(null),
31
39
  value = $bindable(''),
32
- inputRef = $bindable(),
40
+ ref = $bindable(null),
33
41
  selectOnFocus,
34
42
  openOnFocus = false,
35
43
  virtualizer,
36
- flyoutRef = $bindable(),
44
+ flyoutRef = $bindable(null),
37
45
  flyoutProps,
38
- listViewRef = $bindable(),
46
+ listViewRef = $bindable(null),
39
47
  selectedOptions = $bindable([]),
40
48
  listViewProps,
41
49
  showTextualMultiselect,
@@ -44,7 +52,8 @@
44
52
  textChanged,
45
53
  querySubmitted,
46
54
  suggestionChosen,
47
- children
55
+ children,
56
+ ...attributes
48
57
  }: AutoSuggestBoxProps = $props();
49
58
 
50
59
  /**
@@ -69,7 +78,7 @@
69
78
 
70
79
  const OPTIONS = '.fs-autosuggest-option';
71
80
 
72
- const NAVIGATION: TabspotNodeOptions = {
81
+ const NAVIGATION: TabspotNodeOptions = $derived({
73
82
  root: {},
74
83
  mover: {
75
84
  axis: 'vertical',
@@ -77,11 +86,11 @@
77
86
  skip: "[aria-disabled='true']",
78
87
  activation: {
79
88
  mode: 'activedescendant',
80
- controller: `#${INPUT_ID}`,
89
+ controller: `#${CSS.escape(id ?? ID)}`,
81
90
  mark: { attribute: 'data-active' }
82
91
  }
83
92
  }
84
- };
93
+ });
85
94
 
86
95
  const context: AutoSuggestBoxContext = $state({
87
96
  config: {
@@ -106,7 +115,7 @@
106
115
  open = v;
107
116
  },
108
117
  get textBoxRef() {
109
- return inputRef;
118
+ return ref;
110
119
  },
111
120
  get activeOption() {
112
121
  return activeOption;
@@ -220,7 +229,7 @@
220
229
 
221
230
  /** The two keys that are the box's own business rather than the list's. */
222
231
  function handleKeyDown(e: KeyboardEvent) {
223
- if (e.target !== inputRef) return;
232
+ if (e.target !== ref) return;
224
233
 
225
234
  if (e.key === 'Escape') {
226
235
  e.preventDefault();
@@ -230,12 +239,13 @@
230
239
 
231
240
  if (e.key !== 'Enter') return;
232
241
 
233
- e.preventDefault();
234
-
235
242
  if (activeOption) {
243
+ // Enter chooses the suggestion under the cursor rather than submitting the form.
244
+ e.preventDefault();
236
245
  context.methods.toggleSelection(e, activeOption.id);
237
246
  open = false;
238
247
  } else {
248
+ // The free text is the value: the form submits it, unless `querySubmitted` prevents it.
239
249
  querySubmitted?.(e, value);
240
250
  }
241
251
  }
@@ -260,14 +270,14 @@
260
270
  // end of the list: a second arrow pressed while this one is still in flight is
261
271
  // a second move, and two cursor sets onto the same option would be one.
262
272
  // Untrusted, so it passes straight through to Tabspot this time.
263
- inputRef?.dispatchEvent(new KeyboardEvent('keydown', { key, bubbles: true, cancelable: true }));
273
+ ref?.dispatchEvent(new KeyboardEvent('keydown', { key, bubbles: true, cancelable: true }));
264
274
  }
265
275
 
266
276
  function handleFocus() {
267
277
  if (openOnFocus) open = true;
268
278
  }
269
279
 
270
- async function handleTextChanged(e: InputEvent, val: string) {
280
+ async function handleTextChanged(e: Event, val: string) {
271
281
  if (val.length > 0 && !open) open = true;
272
282
  lastTypedValue = val;
273
283
  textChanged?.(e, val);
@@ -290,15 +300,15 @@
290
300
  }
291
301
 
292
302
  onClickOutside(
293
- () => ref,
303
+ () => wrapperRef,
294
304
  () => (open = false)
295
305
  );
296
306
 
297
307
  onMount(() => {
298
- if (!inputRef) return;
308
+ if (!ref) return;
299
309
 
300
310
  const off = [
301
- on(inputRef, 'keydown', handleKeyDown),
311
+ on(ref, 'keydown', handleKeyDown),
302
312
  // Tabspot listens on `document` in the capture phase,
303
313
  // `window` comes first on the capture path, to note the
304
314
  // key that caused a move,and to hold a move back until
@@ -307,7 +317,7 @@
307
317
  window,
308
318
  'keydown',
309
319
  (event) => {
310
- if (event.target !== inputRef || !event.isTrusted) return;
320
+ if (event.target !== ref || !event.isTrusted) return;
311
321
 
312
322
  const key = event.key;
313
323
 
@@ -366,48 +376,54 @@
366
376
  </script>
367
377
 
368
378
  <div
369
- class={['fs-autosuggestbox', { open, multiselect: _box.multiselect }]}
370
- style="--max-items: {maxItemsInView}; --current-items: {items.size};"
371
- bind:this={ref}
379
+ {...wrapperAttributes}
380
+ class={['fs-autosuggestbox', { open, multiselect: _box.multiselect }, wrapperAttributes?.class]}
381
+ style="--max-items: {maxItemsInView}; --current-items: {items.size}; {wrapperAttributes?.style ?? ''}"
382
+ bind:this={wrapperRef}
372
383
  >
373
384
  <TextBox
385
+ {...attributes}
374
386
  {type}
375
387
  {placeholder}
376
388
  {hideActionButtons}
377
- id={INPUT_ID}
389
+ {id}
390
+ {name}
378
391
  bind:value
379
- bind:ref={inputRef}
392
+ bind:ref
380
393
  querySubmitted={(e) => querySubmitted?.(e, value)}
381
394
  textChanged={(e) => handleTextChanged(e, value)}
382
- onClear={handleClear}
383
- onfocus={handleFocus}
395
+ onClear={(e) => invokeHandlers(e, [], [handleClear, onClear])}
396
+ onfocus={(e) => invokeHandlers(e, [], [handleFocus, onfocus])}
384
397
  role="combobox"
385
398
  aria-expanded={open}
386
399
  aria-autocomplete="list"
387
400
  aria-controls={open ? `${ID}-list` : undefined}
388
401
  aria-haspopup="listbox"
389
- class="square-{roundClass}"
402
+ wrapperAttributes={{ class: `square-${roundClass}` }}
390
403
  />
391
404
  {#if open}
392
405
  <Flyout
406
+ {...flyoutProps}
393
407
  floating
394
408
  offset={0}
395
- reference={ref}
409
+ reference={wrapperRef}
396
410
  bind:ref={flyoutRef}
397
411
  roundCorners="bottom"
398
412
  placementConfig={{ allowedPlacements: ['bottom', 'top'] }}
399
- onPlacementChange={(place) => handlePlacementChange(place)}
413
+ onPlacementChange={(place) => {
414
+ handlePlacementChange(place);
415
+ flyoutProps?.onPlacementChange?.(place);
416
+ }}
400
417
  class={['fs-autosuggestbox-flyout', roundClass === 'top' && 'top-shadow', flyoutProps?.class]}
401
- {...flyoutProps}
402
418
  >
403
419
  <ListView
420
+ {...listViewProps as any}
404
421
  role="listbox"
405
422
  navigationMode="items"
406
423
  disableTabspot
407
424
  id="{ID}-list"
408
425
  selectedItems={Array.from(selectedOptions.values()).map((opt) => opt.value)}
409
426
  bind:ref={listViewRef}
410
- {...listViewProps as any}
411
427
  >
412
428
  {#if items.size === 0}
413
429
  <ListViewItem disabled>{notFoundText}</ListViewItem>
@@ -1,4 +1,4 @@
1
- import type { AutoSuggestBoxProps } from './types.ts';
2
- declare const AutoSuggestBox: import("svelte").Component<AutoSuggestBoxProps, {}, "ref" | "value" | "open" | "inputRef" | "flyoutRef" | "listViewRef" | "selectedOptions">;
1
+ import type { AutoSuggestBoxProps } from './types.js';
2
+ declare const AutoSuggestBox: import("svelte").Component<AutoSuggestBoxProps, {}, "ref" | "value" | "open" | "wrapperRef" | "flyoutRef" | "listViewRef" | "selectedOptions">;
3
3
  type AutoSuggestBox = ReturnType<typeof AutoSuggestBox>;
4
4
  export default AutoSuggestBox;
@@ -117,35 +117,36 @@ A virtualized list must filter its source data itself and report the filtered le
117
117
  </AutoSuggestBox>
118
118
  ```
119
119
 
120
+ HTML attributes, including class, id and ARIA attributes, apply to the control element. Bind ref to access that control. Use wrapperAttributes and wrapperRef for the outer container.
121
+
120
122
  ## Component Props
121
123
 
122
124
  <!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
123
125
  <!-- props:AutoSuggestBoxProps -->
124
126
 
125
- | Name | Type | Default | Description |
126
- | ----------------------------------------------------------------------------- | --------------------------------------------------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
127
- | `ref` _bindable_ | `HTMLElement` | | The DOM reference of the wrapper element. |
128
- | `inputRef` _bindable_ | `HTMLInputElement` | | The DOM reference of the text box element. |
129
- | `value` _bindable_ | `string` | `''` | The current text of the box. |
130
- | `open` _bindable_ | `boolean` | `false` | Controls the open state of the suggestion list. |
131
- | `multiselect` | `boolean` | | Lets more than one suggestion be chosen, and keeps the list open after each one. |
132
- | `selectOnFocus` | `boolean` | | Mirrors the suggestion under the cursor into the text box as it is walked over. Not supported together with `multiselect`. |
133
- | `openOnFocus` | `boolean` | `false` | Opens the suggestion list as soon as the text box takes focus, instead of waiting for the first keystroke. Useful on touch devices, which have no arrow key to open the list with. |
134
- | `showTextualMultiselect` | `boolean` | | Lists every chosen suggestion in the text box, comma separated. Multiselect only. |
135
- | `notFoundText` | `string` | `'No results found'` | The message shown in place of the list when nothing matches. |
136
- | `selectedOptions` _bindable_ | `{ id: string; value: string }[]` | `[]` | The suggestions currently chosen. |
137
- | `suggestionChosen` | `(e: Event, selection: string) => void` | | Called when a suggestion is chosen: by clicking it, by pressing Enter on it, or by walking onto it while `selectOnFocus` is set. |
138
- | `querySubmitted` | `(e: MouseEvent` &#124; `KeyboardEvent, query: string) => void` | | Called when Enter is pressed with no suggestion under the cursor, or when the search button is clicked. This is where a fresh set of suggestions is fetched. |
139
- | `virtualizer` | `AutoSuggestVirtualizer` | | Bridge to a windowed list, for suggestion sets too long to render whole. |
140
- | `maxItemsInView` | `number` | `6` | How many suggestions are visible before the list scrolls. |
141
- | `textBoxRef` _bindable_ | `HTMLInputElement` | | The DOM reference of the underlying text box input. |
142
- | `textBoxProps` | `TextBoxProps` | | The props to spread on the text box. |
143
- | `flyoutRef` _bindable_ | `HTMLElement` | | The DOM reference of the flyout holding the suggestion list. |
144
- | `flyoutProps` | `FlyoutProps` | | The props to spread on the flyout. |
145
- | `listViewRef` _bindable_ | `HTMLUListElement` | | The DOM reference of the suggestion list. |
146
- | `listViewProps` | `ListViewItemProps` | | The props to spread on the suggestion list. |
147
- | `type`, `placeholder`, `hideActionButtons`, `textChanged` from `TextBoxProps` | | | |
148
- | Element Attributes (`div`) | | | |
127
+ | Name | Type | Default | Description |
128
+ | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
129
+ | `wrapperRef` _bindable_ | `HTMLDivElement` &#124; `null` | | The DOM reference of the wrapper element. |
130
+ | `ref` _bindable_ | `HTMLInputElement` &#124; `null` | | The DOM reference of the text box element. |
131
+ | `value` _bindable_ | `string` | `''` | The current text of the box. |
132
+ | `open` _bindable_ | `boolean` | `false` | Controls the open state of the suggestion list. |
133
+ | `multiselect` | `boolean` | | Lets more than one suggestion be chosen, and keeps the list open after each one. |
134
+ | `selectOnFocus` | `boolean` | | Mirrors the suggestion under the cursor into the text box as it is walked over. Not supported together with `multiselect`. |
135
+ | `openOnFocus` | `boolean` | `false` | Opens the suggestion list as soon as the text box takes focus, instead of waiting for the first keystroke. Useful on touch devices, which have no arrow key to open the list with. |
136
+ | `showTextualMultiselect` | `boolean` | | Lists every chosen suggestion in the text box, comma separated. Multiselect only. |
137
+ | `notFoundText` | `string` | `'No results found'` | The message shown in place of the list when nothing matches. |
138
+ | `selectedOptions` _bindable_ | `{ id: string; value: string }[]` | `[]` | The suggestions currently chosen. |
139
+ | `suggestionChosen` | `(e: Event, selection: string) => void` | | Called when a suggestion is chosen: by clicking it, by pressing Enter on it, or by walking onto it while `selectOnFocus` is set. |
140
+ | `querySubmitted` | `(e: MouseEvent` &#124; `KeyboardEvent, query: string) => void` | | Called when Enter is pressed with no suggestion under the cursor, or when the search button is clicked. This is where a fresh set of suggestions is fetched. Enter then also submits the form with the typed text, unless the event is prevented. |
141
+ | `virtualizer` | `AutoSuggestVirtualizer` | | Bridge to a windowed list, for suggestion sets too long to render whole. |
142
+ | `maxItemsInView` | `number` | `6` | How many suggestions are visible before the list scrolls. |
143
+ | `wrapperAttributes` | `HTMLAttributes` | | The attributes to spread on the wrapper element. |
144
+ | `flyoutRef` _bindable_ | `HTMLElement` &#124; `null` | | The DOM reference of the flyout holding the suggestion list. |
145
+ | `flyoutProps` | `FlyoutProps` | | The props to spread on the flyout. |
146
+ | `listViewRef` _bindable_ | `HTMLUListElement` &#124; `null` | | The DOM reference of the suggestion list. |
147
+ | `listViewProps` | `ListViewItemProps` | | The props to spread on the suggestion list. |
148
+ | `type`, `placeholder`, `hideActionButtons`, `textChanged`, `onClear` from `TextBoxProps` | | | |
149
+ | `HTMLInputAttributes` without `value`, `type`, `role`, `size`, `placeholder` | | | |
149
150
 
150
151
  <!-- /props:AutoSuggestBoxProps -->
151
152
 
@@ -154,14 +155,14 @@ A virtualized list must filter its source data itself and report the filtered le
154
155
  <!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
155
156
  <!-- props:AutoSuggestOptionProps -->
156
157
 
157
- | Name | Type | Default | Description |
158
- | ----------------------------------------------- | --------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
159
- | `value` | `string` | | The value reported to the box when the suggestion is chosen. Falls back to the id. |
160
- | `text` | `string` | | The text shown in the box once the suggestion is chosen. Falls back to `value`. |
161
- | `id` | `string` | | The id of the option element, referenced by the box through `aria-activedescendant`. Falls back to a generated id. |
162
- | `ref` _bindable_ | `HTMLLIElement` | | The DOM reference of the option element. |
163
- | `disabled` | `boolean` | | Takes the suggestion out of reach: it is shown, but the cursor steps over it. |
164
- | `index` | `number` | | Where the suggestion sits in the whole set. A windowed list needs the real index, not the position within the rendered slice. |
165
- | `ListViewItemProps<'li'>` without `as`, `value` | | | |
158
+ | Name | Type | Default | Description |
159
+ | ----------------------------------------------- | ----------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
160
+ | `value` | `string` | | The value reported to the box when the suggestion is chosen. Falls back to the id. |
161
+ | `text` | `string` | | The text shown in the box once the suggestion is chosen. Falls back to `value`. |
162
+ | `id` | `string` | | The id of the option element, referenced by the box through `aria-activedescendant`. Falls back to a generated id. |
163
+ | `ref` _bindable_ | `HTMLLIElement` &#124; `null` | | The DOM reference of the option element. |
164
+ | `disabled` | `boolean` | | Takes the suggestion out of reach: it is shown, but the cursor steps over it. |
165
+ | `index` | `number` | | Where the suggestion sits in the whole set. A windowed list needs the real index, not the position within the rendered slice. |
166
+ | `ListViewItemProps<'li'>` without `as`, `value` | | | |
166
167
 
167
168
  <!-- /props:AutoSuggestOptionProps -->
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import { invokeHandlers } from '../../internal/index.js';
2
3
  import { PREFIX } from '../../internal/constants.js';
3
4
  import ListViewItem from '../list-view/list-view-item.svelte';
4
5
  import { getAutoSuggestBoxContext } from './auto-suggest-box.js';
@@ -9,12 +10,13 @@
9
10
 
10
11
  let {
11
12
  disabled,
12
- ref = $bindable(),
13
+ ref = $bindable(null),
13
14
  id = ID,
14
15
  value = id!,
15
16
  text,
16
17
  index,
17
18
  children,
19
+ onclick,
18
20
  ...attributes
19
21
  }: AutoSuggestOptionProps = $props();
20
22
 
@@ -58,16 +60,16 @@
58
60
 
59
61
  {#if isVisible || virtualized}
60
62
  <ListViewItem
63
+ {...attributes}
61
64
  {id}
62
65
  role="option"
63
66
  {value}
64
67
  tabindex={-1}
65
68
  data-index={index}
66
- class={['fs-autosuggest-option', selectOnFocus && 'no-outline']}
67
- onclick={handleClick}
69
+ class={['fs-autosuggest-option', selectOnFocus && 'no-outline', attributes?.class]}
70
+ onclick={(e) => invokeHandlers(e, disabled, [handleClick, onclick])}
68
71
  bind:ref
69
72
  {disabled}
70
- {...attributes}
71
73
  >
72
74
  {@render children?.()}
73
75
  </ListViewItem>
@@ -2,17 +2,17 @@ import type { FSContext } from '../../internal/index.js';
2
2
  import type { TextBoxProps } from '../text-box/types.ts';
3
3
  import type { ListViewItemProps } from '../list-view/types.ts';
4
4
  import type { FlyoutProps } from '../flyout/types.ts';
5
- import type { HTMLAttributes } from 'svelte/elements';
5
+ import type { HTMLAttributes, HTMLInputAttributes } from 'svelte/elements';
6
6
  /** @propsmith AutoSuggestBoxProps */
7
7
  export type AutoSuggestBoxProps = {
8
8
  /** The DOM reference of the wrapper element.
9
9
  * @bindable
10
10
  */
11
- ref?: HTMLElement;
11
+ wrapperRef?: HTMLDivElement | null;
12
12
  /** The DOM reference of the text box element.
13
13
  * @bindable
14
14
  */
15
- inputRef?: HTMLInputElement;
15
+ ref?: HTMLInputElement | null;
16
16
  /** The current text of the box.
17
17
  * @default ''
18
18
  * @bindable
@@ -53,7 +53,8 @@ export type AutoSuggestBoxProps = {
53
53
  */
54
54
  suggestionChosen?: (e: Event, selection: string) => void;
55
55
  /** Called when Enter is pressed with no suggestion under the cursor, or when the search
56
- * button is clicked. This is where a fresh set of suggestions is fetched.
56
+ * button is clicked. This is where a fresh set of suggestions is fetched. Enter then also
57
+ * submits the form with the typed text, unless the event is prevented.
57
58
  */
58
59
  querySubmitted?: (e: MouseEvent | KeyboardEvent, query: string) => void;
59
60
  /** Bridge to a windowed list, for suggestion sets too long to render whole.
@@ -64,18 +65,14 @@ export type AutoSuggestBoxProps = {
64
65
  * @default 6
65
66
  */
66
67
  maxItemsInView?: number;
67
- /** The DOM reference of the underlying text box input.
68
- * @bindable
69
- */
70
- textBoxRef?: HTMLInputElement;
71
- /** The props to spread on the text box.
72
- * @type TextBoxProps
68
+ /** The attributes to spread on the wrapper element.
69
+ * @type HTMLAttributes
73
70
  */
74
- textBoxProps?: Omit<TextBoxProps, 'type' | 'ref' | 'placeholder' | 'hideActionButtons' | 'textChanged'>;
71
+ wrapperAttributes?: HTMLAttributes<HTMLDivElement>;
75
72
  /** The DOM reference of the flyout holding the suggestion list.
76
73
  * @bindable
77
74
  */
78
- flyoutRef?: HTMLElement;
75
+ flyoutRef?: HTMLElement | null;
79
76
  /** The props to spread on the flyout.
80
77
  * @type FlyoutProps
81
78
  */
@@ -83,12 +80,12 @@ export type AutoSuggestBoxProps = {
83
80
  /** The DOM reference of the suggestion list.
84
81
  * @bindable
85
82
  */
86
- listViewRef?: HTMLUListElement;
83
+ listViewRef?: HTMLUListElement | null;
87
84
  /** The props to spread on the suggestion list.
88
85
  * @type ListViewItemProps
89
86
  */
90
87
  listViewProps?: Omit<ListViewItemProps, 'as' | 'role' | 'ref' | 'navigationMode' | 'selectedItems'>;
91
- } & Pick<TextBoxProps, 'type' | 'placeholder' | 'hideActionButtons' | 'textChanged'> & HTMLAttributes<HTMLDivElement>;
88
+ } & Pick<TextBoxProps, 'type' | 'placeholder' | 'hideActionButtons' | 'textChanged' | 'onClear'> & Omit<HTMLInputAttributes, 'value' | 'type' | 'role' | 'size' | 'placeholder'>;
92
89
  /**
93
90
  * Bridge to a windowed list. `size` is the total number of suggestions, not the
94
91
  * number currently rendered — it is how the box knows where the list really ends
@@ -106,7 +103,7 @@ export type AutoSuggestBoxContext = FSContext<{
106
103
  multiselect?: boolean;
107
104
  }, {
108
105
  readonly searchValue?: string;
109
- readonly textBoxRef?: HTMLInputElement;
106
+ readonly textBoxRef?: HTMLInputElement | null;
110
107
  readonly lastTypedValue?: string;
111
108
  open?: boolean;
112
109
  activeOption?: OptionType | null;
@@ -135,7 +132,7 @@ export type AutoSuggestOptionProps = {
135
132
  /** The DOM reference of the option element.
136
133
  * @bindable
137
134
  */
138
- ref?: HTMLLIElement;
135
+ ref?: HTMLLIElement | null;
139
136
  /** Takes the suggestion out of reach: it is shown, but the cursor steps over it. */
140
137
  disabled?: boolean;
141
138
  /** Where the suggestion sits in the whole set. A windowed list needs the real index,
@@ -15,7 +15,7 @@
15
15
  color = 'attention',
16
16
  style,
17
17
  activeAppearance = 'ring',
18
- ref = $bindable(),
18
+ ref = $bindable(null),
19
19
  idForColor,
20
20
  badge,
21
21
  ...attributes
@@ -49,6 +49,7 @@
49
49
  ```
50
50
  -->
51
51
  <div
52
+ {...attributes}
52
53
  role="img"
53
54
  aria-label={name}
54
55
  bind:this={ref}
@@ -60,9 +61,9 @@
60
61
  active,
61
62
  shape,
62
63
  hideBg && 'hide-bg',
63
- (badge?.status || badge?.icon) && 'mask'
64
+ (badge?.status || badge?.icon) && 'mask',
65
+ attributes?.class
64
66
  ]}
65
- {...attributes}
66
67
  >
67
68
  <span class="content">
68
69
  {#if image}
@@ -83,7 +83,7 @@ An avatar can have its color automatically picked based on the name prop, or idF
83
83
  | ------------------ | ------------------------------------------------------------------------------ | ------------- | --------------------------------------------------------------------------------------------------------------- |
84
84
  | `name` | `string` | `'Avatar'` | The name of the person or entity represented by this Avatar. This should always be provided if it is available. |
85
85
  | `image` | `{ src: string; }` | | The Avatar's image |
86
- | `ref` _bindable_ | `HTMLDivElement` | | The DOM reference of the avatar element. |
86
+ | `ref` _bindable_ | `HTMLDivElement` &#124; `null` | | The DOM reference of the avatar element. |
87
87
  | `size` | `number` | `48` | Size of the avatar in pixels. |
88
88
  | `shape` | `'circular'` &#124; `'rounded'` &#124; `'square'` | `'circular'` | The avatar can have a circular, rounded or square shape. |
89
89
  | `color` | [`Colors`](https://fluentui-svelte.dev/docs/types/#colors) &#124; `'colorful'` | `'attention'` | The color when displaying either an icon or initials. For now it only supports system colors (plus colorful). |
@@ -17,7 +17,7 @@ export type AvatarProps = {
17
17
  /** The DOM reference of the avatar element.
18
18
  * @bindable
19
19
  */
20
- ref?: HTMLDivElement;
20
+ ref?: HTMLDivElement | null;
21
21
  /** Size of the avatar in pixels.
22
22
  * @default 48
23
23
  */
@@ -11,7 +11,7 @@
11
11
  class: classes,
12
12
  color,
13
13
  style,
14
- ref = $bindable(),
14
+ ref = $bindable(null),
15
15
  ...attributes
16
16
  }: BadgeIconProps = $props();
17
17
 
@@ -41,12 +41,12 @@
41
41
  ```
42
42
  -->
43
43
  <span
44
+ {...attributes}
44
45
  bind:this={ref}
45
46
  aria-label={arialabel}
46
47
  role="img"
47
48
  class={['fs-badge-icon', color || colors[status], classes]}
48
49
  style="--badge-size: {pxToRem(size)}; {style}"
49
- {...attributes}
50
50
  >
51
51
  {#if Icon}
52
52
  <RenderSoC SoC={Icon} args={{ 'aria-hidden': true, width: `${size}px`, height: `${size}px` }} />
@@ -13,7 +13,7 @@
13
13
  children,
14
14
  class: classes,
15
15
  style,
16
- ref = $bindable(),
16
+ ref = $bindable(null),
17
17
  ...attributes
18
18
  }: BadgeProps = $props();
19
19
  </script>
@@ -36,10 +36,10 @@
36
36
  ```
37
37
  -->
38
38
  <span
39
+ {...attributes}
39
40
  bind:this={ref}
40
41
  class={['fs-badge', shape, appearance, color, classes]}
41
42
  style="--badge-shapes: {shapes[shape]}; --badge-size: {pxToRem(size)}; {style}"
42
- {...attributes}
43
43
  >
44
44
  {#if iconPosition === 'after'}
45
45
  {@render children?.()}
@@ -90,7 +90,7 @@ Use the icon prop to render an icon inside the badge. You can pass the icon as a
90
90
  | `iconPosition` | `'before'` &#124; `'after'` | `'before'` | The position of the icon relative to the badge content. |
91
91
  | `color` | [`Colors`](https://fluentui-svelte.dev/docs/types/#colors) | `'information'` | The color of the badge. For now it only supports system colors. |
92
92
  | `icon` | `Snippet` &#124; `Component` | | Icon to render inside the badge. |
93
- | `ref` _bindable_ | `HTMLSpanElement` | | The DOM reference of the badge element. |
93
+ | `ref` _bindable_ | `HTMLSpanElement` &#124; `null` | | The DOM reference of the badge element. |
94
94
  | HTML Attributes | | | |
95
95
 
96
96
  <!-- /props:BadgeProps -->
@@ -140,7 +140,7 @@ By default, Avatar uses an instance of BadgeIcon. As you can see, the first exam
140
140
  | `size` | `number` | `20` | The size of the badge in pixels. |
141
141
  | `color` | [`Colors`](https://fluentui-svelte.dev/docs/types/#colors) | | Overrides the color the status would pick on its own. |
142
142
  | `icon` | `Snippet` &#124; `Component` | | Custom icon, rendered instead of the one the status would pick on its own. |
143
- | `ref` _bindable_ | `HTMLSpanElement` | | The DOM reference of the badge element. |
143
+ | `ref` _bindable_ | `HTMLSpanElement` &#124; `null` | | The DOM reference of the badge element. |
144
144
  | HTML Attributes | | | |
145
145
 
146
146
  <!-- /props:BadgeIconProps -->
@@ -30,7 +30,7 @@ export type BadgeProps = {
30
30
  /** The DOM reference of the badge element.
31
31
  * @bindable
32
32
  */
33
- ref?: HTMLSpanElement;
33
+ ref?: HTMLSpanElement | null;
34
34
  } & PolymorphicProps<'span'>;
35
35
  /** The presence of a person, rendered by BadgeIcon on its own or by an Avatar through its badge prop. */
36
36
  export type BadgePresence = {
@@ -66,5 +66,5 @@ export type BadgeIconProps = {
66
66
  /** The DOM reference of the badge element.
67
67
  * @bindable
68
68
  */
69
- ref?: HTMLSpanElement;
69
+ ref?: HTMLSpanElement | null;
70
70
  } & Omit<PolymorphicProps<'span'>, 'children'>;
@@ -4,7 +4,7 @@
4
4
 
5
5
  let {
6
6
  as = 'button' as T,
7
- ref = $bindable(),
7
+ ref = $bindable(null),
8
8
  icon,
9
9
  iconPosition = 'before',
10
10
  current = false,
@@ -37,6 +37,7 @@
37
37
  -->
38
38
  <svelte:element
39
39
  this={_as}
40
+ {...attributes}
40
41
  bind:this={ref as BreadcrumbItemElementDOMType[T]}
41
42
  type={_as === 'button' ? 'button' : undefined}
42
43
  disabled={nativelyDisabled || undefined}
@@ -44,7 +45,6 @@
44
45
  aria-current={current ? 'page' : undefined}
45
46
  class={['fs-breadcrumb-button', { current, disabled }, classes]}
46
47
  onclick={(e: MouseEvent) => invokeHandlers(e, disabled, [onclick])}
47
- {...attributes}
48
48
  >
49
49
  {#if icon && iconPosition === 'before'}
50
50
  <span class="fs-breadcrumb-button-icon">