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
|
@@ -25,78 +25,78 @@ function isPlainObject(value) {
|
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<Table
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
28
|
+
bind:ref
|
|
29
|
+
bind:sorting={
|
|
30
|
+
() => (Array.isArray(sorting) ? sorting : localSorting),
|
|
31
|
+
(value) => {
|
|
32
|
+
const next = Array.isArray(value) ? value : [];
|
|
33
|
+
sorting = next;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
bind:selectedRows={
|
|
37
|
+
() => (Array.isArray(selectedRows) ? selectedRows : localSelectedRows),
|
|
38
|
+
(value) => {
|
|
39
|
+
const next = (Array.isArray(value) ? value : []) as T[];
|
|
40
|
+
selectedRows = next;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
bind:pinnedRows={
|
|
44
|
+
() => (Array.isArray(pinnedRows) ? pinnedRows : localPinnedRows),
|
|
45
|
+
(value) => {
|
|
46
|
+
const next = Array.isArray(value) ? value : [];
|
|
47
|
+
pinnedRows = next;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
bind:expandedRows={
|
|
51
|
+
() => (Array.isArray(expandedRows) ? expandedRows : localExpandedRows),
|
|
52
|
+
(value) => {
|
|
53
|
+
const next = Array.isArray(value) ? value : [];
|
|
54
|
+
expandedRows = next;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
bind:columnFilters={
|
|
58
|
+
() => (isPlainObject(columnFilters) ? columnFilters : localColumnFilters),
|
|
59
|
+
(value) => {
|
|
60
|
+
columnFilters = isPlainObject(value)
|
|
61
|
+
? (value as Record<string, string>)
|
|
62
|
+
: ({} as Record<string, string>);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
bind:columnSizing={
|
|
66
|
+
() => (isPlainObject(columnSizing) ? columnSizing : localColumnSizing),
|
|
67
|
+
(value) => {
|
|
68
|
+
columnSizing = isPlainObject(value)
|
|
69
|
+
? (value as Record<string, number>)
|
|
70
|
+
: ({} as Record<string, number>);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
bind:globalFilter={
|
|
74
|
+
() => (typeof globalFilter === "string" ? globalFilter : localGlobalFilter),
|
|
75
|
+
(value) => {
|
|
76
|
+
globalFilter = typeof value === "string" ? value : "";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
bind:page={
|
|
80
|
+
() => (typeof page === "number" && Number.isFinite(page) ? page : localPage),
|
|
81
|
+
(value) => {
|
|
82
|
+
page = typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
bind:columnVisibility={
|
|
86
|
+
() => (isPlainObject(columnVisibility) ? columnVisibility : localColumnVisibility),
|
|
87
|
+
(value) => {
|
|
88
|
+
columnVisibility = isPlainObject(value)
|
|
89
|
+
? (value as Record<string, boolean>)
|
|
90
|
+
: ({} as Record<string, boolean>);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
bind:columnPinning={
|
|
94
|
+
() => (isPlainObject(columnPinning) ? columnPinning : localColumnPinning),
|
|
95
|
+
(value) => {
|
|
96
|
+
columnPinning = isPlainObject(value)
|
|
97
|
+
? (value as { left?: string[]; right?: string[] })
|
|
98
|
+
: ({} as { left?: string[]; right?: string[] });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
{...rest}
|
|
102
102
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { SafeTableProps as Props } from
|
|
2
|
-
import type { SafeTableProps } from
|
|
1
|
+
export type { SafeTableProps as Props } from "./safe-table.types.js";
|
|
2
|
+
import type { SafeTableProps } from "./safe-table.types.js";
|
|
3
3
|
declare function $$render<T extends Record<string, any>>(): {
|
|
4
4
|
props: SafeTableProps<T>;
|
|
5
5
|
exports: {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as SafeTable } from
|
|
2
|
-
export type { SafeTableProps } from
|
|
1
|
+
export { default as SafeTable } from "./SafeTable.svelte";
|
|
2
|
+
export type { SafeTableProps } from "./safe-table.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as SafeTable } from
|
|
1
|
+
export { default as SafeTable } from "./SafeTable.svelte";
|
|
@@ -26,69 +26,69 @@ onMount(() => {
|
|
|
26
26
|
});
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
|
-
{#if variant ===
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{:else if variant ===
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
{:else if variant ===
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
29
|
+
{#if variant === "input"}
|
|
30
|
+
<Input
|
|
31
|
+
type="search"
|
|
32
|
+
{placeholder}
|
|
33
|
+
bind:value
|
|
34
|
+
leadingIcon="lucide:search"
|
|
35
|
+
class={className}
|
|
36
|
+
{...rest as any}
|
|
37
|
+
>
|
|
38
|
+
{#snippet trailingSlot()}
|
|
39
|
+
{#if kbd.length > 0}
|
|
40
|
+
<div class="pointer-events-none flex items-center gap-1">
|
|
41
|
+
{#each kbd as key}
|
|
42
|
+
<Kbd value={key} size="sm" />
|
|
43
|
+
{/each}
|
|
44
|
+
</div>
|
|
45
|
+
{/if}
|
|
46
|
+
{/snippet}
|
|
47
|
+
</Input>
|
|
48
|
+
{:else if variant === "modal"}
|
|
49
|
+
<button
|
|
50
|
+
type="button"
|
|
51
|
+
class={twMerge(
|
|
52
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-outline-variant bg-surface px-3 py-2 text-sm text-on-surface-variant shadow-sm transition-colors hover:bg-surface-container hover:text-on-surface focus:outline-none focus:ring-2 focus:ring-primary",
|
|
53
|
+
className,
|
|
54
|
+
)}
|
|
55
|
+
onclick={() => (open = true)}
|
|
56
|
+
{...rest as any}
|
|
57
|
+
>
|
|
58
|
+
<span class="flex items-center gap-2">
|
|
59
|
+
<span class="iconify lucide--search text-lg"></span>
|
|
60
|
+
<span>{placeholder}</span>
|
|
61
|
+
</span>
|
|
62
|
+
{#if kbd.length > 0}
|
|
63
|
+
<span class="flex items-center gap-1">
|
|
64
|
+
{#each kbd as key}
|
|
65
|
+
<Kbd value={key} size="sm" />
|
|
66
|
+
{/each}
|
|
67
|
+
</span>
|
|
68
|
+
{/if}
|
|
69
|
+
</button>
|
|
70
|
+
{:else if variant === "button"}
|
|
71
|
+
<Button
|
|
72
|
+
variant="ghost"
|
|
73
|
+
color="surface"
|
|
74
|
+
leadingIcon="lucide:search"
|
|
75
|
+
class={className}
|
|
76
|
+
onclick={() => (open = true)}
|
|
77
|
+
{...rest as any}
|
|
78
|
+
/>
|
|
79
79
|
{/if}
|
|
80
80
|
|
|
81
|
-
{#if variant ===
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
{#if variant === "modal" || variant === "button"}
|
|
82
|
+
<Modal bind:open size="lg">
|
|
83
|
+
{#snippet content()}
|
|
84
|
+
<Command
|
|
85
|
+
{groups}
|
|
86
|
+
bind:search={value}
|
|
87
|
+
placeholder="Type a command or search..."
|
|
88
|
+
ui={{
|
|
89
|
+
root: "border-0 shadow-none",
|
|
90
|
+
}}
|
|
91
|
+
/>
|
|
92
|
+
{/snippet}
|
|
93
|
+
</Modal>
|
|
94
94
|
{/if}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Search } from
|
|
2
|
-
export type * from
|
|
1
|
+
export { default as Search } from "./Search.svelte";
|
|
2
|
+
export type * from "./search.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Search } from
|
|
1
|
+
export { default as Search } from "./Search.svelte";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { HTMLAttributes } from
|
|
2
|
-
import type { ClassNameValue } from
|
|
3
|
-
import type { CommandGroup } from
|
|
4
|
-
export type SearchVariant =
|
|
5
|
-
export interface SearchProps extends Omit<HTMLAttributes<HTMLInputElement | HTMLButtonElement>,
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import type { ClassNameValue } from "tailwind-merge";
|
|
3
|
+
import type { CommandGroup } from "sv5ui";
|
|
4
|
+
export type SearchVariant = "input" | "modal" | "button";
|
|
5
|
+
export interface SearchProps extends Omit<HTMLAttributes<HTMLInputElement | HTMLButtonElement>, "class"> {
|
|
6
6
|
/**
|
|
7
7
|
* Determines the visual style and behavior of the search component.
|
|
8
8
|
* - `input`: A standard input box.
|
|
@@ -40,14 +40,20 @@ function handleDragEnd(event, manager) {
|
|
|
40
40
|
}
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
|
-
<DragDropProvider
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
<DragDropProvider
|
|
44
|
+
{...rest}
|
|
45
|
+
onDragStart={handleDragStart}
|
|
46
|
+
onDragEnd={handleDragEnd}
|
|
47
|
+
{onDragMove}
|
|
48
|
+
{onDragOver}
|
|
49
|
+
>
|
|
50
|
+
{@render children?.()}
|
|
51
|
+
<DragOverlay>
|
|
52
|
+
{#snippet children(draggable)}
|
|
53
|
+
{@const snippet = ctx.getOverlay(draggingGroupId ?? "")}
|
|
54
|
+
{#if snippet}
|
|
55
|
+
{@render snippet({ item: draggable.data })}
|
|
56
|
+
{/if}
|
|
57
|
+
{/snippet}
|
|
58
|
+
</DragOverlay>
|
|
53
59
|
</DragDropProvider>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Snippet } from
|
|
2
|
-
import type { DragStartEvent, DragEndEvent, DragOverEvent, DragMoveEvent, DragDropManagerInput } from
|
|
3
|
-
import type { DragDropManager } from
|
|
1
|
+
import { type Snippet } from "svelte";
|
|
2
|
+
import type { DragStartEvent, DragEndEvent, DragOverEvent, DragMoveEvent, DragDropManagerInput } from "@dnd-kit/dom";
|
|
3
|
+
import type { DragDropManager } from "@dnd-kit/dom";
|
|
4
4
|
interface Props extends DragDropManagerInput {
|
|
5
5
|
children?: Snippet;
|
|
6
6
|
onDragStart?: (event: DragStartEvent, manager: DragDropManager) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as SortableGroup } from
|
|
1
|
+
export { default as SortableGroup } from "./SortableGroup.svelte";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as SortableGroup } from
|
|
1
|
+
export { default as SortableGroup } from "./SortableGroup.svelte";
|
|
@@ -22,60 +22,63 @@ const itemClasses = $derived(twMerge("relative flex items-center gap-3 rounded-l
|
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
24
|
<sortable.Provider {overlay}>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
25
|
+
<div use:sortable.container class={listClass} role="list">
|
|
26
|
+
{#each items as item, index (getKey(item))}
|
|
27
|
+
{@const id = getKey(item)}
|
|
28
|
+
{@const dragging = sortable.draggingId === String(id)}
|
|
29
|
+
<div
|
|
30
|
+
use:sortable.item={{ index, item }}
|
|
31
|
+
role="listitem"
|
|
32
|
+
class={twMerge(
|
|
33
|
+
"relative sortable-item",
|
|
34
|
+
itemClasses,
|
|
35
|
+
dragging && (overlay ? "bg-transparent border-transparent" : "z-10 opacity-95 shadow-md"),
|
|
36
|
+
)}
|
|
37
|
+
aria-grabbed={dragging}
|
|
38
|
+
>
|
|
39
|
+
{#if overlay && dragging}
|
|
40
|
+
<div
|
|
41
|
+
class="absolute inset-0 z-10 rounded-[inherit] border-2 border-dashed border-primary/50 bg-primary/5 pointer-events-none"
|
|
42
|
+
></div>
|
|
43
|
+
{/if}
|
|
44
|
+
<div class={["flex w-full items-center gap-3", overlay && dragging && "invisible"]}>
|
|
45
|
+
{#if handle === true}
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
data-sortable-handle
|
|
49
|
+
class="inline-flex shrink-0 cursor-grab rounded-md p-1 text-on-surface-variant hover:bg-surface-container-high active:cursor-grabbing"
|
|
50
|
+
aria-label="Drag to reorder"
|
|
51
|
+
>
|
|
52
|
+
<Icon name="lucide:grip-vertical" size="16" />
|
|
53
|
+
</button>
|
|
54
|
+
{/if}
|
|
55
|
+
{@render children({ item, index, dragging })}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
{/each}
|
|
59
|
+
</div>
|
|
58
60
|
</sortable.Provider>
|
|
59
61
|
|
|
60
62
|
<style>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
:global([data-sortable-active="true"]) {
|
|
64
|
+
user-select: none;
|
|
65
|
+
}
|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
/*
|
|
66
68
|
* dnd-kit animates items via Web Animations API using the CSS `translate` property.
|
|
67
69
|
* Using will-change:translate tells the browser to promote these elements to their own
|
|
68
70
|
* GPU layer so the WAAPI animation (smooth push/shift) runs without layout thrashing.
|
|
69
71
|
* Do NOT add CSS transition:transform here — it conflicts with WAAPI and causes jank.
|
|
70
72
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
:global(.sortable-item) {
|
|
74
|
+
will-change: translate;
|
|
75
|
+
}
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
/* Smooth color/opacity transitions for the dragging state indicator */
|
|
78
|
+
:global(.sortable-item:not([aria-grabbed="true"])) {
|
|
79
|
+
transition:
|
|
80
|
+
background-color 150ms ease,
|
|
81
|
+
border-color 150ms ease,
|
|
82
|
+
opacity 150ms ease;
|
|
83
|
+
}
|
|
81
84
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { SortableListProps } from
|
|
2
|
-
import type { SortableListProps } from
|
|
1
|
+
export type { SortableListProps } from "./sortable-list.types.js";
|
|
2
|
+
import type { SortableListProps } from "./sortable-list.types.js";
|
|
3
3
|
declare function $$render<T>(): {
|
|
4
4
|
props: SortableListProps<T>;
|
|
5
5
|
exports: {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as SortableList } from
|
|
2
|
-
export type { SortableListProps } from
|
|
1
|
+
export { default as SortableList } from "./SortableList.svelte";
|
|
2
|
+
export type { SortableListProps } from "./sortable-list.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as SortableList } from
|
|
1
|
+
export { default as SortableList } from "./SortableList.svelte";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
2
|
-
import type { ClassNameValue } from
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { ClassNameValue } from "tailwind-merge";
|
|
3
3
|
export interface SortableListProps<T> {
|
|
4
4
|
items: T[];
|
|
5
5
|
getKey: (item: T) => string | number;
|
|
6
6
|
onReorder?: (items: T[]) => void;
|
|
7
|
-
axis?:
|
|
7
|
+
axis?: "vertical" | "horizontal" | "grid";
|
|
8
8
|
handle?: boolean | string;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
class?: ClassNameValue;
|
|
@@ -13,19 +13,19 @@ function handleMouseMove(e) {
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
16
|
-
<div
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
<div
|
|
17
|
+
class={twMerge(styles.root() as string, className)}
|
|
18
|
+
onmousemove={handleMouseMove}
|
|
19
|
+
{...restProps}
|
|
20
20
|
>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
<!-- Spotlight Effect Background -->
|
|
22
|
+
<div
|
|
23
|
+
class={styles.spotlight() as string}
|
|
24
|
+
style:background={`radial-gradient(${size}px circle at ${mouseX}px ${mouseY}px, ${color}, transparent 80%)`}
|
|
25
|
+
></div>
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
<!-- Content -->
|
|
28
|
+
<div class={styles.content() as string}>
|
|
29
|
+
{@render children?.()}
|
|
30
|
+
</div>
|
|
31
31
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SpotlightProps } from
|
|
1
|
+
import type { SpotlightProps } from "./spotlight.types.js";
|
|
2
2
|
declare const Spotlight: import("svelte").Component<SpotlightProps, {}, "">;
|
|
3
3
|
type Spotlight = ReturnType<typeof Spotlight>;
|
|
4
4
|
export default Spotlight;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Spotlight from
|
|
1
|
+
import Spotlight from "./Spotlight.svelte";
|
|
2
2
|
export { Spotlight };
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
3
|
+
export * from "./spotlight.types.js";
|
|
4
|
+
export * from "./spotlight.variants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Spotlight from
|
|
1
|
+
import Spotlight from "./Spotlight.svelte";
|
|
2
2
|
export { Spotlight };
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
3
|
+
export * from "./spotlight.types.js";
|
|
4
|
+
export * from "./spotlight.variants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
2
|
-
import type { HTMLAttributes } from
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
export interface SpotlightProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Size of the spotlight in pixels.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
2
|
export declare const spotlightVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
[key: string]: {
|
|
4
4
|
[key: string]: import("tailwind-variants").ClassValue | {
|