fluentui-svelte 0.6.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 (243) 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 +2 -2
  63. package/dist/components/dialog/dialog-content.svelte +2 -2
  64. package/dist/components/dialog/dialog-surface.svelte +102 -9
  65. package/dist/components/dialog/dialog-title.svelte +2 -2
  66. package/dist/components/dialog/dialog-trigger.svelte +2 -2
  67. package/dist/components/dialog/dialog.svelte +22 -11
  68. package/dist/components/dialog/docs/llms.md +56 -19
  69. package/dist/components/dialog/types.d.ts +25 -7
  70. package/dist/components/divider/divider.svelte +6 -4
  71. package/dist/components/divider/types.d.ts +1 -1
  72. package/dist/components/dropdown/docs/llms.md +30 -28
  73. package/dist/components/dropdown/dropdown-option.svelte +17 -5
  74. package/dist/components/dropdown/dropdown.svelte +182 -84
  75. package/dist/components/dropdown/dropdown.svelte.d.ts +1 -1
  76. package/dist/components/dropdown/types.d.ts +26 -20
  77. package/dist/components/dropdown-select/docs/llms.md +24 -22
  78. package/dist/components/dropdown-select/dropdown-select-option.svelte +2 -2
  79. package/dist/components/dropdown-select/dropdown-select.svelte +42 -7
  80. package/dist/components/dropdown-select/types.d.ts +4 -4
  81. package/dist/components/expander/docs/llms.md +3 -3
  82. package/dist/components/expander/expander.svelte +13 -8
  83. package/dist/components/expander/types.d.ts +5 -5
  84. package/dist/components/flyout/docs/llms.md +1 -1
  85. package/dist/components/flyout/flyout.svelte +17 -6
  86. package/dist/components/flyout/types.d.ts +1 -1
  87. package/dist/components/hyperlink/docs/llms.md +6 -6
  88. package/dist/components/hyperlink/hyperlink.svelte +13 -4
  89. package/dist/components/hyperlink/types.d.ts +1 -1
  90. package/dist/components/info-bar/docs/llms.md +11 -10
  91. package/dist/components/info-bar/info-bar.svelte +3 -2
  92. package/dist/components/info-bar/types.d.ts +4 -0
  93. package/dist/components/label/docs/llms.md +75 -22
  94. package/dist/components/label/label-context.d.ts +14 -0
  95. package/dist/components/label/label-context.js +10 -0
  96. package/dist/components/label/label.svelte +153 -30
  97. package/dist/components/label/label.svelte.d.ts +1 -1
  98. package/dist/components/label/types.d.ts +48 -4
  99. package/dist/components/list-view/docs/llms.md +103 -33
  100. package/dist/components/list-view/list-view-item-branch.svelte +257 -0
  101. package/dist/components/list-view/list-view-item-branch.svelte.d.ts +4 -0
  102. package/dist/components/list-view/list-view-item.svelte +164 -46
  103. package/dist/components/list-view/list-view-item.svelte.d.ts +5 -5
  104. package/dist/components/list-view/list-view.svelte +73 -25
  105. package/dist/components/list-view/types.d.ts +71 -8
  106. package/dist/components/list-view/utils.d.ts +10 -0
  107. package/dist/components/list-view/utils.js +17 -1
  108. package/dist/components/menu/docs/llms.md +98 -15
  109. package/dist/components/menu/menu-command-bar-item.svelte +61 -0
  110. package/dist/components/menu/menu-command-bar-item.svelte.d.ts +14 -0
  111. package/dist/components/menu/menu-command-bar.svelte +218 -0
  112. package/dist/components/menu/menu-command-bar.svelte.d.ts +21 -0
  113. package/dist/components/menu/menu-group.svelte +6 -3
  114. package/dist/components/menu/menu-item-checkbox.svelte +5 -4
  115. package/dist/components/menu/menu-item-radio.svelte +5 -4
  116. package/dist/components/menu/menu-item-switch.svelte +5 -4
  117. package/dist/components/menu/menu-item.svelte +5 -5
  118. package/dist/components/menu/menu-item.svelte.d.ts +2 -3
  119. package/dist/components/menu/menu-list.svelte +10 -1
  120. package/dist/components/menu/menu-popover.svelte +9 -5
  121. package/dist/components/menu/menu-trigger.svelte +2 -1
  122. package/dist/components/menu/menu.svelte.js +1 -0
  123. package/dist/components/menu/types.d.ts +62 -7
  124. package/dist/components/number-box/docs/llms.md +6 -4
  125. package/dist/components/number-box/number-box.svelte +35 -29
  126. package/dist/components/number-box/number-box.svelte.d.ts +1 -1
  127. package/dist/components/number-box/types.d.ts +1 -1
  128. package/dist/components/persona/docs/llms.md +29 -25
  129. package/dist/components/persona/persona.svelte +8 -6
  130. package/dist/components/persona/types.d.ts +4 -3
  131. package/dist/components/progress-bar/docs/llms.md +13 -13
  132. package/dist/components/progress-bar/progress-bar.svelte +6 -6
  133. package/dist/components/progress-bar/types.d.ts +4 -4
  134. package/dist/components/progress-ring/docs/llms.md +14 -14
  135. package/dist/components/progress-ring/progress-ring.svelte +5 -5
  136. package/dist/components/progress-ring/types.d.ts +3 -3
  137. package/dist/components/radio-button/docs/llms.md +11 -8
  138. package/dist/components/radio-button/radio-button.svelte +38 -12
  139. package/dist/components/radio-button/radio-button.svelte.d.ts +1 -1
  140. package/dist/components/radio-button/types.d.ts +11 -8
  141. package/dist/components/rating/docs/llms.md +15 -14
  142. package/dist/components/rating/rating.svelte +66 -29
  143. package/dist/components/rating/rating.svelte.d.ts +1 -1
  144. package/dist/components/rating/types.d.ts +8 -8
  145. package/dist/components/side-nav/docs/llms.md +110 -0
  146. package/dist/components/side-nav/side-nav-branch.svelte +43 -0
  147. package/dist/components/side-nav/side-nav-branch.svelte.d.ts +4 -0
  148. package/dist/components/side-nav/side-nav-item.svelte +75 -0
  149. package/dist/components/side-nav/side-nav-item.svelte.d.ts +25 -0
  150. package/dist/components/side-nav/side-nav-list.svelte +32 -0
  151. package/dist/components/side-nav/side-nav-list.svelte.d.ts +7 -0
  152. package/dist/components/side-nav/side-nav.d.ts +2 -0
  153. package/dist/components/side-nav/side-nav.js +2 -0
  154. package/dist/components/side-nav/side-nav.svelte +355 -0
  155. package/dist/components/side-nav/side-nav.svelte.d.ts +24 -0
  156. package/dist/components/side-nav/types.d.ts +149 -0
  157. package/dist/components/side-nav/types.js +1 -0
  158. package/dist/components/skeleton/docs/llms.md +1 -1
  159. package/dist/components/skeleton/skeleton.svelte +2 -2
  160. package/dist/components/skeleton/types.d.ts +1 -1
  161. package/dist/components/slider/docs/llms.md +31 -28
  162. package/dist/components/slider/slider.svelte +126 -61
  163. package/dist/components/slider/slider.svelte.d.ts +1 -3
  164. package/dist/components/slider/types.d.ts +21 -14
  165. package/dist/components/tab-view/docs/llms.md +7 -7
  166. package/dist/components/tab-view/tab-view-tab.svelte +16 -14
  167. package/dist/components/tab-view/tab-view.svelte +16 -9
  168. package/dist/components/tab-view/types.d.ts +6 -6
  169. package/dist/components/table/docs/llms.md +38 -33
  170. package/dist/components/table/table-body.svelte +2 -2
  171. package/dist/components/table/table-cell-actions.svelte +8 -2
  172. package/dist/components/table/table-cell-layout.svelte +2 -2
  173. package/dist/components/table/table-cell.svelte +2 -2
  174. package/dist/components/table/table-header-cell.svelte +2 -2
  175. package/dist/components/table/table-header.svelte +2 -2
  176. package/dist/components/table/table-row.svelte +2 -2
  177. package/dist/components/table/table-selection-cell.svelte +6 -6
  178. package/dist/components/table/table.svelte +2 -2
  179. package/dist/components/table/types.d.ts +11 -11
  180. package/dist/components/tag/docs/llms.md +26 -26
  181. package/dist/components/tag/tag-group.svelte +2 -2
  182. package/dist/components/tag/tag.svelte +13 -12
  183. package/dist/components/tag/types.d.ts +6 -4
  184. package/dist/components/tag-picker/docs/llms.md +61 -55
  185. package/dist/components/tag-picker/option-group.svelte +17 -4
  186. package/dist/components/tag-picker/option-group.svelte.d.ts +1 -1
  187. package/dist/components/tag-picker/option.svelte +15 -4
  188. package/dist/components/tag-picker/tag-picker.svelte +137 -65
  189. package/dist/components/tag-picker/tag-picker.svelte.d.ts +2 -2
  190. package/dist/components/tag-picker/types.d.ts +36 -16
  191. package/dist/components/text-box/docs/llms.md +31 -4
  192. package/dist/components/text-box/text-box-button.svelte +3 -3
  193. package/dist/components/text-box/text-box-button.svelte.d.ts +1 -1
  194. package/dist/components/text-box/text-box.svelte +41 -14
  195. package/dist/components/text-box/types.d.ts +5 -5
  196. package/dist/components/textarea/docs/llms.md +4 -3
  197. package/dist/components/textarea/textarea.svelte +14 -6
  198. package/dist/components/textarea/types.d.ts +2 -4
  199. package/dist/components/time-picker/docs/llms.md +18 -15
  200. package/dist/components/time-picker/time-picker.svelte +133 -33
  201. package/dist/components/time-picker/time-picker.svelte.d.ts +1 -1
  202. package/dist/components/time-picker/types.d.ts +23 -13
  203. package/dist/components/title-bar/docs/llms.md +382 -0
  204. package/dist/components/title-bar/title-bar-left-controls.svelte +215 -0
  205. package/dist/components/title-bar/title-bar-left-controls.svelte.d.ts +22 -0
  206. package/dist/components/title-bar/title-bar-right-controls.svelte +190 -0
  207. package/dist/components/title-bar/title-bar-right-controls.svelte.d.ts +27 -0
  208. package/dist/components/title-bar/title-bar.d.ts +3 -0
  209. package/dist/components/title-bar/title-bar.js +4 -0
  210. package/dist/components/title-bar/title-bar.svelte +224 -0
  211. package/dist/components/title-bar/title-bar.svelte.d.ts +26 -0
  212. package/dist/components/title-bar/types.d.ts +165 -0
  213. package/dist/components/title-bar/types.js +1 -0
  214. package/dist/components/toggle-switch/docs/llms.md +11 -9
  215. package/dist/components/toggle-switch/toggle-switch.svelte +23 -14
  216. package/dist/components/toggle-switch/toggle-switch.svelte.d.ts +1 -1
  217. package/dist/components/toggle-switch/types.d.ts +12 -10
  218. package/dist/components/tooltip/docs/llms.md +1 -1
  219. package/dist/components/tooltip/tooltip.svelte +5 -4
  220. package/dist/components/tooltip/types.d.ts +1 -1
  221. package/dist/components/top-nav/docs/llms.md +1 -1
  222. package/dist/components/top-nav/top-nav-item.svelte +2 -2
  223. package/dist/components/top-nav/top-nav.svelte +2 -2
  224. package/dist/components/top-nav/types.d.ts +2 -2
  225. package/dist/components/tree-view/docs/llms.md +11 -11
  226. package/dist/components/tree-view/tree-view-item-content.svelte +3 -3
  227. package/dist/components/tree-view/tree-view-item.svelte +13 -5
  228. package/dist/components/tree-view/tree-view.svelte +20 -5
  229. package/dist/components/tree-view/tree-view.svelte.d.ts +1 -1
  230. package/dist/components/tree-view/tree-view.svelte.js +31 -3
  231. package/dist/components/tree-view/types.d.ts +7 -3
  232. package/dist/index.d.ts +18 -0
  233. package/dist/index.js +20 -0
  234. package/dist/internal/components/dynamic-carousel/dynamic-carousel.svelte +26 -5
  235. package/dist/internal/components/dynamic-carousel/dynamic-carousel.svelte.d.ts +2 -0
  236. package/dist/internal/index.d.ts +1 -0
  237. package/dist/internal/index.js +1 -0
  238. package/dist/internal/native-field.svelte.d.ts +44 -0
  239. package/dist/internal/native-field.svelte.js +85 -0
  240. package/dist/internal/utils.d.ts +16 -2
  241. package/dist/internal/utils.js +25 -3
  242. package/dist/types/index.d.ts +3 -3
  243. package/package.json +50 -36
@@ -21,6 +21,8 @@ Other components that can be used within the menu include:
21
21
  - `MenuItemCheckbox`: A menu item that can be checked or unchecked.
22
22
  - `MenuItemSwitch`: A menu item that can be toggled on or off.
23
23
  - `MenuItemRadio`: A menu item that can be selected as part of a group of radio items.
24
+ - `MenuCommandBar`: A row of icon-only commands placed at the top or at the bottom of the menu, with an optional overflow submenu.
25
+ - `MenuCommandBarItem`: A square, icon-only command of a MenuCommandBar, with a label that names it and shows as its tooltip.
24
26
 
25
27
  ## Usage
26
28
 
@@ -87,7 +89,7 @@ To correctly attach events to the trigger element, you should wrap the element w
87
89
  {#snippet children({ state, menuTriggerProps, primaryButtonProps })}
88
90
  <SplitButton
89
91
  bind:menuTriggerRef={state.ref}
90
- {menuTriggerProps}
92
+ menuTriggerProps={{ ...menuTriggerProps, 'aria-label': 'More options' }}
91
93
  primaryButtonProps={{ onclick: () => alert('Primary action'), ...primaryButtonProps }}
92
94
  >
93
95
  Primary Action
@@ -103,6 +105,51 @@ To correctly attach events to the trigger element, you should wrap the element w
103
105
  </Menu>
104
106
  ```
105
107
 
108
+ ### Menu with a command bar
109
+
110
+ A command bar flyout pairs a row of square, icon-only primary commands with the items of the menu. Place a `MenuCommandBar` at the top or at the bottom of the `MenuList` and set its `position` to match. Fill it with `MenuCommandBarItem`, each with an `icon` and a `label` that names it and shows as its tooltip. The `overflow` snippet adds a "more" button at the end of the row that opens the secondary commands in a submenu.
111
+
112
+ Left and Right move along the bar. Up and Down move between the bar and the items of the menu.
113
+
114
+ ```svelte
115
+ <Menu>
116
+ <MenuTrigger>
117
+ {#snippet children({ state, menuTriggerProps })}
118
+ <Button bind:ref={state.ref} {...menuTriggerProps}>Commands on top</Button>
119
+ {/snippet}
120
+ </MenuTrigger>
121
+ <MenuPopover>
122
+ <MenuList>
123
+ <!-- position="bottom" when the bar comes after the items -->
124
+ <MenuCommandBar>
125
+ <MenuCommandBarItem icon={CutRegular} label="Cut" />
126
+ <MenuCommandBarItem icon={CopyRegular} label="Copy" />
127
+ <MenuCommandBarItem icon={ClipboardPasteRegular} label="Paste" />
128
+ {#snippet overflow()}
129
+ <MenuItem>Select all</MenuItem>
130
+ <MenuItem>Rename</MenuItem>
131
+ {/snippet}
132
+ </MenuCommandBar>
133
+ <MenuItem>Open</MenuItem>
134
+ <MenuItem>Open with</MenuItem>
135
+ <MenuItem>Properties</MenuItem>
136
+ </MenuList>
137
+ </MenuPopover>
138
+ </Menu>
139
+ ```
140
+
141
+ By default every command is a square that shows only its icon. `showLabels` shows the label of every command below its icon, and `showDividers` draws a divider between every two commands; with either of them the commands share the width of the bar evenly.
142
+
143
+ ```svelte
144
+ <MenuCommandBar showLabels showDividers>
145
+ <MenuCommandBarItem icon={CutRegular} label="Cut" />
146
+ <MenuCommandBarItem icon={CopyRegular} label="Copy" />
147
+ <MenuCommandBarItem icon={EditRegular} label="Rename" />
148
+ <MenuCommandBarItem icon={ShareRegular} label="Share" />
149
+ <MenuCommandBarItem icon={DeleteRegular} label="Delete" />
150
+ </MenuCommandBar>
151
+ ```
152
+
106
153
  ## Context Menu
107
154
 
108
155
  This variant of the `MenuTrigger` component allows you to create context menus that open on right-click. You can specify the element to which the context menu should be attached using the `ref` prop. If no element is provided, it will attach to the `document.body` by default.
@@ -147,8 +194,8 @@ This variant of the `MenuTrigger` component allows you to create context menus t
147
194
 
148
195
  | Name | Type | Default | Description |
149
196
  | ----------------- | ------------------------------------ | ------- | -------------------------------------------------------- |
150
- | `ref` | `HTMLElement` | | The element used to position the popover. |
151
- | `open` _bindable_ | `boolean` | | Controls the open state of the popover. |
197
+ | `ref` | `HTMLElement` &#124; `null` | | The element used to position the popover. |
198
+ | `open` _bindable_ | `boolean` &#124; `null` | | Controls the open state of the popover. |
152
199
  | `keepMounted` | `boolean` | `false` | Keeps the popover mounted in the DOM while it is closed. |
153
200
  | `placement` | `ComputePositionConfig['placement']` | | Where the popover is positioned relative to its trigger. |
154
201
  | `positionConfig` | `ComputePositionConfig` | | The position configuration handed over to floating-ui. |
@@ -190,13 +237,13 @@ This variant of the `MenuTrigger` component allows you to create context menus t
190
237
  <!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
191
238
  <!-- props:MenuItemActionableProps -->
192
239
 
193
- | Name | Type | Default | Description |
194
- | -------------------------------------- | --------- | ------- | ------------------------------------------------------------------------------------------ |
195
- | `checked` _bindable_ | `boolean` | | Whether the item is checked. |
196
- | `value` | `string` | `id` | The value reported to the menu when the item is checked. Falls back to the id of the item. |
197
- | `name` | `string` | `id` | The group of items this one belongs to. Falls back to the id of the item. |
198
- | `MenuItemProps` without `href` | | | |
199
- | `ComponentProps<typeof Button<'div'>>` | | | |
240
+ | Name | Type | Default | Description |
241
+ | ------------------------------ | ----------------------- | ------- | ------------------------------------------------------------------------------------------ |
242
+ | `checked` _bindable_ | `boolean` &#124; `null` | | Whether the item is checked. |
243
+ | `value` | `string` | `id` | The value reported to the menu when the item is checked. Falls back to the id of the item. |
244
+ | `name` | `string` | `id` | The group of items this one belongs to. Falls back to the id of the item. |
245
+ | `MenuItemProps` without `href` | | | |
246
+ | `ButtonProps<'button'>` | | | |
200
247
 
201
248
  <!-- /props:MenuItemActionableProps -->
202
249
 
@@ -205,10 +252,46 @@ This variant of the `MenuTrigger` component allows you to create context menus t
205
252
  <!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
206
253
  <!-- props:MenuGroupProps -->
207
254
 
208
- | Name | Type | Default | Description |
209
- | ---------------- | ---------------- | ------- | --------------------------------------- |
210
- | `ref` _bindable_ | `HTMLDivElement` | | The DOM reference of the group element. |
211
- | `header` | `string` | | The label of the group. |
212
- | `children` | `Snippet` | | The items of the group. |
255
+ | Name | Type | Default | Description |
256
+ | ---------------- | ------------------------------ | ------- | --------------------------------------- |
257
+ | `ref` _bindable_ | `HTMLDivElement` &#124; `null` | | The DOM reference of the group element. |
258
+ | `header` | `string` | | The label of the group. |
259
+ | `children` | `Snippet` | | The items of the group. |
213
260
 
214
261
  <!-- /props:MenuGroupProps -->
262
+
263
+ ## Component Props (MenuCommandBar)
264
+
265
+ <!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
266
+ <!-- props:MenuCommandBarProps -->
267
+
268
+ | Name | Type | Default | Description |
269
+ | ----------------------------------------------------------- | ------------------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------- |
270
+ | `ref` _bindable_ | `HTMLDivElement` &#124; `null` | | The DOM reference of the command bar element. |
271
+ | `position` | `'top'` &#124; `'bottom'` | `'top'` | Where the bar sits in the menu. A bar at the top has its divider below it, and one at the bottom has it above. |
272
+ | `label` | `string` | `'Commands'` | The accessible name of the group of commands. |
273
+ | `overflowLabel` | `string` | `'More options'` | The accessible name of the button that opens the overflow. |
274
+ | `overflow` | `Snippet` | | The secondary commands. When present, a "more" button at the end of the bar opens them in a submenu. |
275
+ | `showLabels` | `boolean` | `false` | Shows the label of every command below its icon. Without labels, every command is a square. |
276
+ | `showDividers` | `boolean` | `false` | Draws a divider between every two commands. |
277
+ | `children` | `Snippet` | | The primary commands, as `MenuCommandBarItem`s. |
278
+ | `HTMLAttributes<HTMLDivElement>` without `children`, `role` | | | |
279
+
280
+ <!-- /props:MenuCommandBarProps -->
281
+
282
+ ## Component Props (MenuCommandBarItem)
283
+
284
+ <!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
285
+ <!-- props:MenuCommandBarItemProps -->
286
+
287
+ | Name | Type | Default | Description |
288
+ | --------------------------------------------------------------------------- | --------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
289
+ | `ref` _bindable_ | `HTMLButtonElement` &#124; `null` | | The DOM reference of the button element. |
290
+ | `icon` | `Snippet` &#124; `Component` | | The icon of the command. |
291
+ | `label` | `string` | | The name of the command. Without visible labels it is the accessible name of the button and shows as its tooltip; with them it shows below the icon. |
292
+ | `disabled` | `boolean` | | Disables the user interaction. |
293
+ | `onclick` | `(e: MouseEvent) => void` | | Called when the command is activated. The menu closes afterwards, unless it persists on item activation. |
294
+ | `AriaAttributes` without `aria-label` | | | |
295
+ | `id`, `class`, `onkeydown`, `onfocus`, `onblur` from `HTMLButtonAttributes` | | | |
296
+
297
+ <!-- /props:MenuCommandBarItemProps -->
@@ -0,0 +1,61 @@
1
+ <script lang="ts">
2
+ import { Button } from '../../index.js';
3
+ import { RenderSoC } from '../../internal/index.js';
4
+ import { getMenuCommandBarContext, getMenuContext, COMPONENT_NAME as MENU_COMPONENT_NAME } from './menu.svelte.js';
5
+ import type { MenuCommandBarItemProps } from './types.js';
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ icon,
10
+ label,
11
+ disabled,
12
+ onclick,
13
+ class: classes,
14
+ ...attributes
15
+ }: MenuCommandBarItemProps = $props();
16
+
17
+ const context = getMenuContext();
18
+
19
+ if (!context) throw new Error(`No MenuContext found for ${MENU_COMPONENT_NAME}.`);
20
+
21
+ const { toggle } = context.methods;
22
+
23
+ const commandBarContext = getMenuCommandBarContext();
24
+
25
+ // A visible label names the button itself, a hidden one names it and shows as its tooltip.
26
+ const showLabel = $derived(!!commandBarContext?.showLabels);
27
+ </script>
28
+
29
+ <!--
30
+ @component
31
+
32
+ A command of a `MenuCommandBar`: a square icon whose label names it and shows as its tooltip, or the icon with the label below it when the bar shows labels.
33
+
34
+ - Usage:
35
+ ```tsx
36
+ <MenuCommandBar>
37
+ <MenuCommandBarItem icon={CutRegular} label="Cut" onclick={cut} />
38
+ </MenuCommandBar>
39
+ ```
40
+ -->
41
+ <Button
42
+ {...attributes}
43
+ bind:ref
44
+ {disabled}
45
+ role="menuitem"
46
+ appearance="subtle"
47
+ aria-label={showLabel ? undefined : label}
48
+ title={showLabel ? undefined : label}
49
+ class={['fs-menu-command-bar-item', classes]}
50
+ onclick={(e: MouseEvent) => {
51
+ if (disabled) return;
52
+ onclick?.(e);
53
+ if (!context.config.persistOnItemActivation) toggle(e);
54
+ }}
55
+ >
56
+ <RenderSoC SoC={icon} args={{ class: 'fs-menu-command-bar-item-icon' }} />
57
+ {#if showLabel}
58
+ <span class="fs-menu-command-bar-item-label">{label}</span>
59
+ {/if}
60
+ </Button>
61
+ <!-- The layout is drawn by MenuCommandBar, which styles the overflow button the same way. -->
@@ -0,0 +1,14 @@
1
+ import type { MenuCommandBarItemProps } from './types.ts';
2
+ /**
3
+ * A command of a `MenuCommandBar`: a square icon whose label names it and shows as its tooltip, or the icon with the label below it when the bar shows labels.
4
+ *
5
+ * - Usage:
6
+ * ```tsx
7
+ * <MenuCommandBar>
8
+ * <MenuCommandBarItem icon={CutRegular} label="Cut" onclick={cut} />
9
+ * </MenuCommandBar>
10
+ * ```
11
+ */
12
+ declare const MenuCommandBarItem: import("svelte").Component<MenuCommandBarItemProps, {}, "ref">;
13
+ type MenuCommandBarItem = ReturnType<typeof MenuCommandBarItem>;
14
+ export default MenuCommandBarItem;
@@ -0,0 +1,218 @@
1
+ <script lang="ts">
2
+ import { getTabspotAttributes } from 'tabspot';
3
+ import MoreHorizontalRegular from 'fluentui-icons-svelte/MoreHorizontalRegular.svelte';
4
+ import { Button, Menu, MenuList, MenuPopover, MenuTrigger } from '../../index.js';
5
+ import { getGlobalFSContext } from '../../providers/fluentui-svelte/fluentui-svelte.js';
6
+ import { getMenuContext, setMenuCommandBarContext, COMPONENT_NAME as MENU_COMPONENT_NAME } from './menu.svelte.js';
7
+ import type { MenuCommandBarProps } from './types.js';
8
+
9
+ let {
10
+ ref = $bindable(null),
11
+ position = 'top',
12
+ label = 'Commands',
13
+ overflowLabel = 'More options',
14
+ overflow,
15
+ showLabels = false,
16
+ showDividers = false,
17
+ children: commands,
18
+ class: classes,
19
+ onkeydown: userOnkeydown,
20
+ ...attributes
21
+ }: MenuCommandBarProps = $props();
22
+
23
+ if (!getMenuContext()) throw new Error(`No MenuContext found for ${MENU_COMPONENT_NAME}.`);
24
+
25
+ const globalFSContext = getGlobalFSContext();
26
+
27
+ setMenuCommandBarContext({
28
+ get showLabels() {
29
+ return showLabels;
30
+ }
31
+ });
32
+
33
+ // Left and Right move along the bar. Up and Down are left to the bar, which hands the focus over
34
+ // to the items of the menu, and the menu hands it back when its items run out towards the bar.
35
+ const tabspotAttributes = getTabspotAttributes({
36
+ mover: { axis: 'horizontal', ignoreKeys: ['ArrowUp', 'ArrowDown'] },
37
+ grouper: {}
38
+ });
39
+
40
+ const isFocusable = (element: HTMLElement) =>
41
+ !element.matches(':disabled, [aria-disabled="true"]') && element.checkVisibility();
42
+
43
+ /** The items of the menu the bar sits in, without the bar and without any submenu. */
44
+ const getMenuItems = (list: HTMLElement) =>
45
+ Array.from(list.querySelectorAll<HTMLElement>('[role^="menuitem"]')).filter(
46
+ (item) => item.closest('.fs-menu-list') === list && !ref?.contains(item) && isFocusable(item)
47
+ );
48
+
49
+ const focusBar = () =>
50
+ Array.from(ref?.children ?? [])
51
+ .find((child): child is HTMLElement => child instanceof HTMLElement && isFocusable(child))
52
+ ?.focus();
53
+
54
+ const onkeydown = (e: KeyboardEvent) => {
55
+ // The overflow submenu owns its own keys.
56
+ if (e.target instanceof HTMLElement && e.target.parentElement !== ref) return;
57
+
58
+ const list = ref?.closest<HTMLElement>('.fs-menu-list');
59
+ const toItems = position === 'top' ? e.key === 'ArrowDown' : e.key === 'ArrowUp';
60
+ if (!list || !toItems) return;
61
+
62
+ const items = getMenuItems(list);
63
+ const item = position === 'top' ? items.at(0) : items.at(-1);
64
+ if (!item) return;
65
+
66
+ e.preventDefault();
67
+ item.focus();
68
+ };
69
+
70
+ $effect(() => {
71
+ const list = ref?.closest<HTMLElement>('.fs-menu-list');
72
+ const instance = globalFSContext?.state.tabspotInstance;
73
+ if (!list || !instance) return;
74
+
75
+ return instance.subscribe(list, (event) => {
76
+ const towardsBar = position === 'top' ? event.direction === 'up' : event.direction === 'down';
77
+ if (!event.atEdge || !towardsBar || ref?.contains(event.from)) return;
78
+
79
+ event.preventDefault();
80
+ focusBar();
81
+ });
82
+ });
83
+ </script>
84
+
85
+ <!--
86
+ @component
87
+
88
+ A row of square, icon-only `MenuCommandBarItem`s, the primary commands of a command bar flyout. It goes at the top or at the bottom of a `MenuList`, and sets itself apart from the items with a divider. An `overflow` snippet adds a "more" button that opens the secondary commands in a submenu.
89
+
90
+ - Usage:
91
+ ```tsx
92
+ <MenuList>
93
+ <MenuCommandBar>
94
+ <MenuCommandBarItem icon={CutRegular} label="Cut" />
95
+ <MenuCommandBarItem icon={CopyRegular} label="Copy" />
96
+ {#snippet overflow()}
97
+ <MenuItem>Select all</MenuItem>
98
+ {/snippet}
99
+ </MenuCommandBar>
100
+ <MenuItem>Paste</MenuItem>
101
+ </MenuList>
102
+ ```
103
+ -->
104
+ <div
105
+ {...attributes}
106
+ {...tabspotAttributes}
107
+ bind:this={ref}
108
+ role="group"
109
+ aria-label={label}
110
+ class={['fs-menu-command-bar', position, { labels: showLabels, dividers: showDividers }, classes]}
111
+ onkeydown={(e) => {
112
+ userOnkeydown?.(e);
113
+ onkeydown(e);
114
+ }}
115
+ >
116
+ {@render commands?.()}
117
+ {#if overflow}
118
+ <Menu>
119
+ <MenuTrigger>
120
+ {#snippet children({ state, menuTriggerProps })}
121
+ <Button
122
+ bind:ref={() => state.ref as HTMLButtonElement | null, (v) => (state.ref = v)}
123
+ {...menuTriggerProps}
124
+ class="{menuTriggerProps.class} fs-menu-command-bar-item"
125
+ appearance="subtle"
126
+ isMenuButton={false}
127
+ indicatorIcon={undefined}
128
+ aria-label={overflowLabel}
129
+ title={overflowLabel}
130
+ >
131
+ <MoreHorizontalRegular aria-hidden="true" />
132
+ </Button>
133
+ {/snippet}
134
+ </MenuTrigger>
135
+ <MenuPopover>
136
+ <MenuList>{@render overflow()}</MenuList>
137
+ </MenuPopover>
138
+ </Menu>
139
+ {/if}
140
+ </div>
141
+
142
+ <style>
143
+ .fs-menu-command-bar {
144
+ display: flex;
145
+ align-items: center;
146
+ /* The squares spread over the width of the menu, the overflow button closing the row. */
147
+ justify-content: space-between;
148
+ /* The commands never squeeze into the width of the menu: the menu grows to fit them all,
149
+ with this much room between any two. */
150
+ --fs-menu-command-bar-gap: 0.5rem;
151
+ gap: var(--fs-menu-command-bar-gap);
152
+ flex: none;
153
+ padding: 0.25rem;
154
+ /* The divider runs from edge to edge of the menu, like a MenuDivider. */
155
+ margin-inline: -0.25rem;
156
+ &.top {
157
+ border-bottom: 1px solid var(--fs-control-stroke-default);
158
+ margin-block: -0.25rem 0.25rem;
159
+ }
160
+ &.bottom {
161
+ border-top: 1px solid var(--fs-control-stroke-default);
162
+ margin-block: 0.25rem -0.25rem;
163
+ }
164
+ /* Every command is a square of at least 40px, the overflow button included. */
165
+ & > :global(.fs-button.fs-menu-command-bar-item) {
166
+ flex: none;
167
+ /* The overflow button is a submenu trigger, which otherwise spans the whole menu. */
168
+ inline-size: 2.5rem;
169
+ min-inline-size: 2.5rem;
170
+ min-block-size: 2.5rem;
171
+ aspect-ratio: 1;
172
+ padding: 0;
173
+ justify-content: center;
174
+ border-radius: var(--fs-control-inner-border-radius);
175
+ }
176
+ & > :global(.fs-menu-command-bar-item svg) {
177
+ flex: none;
178
+ inline-size: 1.25rem;
179
+ block-size: 1.25rem;
180
+ fill: currentColor;
181
+ }
182
+ /* With labels, or with dividers, the commands share the width of the bar evenly, so a divider
183
+ always falls halfway between two of them. The icon-only overflow button stays a square. */
184
+ &.labels,
185
+ &.dividers {
186
+ align-items: stretch;
187
+ & > :global(.fs-button.fs-menu-command-bar-item:not(.fs-submenu-trigger)) {
188
+ flex: 1 0 0;
189
+ inline-size: auto;
190
+ min-inline-size: max-content;
191
+ aspect-ratio: auto;
192
+ }
193
+ & > :global(.fs-button.fs-submenu-trigger) {
194
+ aspect-ratio: auto;
195
+ }
196
+ }
197
+ &.labels > :global(.fs-button.fs-menu-command-bar-item:not(.fs-submenu-trigger)) {
198
+ flex-direction: column;
199
+ gap: 0.25rem;
200
+ padding: 0.375rem 0.75rem;
201
+ font-size: var(--fs-caption-font-size);
202
+ line-height: var(--fs-caption-line-height);
203
+ }
204
+ &.dividers > :global(.fs-button.fs-menu-command-bar-item + .fs-button.fs-menu-command-bar-item::before) {
205
+ content: '';
206
+ position: absolute;
207
+ /* Centered in the gap between the two commands. */
208
+ inset-inline-start: calc(var(--fs-menu-command-bar-gap) / -2 - 0.5px);
209
+ inset-block: 25%;
210
+ inline-size: 1px;
211
+ background: var(--fs-divider-stroke-default);
212
+ pointer-events: none;
213
+ }
214
+ }
215
+ :global(.fs-menu-command-bar-item-label) {
216
+ white-space: nowrap;
217
+ }
218
+ </style>
@@ -0,0 +1,21 @@
1
+ import type { MenuCommandBarProps } from './types.ts';
2
+ /**
3
+ * A row of square, icon-only `MenuCommandBarItem`s, the primary commands of a command bar flyout. It goes at the top or at the bottom of a `MenuList`, and sets itself apart from the items with a divider. An `overflow` snippet adds a "more" button that opens the secondary commands in a submenu.
4
+ *
5
+ * - Usage:
6
+ * ```tsx
7
+ * <MenuList>
8
+ * <MenuCommandBar>
9
+ * <MenuCommandBarItem icon={CutRegular} label="Cut" />
10
+ * <MenuCommandBarItem icon={CopyRegular} label="Copy" />
11
+ * {#snippet overflow()}
12
+ * <MenuItem>Select all</MenuItem>
13
+ * {/snippet}
14
+ * </MenuCommandBar>
15
+ * <MenuItem>Paste</MenuItem>
16
+ * </MenuList>
17
+ * ```
18
+ */
19
+ declare const MenuCommandBar: import("svelte").Component<MenuCommandBarProps, {}, "ref">;
20
+ type MenuCommandBar = ReturnType<typeof MenuCommandBar>;
21
+ export default MenuCommandBar;
@@ -6,11 +6,14 @@
6
6
  const COMPONENT_NAME = 'menu-group';
7
7
  const ID = `${PREFIX}${COMPONENT_NAME}-${FALLBACK_ID}`;
8
8
 
9
- let { ref = $bindable(), header, children }: MenuGroupProps = $props();
9
+ let { ref = $bindable(null), header, children }: MenuGroupProps = $props();
10
10
  </script>
11
11
 
12
- <div class="fs-menu-group" role="group" aria-labelledby="group-name-{ID}" bind:this={ref}>
13
- <h3 id="group-name-{ID}" class="group-name">{header || ID}</h3>
12
+ <div class="fs-menu-group" role="group" aria-labelledby={header ? `group-name-${ID}` : undefined} bind:this={ref}>
13
+ {#if header}
14
+ <!-- A menu holds only items, groups and separators, so the label is plain text that names the group. -->
15
+ <div id="group-name-{ID}" class="group-name" role="presentation">{header}</div>
16
+ {/if}
14
17
  {@render children()}
15
18
  </div>
16
19
 
@@ -12,11 +12,11 @@
12
12
  const ID = `${PREFIX}${COMPONENT_NAME}-${FALLBACK_ID}`;
13
13
 
14
14
  let {
15
- ref = $bindable(),
15
+ ref = $bindable(null),
16
16
  icon: Icon,
17
17
  secondaryContent,
18
18
  children,
19
- checked = $bindable(),
19
+ checked = $bindable(null),
20
20
  disabled,
21
21
  class: classes,
22
22
  id = ID,
@@ -24,6 +24,7 @@
24
24
  value = id as string,
25
25
  subText,
26
26
  onclick,
27
+ onkeydown,
27
28
  ...attributes
28
29
  }: MenuItemActionableProps = $props();
29
30
 
@@ -61,6 +62,7 @@
61
62
  ```
62
63
  -->
63
64
  <Button
65
+ {...attributes}
64
66
  as="button"
65
67
  {disabled}
66
68
  appearance="subtle"
@@ -69,11 +71,10 @@
69
71
  invokeHandlers(e, [e.key !== 'Enter', !!disabled], [onkeydown, () => toggleCheckbox(e, value, name)])}
70
72
  aria-checked={checked}
71
73
  role="menuitemcheckbox"
72
- style={`--margin-left: ${hasIcons && !Icon ? 1.5 : 0}rem;}`}
74
+ style="{attributes.style ?? ''}; --margin-left: {hasIcons && !Icon ? 1.5 : 0}rem;"
73
75
  aria-label={secondaryContent ? `${secondaryContent}, Use ${secondaryContent}` : undefined}
74
76
  class="fs-menu-item-checkbox {hasIcons || hasCheckmarks ? 'align' : ''} {checked ? 'checked' : ''} {classes}"
75
77
  bind:ref
76
- {...attributes}
77
78
  >
78
79
  <span class="label" aria-label="{secondaryContent}, Use {secondaryContent}">
79
80
  <CheckmarkFilled class="indicator" />
@@ -12,17 +12,18 @@
12
12
  const ID = `${PREFIX}${COMPONENT_NAME}-${FALLBACK_ID}`;
13
13
 
14
14
  let {
15
- ref = $bindable(),
15
+ ref = $bindable(null),
16
16
  icon: Icon,
17
17
  secondaryContent,
18
18
  children,
19
- checked = $bindable(),
19
+ checked = $bindable(null),
20
20
  disabled,
21
21
  class: classes,
22
22
  id = ID,
23
23
  name = id as string,
24
24
  value = id as string,
25
25
  onclick,
26
+ onkeydown,
26
27
  subText,
27
28
  ...attributes
28
29
  }: MenuItemActionableProps = $props();
@@ -61,6 +62,7 @@
61
62
  ```
62
63
  -->
63
64
  <Button
65
+ {...attributes}
64
66
  {disabled}
65
67
  appearance="subtle"
66
68
  onclick={(e: MouseEvent) =>
@@ -73,11 +75,10 @@
73
75
  )}
74
76
  aria-checked={checked}
75
77
  role="menuitemradio"
76
- style={`--margin-left: ${hasIcons && !Icon ? 1.5 : 0}rem;}`}
78
+ style="{attributes.style ?? ''}; --margin-left: {hasIcons && !Icon ? 1.5 : 0}rem;"
77
79
  aria-label={secondaryContent ? `${secondaryContent}, Use ${secondaryContent}` : undefined}
78
80
  class="fs-menu-item-radio {hasIcons ? 'align' : ''} {checked ? 'checked' : ''} {classes}"
79
81
  bind:ref
80
- {...attributes}
81
82
  >
82
83
  <span class="label" aria-label="{secondaryContent}, Use {secondaryContent}">
83
84
  <CheckmarkFilled class="indicator" />
@@ -11,11 +11,11 @@
11
11
  const ID = `${PREFIX}${COMPONENT_NAME}-${FALLBACK_ID}`;
12
12
 
13
13
  let {
14
- ref = $bindable(),
14
+ ref = $bindable(null),
15
15
  icon: Icon,
16
16
  secondaryContent,
17
17
  children,
18
- checked = $bindable(),
18
+ checked = $bindable(null),
19
19
  disabled,
20
20
  id = ID,
21
21
  class: classes,
@@ -23,6 +23,7 @@
23
23
  value = id as string,
24
24
  subText,
25
25
  onclick,
26
+ onkeydown,
26
27
  ...attributes
27
28
  }: MenuItemActionableProps = $props();
28
29
 
@@ -62,6 +63,7 @@
62
63
  ```
63
64
  -->
64
65
  <Button
66
+ {...attributes}
65
67
  {disabled}
66
68
  {id}
67
69
  appearance="subtle"
@@ -70,11 +72,10 @@
70
72
  invokeHandlers(e, [e.key !== 'Enter', !!disabled], [onkeydown, () => toggleCheckbox(e, value, name)])}
71
73
  aria-checked={checked}
72
74
  role="menuitemcheckbox"
73
- style={`--margin-left: ${marginLeft}rem;}`}
75
+ style="{attributes.style ?? ''}; --margin-left: {marginLeft}rem;"
74
76
  aria-label={secondaryContent ? `${secondaryContent}, Use ${secondaryContent}` : undefined}
75
77
  class="fs-menu-item-switch {hasIcons || hasCheckmarks ? 'align' : ''} {checked ? 'checked' : ''} {classes}"
76
78
  bind:ref
77
- {...attributes}
78
79
  >
79
80
  <span class="label" aria-label="{secondaryContent}, Use {secondaryContent}">
80
81
  {#if Icon}
@@ -4,14 +4,14 @@
4
4
  import { PREFIX } from '../../internal/constants.js';
5
5
  import { invokeHandlers, RenderSoC } from '../../internal/index.js';
6
6
  import type { MenuItemProps } from './types.js';
7
- import type { ComponentProps } from 'svelte';
7
+ import type { ButtonProps } from '../button/types.js';
8
8
 
9
9
  const FALLBACK_ID = $props.id();
10
10
  const COMPONENT_NAME = 'menu-item';
11
11
  const ID = `${PREFIX}${COMPONENT_NAME}-${FALLBACK_ID}`;
12
12
 
13
13
  let {
14
- ref = $bindable(),
14
+ ref = $bindable(null),
15
15
  icon: Icon,
16
16
  secondaryContent,
17
17
  children,
@@ -23,7 +23,7 @@
23
23
  onkeydown,
24
24
  subText,
25
25
  ...attributes
26
- }: MenuItemProps & ComponentProps<typeof Button> = $props();
26
+ }: MenuItemProps & ButtonProps<'a' | 'button'> = $props();
27
27
 
28
28
  const context = getMenuContext();
29
29
 
@@ -54,6 +54,7 @@
54
54
  ```
55
55
  -->
56
56
  <Button
57
+ {...attributes}
57
58
  {href}
58
59
  {disabled}
59
60
  {id}
@@ -63,10 +64,9 @@
63
64
  onkeydown={(e: KeyboardEvent) =>
64
65
  invokeHandlers(e, [e.key !== 'Enter', persistOnItemActivation, disabled], [onkeydown, toggle])}
65
66
  as={href ? 'a' : 'button'}
66
- style={`--margin-left: ${marginLeft}rem;`}
67
+ style="{attributes.style ?? ''}; --margin-left: {marginLeft}rem;"
67
68
  class="fs-menu-item {hasIcons || hasCheckmarks ? 'align' : ''} {classes}"
68
69
  bind:ref
69
- {...attributes}
70
70
  >
71
71
  <span class="label" aria-label={secondaryContent ? `${secondaryContent}, Use ${secondaryContent}` : undefined}>
72
72
  {#if Icon}