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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const spotlightVariants = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
root:
|
|
5
|
-
spotlight:
|
|
6
|
-
content:
|
|
7
|
-
}
|
|
4
|
+
root: "relative overflow-hidden group",
|
|
5
|
+
spotlight: "pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100",
|
|
6
|
+
content: "relative z-10 h-full w-full",
|
|
7
|
+
},
|
|
8
8
|
});
|
|
@@ -9,30 +9,30 @@ const slots = $derived(tableBulkActionBarVariants());
|
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<div
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
class={slots.root({ class: [ui?.root, className] })}
|
|
13
|
+
transition:fly={{ y: 20, duration: 250 }}
|
|
14
|
+
{...restProps}
|
|
15
15
|
>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
<div class={slots.content({ class: ui?.content })}>
|
|
17
|
+
<span class={slots.countBadge({ class: ui?.countBadge })}>{count}</span>
|
|
18
|
+
<span class="opacity-90">{text}</span>
|
|
19
|
+
</div>
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
{#if children}
|
|
22
|
+
<div class={slots.actions({ class: ui?.actions })}>
|
|
23
|
+
{@render children()}
|
|
24
|
+
</div>
|
|
25
|
+
{/if}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
<div class={slots.clearButton({ class: ui?.clearButton })}>
|
|
28
|
+
<Button
|
|
29
|
+
variant="ghost"
|
|
30
|
+
color="surface"
|
|
31
|
+
size="sm"
|
|
32
|
+
icon="lucide:x"
|
|
33
|
+
onclick={onClear}
|
|
34
|
+
class="h-8 w-8 !p-0 rounded-full"
|
|
35
|
+
aria-label="Clear selection"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
38
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TableBulkActionBarProps } from
|
|
1
|
+
import type { TableBulkActionBarProps } from "./table-bulk-action-bar.types.js";
|
|
2
2
|
export type Props = TableBulkActionBarProps;
|
|
3
3
|
declare const TableBulkActionBar: import("svelte").Component<TableBulkActionBarProps, {}, "">;
|
|
4
4
|
type TableBulkActionBar = ReturnType<typeof TableBulkActionBar>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as TableBulkActionBar } from
|
|
2
|
-
export type { TableBulkActionBarProps } from
|
|
1
|
+
export { default as TableBulkActionBar } from "./TableBulkActionBar.svelte";
|
|
2
|
+
export type { TableBulkActionBarProps } from "./table-bulk-action-bar.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as TableBulkActionBar } from
|
|
1
|
+
export { default as TableBulkActionBar } from "./TableBulkActionBar.svelte";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
2
|
-
import type { ClassNameValue } from
|
|
3
|
-
import type { TableBulkActionBarSlots } from
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { ClassNameValue } from "tailwind-merge";
|
|
3
|
+
import type { TableBulkActionBarSlots } from "./table-bulk-action-bar.variants.js";
|
|
4
4
|
export type TableBulkActionBarProps = {
|
|
5
5
|
/**
|
|
6
6
|
* The number of selected items to display.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
2
|
export declare const tableBulkActionBarVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
[key: string]: {
|
|
4
4
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const tableBulkActionBarVariants = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
root:
|
|
5
|
-
content:
|
|
6
|
-
countBadge:
|
|
7
|
-
actions:
|
|
8
|
-
clearButton:
|
|
9
|
-
}
|
|
4
|
+
root: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center justify-between gap-6 rounded-2xl border border-outline-variant/50 bg-surface/95 px-4 py-3 shadow-xl shadow-surface-container-highest/20 backdrop-blur-md",
|
|
5
|
+
content: "flex items-center gap-3 text-sm text-on-surface whitespace-nowrap",
|
|
6
|
+
countBadge: "font-semibold bg-primary text-on-primary px-2 py-0.5 rounded-full text-xs flex items-center justify-center min-w-[20px]",
|
|
7
|
+
actions: "flex items-center gap-2 border-l border-outline-variant/50 pl-4",
|
|
8
|
+
clearButton: "",
|
|
9
|
+
},
|
|
10
10
|
});
|
|
@@ -27,69 +27,69 @@ function handleRowClick(e, item) {
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
{#snippet renderTree(treeItems: TreeItem[])}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<div class={styles.item()}>
|
|
37
|
-
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
38
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
39
|
-
<div
|
|
40
|
-
class={twMerge(
|
|
41
|
-
styles.itemRow(),
|
|
42
|
-
isSelected && styles.itemRowActive(),
|
|
43
|
-
item.disabled && styles.itemRowDisabled()
|
|
44
|
-
)}
|
|
45
|
-
onclick={(e) => handleRowClick(e, item)}
|
|
46
|
-
>
|
|
47
|
-
<!-- Chevron / Spacer -->
|
|
48
|
-
<div class={styles.chevronWrapper()}>
|
|
49
|
-
{#if hasChildren}
|
|
50
|
-
<button
|
|
51
|
-
type="button"
|
|
52
|
-
class="w-full h-full flex items-center justify-center outline-none"
|
|
53
|
-
onclick={(e) => {
|
|
54
|
-
if (!expandOnRowClick) toggleExpand(e, item)
|
|
55
|
-
}}
|
|
56
|
-
tabindex="-1"
|
|
57
|
-
disabled={item.disabled}
|
|
58
|
-
>
|
|
59
|
-
<Icon
|
|
60
|
-
name="lucide:chevron-right"
|
|
61
|
-
class={twMerge(styles.chevron(), isExpanded && 'rotate-90')}
|
|
62
|
-
/>
|
|
63
|
-
</button>
|
|
64
|
-
{/if}
|
|
65
|
-
</div>
|
|
30
|
+
<div class={styles.root()}>
|
|
31
|
+
{#each treeItems as item}
|
|
32
|
+
{@const hasChildren = item.children && item.children.length > 0}
|
|
33
|
+
{@const isExpanded = expandedSet.has(item.id)}
|
|
34
|
+
{@const isSelected = selectedSet.has(item.id)}
|
|
66
35
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
36
|
+
<div class={styles.item()}>
|
|
37
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
38
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
39
|
+
<div
|
|
40
|
+
class={twMerge(
|
|
41
|
+
styles.itemRow(),
|
|
42
|
+
isSelected && styles.itemRowActive(),
|
|
43
|
+
item.disabled && styles.itemRowDisabled(),
|
|
44
|
+
)}
|
|
45
|
+
onclick={(e) => handleRowClick(e, item)}
|
|
46
|
+
>
|
|
47
|
+
<!-- Chevron / Spacer -->
|
|
48
|
+
<div class={styles.chevronWrapper()}>
|
|
49
|
+
{#if hasChildren}
|
|
50
|
+
<button
|
|
51
|
+
type="button"
|
|
52
|
+
class="w-full h-full flex items-center justify-center outline-none"
|
|
53
|
+
onclick={(e) => {
|
|
54
|
+
if (!expandOnRowClick) toggleExpand(e, item);
|
|
55
|
+
}}
|
|
56
|
+
tabindex="-1"
|
|
57
|
+
disabled={item.disabled}
|
|
58
|
+
>
|
|
59
|
+
<Icon
|
|
60
|
+
name="lucide:chevron-right"
|
|
61
|
+
class={twMerge(styles.chevron(), isExpanded && "rotate-90")}
|
|
62
|
+
/>
|
|
63
|
+
</button>
|
|
64
|
+
{/if}
|
|
65
|
+
</div>
|
|
71
66
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{:else}
|
|
77
|
-
{item.label}
|
|
78
|
-
{/if}
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
67
|
+
<!-- Icon -->
|
|
68
|
+
{#if item.icon}
|
|
69
|
+
<Icon name={item.icon} class={styles.icon()} />
|
|
70
|
+
{/if}
|
|
81
71
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
<!-- Label -->
|
|
73
|
+
<div class={styles.label()}>
|
|
74
|
+
{#if labelSnippet}
|
|
75
|
+
{@render labelSnippet(item)}
|
|
76
|
+
{:else}
|
|
77
|
+
{item.label}
|
|
78
|
+
{/if}
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<!-- Children -->
|
|
83
|
+
{#if hasChildren && isExpanded}
|
|
84
|
+
<div class={styles.childrenWrapper()}>
|
|
85
|
+
{@render renderTree(item.children!)}
|
|
86
|
+
</div>
|
|
87
|
+
{/if}
|
|
88
|
+
</div>
|
|
89
|
+
{/each}
|
|
90
|
+
</div>
|
|
91
91
|
{/snippet}
|
|
92
92
|
|
|
93
93
|
<div class={className} {...restProps}>
|
|
94
|
-
|
|
94
|
+
{@render renderTree(items)}
|
|
95
95
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TreeViewProps } from
|
|
1
|
+
import type { TreeViewProps } from "./tree-view.types.js";
|
|
2
2
|
declare const TreeView: import("svelte").Component<TreeViewProps, {}, "expandedIds">;
|
|
3
3
|
type TreeView = ReturnType<typeof TreeView>;
|
|
4
4
|
export default TreeView;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import TreeView from
|
|
1
|
+
import TreeView from "./TreeView.svelte";
|
|
2
2
|
export { TreeView };
|
|
3
|
-
export type { TreeViewProps, TreeItem as TreeViewItem } from
|
|
4
|
-
export * from
|
|
3
|
+
export type { TreeViewProps, TreeItem as TreeViewItem } from "./tree-view.types.js";
|
|
4
|
+
export * from "./tree-view.variants.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import TreeView from
|
|
1
|
+
import TreeView from "./TreeView.svelte";
|
|
2
2
|
export { TreeView };
|
|
3
|
-
export * from
|
|
3
|
+
export * from "./tree-view.variants.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { HTMLAttributes } from
|
|
2
|
-
import type { TreeViewVariantProps } from
|
|
3
|
-
import type { Snippet } from
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import type { TreeViewVariantProps } from "./tree-view.variants.js";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
4
|
export interface TreeItem {
|
|
5
5
|
/**
|
|
6
6
|
* Unique identifier for the item.
|
|
@@ -43,7 +43,7 @@ export interface TreeViewProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
43
43
|
/**
|
|
44
44
|
* Component size.
|
|
45
45
|
*/
|
|
46
|
-
size?: TreeViewVariantProps[
|
|
46
|
+
size?: TreeViewVariantProps["size"];
|
|
47
47
|
/**
|
|
48
48
|
* Whether clicking the row expands the item, or only clicking the chevron expands it.
|
|
49
49
|
* @default true
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const treeViewVariants = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
root:
|
|
5
|
-
item:
|
|
6
|
-
itemRow:
|
|
7
|
-
itemRowActive:
|
|
8
|
-
itemRowDisabled:
|
|
9
|
-
chevronWrapper:
|
|
10
|
-
chevron:
|
|
11
|
-
icon:
|
|
12
|
-
label:
|
|
13
|
-
childrenWrapper:
|
|
4
|
+
root: "flex flex-col text-sm",
|
|
5
|
+
item: "flex flex-col",
|
|
6
|
+
itemRow: "flex items-center gap-1.5 py-1.5 px-2 rounded-md hover:bg-surface-100 dark:hover:bg-surface-800 cursor-pointer select-none transition-colors text-surface-900 dark:text-surface-50",
|
|
7
|
+
itemRowActive: "bg-primary-50 dark:bg-primary-900/30 text-primary-900 dark:text-primary-100",
|
|
8
|
+
itemRowDisabled: "opacity-50 cursor-not-allowed hover:bg-transparent dark:hover:bg-transparent",
|
|
9
|
+
chevronWrapper: "flex items-center justify-center w-5 h-5 shrink-0 rounded hover:bg-surface-200 dark:hover:bg-surface-700 transition-colors",
|
|
10
|
+
chevron: "w-4 h-4 transition-transform duration-200",
|
|
11
|
+
icon: "w-4 h-4 shrink-0 text-surface-500 dark:text-surface-400",
|
|
12
|
+
label: "truncate flex-1",
|
|
13
|
+
childrenWrapper: "flex flex-col pl-4 ml-2.5 border-l border-outline-variant/50 mt-1",
|
|
14
14
|
},
|
|
15
15
|
variants: {
|
|
16
16
|
size: {
|
|
17
17
|
sm: {
|
|
18
|
-
itemRow:
|
|
19
|
-
chevron:
|
|
20
|
-
icon:
|
|
18
|
+
itemRow: "py-1 text-xs",
|
|
19
|
+
chevron: "w-3 h-3",
|
|
20
|
+
icon: "w-3 h-3",
|
|
21
21
|
},
|
|
22
22
|
md: {
|
|
23
|
-
itemRow:
|
|
24
|
-
}
|
|
25
|
-
}
|
|
23
|
+
itemRow: "py-1.5 text-sm",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
26
|
},
|
|
27
27
|
defaultVariants: {
|
|
28
|
-
size:
|
|
29
|
-
}
|
|
28
|
+
size: "md",
|
|
29
|
+
},
|
|
30
30
|
});
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
|
@@ -32,32 +32,32 @@
|
|
|
32
32
|
* Default icons used across components
|
|
33
33
|
*/
|
|
34
34
|
export const iconsDefaults = {
|
|
35
|
-
loading:
|
|
36
|
-
chevronDown:
|
|
37
|
-
chevronLeft:
|
|
38
|
-
chevronRight:
|
|
39
|
-
chevronsLeft:
|
|
40
|
-
chevronsRight:
|
|
41
|
-
ellipsis:
|
|
42
|
-
close:
|
|
43
|
-
menu:
|
|
44
|
-
external:
|
|
45
|
-
check:
|
|
46
|
-
light:
|
|
47
|
-
dark:
|
|
48
|
-
upload:
|
|
49
|
-
file:
|
|
50
|
-
zoomIn:
|
|
51
|
-
trash:
|
|
52
|
-
search:
|
|
53
|
-
star:
|
|
54
|
-
folder:
|
|
55
|
-
folderOpen:
|
|
56
|
-
sortAsc:
|
|
57
|
-
sortDesc:
|
|
58
|
-
sortDefault:
|
|
59
|
-
panelLeft:
|
|
60
|
-
dragHandle:
|
|
35
|
+
loading: "lucide:loader-circle",
|
|
36
|
+
chevronDown: "lucide:chevron-down",
|
|
37
|
+
chevronLeft: "lucide:chevron-left",
|
|
38
|
+
chevronRight: "lucide:chevron-right",
|
|
39
|
+
chevronsLeft: "lucide:chevrons-left",
|
|
40
|
+
chevronsRight: "lucide:chevrons-right",
|
|
41
|
+
ellipsis: "lucide:ellipsis",
|
|
42
|
+
close: "lucide:x",
|
|
43
|
+
menu: "lucide:menu",
|
|
44
|
+
external: "lucide:arrow-up-right",
|
|
45
|
+
check: "lucide:check",
|
|
46
|
+
light: "lucide:sun",
|
|
47
|
+
dark: "lucide:moon",
|
|
48
|
+
upload: "lucide:upload",
|
|
49
|
+
file: "lucide:file",
|
|
50
|
+
zoomIn: "lucide:zoom-in",
|
|
51
|
+
trash: "lucide:trash-2",
|
|
52
|
+
search: "lucide:search",
|
|
53
|
+
star: "lucide:star",
|
|
54
|
+
folder: "lucide:folder",
|
|
55
|
+
folderOpen: "lucide:folder-open",
|
|
56
|
+
sortAsc: "lucide:chevron-up",
|
|
57
|
+
sortDesc: "lucide:chevron-down",
|
|
58
|
+
sortDefault: "lucide:chevrons-up-down",
|
|
59
|
+
panelLeft: "lucide:panel-left",
|
|
60
|
+
dragHandle: "lucide:grip-vertical",
|
|
61
61
|
};
|
|
62
62
|
// ==================== GLOBAL STATE ====================
|
|
63
63
|
let globalConfig = {};
|
|
@@ -93,10 +93,10 @@ function deepMerge(target, source) {
|
|
|
93
93
|
const sourceValue = source[key];
|
|
94
94
|
const targetValue = target[key];
|
|
95
95
|
if (sourceValue !== undefined &&
|
|
96
|
-
typeof sourceValue ===
|
|
96
|
+
typeof sourceValue === "object" &&
|
|
97
97
|
sourceValue !== null &&
|
|
98
98
|
!Array.isArray(sourceValue) &&
|
|
99
|
-
typeof targetValue ===
|
|
99
|
+
typeof targetValue === "object" &&
|
|
100
100
|
targetValue !== null &&
|
|
101
101
|
!Array.isArray(targetValue)) {
|
|
102
102
|
result[key] = deepMerge(targetValue, sourceValue);
|
package/dist/editor.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Compatibility proxy for the SV5UI editor subpath. */
|
|
2
|
-
export * from
|
|
2
|
+
export * from "sv5ui/editor";
|
package/dist/editor.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Compatibility proxy for the SV5UI editor subpath. */
|
|
2
|
-
export * from
|
|
2
|
+
export * from "sv5ui/editor";
|
|
@@ -53,16 +53,21 @@ function handleDragEnd(event) {
|
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
55
|
{#if isGrouped}
|
|
56
|
-
|
|
56
|
+
{@render children?.()}
|
|
57
57
|
{:else}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
<DragDropProvider
|
|
59
|
+
{modifiers}
|
|
60
|
+
onDragStart={handleDragStart}
|
|
61
|
+
onDragOver={handleDragOver}
|
|
62
|
+
onDragEnd={handleDragEnd}
|
|
63
|
+
>
|
|
64
|
+
{@render children?.()}
|
|
65
|
+
{#if overlay}
|
|
66
|
+
<DragOverlay>
|
|
67
|
+
{#snippet children(draggable)}
|
|
68
|
+
{@render overlay({ item: draggable.data as T })}
|
|
69
|
+
{/snippet}
|
|
70
|
+
</DragOverlay>
|
|
71
|
+
{/if}
|
|
72
|
+
</DragDropProvider>
|
|
68
73
|
{/if}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DragPayload, UseDroppableOptions } from
|
|
1
|
+
import type { DragPayload, UseDroppableOptions } from "../useDragDrop/useDragDrop.svelte.js";
|
|
2
2
|
export declare const DRAG_DROP_CONTEXT_KEY: unique symbol;
|
|
3
3
|
export interface DragDropContextValue {
|
|
4
4
|
registerDroppable: <T>(id: string, options: UseDroppableOptions<T>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DRAG_DROP_CONTEXT_KEY = Symbol(
|
|
1
|
+
export const DRAG_DROP_CONTEXT_KEY = Symbol("sv5ui-plus-drag-drop");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UseSortableOptions } from
|
|
2
|
-
import type { Snippet } from
|
|
1
|
+
import type { UseSortableOptions } from "../useSortable/useSortable.svelte.js";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
3
|
export declare const SORTABLE_CONTEXT_KEY: unique symbol;
|
|
4
4
|
export declare const SORTABLE_GROUP_CONTEXT_KEY: unique symbol;
|
|
5
5
|
export interface SortableGroupContextValue {
|
|
@@ -15,11 +15,11 @@ export interface SortableGroupContextValue {
|
|
|
15
15
|
}
|
|
16
16
|
export interface SortableContextValue<T> {
|
|
17
17
|
groupId: string;
|
|
18
|
-
getItems: UseSortableOptions<T>[
|
|
19
|
-
getId: UseSortableOptions<T>[
|
|
20
|
-
onReorder: UseSortableOptions<T>[
|
|
18
|
+
getItems: UseSortableOptions<T>["getItems"];
|
|
19
|
+
getId: UseSortableOptions<T>["getId"];
|
|
20
|
+
onReorder: UseSortableOptions<T>["onReorder"];
|
|
21
21
|
isDisabled: () => boolean;
|
|
22
|
-
getAxis: () =>
|
|
22
|
+
getAxis: () => "vertical" | "horizontal" | "grid";
|
|
23
23
|
getHandle: () => string | undefined;
|
|
24
24
|
setDraggingId: (id: string | number | null) => void;
|
|
25
25
|
getDraggingId: () => string | number | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const SORTABLE_CONTEXT_KEY = Symbol(
|
|
2
|
-
export const SORTABLE_GROUP_CONTEXT_KEY = Symbol(
|
|
1
|
+
export const SORTABLE_CONTEXT_KEY = Symbol("sv5ui-plus-sortable");
|
|
2
|
+
export const SORTABLE_GROUP_CONTEXT_KEY = Symbol("sv5ui-plus-sortable-group");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./useDragDrop.svelte.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./useDragDrop.svelte.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Action } from
|
|
2
|
-
import type { Component } from
|
|
3
|
-
import { type Snippet } from
|
|
1
|
+
import type { Action } from "svelte/action";
|
|
2
|
+
import type { Component } from "svelte";
|
|
3
|
+
import { type Snippet } from "svelte";
|
|
4
4
|
export interface DragPayload<T = unknown> {
|
|
5
5
|
id: string;
|
|
6
6
|
data?: T;
|