sv5ui-plus 5.0.4 → 5.0.6
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.
- package/README.md +6 -6
- package/dist/adapters/notify.d.ts +1 -1
- package/dist/adapters/notify.js +18 -18
- package/dist/compat.d.ts +2 -2
- package/dist/compat.js +2 -2
- package/dist/components/BentoGrid/BentoCard.svelte +33 -33
- package/dist/components/BentoGrid/BentoCard.svelte.d.ts +1 -1
- package/dist/components/BentoGrid/BentoGrid.svelte +1 -1
- package/dist/components/BentoGrid/BentoGrid.svelte.d.ts +1 -1
- package/dist/components/BentoGrid/bento-grid.types.d.ts +2 -2
- package/dist/components/BentoGrid/bento-grid.variants.d.ts +1 -1
- package/dist/components/BentoGrid/bento-grid.variants.js +10 -10
- package/dist/components/BentoGrid/index.d.ts +4 -4
- package/dist/components/BentoGrid/index.js +4 -4
- package/dist/components/Chart/Chart.svelte +1 -1
- package/dist/components/Chart/Chart.svelte.d.ts +1 -1
- package/dist/components/Chart/chart.types.d.ts +3 -3
- package/dist/components/Chart/index.d.ts +2 -2
- package/dist/components/Chart/index.js +2 -2
- package/dist/components/Chat/ChatBubble.svelte +19 -19
- package/dist/components/Chat/ChatBubble.svelte.d.ts +1 -1
- package/dist/components/Chat/ChatInput.svelte +26 -27
- package/dist/components/Chat/ChatInput.svelte.d.ts +1 -1
- package/dist/components/Chat/ChatMessage.svelte +1 -1
- package/dist/components/Chat/ChatMessage.svelte.d.ts +1 -1
- package/dist/components/Chat/chat.types.d.ts +6 -6
- package/dist/components/Chat/chat.variants.d.ts +1 -1
- package/dist/components/Chat/chat.variants.js +29 -29
- package/dist/components/Chat/index.d.ts +5 -5
- package/dist/components/Chat/index.js +5 -5
- package/dist/components/CodeBlock/CodeBlock.svelte +15 -15
- package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +1 -1
- package/dist/components/CodeBlock/code-block.types.d.ts +5 -5
- package/dist/components/CodeBlock/code-block.variants.d.ts +1 -1
- package/dist/components/CodeBlock/code-block.variants.js +40 -40
- package/dist/components/CodeBlock/index.d.ts +2 -2
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.svelte +93 -97
- package/dist/components/ConfirmDialog/ConfirmDialog.svelte.d.ts +1 -1
- package/dist/components/ConfirmDialog/confirm.d.ts +1 -1
- package/dist/components/ConfirmDialog/confirm.js +9 -9
- package/dist/components/ConfirmDialog/confirm.types.d.ts +4 -4
- package/dist/components/ConfirmDialog/index.d.ts +4 -4
- package/dist/components/ConfirmDialog/index.js +2 -2
- package/dist/components/DatePickerField/DatePickerField.svelte +11 -11
- package/dist/components/DatePickerField/DatePickerField.svelte.d.ts +2 -2
- package/dist/components/DatePickerField/date-picker-field.types.d.ts +1 -1
- package/dist/components/DatePickerField/index.d.ts +2 -2
- package/dist/components/DatePickerField/index.js +1 -1
- package/dist/components/DateRangePickerField/DateRangePickerField.svelte +26 -26
- package/dist/components/DateRangePickerField/DateRangePickerField.svelte.d.ts +2 -2
- package/dist/components/DateRangePickerField/date-range-picker-field.types.d.ts +1 -1
- package/dist/components/DateRangePickerField/index.d.ts +2 -2
- package/dist/components/DateRangePickerField/index.js +1 -1
- package/dist/components/Fonts/Fonts.svelte +12 -12
- package/dist/components/Fonts/Fonts.svelte.d.ts +1 -1
- package/dist/components/Fonts/fonts.d.ts +1 -1
- package/dist/components/Fonts/fonts.js +42 -42
- package/dist/components/Fonts/fonts.types.d.ts +6 -6
- package/dist/components/Fonts/index.d.ts +3 -3
- package/dist/components/Fonts/index.js +2 -2
- package/dist/components/FormSelect/FormSelect.svelte +4 -4
- package/dist/components/FormSelect/FormSelect.svelte.d.ts +2 -2
- package/dist/components/FormSelect/form-select.types.d.ts +3 -3
- package/dist/components/FormSelect/index.d.ts +2 -2
- package/dist/components/FormSelect/index.js +1 -1
- package/dist/components/List/List.svelte +1 -1
- package/dist/components/List/List.svelte.d.ts +1 -1
- package/dist/components/List/ListItem.svelte +31 -39
- package/dist/components/List/ListItem.svelte.d.ts +1 -1
- package/dist/components/List/index.d.ts +4 -4
- package/dist/components/List/index.js +4 -4
- package/dist/components/List/list.types.d.ts +4 -4
- package/dist/components/List/list.variants.d.ts +1 -1
- package/dist/components/List/list.variants.js +22 -22
- package/dist/components/LocaleButton/LocaleButton.svelte +104 -108
- package/dist/components/LocaleButton/LocaleButton.svelte.d.ts +1 -1
- package/dist/components/LocaleButton/index.d.ts +2 -2
- package/dist/components/LocaleButton/index.js +1 -1
- package/dist/components/LocaleButton/locale-button.types.d.ts +12 -12
- package/dist/components/LocaleButton/locale-button.variants.d.ts +2 -2
- package/dist/components/LocaleButton/locale-button.variants.js +68 -68
- package/dist/components/Marquee/Marquee.svelte +34 -34
- package/dist/components/Marquee/Marquee.svelte.d.ts +1 -1
- package/dist/components/Marquee/index.d.ts +3 -3
- package/dist/components/Marquee/index.js +3 -3
- package/dist/components/Marquee/marquee.types.d.ts +4 -4
- package/dist/components/Marquee/marquee.variants.d.ts +1 -1
- package/dist/components/Marquee/marquee.variants.js +15 -15
- package/dist/components/NavigationMenu/NavigationMenu.svelte +366 -379
- package/dist/components/NavigationMenu/NavigationMenu.svelte.d.ts +1 -1
- package/dist/components/NavigationMenu/index.d.ts +2 -2
- package/dist/components/NavigationMenu/index.js +1 -1
- package/dist/components/NavigationMenu/navigation-menu.types.d.ts +17 -17
- package/dist/components/NavigationMenu/navigation-menu.variants.d.ts +1 -1
- package/dist/components/NavigationMenu/navigation-menu.variants.js +177 -177
- package/dist/components/NumberTicker/NumberTicker.svelte +1 -5
- package/dist/components/NumberTicker/NumberTicker.svelte.d.ts +1 -1
- package/dist/components/NumberTicker/index.d.ts +3 -3
- package/dist/components/NumberTicker/index.js +3 -3
- package/dist/components/NumberTicker/number-ticker.types.d.ts +1 -1
- package/dist/components/NumberTicker/number-ticker.variants.d.ts +1 -1
- package/dist/components/NumberTicker/number-ticker.variants.js +3 -3
- package/dist/components/PasswordInput/PasswordInput.svelte +58 -58
- package/dist/components/PasswordInput/PasswordInput.svelte.d.ts +1 -1
- package/dist/components/PasswordInput/index.d.ts +2 -2
- package/dist/components/PasswordInput/index.js +1 -1
- package/dist/components/PasswordInput/password-input.types.d.ts +9 -9
- package/dist/components/PasswordInput/password-input.variants.d.ts +2 -2
- package/dist/components/PasswordInput/password-input.variants.js +62 -62
- package/dist/components/Prose/Prose.svelte +5 -5
- package/dist/components/Prose/Prose.svelte.d.ts +1 -1
- package/dist/components/Prose/index.d.ts +3 -3
- package/dist/components/Prose/index.js +3 -3
- package/dist/components/Prose/prose.types.d.ts +4 -4
- package/dist/components/Prose/prose.variants.d.ts +1 -1
- package/dist/components/Prose/prose.variants.js +27 -27
- package/dist/components/{Resizable/Resizable.svelte → ResizeContainer/ResizeContainer.svelte} +3 -3
- package/dist/components/ResizeContainer/ResizeContainer.svelte.d.ts +4 -0
- package/dist/components/ResizeContainer/index.d.ts +4 -0
- package/dist/components/ResizeContainer/index.js +4 -0
- package/dist/components/ResizeContainer/resize-container.types.d.ts +18 -0
- package/dist/components/ResizeContainer/resize-container.variants.d.ts +30 -0
- package/dist/components/ResizeContainer/resize-container.variants.js +17 -0
- package/dist/components/SafeTable/SafeTable.svelte +74 -74
- package/dist/components/SafeTable/SafeTable.svelte.d.ts +2 -2
- package/dist/components/SafeTable/index.d.ts +2 -2
- package/dist/components/SafeTable/index.js +1 -1
- package/dist/components/SafeTable/safe-table.types.d.ts +1 -1
- package/dist/components/Search/Search.svelte +63 -63
- package/dist/components/Search/Search.svelte.d.ts +1 -1
- package/dist/components/Search/index.d.ts +2 -2
- package/dist/components/Search/index.js +1 -1
- package/dist/components/Search/search.types.d.ts +5 -5
- package/dist/components/SortableGroup/SortableGroup.svelte +16 -10
- package/dist/components/SortableGroup/SortableGroup.svelte.d.ts +3 -3
- package/dist/components/SortableGroup/index.d.ts +1 -1
- package/dist/components/SortableGroup/index.js +1 -1
- package/dist/components/SortableList/SortableList.svelte +49 -46
- package/dist/components/SortableList/SortableList.svelte.d.ts +2 -2
- package/dist/components/SortableList/index.d.ts +2 -2
- package/dist/components/SortableList/index.js +1 -1
- package/dist/components/SortableList/sortable-list.types.d.ts +3 -3
- package/dist/components/Spotlight/Spotlight.svelte +13 -13
- package/dist/components/Spotlight/Spotlight.svelte.d.ts +1 -1
- package/dist/components/Spotlight/index.d.ts +3 -3
- package/dist/components/Spotlight/index.js +3 -3
- package/dist/components/Spotlight/spotlight.types.d.ts +2 -2
- package/dist/components/Spotlight/spotlight.variants.d.ts +1 -1
- package/dist/components/Spotlight/spotlight.variants.js +5 -5
- package/dist/components/TableBulkActionBar/TableBulkActionBar.svelte +23 -23
- package/dist/components/TableBulkActionBar/TableBulkActionBar.svelte.d.ts +1 -1
- package/dist/components/TableBulkActionBar/index.d.ts +2 -2
- package/dist/components/TableBulkActionBar/index.js +1 -1
- package/dist/components/TableBulkActionBar/table-bulk-action-bar.types.d.ts +3 -3
- package/dist/components/TableBulkActionBar/table-bulk-action-bar.variants.d.ts +1 -1
- package/dist/components/TableBulkActionBar/table-bulk-action-bar.variants.js +7 -7
- package/dist/components/TreeView/TreeView.svelte +59 -59
- package/dist/components/TreeView/TreeView.svelte.d.ts +1 -1
- package/dist/components/TreeView/index.d.ts +3 -3
- package/dist/components/TreeView/index.js +2 -2
- package/dist/components/TreeView/tree-view.types.d.ts +4 -4
- package/dist/components/TreeView/tree-view.variants.d.ts +1 -1
- package/dist/components/TreeView/tree-view.variants.js +19 -19
- package/dist/config.d.ts +1 -1
- package/dist/config.js +28 -28
- package/dist/editor.d.ts +1 -1
- package/dist/editor.js +1 -1
- package/dist/form/resolve-form-field-name.js +1 -1
- package/dist/hooks/internal/DragDropProviderScope.svelte +1 -1
- package/dist/hooks/internal/DragDropProviderScope.svelte.d.ts +1 -1
- package/dist/hooks/internal/SortableProvider.svelte +16 -11
- package/dist/hooks/internal/SortableProvider.svelte.d.ts +1 -1
- package/dist/hooks/internal/drag-drop-context.d.ts +1 -1
- package/dist/hooks/internal/drag-drop-context.js +1 -1
- package/dist/hooks/internal/sortable-context.d.ts +6 -6
- package/dist/hooks/internal/sortable-context.js +2 -2
- package/dist/hooks/useDragDrop/index.d.ts +1 -1
- package/dist/hooks/useDragDrop/index.js +1 -1
- package/dist/hooks/useDragDrop/useDragDrop.svelte.d.ts +3 -3
- package/dist/hooks/useDragDrop/useDragDrop.svelte.js +15 -15
- package/dist/hooks/useSortable/index.d.ts +2 -2
- package/dist/hooks/useSortable/index.js +2 -2
- package/dist/hooks/useSortable/useSortable.svelte.d.ts +4 -4
- package/dist/hooks/useSortable/useSortable.svelte.js +23 -23
- package/dist/hooks/utils.js +1 -1
- package/dist/index.d.ts +29 -31
- package/dist/index.js +28 -30
- package/dist/mcp/install-template.mjs +44 -44
- package/dist/mcp/server.mjs +262 -263
- package/dist/mcp/sv5ui-plus-docs.data.json +4 -10
- package/package.json +17 -14
- package/dist/components/ColorPicker/ColorPicker.svelte +0 -109
- package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +0 -4
- package/dist/components/ColorPicker/color-picker.types.d.ts +0 -26
- package/dist/components/ColorPicker/color-picker.variants.d.ts +0 -69
- package/dist/components/ColorPicker/color-picker.variants.js +0 -13
- package/dist/components/ColorPicker/index.d.ts +0 -4
- package/dist/components/ColorPicker/index.js +0 -4
- package/dist/components/Resizable/Resizable.svelte.d.ts +0 -4
- package/dist/components/Resizable/index.d.ts +0 -4
- package/dist/components/Resizable/index.js +0 -4
- package/dist/components/Resizable/resizable.types.d.ts +0 -18
- package/dist/components/Resizable/resizable.types.js +0 -1
- package/dist/components/Resizable/resizable.variants.d.ts +0 -48
- package/dist/components/Resizable/resizable.variants.js +0 -17
- package/dist/components/ScrollArea/ScrollArea.svelte +0 -54
- package/dist/components/ScrollArea/ScrollArea.svelte.d.ts +0 -4
- package/dist/components/ScrollArea/index.d.ts +0 -4
- package/dist/components/ScrollArea/index.js +0 -4
- package/dist/components/ScrollArea/scroll-area.types.d.ts +0 -27
- package/dist/components/ScrollArea/scroll-area.types.js +0 -1
- package/dist/components/ScrollArea/scroll-area.variants.d.ts +0 -45
- package/dist/components/ScrollArea/scroll-area.variants.js +0 -27
- /package/dist/components/{ColorPicker/color-picker.types.js → ResizeContainer/resize-container.types.js} +0 -0
|
@@ -210,414 +210,401 @@ $effect(() => () => clearTimeout(flyoutTimer));
|
|
|
210
210
|
</script>
|
|
211
211
|
|
|
212
212
|
{#snippet leading(item: NavigationMenuItem, index: number, open: boolean)}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
213
|
+
{#if itemLeading}
|
|
214
|
+
{@render itemLeading({ item, index, active: !!item.active, open })}
|
|
215
|
+
{:else if item.avatar}
|
|
216
|
+
{#if item.chip}
|
|
217
|
+
<Chip
|
|
218
|
+
inset
|
|
219
|
+
{...typeof item.chip === "object" ? item.chip : {}}
|
|
220
|
+
class={classes.linkLeadingAvatar}
|
|
221
|
+
>
|
|
222
|
+
<Avatar size="2xs" {...item.avatar} />
|
|
223
|
+
</Chip>
|
|
224
|
+
{:else}
|
|
225
|
+
<Avatar size="2xs" {...item.avatar} class={classes.linkLeadingAvatar} />
|
|
226
|
+
{/if}
|
|
227
|
+
{:else if item.icon}
|
|
228
|
+
<Icon name={item.icon} class={classes.linkLeadingIcon} />
|
|
229
|
+
{/if}
|
|
230
230
|
{/snippet}
|
|
231
231
|
|
|
232
232
|
{#snippet label(item: NavigationMenuItem, index: number, open: boolean)}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
233
|
+
{#if itemLabel}
|
|
234
|
+
{@render itemLabel({ item, index, active: !!item.active, open })}
|
|
235
|
+
{:else}
|
|
236
|
+
<span class={classes.linkLabel}>{itemLabelText(item)}</span>
|
|
237
|
+
{#if externalIcon !== false && isExternal(item.href)}
|
|
238
|
+
<Icon
|
|
239
|
+
name={typeof externalIcon === "string" ? externalIcon : icons.external}
|
|
240
|
+
class={classes.linkLabelExternalIcon}
|
|
241
|
+
/>
|
|
242
|
+
{/if}
|
|
243
|
+
{/if}
|
|
244
244
|
{/snippet}
|
|
245
245
|
|
|
246
246
|
{#snippet trailing(item: NavigationMenuItem, index: number, open: boolean, isTrigger: boolean)}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
247
|
+
{#if itemTrailing}
|
|
248
|
+
{@render itemTrailing({ item, index, active: !!item.active, open })}
|
|
249
|
+
{:else}
|
|
250
|
+
<span class={classes.linkTrailing}>
|
|
251
|
+
{#if item.badge !== undefined}
|
|
252
|
+
<Badge
|
|
253
|
+
size="sm"
|
|
254
|
+
color="surface"
|
|
255
|
+
variant="soft"
|
|
256
|
+
{...typeof item.badge === "object" ? item.badge : { label: item.badge }}
|
|
257
|
+
class={classes.linkTrailingBadge}
|
|
258
|
+
/>
|
|
259
|
+
{/if}
|
|
260
|
+
{#if isTrigger}
|
|
261
|
+
<Icon
|
|
262
|
+
name={item.trailingIcon ?? trailingIcon}
|
|
263
|
+
class={[classes.linkTrailingIcon, open ? "rotate-180" : ""]}
|
|
264
|
+
/>
|
|
265
|
+
{/if}
|
|
266
|
+
</span>
|
|
267
|
+
{/if}
|
|
268
268
|
{/snippet}
|
|
269
269
|
|
|
270
270
|
{#snippet linkBody(item: NavigationMenuItem, index: number, open: boolean, isTrigger: boolean)}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
{/if}
|
|
271
|
+
{@render leading(item, index, open)}
|
|
272
|
+
{@render label(item, index, open)}
|
|
273
|
+
{@render trailing(item, index, open, isTrigger)}
|
|
274
|
+
{#if (effectiveCollapsed || stacked) && item.badge !== undefined}
|
|
275
|
+
<span class={classes.linkBadgeDot} data-navigation-menu-badge-dot="" aria-hidden="true"></span>
|
|
276
|
+
{/if}
|
|
278
277
|
{/snippet}
|
|
279
278
|
|
|
280
279
|
{#snippet childLink(sub: NavigationMenuChildItem)}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
</li>
|
|
324
|
-
{/if}
|
|
280
|
+
{#if sub.children?.length}
|
|
281
|
+
<li class={classes.childGroup}>
|
|
282
|
+
<p class={classes.childGroupLabel}>{sub.label}</p>
|
|
283
|
+
<ul class={classes.childGroupList}>
|
|
284
|
+
{#each sub.children as grandchild, gi (grandchild.href ?? gi)}
|
|
285
|
+
{@render childLink(grandchild)}
|
|
286
|
+
{/each}
|
|
287
|
+
</ul>
|
|
288
|
+
</li>
|
|
289
|
+
{:else}
|
|
290
|
+
{@const active = isItemActive(sub.active, sub.href, sub.exact)}
|
|
291
|
+
<li class={classes.childItem}>
|
|
292
|
+
<Link
|
|
293
|
+
href={safeHref(sub.href)}
|
|
294
|
+
target={sub.target}
|
|
295
|
+
raw
|
|
296
|
+
exact={sub.exact ?? exact}
|
|
297
|
+
{active}
|
|
298
|
+
onclick={sub.onSelect}
|
|
299
|
+
data-active={active ? "" : undefined}
|
|
300
|
+
class={[classes.childLink, sub.class]}
|
|
301
|
+
>
|
|
302
|
+
{#if sub.icon}
|
|
303
|
+
<Icon name={sub.icon} class={classes.childLinkIcon} />
|
|
304
|
+
{/if}
|
|
305
|
+
<span class={classes.childLinkWrapper}>
|
|
306
|
+
<span class="inline-flex items-center gap-1">
|
|
307
|
+
<span class={classes.childLinkLabel}>{sub.label}</span>
|
|
308
|
+
{#if externalIcon !== false && isExternal(sub.href)}
|
|
309
|
+
<Icon
|
|
310
|
+
name={typeof externalIcon === "string" ? externalIcon : icons.external}
|
|
311
|
+
class={classes.linkLabelExternalIcon}
|
|
312
|
+
/>
|
|
313
|
+
{/if}
|
|
314
|
+
</span>
|
|
315
|
+
{#if sub.description}
|
|
316
|
+
<span class={classes.childLinkDescription}>{sub.description}</span>
|
|
317
|
+
{/if}
|
|
318
|
+
</span>
|
|
319
|
+
</Link>
|
|
320
|
+
</li>
|
|
321
|
+
{/if}
|
|
325
322
|
{/snippet}
|
|
326
323
|
|
|
327
324
|
{#snippet megaContent(item: NavigationMenuItem, index: number)}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
325
|
+
{#if itemContent}
|
|
326
|
+
{@render itemContent({ item, index })}
|
|
327
|
+
{:else}
|
|
328
|
+
<ul class={classes.childList}>
|
|
329
|
+
{#each item.children ?? [] as child, ci (child.href ?? ci)}
|
|
330
|
+
{@render childLink(child)}
|
|
331
|
+
{/each}
|
|
332
|
+
</ul>
|
|
333
|
+
{/if}
|
|
337
334
|
{/snippet}
|
|
338
335
|
|
|
339
336
|
{#snippet horizontalMenu()}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
{/if}
|
|
427
|
-
</Bits.List>
|
|
428
|
-
<div class={classes.viewportWrapper}>
|
|
429
|
-
<Bits.Viewport {...contentProps} class={classes.viewport} />
|
|
430
|
-
</div>
|
|
431
|
-
</Bits.Root>
|
|
337
|
+
<Bits.Root
|
|
338
|
+
bind:ref
|
|
339
|
+
value={horizontalValue}
|
|
340
|
+
onValueChange={(v) => emit(v || undefined)}
|
|
341
|
+
orientation="horizontal"
|
|
342
|
+
{delayDuration}
|
|
343
|
+
{skipDelayDuration}
|
|
344
|
+
class={classes.root}
|
|
345
|
+
{...restProps as Record<string, unknown>}
|
|
346
|
+
>
|
|
347
|
+
<Bits.List bind:ref={listEl} class={classes.list}>
|
|
348
|
+
{#if showHighlight}
|
|
349
|
+
<div
|
|
350
|
+
class={classes.highlight}
|
|
351
|
+
style={highlightStyle}
|
|
352
|
+
data-navigation-menu-highlight=""
|
|
353
|
+
aria-hidden="true"
|
|
354
|
+
></div>
|
|
355
|
+
{/if}
|
|
356
|
+
{#if listLeading}{@render listLeading()}{/if}
|
|
357
|
+
{#each groups as group, gi (gi)}
|
|
358
|
+
{#each group as item, index (itemValue(item, gi, index))}
|
|
359
|
+
{@const iv = itemValue(item, gi, index)}
|
|
360
|
+
{@const kind = resolvedType(item)}
|
|
361
|
+
{@const open = openSet.has(iv)}
|
|
362
|
+
{#if itemSlot}
|
|
363
|
+
<Bits.Item value={iv} class={classes.item}>
|
|
364
|
+
{@render itemSlot({ item, index, active: !!item.active, open })}
|
|
365
|
+
</Bits.Item>
|
|
366
|
+
{:else if kind === "label"}
|
|
367
|
+
<li class={classes.label}>{itemLabelText(item)}</li>
|
|
368
|
+
{:else if isDropdown(item)}
|
|
369
|
+
<Bits.Item value={iv} openOnHover={!disableHoverTrigger} class={classes.item}>
|
|
370
|
+
<Bits.Trigger disabled={disabled || item.disabled}>
|
|
371
|
+
{#snippet child({ props }: { props: Record<string, unknown> })}
|
|
372
|
+
<button
|
|
373
|
+
{...disableClickTrigger ? { ...props, onclick: blockClick } : props}
|
|
374
|
+
class={linkClass(item)}
|
|
375
|
+
data-active={item.active ? "" : undefined}
|
|
376
|
+
>
|
|
377
|
+
{@render linkBody(item, index, open, true)}
|
|
378
|
+
</button>
|
|
379
|
+
{/snippet}
|
|
380
|
+
</Bits.Trigger>
|
|
381
|
+
<Bits.Content {...contentProps} class={classes.content}>
|
|
382
|
+
{@render megaContent(item, index)}
|
|
383
|
+
</Bits.Content>
|
|
384
|
+
</Bits.Item>
|
|
385
|
+
{:else}
|
|
386
|
+
{@const active = isItemActive(item.active, item.href, item.exact)}
|
|
387
|
+
{@const href = safeHref(item.href)}
|
|
388
|
+
<Bits.Item value={iv} class={classes.item}>
|
|
389
|
+
<Bits.Link {href} {active} onSelect={item.onSelect}>
|
|
390
|
+
{#snippet child({ props }: { props: Record<string, unknown> })}
|
|
391
|
+
<Link
|
|
392
|
+
{href}
|
|
393
|
+
target={item.target}
|
|
394
|
+
raw
|
|
395
|
+
exact={item.exact ?? exact}
|
|
396
|
+
{active}
|
|
397
|
+
disabled={disabled || item.disabled}
|
|
398
|
+
{...props}
|
|
399
|
+
class={linkClass(item)}
|
|
400
|
+
>
|
|
401
|
+
{@render linkBody(item, index, open, false)}
|
|
402
|
+
</Link>
|
|
403
|
+
{/snippet}
|
|
404
|
+
</Bits.Link>
|
|
405
|
+
</Bits.Item>
|
|
406
|
+
{/if}
|
|
407
|
+
{/each}
|
|
408
|
+
{#if gi < groups.length - 1}
|
|
409
|
+
<li role="separator" aria-orientation="vertical" class={classes.separator}></li>
|
|
410
|
+
{/if}
|
|
411
|
+
{/each}
|
|
412
|
+
{#if listTrailing}{@render listTrailing()}{/if}
|
|
413
|
+
{#if arrow}
|
|
414
|
+
<Bits.Indicator class={classes.indicator}>
|
|
415
|
+
<div class={classes.arrow}></div>
|
|
416
|
+
</Bits.Indicator>
|
|
417
|
+
{/if}
|
|
418
|
+
</Bits.List>
|
|
419
|
+
<div class={classes.viewportWrapper}>
|
|
420
|
+
<Bits.Viewport {...contentProps} class={classes.viewport} />
|
|
421
|
+
</div>
|
|
422
|
+
</Bits.Root>
|
|
432
423
|
{/snippet}
|
|
433
424
|
|
|
434
425
|
{#snippet verticalLeaf(item: NavigationMenuItem, index: number)}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
426
|
+
{@const active = isItemActive(item.active, item.href, item.exact)}
|
|
427
|
+
{@const collapsedTip = effectiveCollapsed && !stacked && (item.tooltip ?? tooltip)}
|
|
428
|
+
{#if collapsedTip}
|
|
429
|
+
<Tooltip text={itemLabelText(item)} side="right" {...asProps(item.tooltip ?? tooltip)}>
|
|
430
|
+
<Link
|
|
431
|
+
href={safeHref(item.href)}
|
|
432
|
+
target={item.target}
|
|
433
|
+
raw
|
|
434
|
+
exact={item.exact ?? exact}
|
|
435
|
+
{active}
|
|
436
|
+
disabled={disabled || item.disabled}
|
|
437
|
+
onclick={item.onSelect}
|
|
438
|
+
data-active={active ? "" : undefined}
|
|
439
|
+
class={linkClass(item)}
|
|
440
|
+
>
|
|
441
|
+
{@render linkBody(item, index, false, false)}
|
|
442
|
+
</Link>
|
|
443
|
+
</Tooltip>
|
|
444
|
+
{:else}
|
|
445
|
+
<Link
|
|
446
|
+
href={safeHref(item.href)}
|
|
447
|
+
target={item.target}
|
|
448
|
+
raw
|
|
449
|
+
exact={item.exact ?? exact}
|
|
450
|
+
{active}
|
|
451
|
+
disabled={disabled || item.disabled}
|
|
452
|
+
onclick={item.onSelect}
|
|
453
|
+
data-active={active ? "" : undefined}
|
|
454
|
+
class={linkClass(item)}
|
|
455
|
+
>
|
|
456
|
+
{@render linkBody(item, index, false, false)}
|
|
457
|
+
</Link>
|
|
458
|
+
{/if}
|
|
468
459
|
{/snippet}
|
|
469
460
|
|
|
470
461
|
{#snippet verticalItem(item: NavigationMenuItem, index: number, groupIndex: number)}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
462
|
+
{@const iv = itemValue(item, groupIndex, index)}
|
|
463
|
+
{@const kind = resolvedType(item)}
|
|
464
|
+
{@const open = openSet.has(iv)}
|
|
465
|
+
<li class={[classes.item, itemActions ? "group/nav-row relative" : ""]}>
|
|
466
|
+
{#if itemSlot}
|
|
467
|
+
{@render itemSlot({ item, index, active: !!item.active, open })}
|
|
468
|
+
{:else if kind === "label"}
|
|
469
|
+
<div class={classes.label}>
|
|
470
|
+
{itemLabelText(item)}
|
|
471
|
+
{#if itemActions}
|
|
472
|
+
<span class={classes.labelActions}>
|
|
473
|
+
{@render itemActions({ item, index, active: !!item.active, open })}
|
|
474
|
+
</span>
|
|
475
|
+
{/if}
|
|
476
|
+
</div>
|
|
477
|
+
{:else if isDropdown(item)}
|
|
478
|
+
{#if effectiveCollapsed}
|
|
479
|
+
<Popover
|
|
480
|
+
side="right"
|
|
481
|
+
sideOffset={8}
|
|
482
|
+
{...asProps(item.popover ?? popover)}
|
|
483
|
+
open={flyoutKey === iv}
|
|
484
|
+
onOpenChange={(open) => handleFlyoutChange(open, iv)}
|
|
485
|
+
ui={{
|
|
486
|
+
content:
|
|
487
|
+
"origin-left data-[state=open]:animate-[zoom-in_150ms_ease] data-[state=closed]:animate-[zoom-out_150ms_ease]",
|
|
488
|
+
}}
|
|
489
|
+
>
|
|
490
|
+
<span
|
|
491
|
+
role="button"
|
|
492
|
+
tabindex={disabled || item.disabled ? undefined : 0}
|
|
493
|
+
aria-expanded={flyoutKey === iv}
|
|
494
|
+
class={linkClass(item)}
|
|
495
|
+
onpointerenter={() => openFlyout(iv)}
|
|
496
|
+
onpointerleave={closeFlyoutSoon}
|
|
497
|
+
onclickcapture={(e) => {
|
|
498
|
+
e.stopPropagation();
|
|
499
|
+
openFlyout(iv);
|
|
500
|
+
}}
|
|
501
|
+
onkeydown={(e) => {
|
|
502
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
503
|
+
e.preventDefault();
|
|
504
|
+
openFlyout(iv);
|
|
505
|
+
}}
|
|
506
|
+
>
|
|
507
|
+
{@render linkBody(item, index, false, false)}
|
|
508
|
+
</span>
|
|
509
|
+
{#snippet content()}
|
|
510
|
+
<div
|
|
511
|
+
role="presentation"
|
|
512
|
+
class="min-w-52 p-1"
|
|
513
|
+
onpointerenter={() => clearTimeout(flyoutTimer)}
|
|
514
|
+
onpointerleave={closeFlyoutSoon}
|
|
515
|
+
>
|
|
516
|
+
{#if itemContent}
|
|
517
|
+
{@render itemContent({ item, index })}
|
|
518
|
+
{:else}
|
|
519
|
+
<p class={classes.childLabel}>{itemLabelText(item)}</p>
|
|
520
|
+
<ul class="grid gap-0.5">
|
|
521
|
+
{#each item.children ?? [] as child, ci (child.href ?? ci)}
|
|
522
|
+
{@render childLink(child)}
|
|
523
|
+
{/each}
|
|
524
|
+
</ul>
|
|
525
|
+
{/if}
|
|
526
|
+
</div>
|
|
527
|
+
{/snippet}
|
|
528
|
+
</Popover>
|
|
529
|
+
{:else}
|
|
530
|
+
<button
|
|
531
|
+
type="button"
|
|
532
|
+
class={linkClass(item)}
|
|
533
|
+
aria-expanded={open}
|
|
534
|
+
disabled={disabled || item.disabled || !collapsible}
|
|
535
|
+
data-state={open ? "open" : "closed"}
|
|
536
|
+
onclick={() => toggleOpen(iv)}
|
|
537
|
+
>
|
|
538
|
+
{@render linkBody(item, index, open, true)}
|
|
539
|
+
</button>
|
|
540
|
+
{#if open}
|
|
541
|
+
<ul class={classes.childList} transition:slide={{ duration: 200 }}>
|
|
542
|
+
{#each item.children ?? [] as child, ci (child.href ?? ci)}
|
|
543
|
+
{@render childLink(child)}
|
|
544
|
+
{/each}
|
|
545
|
+
</ul>
|
|
546
|
+
{/if}
|
|
547
|
+
{/if}
|
|
548
|
+
{:else}
|
|
549
|
+
{@render verticalLeaf(item, index)}
|
|
550
|
+
{#if itemActions}
|
|
551
|
+
<div class={classes.itemActions}>
|
|
552
|
+
{@render itemActions({ item, index, active: !!item.active, open })}
|
|
553
|
+
</div>
|
|
554
|
+
{/if}
|
|
555
|
+
{/if}
|
|
556
|
+
</li>
|
|
566
557
|
{/snippet}
|
|
567
558
|
|
|
568
559
|
{#snippet verticalMenu()}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
{/each}
|
|
598
|
-
{#if listTrailing}{@render listTrailing()}{/if}
|
|
599
|
-
</ul>
|
|
600
|
-
</svelte:element>
|
|
560
|
+
<svelte:element
|
|
561
|
+
this={as}
|
|
562
|
+
bind:this={ref}
|
|
563
|
+
aria-label="Navigation"
|
|
564
|
+
class={classes.root}
|
|
565
|
+
{...restProps}
|
|
566
|
+
>
|
|
567
|
+
<ul bind:this={listEl} class={classes.list}>
|
|
568
|
+
{#if showHighlight}
|
|
569
|
+
<div
|
|
570
|
+
class={classes.highlight}
|
|
571
|
+
style={highlightStyle}
|
|
572
|
+
data-navigation-menu-highlight=""
|
|
573
|
+
aria-hidden="true"
|
|
574
|
+
></div>
|
|
575
|
+
{/if}
|
|
576
|
+
{#if listLeading}{@render listLeading()}{/if}
|
|
577
|
+
{#each groups as group, gi (gi)}
|
|
578
|
+
{#each group as item, index (itemValue(item, gi, index))}
|
|
579
|
+
{@render verticalItem(item, index, gi)}
|
|
580
|
+
{/each}
|
|
581
|
+
{#if gi < groups.length - 1}
|
|
582
|
+
<li role="separator" aria-orientation="horizontal" class={classes.separator}></li>
|
|
583
|
+
{/if}
|
|
584
|
+
{/each}
|
|
585
|
+
{#if listTrailing}{@render listTrailing()}{/if}
|
|
586
|
+
</ul>
|
|
587
|
+
</svelte:element>
|
|
601
588
|
{/snippet}
|
|
602
589
|
|
|
603
590
|
{#if showDrawer}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
{:else if orientation ===
|
|
620
|
-
|
|
591
|
+
<Button
|
|
592
|
+
icon={drawerOpen ? icons.close : icons.menu}
|
|
593
|
+
variant="ghost"
|
|
594
|
+
color="surface"
|
|
595
|
+
aria-label="Toggle navigation"
|
|
596
|
+
aria-expanded={drawerOpen}
|
|
597
|
+
onclick={() => (drawerOpen = !drawerOpen)}
|
|
598
|
+
/>
|
|
599
|
+
<Drawer bind:open={drawerOpen} direction="left" {...drawerProps}>
|
|
600
|
+
{#snippet body()}
|
|
601
|
+
<div style="width: {drawerWidth}">
|
|
602
|
+
{@render verticalMenu()}
|
|
603
|
+
</div>
|
|
604
|
+
{/snippet}
|
|
605
|
+
</Drawer>
|
|
606
|
+
{:else if orientation === "horizontal"}
|
|
607
|
+
{@render horizontalMenu()}
|
|
621
608
|
{:else}
|
|
622
|
-
|
|
609
|
+
{@render verticalMenu()}
|
|
623
610
|
{/if}
|