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
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ bun add sv5ui sv5ui-plus
|
|
|
12
12
|
|
|
13
13
|
```css
|
|
14
14
|
/* src/routes/layout.css */
|
|
15
|
-
@import
|
|
15
|
+
@import "sv5ui/theme.css";
|
|
16
16
|
@source '../../node_modules/sv5ui-plus/dist';
|
|
17
17
|
```
|
|
18
18
|
|
|
@@ -20,15 +20,15 @@ Import core UI from SV5UI and addons from SV5UI Plus:
|
|
|
20
20
|
|
|
21
21
|
```svelte
|
|
22
22
|
<script lang="ts">
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
import { Button, Icon } from "sv5ui";
|
|
24
|
+
import { ConfirmDialog, Search } from "sv5ui-plus";
|
|
25
25
|
</script>
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
For an incremental migration from Svelora, `sv5ui-plus/compat` re-exports SV5UI together with SV5UI Plus addons:
|
|
29
29
|
|
|
30
30
|
```ts
|
|
31
|
-
import { Button,
|
|
31
|
+
import { Button, ConfirmDialog } from "sv5ui-plus/compat";
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
New code should use the explicit `sv5ui` and `sv5ui-plus` imports.
|
|
@@ -36,8 +36,8 @@ New code should use the explicit `sv5ui` and `sv5ui-plus` imports.
|
|
|
36
36
|
## Addons
|
|
37
37
|
|
|
38
38
|
- Content and display: `BentoGrid`, `Chart`, `Chat`, `CodeBlock`, `Fonts`, `List`, `Marquee`, `NumberTicker`, `Prose`, `Spotlight`
|
|
39
|
-
- Forms and overlays: `
|
|
40
|
-
- Layout and data: `
|
|
39
|
+
- Forms and overlays: `ConfirmDialog`, `LocaleButton`, `PasswordInput`, `Search`
|
|
40
|
+
- Layout and data: `ResizeContainer`, `SafeTable`, `TableBulkActionBar`, `TreeView`
|
|
41
41
|
- Forms: `FormSelect`, `DatePickerField`, `DateRangePickerField`, `PasswordInput`
|
|
42
42
|
- Drag and drop: `SortableGroup`, `SortableList`, `useDragDrop`, `useSortable`
|
|
43
43
|
- SvelteKit adapter: `SvelteKitNavigationMenu`
|
package/dist/adapters/notify.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { toast } from
|
|
1
|
+
import { toast } from "sv5ui";
|
|
2
2
|
function errorMessage(error) {
|
|
3
|
-
if (typeof error ===
|
|
3
|
+
if (typeof error === "string")
|
|
4
4
|
return error;
|
|
5
5
|
if (error instanceof Error)
|
|
6
6
|
return error.message;
|
|
7
|
-
if (error && typeof error ===
|
|
7
|
+
if (error && typeof error === "object") {
|
|
8
8
|
const value = error;
|
|
9
|
-
if (typeof value.message ===
|
|
9
|
+
if (typeof value.message === "string")
|
|
10
10
|
return value.message;
|
|
11
|
-
if (typeof value.error ===
|
|
11
|
+
if (typeof value.error === "string")
|
|
12
12
|
return value.error;
|
|
13
13
|
return JSON.stringify(error);
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return "An unknown error occurred";
|
|
16
16
|
}
|
|
17
17
|
function resolveOptions(options) {
|
|
18
18
|
if (!options)
|
|
@@ -21,13 +21,13 @@ function resolveOptions(options) {
|
|
|
21
21
|
const style = styles
|
|
22
22
|
? Object.entries(styles)
|
|
23
23
|
.map(([key, value]) => `${key}: ${value}`)
|
|
24
|
-
.join(
|
|
24
|
+
.join("; ")
|
|
25
25
|
: undefined;
|
|
26
|
-
const className = classes ? Object.values(classes).join(
|
|
26
|
+
const className = classes ? Object.values(classes).join(" ") : undefined;
|
|
27
27
|
return {
|
|
28
28
|
...rest,
|
|
29
|
-
style: [rest.style, style].filter(Boolean).join(
|
|
30
|
-
class: [rest.class, className].filter(Boolean).join(
|
|
29
|
+
style: [rest.style, style].filter(Boolean).join("; ") || undefined,
|
|
30
|
+
class: [rest.class, className].filter(Boolean).join(" ") || undefined,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
export const notify = {
|
|
@@ -46,14 +46,14 @@ export const notify = {
|
|
|
46
46
|
loading(message, options) {
|
|
47
47
|
return toast.loading(message, {
|
|
48
48
|
duration: Number.POSITIVE_INFINITY,
|
|
49
|
-
...resolveOptions(options)
|
|
49
|
+
...resolveOptions(options),
|
|
50
50
|
});
|
|
51
51
|
},
|
|
52
52
|
processing(message, options) {
|
|
53
53
|
return toast.loading(message, {
|
|
54
54
|
duration: Number.POSITIVE_INFINITY,
|
|
55
|
-
icon:
|
|
56
|
-
...resolveOptions(options)
|
|
55
|
+
icon: "lucide:loader-circle",
|
|
56
|
+
...resolveOptions(options),
|
|
57
57
|
});
|
|
58
58
|
},
|
|
59
59
|
default(message, options) {
|
|
@@ -67,22 +67,22 @@ export const notify = {
|
|
|
67
67
|
.then(([data]) => {
|
|
68
68
|
if (checkSuccess && !checkSuccess(data))
|
|
69
69
|
throw data;
|
|
70
|
-
notify.success(typeof success ===
|
|
70
|
+
notify.success(typeof success === "function" ? success(data) : success, {
|
|
71
71
|
...shared,
|
|
72
72
|
...successOptions,
|
|
73
|
-
id
|
|
73
|
+
id,
|
|
74
74
|
});
|
|
75
75
|
})
|
|
76
76
|
.catch((reason) => {
|
|
77
|
-
notify.error(typeof error ===
|
|
77
|
+
notify.error(typeof error === "function" ? error(reason) : error, {
|
|
78
78
|
...shared,
|
|
79
79
|
...errorOptions,
|
|
80
|
-
id
|
|
80
|
+
id,
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
return promise;
|
|
84
84
|
},
|
|
85
85
|
dismiss(id) {
|
|
86
86
|
return toast.dismiss(id);
|
|
87
|
-
}
|
|
87
|
+
},
|
|
88
88
|
};
|
package/dist/compat.d.ts
CHANGED
package/dist/compat.js
CHANGED
|
@@ -7,39 +7,39 @@ let styles = $derived(bentoGridVariants());
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<div class={twMerge(styles.cardBase(), className)} {...restProps}>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
<div class={styles.cardBackground()}>
|
|
11
|
+
{#if background}
|
|
12
|
+
{@render background()}
|
|
13
|
+
{/if}
|
|
14
|
+
</div>
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<h3 class={styles.cardTitle()}>{name}</h3>
|
|
25
|
-
|
|
26
|
-
{#if description}
|
|
27
|
-
<p class={styles.cardDescription()}>{description}</p>
|
|
28
|
-
{/if}
|
|
29
|
-
</div>
|
|
16
|
+
<!-- Push content up slightly on hover by adjusting group styles or locally -->
|
|
17
|
+
<div class={twMerge(styles.cardContent(), href && "group-hover:-translate-y-4")}>
|
|
18
|
+
{#if icon}
|
|
19
|
+
<div class={styles.cardIconWrapper()}>
|
|
20
|
+
<Icon {name} class="w-6 h-6" />
|
|
21
|
+
</div>
|
|
22
|
+
{/if}
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
<h3 class={styles.cardTitle()}>{name}</h3>
|
|
25
|
+
|
|
26
|
+
{#if description}
|
|
27
|
+
<p class={styles.cardDescription()}>{description}</p>
|
|
28
|
+
{/if}
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
{#if href || actionSnippet}
|
|
32
|
+
<div class={twMerge(styles.cardAction(), !href && !actionSnippet && "hidden")}>
|
|
33
|
+
{#if actionSnippet}
|
|
34
|
+
{@render actionSnippet()}
|
|
35
|
+
{:else if href}
|
|
36
|
+
<Button {href} variant="ghost" size="sm" class="pl-0 hover:bg-transparent">
|
|
37
|
+
{cta}
|
|
38
|
+
{#snippet trailingSlot()}
|
|
39
|
+
<Icon name="lucide:arrow-right" class="w-4 h-4 ml-1" />
|
|
40
|
+
{/snippet}
|
|
41
|
+
</Button>
|
|
42
|
+
{/if}
|
|
43
|
+
</div>
|
|
44
|
+
{/if}
|
|
45
45
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BentoCardProps } from
|
|
1
|
+
import type { BentoCardProps } from "./bento-grid.types.js";
|
|
2
2
|
declare const BentoCard: import("svelte").Component<BentoCardProps, {}, "">;
|
|
3
3
|
type BentoCard = ReturnType<typeof BentoCard>;
|
|
4
4
|
export default BentoCard;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BentoGridProps } from
|
|
1
|
+
import type { BentoGridProps } from "./bento-grid.types.js";
|
|
2
2
|
declare const BentoGrid: import("svelte").Component<BentoGridProps, {}, "">;
|
|
3
3
|
type BentoGrid = ReturnType<typeof BentoGrid>;
|
|
4
4
|
export default BentoGrid;
|
|
@@ -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 BentoGridProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Additional CSS classes.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const bentoGridVariants = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
gridBase:
|
|
5
|
-
cardBase:
|
|
6
|
-
cardBackground:
|
|
7
|
-
cardContent:
|
|
8
|
-
cardIconWrapper:
|
|
9
|
-
cardTitle:
|
|
10
|
-
cardDescription:
|
|
11
|
-
cardAction:
|
|
4
|
+
gridBase: "grid grid-cols-1 md:grid-cols-3 gap-4 max-w-7xl mx-auto w-full",
|
|
5
|
+
cardBase: "group relative flex flex-col justify-between overflow-hidden rounded-xl bg-surface-50 dark:bg-surface-900 border border-outline-variant transition-all hover:shadow-md dark:hover:shadow-surface-800/50",
|
|
6
|
+
cardBackground: "absolute inset-0 transition-all duration-300 pointer-events-none",
|
|
7
|
+
cardContent: "pointer-events-none z-10 flex transform-gpu flex-col gap-1 p-6 transition-all duration-300",
|
|
8
|
+
cardIconWrapper: "mb-2 w-10 h-10 flex items-center justify-center rounded-lg bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400",
|
|
9
|
+
cardTitle: "text-lg font-semibold text-surface-900 dark:text-surface-50",
|
|
10
|
+
cardDescription: "text-sm text-surface-500 dark:text-surface-400",
|
|
11
|
+
cardAction: "pointer-events-auto absolute bottom-0 left-0 w-full p-6 opacity-0 translate-y-4 transition-all duration-300 group-hover:opacity-100 group-hover:translate-y-0",
|
|
12
12
|
},
|
|
13
13
|
variants: {
|
|
14
14
|
// Variants can be added if we want different styles of grids
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
16
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BentoGrid from
|
|
2
|
-
import BentoCard from
|
|
1
|
+
import BentoGrid from "./BentoGrid.svelte";
|
|
2
|
+
import BentoCard from "./BentoCard.svelte";
|
|
3
3
|
export { BentoGrid, BentoCard };
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
4
|
+
export * from "./bento-grid.types.js";
|
|
5
|
+
export * from "./bento-grid.variants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BentoGrid from
|
|
2
|
-
import BentoCard from
|
|
1
|
+
import BentoGrid from "./BentoGrid.svelte";
|
|
2
|
+
import BentoCard from "./BentoCard.svelte";
|
|
3
3
|
export { BentoGrid, BentoCard };
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
4
|
+
export * from "./bento-grid.types.js";
|
|
5
|
+
export * from "./bento-grid.variants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ApexOptions } from
|
|
2
|
-
import type { ClassNameValue } from
|
|
1
|
+
import type { ApexOptions } from "apexcharts";
|
|
2
|
+
import type { ClassNameValue } from "tailwind-merge";
|
|
3
3
|
export interface ChartProps {
|
|
4
4
|
/**
|
|
5
5
|
* Configuration options for ApexCharts.
|
|
@@ -8,7 +8,7 @@ export interface ChartProps {
|
|
|
8
8
|
/**
|
|
9
9
|
* Series data. If provided, overrides options.series.
|
|
10
10
|
*/
|
|
11
|
-
series?: ApexOptions[
|
|
11
|
+
series?: ApexOptions["series"];
|
|
12
12
|
/**
|
|
13
13
|
* Tailwind class to apply to the chart container wrapper.
|
|
14
14
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Chart } from
|
|
2
|
-
export * from
|
|
1
|
+
export { default as Chart } from "./Chart.svelte";
|
|
2
|
+
export * from "./chart.types.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Chart } from
|
|
2
|
-
export * from
|
|
1
|
+
export { default as Chart } from "./Chart.svelte";
|
|
2
|
+
export * from "./chart.types.js";
|
|
@@ -8,23 +8,23 @@ setContext("chat-bubble-position", () => position);
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<div class={twMerge(styles.bubbleBase() as string, className as string)} {...restProps}>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
{#if avatar}
|
|
12
|
+
<div class={styles.bubbleAvatar()}>
|
|
13
|
+
{@render avatar()}
|
|
14
|
+
</div>
|
|
15
|
+
{/if}
|
|
16
|
+
|
|
17
|
+
<div class={styles.bubbleContent()}>
|
|
18
|
+
{#if name || time}
|
|
19
|
+
<div class={styles.bubbleHeader()}>
|
|
20
|
+
{#if name}
|
|
21
|
+
<span class={styles.bubbleName()}>{name}</span>
|
|
22
|
+
{/if}
|
|
23
|
+
{#if time}
|
|
24
|
+
<span class={styles.bubbleTime()}>{time}</span>
|
|
25
|
+
{/if}
|
|
26
|
+
</div>
|
|
27
|
+
{/if}
|
|
28
|
+
{@render children?.()}
|
|
29
|
+
</div>
|
|
30
30
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatBubbleProps } from
|
|
1
|
+
import type { ChatBubbleProps } from "./chat.types.js";
|
|
2
2
|
declare const ChatBubble: import("svelte").Component<ChatBubbleProps, {}, "">;
|
|
3
3
|
type ChatBubble = ReturnType<typeof ChatBubble>;
|
|
4
4
|
export default ChatBubble;
|
|
@@ -18,33 +18,32 @@ function autoResize(node) {
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<div class={twMerge(styles.inputBase() as string, className as string)} {...restProps}>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
{#if leading}
|
|
22
|
+
<div class={styles.inputActions()}>
|
|
23
|
+
{@render leading()}
|
|
24
|
+
</div>
|
|
25
|
+
{/if}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</div>
|
|
27
|
+
<div class={styles.inputFieldWrapper()}>
|
|
28
|
+
<textarea
|
|
29
|
+
bind:value
|
|
30
|
+
{placeholder}
|
|
31
|
+
{disabled}
|
|
32
|
+
rows="1"
|
|
33
|
+
use:autoResize
|
|
34
|
+
class={styles.inputField()}
|
|
35
|
+
onkeydown={(e) => {
|
|
36
|
+
// If you want Shift+Enter for new line, and Enter to submit:
|
|
37
|
+
// if (e.key === 'Enter' && !e.shiftKey) {
|
|
38
|
+
// e.preventDefault()
|
|
39
|
+
// // Dispatch submit event
|
|
40
|
+
// }
|
|
41
|
+
}}></textarea>
|
|
42
|
+
</div>
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
{#if trailing}
|
|
45
|
+
<div class={styles.inputActions()}>
|
|
46
|
+
{@render trailing()}
|
|
47
|
+
</div>
|
|
48
|
+
{/if}
|
|
50
49
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatInputProps } from
|
|
1
|
+
import type { ChatInputProps } from "./chat.types.js";
|
|
2
2
|
declare const ChatInput: import("svelte").Component<ChatInputProps, {}, "value">;
|
|
3
3
|
type ChatInput = ReturnType<typeof ChatInput>;
|
|
4
4
|
export default ChatInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatMessageProps } from
|
|
1
|
+
import type { ChatMessageProps } from "./chat.types.js";
|
|
2
2
|
declare const ChatMessage: import("svelte").Component<ChatMessageProps, {}, "">;
|
|
3
3
|
type ChatMessage = ReturnType<typeof ChatMessage>;
|
|
4
4
|
export default ChatMessage;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
2
|
-
import type { HTMLAttributes } from
|
|
3
|
-
import type { ChatVariantProps } from
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { ChatVariantProps } from "./chat.variants.js";
|
|
4
4
|
export interface ChatBubbleProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/**
|
|
6
6
|
* Position of the chat bubble (start for receiver, end for sender).
|
|
7
7
|
* @default 'start'
|
|
8
8
|
*/
|
|
9
|
-
position?: ChatVariantProps[
|
|
9
|
+
position?: ChatVariantProps["position"];
|
|
10
10
|
/**
|
|
11
11
|
* Name of the sender.
|
|
12
12
|
*/
|
|
@@ -28,12 +28,12 @@ export interface ChatMessageProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
28
28
|
/**
|
|
29
29
|
* Style variant of the message bubble.
|
|
30
30
|
*/
|
|
31
|
-
variant?: ChatVariantProps[
|
|
31
|
+
variant?: ChatVariantProps["variant"];
|
|
32
32
|
/**
|
|
33
33
|
* Position inheritance (used internally for rounded corners).
|
|
34
34
|
* Automatically inherited from ChatBubble if used within it.
|
|
35
35
|
*/
|
|
36
|
-
position?: ChatVariantProps[
|
|
36
|
+
position?: ChatVariantProps["position"];
|
|
37
37
|
/**
|
|
38
38
|
* The message text or content.
|
|
39
39
|
*/
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const chatVariants = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
bubbleBase:
|
|
5
|
-
bubbleAvatar:
|
|
6
|
-
bubbleContent:
|
|
7
|
-
bubbleHeader:
|
|
8
|
-
bubbleName:
|
|
9
|
-
bubbleTime:
|
|
10
|
-
messageBase:
|
|
11
|
-
inputBase:
|
|
12
|
-
inputFieldWrapper:
|
|
13
|
-
inputField:
|
|
14
|
-
inputActions:
|
|
4
|
+
bubbleBase: "flex w-full gap-3 py-2",
|
|
5
|
+
bubbleAvatar: "shrink-0 mt-1",
|
|
6
|
+
bubbleContent: "flex flex-col gap-1 min-w-0 max-w-[80%]",
|
|
7
|
+
bubbleHeader: "flex items-center gap-2 text-xs text-surface-500 dark:text-surface-400",
|
|
8
|
+
bubbleName: "font-semibold text-surface-900 dark:text-surface-50",
|
|
9
|
+
bubbleTime: "",
|
|
10
|
+
messageBase: "px-4 py-2.5 rounded-2xl text-sm break-words",
|
|
11
|
+
inputBase: "flex items-end gap-2 p-3 bg-surface-50 dark:bg-surface-900 border-t border-outline-variant",
|
|
12
|
+
inputFieldWrapper: "flex-1 relative bg-surface-100 dark:bg-surface-800 rounded-2xl border border-outline-variant focus-within:border-primary focus-within:ring-1 focus-within:ring-primary transition-colors",
|
|
13
|
+
inputField: "w-full bg-transparent border-0 px-4 py-3 min-h-[44px] max-h-32 resize-none focus:ring-0 text-sm outline-none",
|
|
14
|
+
inputActions: "shrink-0 flex items-center gap-1",
|
|
15
15
|
},
|
|
16
16
|
variants: {
|
|
17
17
|
position: {
|
|
18
18
|
start: {
|
|
19
|
-
bubbleBase:
|
|
20
|
-
bubbleContent:
|
|
21
|
-
bubbleHeader:
|
|
22
|
-
messageBase:
|
|
19
|
+
bubbleBase: "justify-start",
|
|
20
|
+
bubbleContent: "items-start",
|
|
21
|
+
bubbleHeader: "flex-row",
|
|
22
|
+
messageBase: "rounded-tl-sm",
|
|
23
23
|
},
|
|
24
24
|
end: {
|
|
25
|
-
bubbleBase:
|
|
26
|
-
bubbleContent:
|
|
27
|
-
bubbleHeader:
|
|
28
|
-
messageBase:
|
|
29
|
-
}
|
|
25
|
+
bubbleBase: "justify-end flex-row-reverse",
|
|
26
|
+
bubbleContent: "items-end",
|
|
27
|
+
bubbleHeader: "flex-row-reverse",
|
|
28
|
+
messageBase: "rounded-tr-sm",
|
|
29
|
+
},
|
|
30
30
|
},
|
|
31
31
|
variant: {
|
|
32
32
|
primary: {
|
|
33
|
-
messageBase:
|
|
33
|
+
messageBase: "bg-primary text-on-primary",
|
|
34
34
|
},
|
|
35
35
|
surface: {
|
|
36
|
-
messageBase:
|
|
36
|
+
messageBase: "bg-surface-200 dark:bg-surface-800 text-surface-900 dark:text-surface-50",
|
|
37
37
|
},
|
|
38
38
|
outline: {
|
|
39
|
-
messageBase:
|
|
40
|
-
}
|
|
41
|
-
}
|
|
39
|
+
messageBase: "bg-transparent border border-outline-variant text-surface-900 dark:text-surface-50",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
42
|
},
|
|
43
43
|
defaultVariants: {
|
|
44
|
-
position:
|
|
45
|
-
variant:
|
|
46
|
-
}
|
|
44
|
+
position: "start",
|
|
45
|
+
variant: "surface",
|
|
46
|
+
},
|
|
47
47
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ChatBubble from
|
|
2
|
-
import ChatMessage from
|
|
3
|
-
import ChatInput from
|
|
1
|
+
import ChatBubble from "./ChatBubble.svelte";
|
|
2
|
+
import ChatMessage from "./ChatMessage.svelte";
|
|
3
|
+
import ChatInput from "./ChatInput.svelte";
|
|
4
4
|
export { ChatBubble, ChatMessage, ChatInput };
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
5
|
+
export * from "./chat.types.js";
|
|
6
|
+
export * from "./chat.variants.js";
|