@ouraihub/aether-ui 0.0.0-stage → 0.1.0
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/LICENSE +789 -0
- package/fixtures/model-classify.json +42 -0
- package/fixtures/pricing-cost.json +56 -0
- package/fixtures/reasoning-infer.json +44 -0
- package/fixtures/sse/anthropic-messages/chinese.sse +24 -0
- package/fixtures/sse/anthropic-messages/multi-tool.sse +33 -0
- package/fixtures/sse/anthropic-messages/single-tool.sse +39 -0
- package/fixtures/sse/anthropic-messages/text.sse +27 -0
- package/fixtures/sse/anthropic-messages/truncated.sse +21 -0
- package/fixtures/sse/anthropic-messages/upstream-error.sse +12 -0
- package/fixtures/sse/expect.json +20 -0
- package/fixtures/sse/openai-chat/chinese.sse +14 -0
- package/fixtures/sse/openai-chat/multi-tool.sse +18 -0
- package/fixtures/sse/openai-chat/single-tool.sse +22 -0
- package/fixtures/sse/openai-chat/text.sse +14 -0
- package/fixtures/sse/openai-chat/truncated.sse +12 -0
- package/fixtures/sse/openai-chat/upstream-error.sse +6 -0
- package/fixtures/sse/openai-responses/chinese.sse +33 -0
- package/fixtures/sse/openai-responses/multi-tool.sse +36 -0
- package/fixtures/sse/openai-responses/single-tool.sse +27 -0
- package/fixtures/sse/openai-responses/text.sse +33 -0
- package/fixtures/sse/openai-responses/truncated.sse +30 -0
- package/fixtures/sse/openai-responses/upstream-error.sse +9 -0
- package/package.json +71 -3
- package/src/CopyInput.svelte +33 -0
- package/src/KitNotifier.svelte +33 -0
- package/src/chat/ApprovalCard.svelte +23 -0
- package/src/chat/ChatPanel.svelte +2097 -0
- package/src/chat/MessageItem.svelte +583 -0
- package/src/chat/SkillPicker.svelte +126 -0
- package/src/chat/ToolCallItem.svelte +23 -0
- package/src/chat/UsageDetails.svelte +138 -0
- package/src/chat/index.ts +2 -0
- package/src/chat/run-session.svelte.ts +556 -0
- package/src/components/ui/alert/alert-action.svelte +20 -0
- package/src/components/ui/alert/alert-description.svelte +23 -0
- package/src/components/ui/alert/alert-title.svelte +23 -0
- package/src/components/ui/alert/alert.svelte +43 -0
- package/src/components/ui/alert/index.ts +17 -0
- package/src/components/ui/alert-dialog/alert-dialog-action.svelte +27 -0
- package/src/components/ui/alert-dialog/alert-dialog-cancel.svelte +27 -0
- package/src/components/ui/alert-dialog/alert-dialog-content.svelte +32 -0
- package/src/components/ui/alert-dialog/alert-dialog-description.svelte +17 -0
- package/src/components/ui/alert-dialog/alert-dialog-footer.svelte +23 -0
- package/src/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
- package/src/components/ui/alert-dialog/alert-dialog-media.svelte +20 -0
- package/src/components/ui/alert-dialog/alert-dialog-overlay.svelte +17 -0
- package/src/components/ui/alert-dialog/alert-dialog-portal.svelte +7 -0
- package/src/components/ui/alert-dialog/alert-dialog-title.svelte +17 -0
- package/src/components/ui/alert-dialog/alert-dialog-trigger.svelte +7 -0
- package/src/components/ui/alert-dialog/alert-dialog.svelte +7 -0
- package/src/components/ui/alert-dialog/index.ts +40 -0
- package/src/components/ui/button/button.svelte +81 -0
- package/src/components/ui/button/index.ts +17 -0
- package/src/components/ui/dialog/dialog-close.svelte +11 -0
- package/src/components/ui/dialog/dialog-content.svelte +48 -0
- package/src/components/ui/dialog/dialog-description.svelte +17 -0
- package/src/components/ui/dialog/dialog-footer.svelte +32 -0
- package/src/components/ui/dialog/dialog-header.svelte +20 -0
- package/src/components/ui/dialog/dialog-overlay.svelte +17 -0
- package/src/components/ui/dialog/dialog-portal.svelte +7 -0
- package/src/components/ui/dialog/dialog-title.svelte +17 -0
- package/src/components/ui/dialog/dialog-trigger.svelte +11 -0
- package/src/components/ui/dialog/dialog.svelte +7 -0
- package/src/components/ui/dialog/index.ts +34 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +46 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-content.svelte +31 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-group.svelte +7 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-portal.svelte +7 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +17 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +36 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +31 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-sub.svelte +7 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
- package/src/components/ui/dropdown-menu/dropdown-menu.svelte +7 -0
- package/src/components/ui/dropdown-menu/index.ts +54 -0
- package/src/components/ui/empty/empty-content.svelte +23 -0
- package/src/components/ui/empty/empty-description.svelte +23 -0
- package/src/components/ui/empty/empty-header.svelte +20 -0
- package/src/components/ui/empty/empty-media.svelte +41 -0
- package/src/components/ui/empty/empty-title.svelte +20 -0
- package/src/components/ui/empty/empty.svelte +23 -0
- package/src/components/ui/empty/index.ts +22 -0
- package/src/components/ui/field/field-content.svelte +20 -0
- package/src/components/ui/field/field-description.svelte +25 -0
- package/src/components/ui/field/field-error.svelte +58 -0
- package/src/components/ui/field/field-group.svelte +23 -0
- package/src/components/ui/field/field-label.svelte +25 -0
- package/src/components/ui/field/field-legend.svelte +24 -0
- package/src/components/ui/field/field-separator.svelte +35 -0
- package/src/components/ui/field/field-set.svelte +20 -0
- package/src/components/ui/field/field-title.svelte +20 -0
- package/src/components/ui/field/field.svelte +47 -0
- package/src/components/ui/field/index.ts +33 -0
- package/src/components/ui/input/index.ts +7 -0
- package/src/components/ui/input/input.svelte +48 -0
- package/src/components/ui/label/index.ts +7 -0
- package/src/components/ui/label/label.svelte +20 -0
- package/src/components/ui/select/index.ts +40 -0
- package/src/components/ui/select/select-content.svelte +45 -0
- package/src/components/ui/select/select-group-heading.svelte +21 -0
- package/src/components/ui/select/select-group.svelte +17 -0
- package/src/components/ui/select/select-item.svelte +43 -0
- package/src/components/ui/select/select-label.svelte +20 -0
- package/src/components/ui/select/select-portal.svelte +7 -0
- package/src/components/ui/select/select-scroll-down-button.svelte +20 -0
- package/src/components/ui/select/select-scroll-up-button.svelte +20 -0
- package/src/components/ui/select/select-separator.svelte +18 -0
- package/src/components/ui/select/select-trigger.svelte +29 -0
- package/src/components/ui/select/select-value.svelte +7 -0
- package/src/components/ui/select/select.svelte +11 -0
- package/src/components/ui/separator/index.ts +7 -0
- package/src/components/ui/separator/separator.svelte +21 -0
- package/src/components/ui/sonner/index.ts +1 -0
- package/src/components/ui/sonner/sonner.svelte +40 -0
- package/src/components/ui/switch/index.ts +7 -0
- package/src/components/ui/switch/switch.svelte +34 -0
- package/src/components/ui/textarea/index.ts +7 -0
- package/src/components/ui/textarea/textarea.svelte +22 -0
- package/src/context.ts +34 -0
- package/src/dev/Demo.svelte +45 -0
- package/src/dev/main.ts +7 -0
- package/src/i18n/en.ts +617 -0
- package/src/i18n/index.ts +23 -0
- package/src/i18n/zh-CN.ts +599 -0
- package/src/index.ts +10 -0
- package/src/logs/LogPanel.svelte +97 -0
- package/src/logs/LogSettings.svelte +56 -0
- package/src/logs/index.ts +5 -0
- package/src/logs/logger.ts +96 -0
- package/src/markdown.ts +8 -0
- package/src/mcp/McpClientSettings.svelte +491 -0
- package/src/mcp/McpServerSettings.svelte +327 -0
- package/src/mcp/config.ts +26 -0
- package/src/mcp/index.ts +3 -0
- package/src/mcp/input.ts +73 -0
- package/src/notify.svelte.ts +43 -0
- package/src/ports/contract.ts +165 -0
- package/src/ports/fake.ts +484 -0
- package/src/ports/index.ts +7 -0
- package/src/ports/search.ts +47 -0
- package/src/ports/skill-sources.ts +45 -0
- package/src/providers/EndpointKeysDialog.svelte +343 -0
- package/src/providers/EndpointPanel.svelte +491 -0
- package/src/providers/ModelPickerDialog.svelte +187 -0
- package/src/providers/ModelSelect.svelte +434 -0
- package/src/providers/ModelSettingsDialog.svelte +453 -0
- package/src/providers/ProvidersSettings.svelte +631 -0
- package/src/providers/RequestConfigDialog.svelte +250 -0
- package/src/providers/SecretInput.svelte +276 -0
- package/src/providers/draft.ts +329 -0
- package/src/providers/edit-session.ts +146 -0
- package/src/providers/index.ts +5 -0
- package/src/providers/reasoning.ts +41 -0
- package/src/providers/revision.svelte.ts +4 -0
- package/src/search/SearchSettings.svelte +703 -0
- package/src/search/index.ts +13 -0
- package/src/search/settings-flow.ts +62 -0
- package/src/session.ts +20 -0
- package/src/skills/SkillAdd.svelte +347 -0
- package/src/skills/SkillAuthoring.svelte +381 -0
- package/src/skills/SkillEditor.svelte +94 -0
- package/src/skills/SkillPreviewDialog.svelte +122 -0
- package/src/skills/SkillsSettings.svelte +140 -0
- package/src/skills/error.ts +32 -0
- package/src/skills/index.ts +4 -0
- package/src/styles/kit.css +137 -0
- package/src/styles/tokens.css +22 -0
- package/src/tauri/index.ts +282 -0
- package/src/utils.ts +22 -0
- package/src/web/index.ts +376 -0
- package/README.md +0 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import {
|
|
4
|
+
buttonVariants,
|
|
5
|
+
type ButtonVariant,
|
|
6
|
+
type ButtonSize,
|
|
7
|
+
} from "#lib/components/ui/button/index.js";
|
|
8
|
+
import { cn } from "#lib/utils.js";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
class: className,
|
|
13
|
+
variant = "default",
|
|
14
|
+
size = "default",
|
|
15
|
+
...restProps
|
|
16
|
+
}: AlertDialogPrimitive.ActionProps & {
|
|
17
|
+
variant?: ButtonVariant;
|
|
18
|
+
size?: ButtonSize;
|
|
19
|
+
} = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<AlertDialogPrimitive.Action
|
|
23
|
+
bind:ref
|
|
24
|
+
data-slot="alert-dialog-action"
|
|
25
|
+
class={cn(buttonVariants({ variant, size }), "", className)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import {
|
|
4
|
+
buttonVariants,
|
|
5
|
+
type ButtonVariant,
|
|
6
|
+
type ButtonSize,
|
|
7
|
+
} from "#lib/components/ui/button/index.js";
|
|
8
|
+
import { cn } from "#lib/utils.js";
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
class: className,
|
|
13
|
+
variant = "outline",
|
|
14
|
+
size = "default",
|
|
15
|
+
...restProps
|
|
16
|
+
}: AlertDialogPrimitive.CancelProps & {
|
|
17
|
+
variant?: ButtonVariant;
|
|
18
|
+
size?: ButtonSize;
|
|
19
|
+
} = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<AlertDialogPrimitive.Cancel
|
|
23
|
+
bind:ref
|
|
24
|
+
data-slot="alert-dialog-cancel"
|
|
25
|
+
class={cn(buttonVariants({ variant, size }), "", className)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn, type WithoutChild, type WithoutChildrenOrChild } from "#lib/utils.js";
|
|
4
|
+
import AlertDialogOverlay from "./alert-dialog-overlay.svelte";
|
|
5
|
+
import AlertDialogPortal from "./alert-dialog-portal.svelte";
|
|
6
|
+
import type { ComponentProps } from "svelte";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
class: className,
|
|
11
|
+
size = "default",
|
|
12
|
+
portalProps,
|
|
13
|
+
...restProps
|
|
14
|
+
}: WithoutChild<AlertDialogPrimitive.ContentProps> & {
|
|
15
|
+
size?: "default" | "sm";
|
|
16
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof AlertDialogPortal>>;
|
|
17
|
+
} = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<AlertDialogPortal {...portalProps}>
|
|
21
|
+
<AlertDialogOverlay />
|
|
22
|
+
<AlertDialogPrimitive.Content
|
|
23
|
+
bind:ref
|
|
24
|
+
data-slot="alert-dialog-content"
|
|
25
|
+
data-size={size}
|
|
26
|
+
class={cn(
|
|
27
|
+
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-popover text-popover-foreground ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",
|
|
28
|
+
className
|
|
29
|
+
)}
|
|
30
|
+
{...restProps}
|
|
31
|
+
/>
|
|
32
|
+
</AlertDialogPortal>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "#lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: AlertDialogPrimitive.DescriptionProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AlertDialogPrimitive.Description
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="alert-dialog-description"
|
|
15
|
+
class={cn("text-muted-foreground *:[a]:hover:text-foreground text-kit-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "#lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="alert-dialog-footer"
|
|
16
|
+
class={cn(
|
|
17
|
+
"bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "#lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="alert-dialog-header"
|
|
16
|
+
class={cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "#lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="alert-dialog-media"
|
|
16
|
+
class={cn("bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-kit sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "#lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: AlertDialogPrimitive.OverlayProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AlertDialogPrimitive.Overlay
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="alert-dialog-overlay"
|
|
15
|
+
class={cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "#lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: AlertDialogPrimitive.TitleProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AlertDialogPrimitive.Title
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="alert-dialog-title"
|
|
15
|
+
class={cn("text-kit-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
|
|
3
|
+
|
|
4
|
+
let { ref = $bindable(null), ...restProps }: AlertDialogPrimitive.TriggerProps = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<AlertDialogPrimitive.Trigger bind:ref data-slot="alert-dialog-trigger" {...restProps} />
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Action from "./alert-dialog-action.svelte";
|
|
2
|
+
import Cancel from "./alert-dialog-cancel.svelte";
|
|
3
|
+
import Content from "./alert-dialog-content.svelte";
|
|
4
|
+
import Description from "./alert-dialog-description.svelte";
|
|
5
|
+
import Footer from "./alert-dialog-footer.svelte";
|
|
6
|
+
import Header from "./alert-dialog-header.svelte";
|
|
7
|
+
import Media from "./alert-dialog-media.svelte";
|
|
8
|
+
import Overlay from "./alert-dialog-overlay.svelte";
|
|
9
|
+
import Portal from "./alert-dialog-portal.svelte";
|
|
10
|
+
import Title from "./alert-dialog-title.svelte";
|
|
11
|
+
import Trigger from "./alert-dialog-trigger.svelte";
|
|
12
|
+
import Root from "./alert-dialog.svelte";
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
Root,
|
|
16
|
+
Title,
|
|
17
|
+
Action,
|
|
18
|
+
Cancel,
|
|
19
|
+
Portal,
|
|
20
|
+
Footer,
|
|
21
|
+
Header,
|
|
22
|
+
Trigger,
|
|
23
|
+
Overlay,
|
|
24
|
+
Content,
|
|
25
|
+
Description,
|
|
26
|
+
Media,
|
|
27
|
+
//
|
|
28
|
+
Root as AlertDialog,
|
|
29
|
+
Title as AlertDialogTitle,
|
|
30
|
+
Action as AlertDialogAction,
|
|
31
|
+
Cancel as AlertDialogCancel,
|
|
32
|
+
Portal as AlertDialogPortal,
|
|
33
|
+
Footer as AlertDialogFooter,
|
|
34
|
+
Header as AlertDialogHeader,
|
|
35
|
+
Trigger as AlertDialogTrigger,
|
|
36
|
+
Overlay as AlertDialogOverlay,
|
|
37
|
+
Content as AlertDialogContent,
|
|
38
|
+
Description as AlertDialogDescription,
|
|
39
|
+
Media as AlertDialogMedia,
|
|
40
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { cn, tv, type VariantProps, type WithElementRef } from "#lib/utils.js";
|
|
3
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
export const buttonVariants = tv({
|
|
6
|
+
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-kit border border-transparent bg-clip-padding text-kit-base font-medium focus-visible:ring-3 aria-invalid:ring-3 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-[color,background-color,border-color,box-shadow,translate] outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
10
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
12
|
+
ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
13
|
+
destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-kit-control gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
18
|
+
xs: "h-6 gap-1 rounded-kit-sm px-2 text-kit-xs in-data-[slot=button-group]:rounded-kit has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
19
|
+
sm: "h-kit-control-sm gap-1 rounded-kit-sm px-2.5 text-kit-base in-data-[slot=button-group]:rounded-kit has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
20
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
21
|
+
icon: "size-kit-control",
|
|
22
|
+
"icon-xs": "size-6 rounded-kit-sm in-data-[slot=button-group]:rounded-kit [&_svg:not([class*='size-'])]:size-3",
|
|
23
|
+
"icon-sm": "size-kit-control-sm rounded-kit-sm in-data-[slot=button-group]:rounded-kit",
|
|
24
|
+
"icon-lg": "size-9",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: "default",
|
|
29
|
+
size: "default",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
|
|
34
|
+
export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
|
|
35
|
+
|
|
36
|
+
export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
|
|
37
|
+
WithElementRef<HTMLAnchorAttributes> & {
|
|
38
|
+
variant?: ButtonVariant;
|
|
39
|
+
size?: ButtonSize;
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<script lang="ts">
|
|
44
|
+
let {
|
|
45
|
+
class: className,
|
|
46
|
+
variant = "default",
|
|
47
|
+
size = "default",
|
|
48
|
+
ref = $bindable(null),
|
|
49
|
+
href = undefined,
|
|
50
|
+
type = "button",
|
|
51
|
+
disabled,
|
|
52
|
+
children,
|
|
53
|
+
...restProps
|
|
54
|
+
}: ButtonProps = $props();
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
{#if href}
|
|
58
|
+
<a
|
|
59
|
+
bind:this={ref}
|
|
60
|
+
data-slot="button"
|
|
61
|
+
class={cn(buttonVariants({ variant, size }), className)}
|
|
62
|
+
href={disabled ? undefined : href}
|
|
63
|
+
aria-disabled={disabled}
|
|
64
|
+
role={disabled ? "link" : undefined}
|
|
65
|
+
tabindex={disabled ? -1 : undefined}
|
|
66
|
+
{...restProps}
|
|
67
|
+
>
|
|
68
|
+
{@render children?.()}
|
|
69
|
+
</a>
|
|
70
|
+
{:else}
|
|
71
|
+
<button
|
|
72
|
+
bind:this={ref}
|
|
73
|
+
data-slot="button"
|
|
74
|
+
class={cn(buttonVariants({ variant, size }), className)}
|
|
75
|
+
{type}
|
|
76
|
+
{disabled}
|
|
77
|
+
{...restProps}
|
|
78
|
+
>
|
|
79
|
+
{@render children?.()}
|
|
80
|
+
</button>
|
|
81
|
+
{/if}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Root, {
|
|
2
|
+
type ButtonProps,
|
|
3
|
+
type ButtonSize,
|
|
4
|
+
type ButtonVariant,
|
|
5
|
+
buttonVariants,
|
|
6
|
+
} from "./button.svelte";
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
Root,
|
|
10
|
+
type ButtonProps as Props,
|
|
11
|
+
//
|
|
12
|
+
Root as Button,
|
|
13
|
+
buttonVariants,
|
|
14
|
+
type ButtonProps,
|
|
15
|
+
type ButtonSize,
|
|
16
|
+
type ButtonVariant,
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
type = "button",
|
|
7
|
+
...restProps
|
|
8
|
+
}: DialogPrimitive.CloseProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DialogPrimitive.Close bind:ref data-slot="dialog-close" {type} {...restProps} />
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
import XIcon from '@lucide/svelte/icons/x';
|
|
4
|
+
import { Button } from "#lib/components/ui/button/index.js";
|
|
5
|
+
import { cn, type WithoutChildrenOrChild } from "#lib/utils.js";
|
|
6
|
+
import * as Dialog from "./index.js";
|
|
7
|
+
import DialogPortal from "./dialog-portal.svelte";
|
|
8
|
+
import type { Snippet } from "svelte";
|
|
9
|
+
import type { ComponentProps } from "svelte";
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
ref = $bindable(null),
|
|
13
|
+
class: className,
|
|
14
|
+
portalProps,
|
|
15
|
+
children,
|
|
16
|
+
showCloseButton = true,
|
|
17
|
+
...restProps
|
|
18
|
+
}: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {
|
|
19
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DialogPortal>>;
|
|
20
|
+
children: Snippet;
|
|
21
|
+
showCloseButton?: boolean;
|
|
22
|
+
} = $props();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<DialogPortal {...portalProps}>
|
|
26
|
+
<Dialog.Overlay />
|
|
27
|
+
<DialogPrimitive.Content
|
|
28
|
+
bind:ref
|
|
29
|
+
data-slot="dialog-content"
|
|
30
|
+
class={cn(
|
|
31
|
+
"bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%_-_2rem)] gap-4 rounded-xl p-4 text-kit-base ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...restProps}
|
|
35
|
+
>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
{#if showCloseButton}
|
|
38
|
+
<DialogPrimitive.Close data-slot="dialog-close">
|
|
39
|
+
{#snippet child({ props })}
|
|
40
|
+
<Button variant="ghost" class="absolute top-2 right-2" size="icon-sm" {...props}>
|
|
41
|
+
<XIcon />
|
|
42
|
+
<span class="sr-only">Close</span>
|
|
43
|
+
</Button>
|
|
44
|
+
{/snippet}
|
|
45
|
+
</DialogPrimitive.Close>
|
|
46
|
+
{/if}
|
|
47
|
+
</DialogPrimitive.Content>
|
|
48
|
+
</DialogPortal>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "#lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DialogPrimitive.DescriptionProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DialogPrimitive.Description
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="dialog-description"
|
|
15
|
+
class={cn("text-muted-foreground *:[a]:hover:text-foreground text-kit-sm *:[a]:underline *:[a]:underline-offset-3", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
import { Button } from "#lib/components/ui/button/index.js";
|
|
4
|
+
import { cn, type WithElementRef } from "#lib/utils.js";
|
|
5
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
showCloseButton = false,
|
|
12
|
+
...restProps
|
|
13
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
14
|
+
showCloseButton?: boolean;
|
|
15
|
+
} = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div
|
|
19
|
+
bind:this={ref}
|
|
20
|
+
data-slot="dialog-footer"
|
|
21
|
+
class={cn("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
{#if showCloseButton}
|
|
26
|
+
<DialogPrimitive.Close>
|
|
27
|
+
{#snippet child({ props })}
|
|
28
|
+
<Button variant="outline" {...props}>Close</Button>
|
|
29
|
+
{/snippet}
|
|
30
|
+
</DialogPrimitive.Close>
|
|
31
|
+
{/if}
|
|
32
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "#lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="dialog-header"
|
|
16
|
+
class={cn("gap-2 flex flex-col", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "#lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DialogPrimitive.OverlayProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DialogPrimitive.Overlay
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="dialog-overlay"
|
|
15
|
+
class={cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "#lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DialogPrimitive.TitleProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DialogPrimitive.Title
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="dialog-title"
|
|
15
|
+
class={cn("text-kit-lg leading-none font-semibold", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
type = "button",
|
|
7
|
+
...restProps
|
|
8
|
+
}: DialogPrimitive.TriggerProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DialogPrimitive.Trigger bind:ref data-slot="dialog-trigger" {type} {...restProps} />
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Close from "./dialog-close.svelte";
|
|
2
|
+
import Content from "./dialog-content.svelte";
|
|
3
|
+
import Description from "./dialog-description.svelte";
|
|
4
|
+
import Footer from "./dialog-footer.svelte";
|
|
5
|
+
import Header from "./dialog-header.svelte";
|
|
6
|
+
import Overlay from "./dialog-overlay.svelte";
|
|
7
|
+
import Portal from "./dialog-portal.svelte";
|
|
8
|
+
import Title from "./dialog-title.svelte";
|
|
9
|
+
import Trigger from "./dialog-trigger.svelte";
|
|
10
|
+
import Root from "./dialog.svelte";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
Root,
|
|
14
|
+
Title,
|
|
15
|
+
Portal,
|
|
16
|
+
Footer,
|
|
17
|
+
Header,
|
|
18
|
+
Trigger,
|
|
19
|
+
Overlay,
|
|
20
|
+
Content,
|
|
21
|
+
Description,
|
|
22
|
+
Close,
|
|
23
|
+
//
|
|
24
|
+
Root as Dialog,
|
|
25
|
+
Title as DialogTitle,
|
|
26
|
+
Portal as DialogPortal,
|
|
27
|
+
Footer as DialogFooter,
|
|
28
|
+
Header as DialogHeader,
|
|
29
|
+
Trigger as DialogTrigger,
|
|
30
|
+
Overlay as DialogOverlay,
|
|
31
|
+
Content as DialogContent,
|
|
32
|
+
Description as DialogDescription,
|
|
33
|
+
Close as DialogClose,
|
|
34
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
value = $bindable([]),
|
|
7
|
+
...restProps
|
|
8
|
+
}: DropdownMenuPrimitive.CheckboxGroupProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<DropdownMenuPrimitive.CheckboxGroup
|
|
12
|
+
bind:ref
|
|
13
|
+
bind:value
|
|
14
|
+
data-slot="dropdown-menu-checkbox-group"
|
|
15
|
+
{...restProps}
|
|
16
|
+
/>
|