sv5ui-plus 5.0.5 → 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 +5 -5
- 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 +1 -1
- 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 -29
- package/dist/index.js +28 -28
- 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 +16 -13
- 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.variants.d.ts +0 -48
- package/dist/components/Resizable/resizable.variants.js +0 -17
- /package/dist/components/{Resizable/resizable.types.js → ResizeContainer/resize-container.types.js} +0 -0
|
@@ -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";
|
|
@@ -45,22 +45,22 @@ async function handleCopy() {
|
|
|
45
45
|
</script>
|
|
46
46
|
|
|
47
47
|
<div class={classes.root}>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
<div class={classes.header}>
|
|
49
|
+
<p class={classes.title}>{title}</p>
|
|
50
|
+
<button type="button" class={classes.button} disabled={!canCopy} onclick={handleCopy}>
|
|
51
|
+
{copyLabel}
|
|
52
|
+
</button>
|
|
53
|
+
</div>
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
<div class={classes.body}>
|
|
56
|
+
{#if html}
|
|
57
|
+
{@html html}
|
|
58
|
+
{:else if children}
|
|
59
|
+
{@render children()}
|
|
60
|
+
{:else}
|
|
61
|
+
<pre class="shiki">
|
|
62
62
|
<code>{code}</code>
|
|
63
63
|
</pre>
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
{/if}
|
|
65
|
+
</div>
|
|
66
66
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeBlockProps } from
|
|
1
|
+
import type { CodeBlockProps } from "./code-block.types.js";
|
|
2
2
|
export type Props = CodeBlockProps;
|
|
3
3
|
declare const CodeBlock: import("svelte").Component<CodeBlockProps, {}, "">;
|
|
4
4
|
type CodeBlock = ReturnType<typeof CodeBlock>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Snippet } from
|
|
2
|
-
import type { ClassNameValue } from
|
|
3
|
-
import type { CodeBlockVariantProps, CodeBlockSlots } from
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { ClassNameValue } from "tailwind-merge";
|
|
3
|
+
import type { CodeBlockVariantProps, CodeBlockSlots } from "./code-block.variants.js";
|
|
4
4
|
export type CodeBlockProps = {
|
|
5
5
|
title?: string;
|
|
6
6
|
code?: string;
|
|
7
7
|
copyText?: string;
|
|
8
8
|
copyable?: boolean;
|
|
9
9
|
html?: string;
|
|
10
|
-
variant?: NonNullable<CodeBlockVariantProps[
|
|
11
|
-
size?: NonNullable<CodeBlockVariantProps[
|
|
10
|
+
variant?: NonNullable<CodeBlockVariantProps["variant"]>;
|
|
11
|
+
size?: NonNullable<CodeBlockVariantProps["size"]>;
|
|
12
12
|
class?: ClassNameValue;
|
|
13
13
|
ui?: Partial<Record<CodeBlockSlots, ClassNameValue>>;
|
|
14
14
|
children?: Snippet;
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { tv } from
|
|
1
|
+
import { tv } from "tailwind-variants";
|
|
2
2
|
export const codeBlockVariants = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
root:
|
|
5
|
-
header:
|
|
6
|
-
title:
|
|
7
|
-
button:
|
|
8
|
-
body:
|
|
4
|
+
root: "mt-4 overflow-hidden rounded-2xl border border-outline-variant bg-surface-container",
|
|
5
|
+
header: "flex items-center justify-between border-b border-outline-variant",
|
|
6
|
+
title: "text-sm font-medium text-on-surface-variant",
|
|
7
|
+
button: "rounded-md border border-outline-variant text-xs font-medium text-on-surface-variant transition-colors hover:bg-surface-container-highest disabled:cursor-not-allowed disabled:opacity-50",
|
|
8
|
+
body: "bg-surface-container-highest [&_.shiki]:rounded-none [&_.shiki]:overflow-x-auto [&_.shiki]:m-0",
|
|
9
9
|
},
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
outline: {
|
|
13
|
-
root:
|
|
14
|
-
header:
|
|
15
|
-
button:
|
|
13
|
+
root: "border border-outline-variant bg-surface-container",
|
|
14
|
+
header: "border-outline-variant",
|
|
15
|
+
button: "border-outline-variant",
|
|
16
16
|
},
|
|
17
17
|
soft: {
|
|
18
|
-
root:
|
|
19
|
-
header:
|
|
20
|
-
button:
|
|
18
|
+
root: "border border-outline-variant/60 bg-surface-container/40",
|
|
19
|
+
header: "border-outline-variant/60",
|
|
20
|
+
button: "border-outline-variant/60",
|
|
21
21
|
},
|
|
22
22
|
subtle: {
|
|
23
|
-
root:
|
|
24
|
-
header:
|
|
25
|
-
button:
|
|
23
|
+
root: "border border-outline-variant/40 bg-surface-container/20",
|
|
24
|
+
header: "border-outline-variant/40",
|
|
25
|
+
button: "border-outline-variant/40",
|
|
26
26
|
},
|
|
27
27
|
solid: {
|
|
28
|
-
root:
|
|
29
|
-
header:
|
|
30
|
-
button:
|
|
28
|
+
root: "border border-outline-variant/60 bg-surface-container-high",
|
|
29
|
+
header: "border-outline-variant/60",
|
|
30
|
+
button: "border-outline-variant/60",
|
|
31
31
|
},
|
|
32
32
|
ghost: {
|
|
33
|
-
root:
|
|
34
|
-
header:
|
|
35
|
-
button:
|
|
33
|
+
root: "border border-transparent bg-transparent",
|
|
34
|
+
header: "border-outline-variant/30",
|
|
35
|
+
button: "border-outline-variant/30",
|
|
36
36
|
},
|
|
37
37
|
none: {
|
|
38
|
-
root:
|
|
39
|
-
header:
|
|
40
|
-
button:
|
|
41
|
-
}
|
|
38
|
+
root: "border-0 bg-transparent rounded-none",
|
|
39
|
+
header: "border-0 px-0",
|
|
40
|
+
button: "border-outline-variant/40",
|
|
41
|
+
},
|
|
42
42
|
},
|
|
43
43
|
size: {
|
|
44
44
|
sm: {
|
|
45
|
-
header:
|
|
46
|
-
button:
|
|
47
|
-
body:
|
|
45
|
+
header: "px-3 py-2",
|
|
46
|
+
button: "px-2 py-1",
|
|
47
|
+
body: "[&_.shiki]:p-3 [&_.shiki]:text-xs [&_.shiki]:leading-5",
|
|
48
48
|
},
|
|
49
49
|
md: {
|
|
50
|
-
header:
|
|
51
|
-
button:
|
|
52
|
-
body:
|
|
50
|
+
header: "px-4 py-3",
|
|
51
|
+
button: "px-2.5 py-1",
|
|
52
|
+
body: "[&_.shiki]:p-4 [&_.shiki]:text-sm [&_.shiki]:leading-6",
|
|
53
53
|
},
|
|
54
54
|
lg: {
|
|
55
|
-
header:
|
|
56
|
-
button:
|
|
57
|
-
body:
|
|
58
|
-
}
|
|
59
|
-
}
|
|
55
|
+
header: "px-5 py-4",
|
|
56
|
+
button: "px-3 py-1.5",
|
|
57
|
+
body: "[&_.shiki]:p-5 [&_.shiki]:text-sm [&_.shiki]:leading-6",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
60
|
},
|
|
61
61
|
defaultVariants: {
|
|
62
|
-
variant:
|
|
63
|
-
size:
|
|
64
|
-
}
|
|
62
|
+
variant: "outline",
|
|
63
|
+
size: "md",
|
|
64
|
+
},
|
|
65
65
|
});
|
|
66
66
|
export const codeBlockDefaults = {
|
|
67
67
|
defaultVariants: codeBlockVariants.defaultVariants,
|
|
68
|
-
slots: {}
|
|
68
|
+
slots: {},
|
|
69
69
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as CodeBlock } from
|
|
2
|
-
export type { CodeBlockProps } from
|
|
1
|
+
export { default as CodeBlock } from "./CodeBlock.svelte";
|
|
2
|
+
export type { CodeBlockProps } from "./code-block.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as CodeBlock } from
|
|
1
|
+
export { default as CodeBlock } from "./CodeBlock.svelte";
|
|
@@ -76,107 +76,103 @@ const contentProps = $derived.by(() => {
|
|
|
76
76
|
</script>
|
|
77
77
|
|
|
78
78
|
<Dialog.Root bind:open onOpenChange={handleOpenChange}>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<Dialog.Description class="sr-only"
|
|
93
|
-
>{pending.options.message}</Dialog.Description
|
|
94
|
-
>
|
|
95
|
-
{/if}
|
|
79
|
+
<Dialog.Portal>
|
|
80
|
+
<Dialog.Overlay class="fixed inset-0 z-50 bg-(--scrim-bg,rgba(0,0,0,0.3)) backdrop-blur-sm" />
|
|
81
|
+
{#if pending}
|
|
82
|
+
<Dialog.Content
|
|
83
|
+
{...contentProps}
|
|
84
|
+
class="fixed top-1/2 left-1/2 z-50 w-[min(24rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-outline-variant bg-surface p-6 text-center text-on-surface shadow-2xl focus:outline-none"
|
|
85
|
+
>
|
|
86
|
+
{#if pending.options.title}
|
|
87
|
+
<Dialog.Title class="sr-only">{pending.options.title}</Dialog.Title>
|
|
88
|
+
{/if}
|
|
89
|
+
{#if pending.options.message}
|
|
90
|
+
<Dialog.Description class="sr-only">{pending.options.message}</Dialog.Description>
|
|
91
|
+
{/if}
|
|
96
92
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
93
|
+
{#if pending.options.icon}
|
|
94
|
+
{#key pending.options.icon}
|
|
95
|
+
<div class="mb-4 flex min-h-20 justify-center">
|
|
96
|
+
<Icon
|
|
97
|
+
name={iconNames[pending.options.icon]}
|
|
98
|
+
size={80}
|
|
99
|
+
class={iconColors[pending.options.icon]}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
{/key}
|
|
103
|
+
{/if}
|
|
108
104
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
{#if pending.options.title}
|
|
106
|
+
<h3 class="mb-2 text-lg font-semibold text-on-surface">
|
|
107
|
+
{pending.options.title}
|
|
108
|
+
</h3>
|
|
109
|
+
{/if}
|
|
114
110
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
111
|
+
{#if pending.options.message}
|
|
112
|
+
<p class="mb-6 text-sm text-on-surface-variant">
|
|
113
|
+
{pending.options.message}
|
|
114
|
+
</p>
|
|
115
|
+
{:else if !pending.options.inputPlaceholder}
|
|
116
|
+
<div class="mb-6"></div>
|
|
117
|
+
{/if}
|
|
122
118
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
119
|
+
{#if pending.options.inputPlaceholder}
|
|
120
|
+
{#if pending.options.inputChoices && pending.options.inputChoices.length > 0}
|
|
121
|
+
<div class="mb-3 flex flex-wrap justify-center gap-1">
|
|
122
|
+
{#each pending.options.inputChoices as choice (choice)}
|
|
123
|
+
<Button
|
|
124
|
+
label={choice}
|
|
125
|
+
size="xs"
|
|
126
|
+
variant={currentInputValue === choice ? "solid" : "outline"}
|
|
127
|
+
color={currentInputValue === choice ? "primary" : "surface"}
|
|
128
|
+
onclick={() => (currentInputValue = choice)}
|
|
129
|
+
/>
|
|
130
|
+
{/each}
|
|
131
|
+
</div>
|
|
132
|
+
{/if}
|
|
137
133
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
134
|
+
<div class="mb-6 text-left">
|
|
135
|
+
{#if pending.options.inputType === "textarea"}
|
|
136
|
+
<Textarea
|
|
137
|
+
bind:value={currentInputValue}
|
|
138
|
+
placeholder={pending.options.inputPlaceholder}
|
|
139
|
+
class="w-full"
|
|
140
|
+
/>
|
|
141
|
+
{:else}
|
|
142
|
+
<Input
|
|
143
|
+
type={pending.options.inputType ?? "text"}
|
|
144
|
+
bind:value={currentInputValue}
|
|
145
|
+
placeholder={pending.options.inputPlaceholder}
|
|
146
|
+
class="w-full"
|
|
147
|
+
onkeydown={(e) => {
|
|
148
|
+
if (e.key === "Enter") {
|
|
149
|
+
e.preventDefault();
|
|
150
|
+
handleConfirm();
|
|
151
|
+
}
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
154
|
+
{/if}
|
|
155
|
+
</div>
|
|
156
|
+
{/if}
|
|
161
157
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
158
|
+
<div class="flex justify-center gap-2">
|
|
159
|
+
{#if showCancel}
|
|
160
|
+
<Button
|
|
161
|
+
label={pending.options.cancelText ?? defaultCancelText}
|
|
162
|
+
variant="outline"
|
|
163
|
+
class="flex-1"
|
|
164
|
+
onclick={handleCancel}
|
|
165
|
+
/>
|
|
166
|
+
{/if}
|
|
167
|
+
<Button
|
|
168
|
+
label={pending.options.confirmText ?? defaultConfirmText}
|
|
169
|
+
variant="solid"
|
|
170
|
+
color={pending.options.confirmColor ?? "primary"}
|
|
171
|
+
class={showCancel ? "flex-1" : "w-full"}
|
|
172
|
+
onclick={handleConfirm}
|
|
173
|
+
/>
|
|
174
|
+
</div>
|
|
175
|
+
</Dialog.Content>
|
|
176
|
+
{/if}
|
|
177
|
+
</Dialog.Portal>
|
|
182
178
|
</Dialog.Root>
|
|
@@ -2,7 +2,7 @@ export type Props = {
|
|
|
2
2
|
confirmText?: string;
|
|
3
3
|
cancelText?: string;
|
|
4
4
|
};
|
|
5
|
-
import type { ConfirmOptions } from
|
|
5
|
+
import type { ConfirmOptions } from "./confirm.types.js";
|
|
6
6
|
declare const ConfirmDialog: import("svelte").Component<Props, {
|
|
7
7
|
show: (options?: ConfirmOptions) => Promise<boolean>;
|
|
8
8
|
}, "">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConfirmOptions } from
|
|
1
|
+
import type { ConfirmOptions } from "./confirm.types.js";
|
|
2
2
|
type ShowFn = (options?: ConfirmOptions) => Promise<boolean>;
|
|
3
3
|
export declare function registerConfirmDialog(fn: ShowFn | null): void;
|
|
4
4
|
export declare const confirmDialog: {
|
|
@@ -5,20 +5,20 @@ export function registerConfirmDialog(fn) {
|
|
|
5
5
|
export const confirmDialog = {
|
|
6
6
|
show(options = {}) {
|
|
7
7
|
if (!showFn) {
|
|
8
|
-
console.warn(
|
|
8
|
+
console.warn("[confirmDialog] ConfirmDialog is not registered — add <ConfirmDialog /> to your root layout.");
|
|
9
9
|
return Promise.resolve(false);
|
|
10
10
|
}
|
|
11
11
|
return showFn(options);
|
|
12
12
|
},
|
|
13
13
|
delete(options = {}) {
|
|
14
14
|
return this.show({
|
|
15
|
-
title:
|
|
16
|
-
message:
|
|
17
|
-
confirmText:
|
|
18
|
-
cancelText:
|
|
19
|
-
icon:
|
|
20
|
-
confirmColor:
|
|
21
|
-
...options
|
|
15
|
+
title: "Delete this item?",
|
|
16
|
+
message: "This action is permanent and cannot be undone.",
|
|
17
|
+
confirmText: "Delete",
|
|
18
|
+
cancelText: "Cancel",
|
|
19
|
+
icon: "warning",
|
|
20
|
+
confirmColor: "error",
|
|
21
|
+
...options,
|
|
22
22
|
});
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
24
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ButtonProps } from
|
|
2
|
-
export type ConfirmIcon =
|
|
3
|
-
export type ConfirmColor = NonNullable<ButtonProps[
|
|
1
|
+
import type { ButtonProps } from "sv5ui";
|
|
2
|
+
export type ConfirmIcon = "warning" | "error" | "question" | "info" | "success";
|
|
3
|
+
export type ConfirmColor = NonNullable<ButtonProps["color"]>;
|
|
4
4
|
export interface ConfirmOptions {
|
|
5
5
|
title?: string;
|
|
6
6
|
message?: string;
|
|
@@ -14,7 +14,7 @@ export interface ConfirmOptions {
|
|
|
14
14
|
dismissible?: boolean;
|
|
15
15
|
inputPlaceholder?: string;
|
|
16
16
|
inputValue?: string;
|
|
17
|
-
inputType?:
|
|
17
|
+
inputType?: "text" | "password" | "email" | "number" | "textarea";
|
|
18
18
|
inputChoices?: string[];
|
|
19
19
|
onConfirm?: (value?: string) => void;
|
|
20
20
|
onCancel?: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as ConfirmDialog } from
|
|
2
|
-
export { confirmDialog, registerConfirmDialog } from
|
|
3
|
-
export type { ConfirmOptions, ConfirmIcon, ConfirmColor } from
|
|
4
|
-
export type { ConfirmDialogUtility } from
|
|
1
|
+
export { default as ConfirmDialog } from "./ConfirmDialog.svelte";
|
|
2
|
+
export { confirmDialog, registerConfirmDialog } from "./confirm.js";
|
|
3
|
+
export type { ConfirmOptions, ConfirmIcon, ConfirmColor } from "./confirm.types.js";
|
|
4
|
+
export type { ConfirmDialogUtility } from "./confirm.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as ConfirmDialog } from
|
|
2
|
-
export { confirmDialog, registerConfirmDialog } from
|
|
1
|
+
export { default as ConfirmDialog } from "./ConfirmDialog.svelte";
|
|
2
|
+
export { confirmDialog, registerConfirmDialog } from "./confirm.js";
|
|
@@ -27,15 +27,15 @@ function handleValueChange(next) {
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<DatePicker
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
value={pickerValue}
|
|
31
|
+
onValueChange={handleValueChange}
|
|
32
|
+
{name}
|
|
33
|
+
{granularity}
|
|
34
|
+
{hourCycle}
|
|
35
|
+
{locale}
|
|
36
|
+
{weekStartsOn}
|
|
37
|
+
{required}
|
|
38
|
+
{disabled}
|
|
39
|
+
{readonly}
|
|
40
|
+
class={className}
|
|
41
41
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { DatePickerFieldProps as Props } from
|
|
2
|
-
import type { DatePickerFieldProps } from
|
|
1
|
+
export type { DatePickerFieldProps as Props } from "./date-picker-field.types.js";
|
|
2
|
+
import type { DatePickerFieldProps } from "./date-picker-field.types.js";
|
|
3
3
|
declare const DatePickerField: import("svelte").Component<DatePickerFieldProps, {}, "value">;
|
|
4
4
|
type DatePickerField = ReturnType<typeof DatePickerField>;
|
|
5
5
|
export default DatePickerField;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as DatePickerField } from
|
|
2
|
-
export type { DateFieldGranularity, DatePickerFieldProps } from
|
|
1
|
+
export { default as DatePickerField } from "./DatePickerField.svelte";
|
|
2
|
+
export type { DateFieldGranularity, DatePickerFieldProps } from "./date-picker-field.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as DatePickerField } from
|
|
1
|
+
export { default as DatePickerField } from "./DatePickerField.svelte";
|
|
@@ -56,32 +56,32 @@ function handleClear() {
|
|
|
56
56
|
</script>
|
|
57
57
|
|
|
58
58
|
<div class="flex items-center gap-2">
|
|
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
|
-
|
|
59
|
+
<DateRangePicker
|
|
60
|
+
bind:value={pickerValue}
|
|
61
|
+
onValueChange={handleValueChange}
|
|
62
|
+
onStartValueChange={handleStartValueChange}
|
|
63
|
+
onEndValueChange={handleEndValueChange}
|
|
64
|
+
{granularity}
|
|
65
|
+
timeInput={showTimeInput}
|
|
66
|
+
{hourCycle}
|
|
67
|
+
{locale}
|
|
68
|
+
{weekStartsOn}
|
|
69
|
+
{required}
|
|
70
|
+
{disabled}
|
|
71
|
+
{readonly}
|
|
72
|
+
class={className}
|
|
73
|
+
/>
|
|
74
|
+
{#if clearable && (start || end) && !disabled && !readonly}
|
|
75
|
+
<Button
|
|
76
|
+
type="button"
|
|
77
|
+
variant="ghost"
|
|
78
|
+
color="secondary"
|
|
79
|
+
size="sm"
|
|
80
|
+
icon="lucide:x"
|
|
81
|
+
onclick={handleClear}
|
|
82
|
+
aria-label={clearLabel}
|
|
83
|
+
/>
|
|
84
|
+
{/if}
|
|
85
85
|
</div>
|
|
86
86
|
<input type="hidden" name={startName} value={start} />
|
|
87
87
|
<input type="hidden" name={endName} value={end} />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { DateRangePickerFieldProps as Props } from
|
|
2
|
-
import type { DateRangePickerFieldProps } from
|
|
1
|
+
export type { DateRangePickerFieldProps as Props } from "./date-range-picker-field.types.js";
|
|
2
|
+
import type { DateRangePickerFieldProps } from "./date-range-picker-field.types.js";
|
|
3
3
|
declare const DateRangePickerField: import("svelte").Component<DateRangePickerFieldProps, {}, "start" | "end">;
|
|
4
4
|
type DateRangePickerField = ReturnType<typeof DateRangePickerField>;
|
|
5
5
|
export default DateRangePickerField;
|