@signal9/era-ui 2.2.0 → 2.3.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/dist/ai/actions/action.svelte +41 -0
- package/dist/ai/actions/action.svelte.d.ts +12 -0
- package/dist/ai/actions/actions.svelte +15 -0
- package/dist/ai/actions/actions.svelte.d.ts +8 -0
- package/dist/ai/actions/index.d.ts +2 -0
- package/dist/ai/actions/index.js +2 -0
- package/dist/ai/artifact/artifact-actions.svelte +7 -0
- package/dist/ai/artifact/artifact-actions.svelte.d.ts +8 -0
- package/dist/ai/artifact/artifact-close.svelte +9 -0
- package/dist/ai/artifact/artifact-close.svelte.d.ts +6 -0
- package/dist/ai/artifact/artifact-content.svelte +7 -0
- package/dist/ai/artifact/artifact-content.svelte.d.ts +8 -0
- package/dist/ai/artifact/artifact-description.svelte +7 -0
- package/dist/ai/artifact/artifact-description.svelte.d.ts +8 -0
- package/dist/ai/artifact/artifact-header.svelte +16 -0
- package/dist/ai/artifact/artifact-header.svelte.d.ts +8 -0
- package/dist/ai/artifact/artifact-title.svelte +7 -0
- package/dist/ai/artifact/artifact-title.svelte.d.ts +8 -0
- package/dist/ai/artifact/artifact.svelte +16 -0
- package/dist/ai/artifact/artifact.svelte.d.ts +8 -0
- package/dist/ai/artifact/index.d.ts +8 -0
- package/dist/ai/artifact/index.js +8 -0
- package/dist/ai/chain-of-thought/chain-of-thought-step.svelte +39 -0
- package/dist/ai/chain-of-thought/chain-of-thought-step.svelte.d.ts +11 -0
- package/dist/ai/chain-of-thought/chain-of-thought.svelte +30 -0
- package/dist/ai/chain-of-thought/chain-of-thought.svelte.d.ts +11 -0
- package/dist/ai/chain-of-thought/index.d.ts +3 -0
- package/dist/ai/chain-of-thought/index.js +3 -0
- package/dist/ai/checkpoint.svelte +27 -0
- package/dist/ai/checkpoint.svelte.d.ts +10 -0
- package/dist/ai/confirmation/confirmation-actions.svelte +9 -0
- package/dist/ai/confirmation/confirmation-actions.svelte.d.ts +8 -0
- package/dist/ai/confirmation/confirmation.svelte +36 -0
- package/dist/ai/confirmation/confirmation.svelte.d.ts +11 -0
- package/dist/ai/confirmation/index.d.ts +2 -0
- package/dist/ai/confirmation/index.js +2 -0
- package/dist/ai/context/context.svelte +49 -0
- package/dist/ai/context/context.svelte.d.ts +9 -0
- package/dist/ai/context/index.d.ts +1 -0
- package/dist/ai/context/index.js +1 -0
- package/dist/ai/conversation/context.d.ts +3 -0
- package/dist/ai/conversation/context.js +12 -0
- package/dist/ai/conversation/conversation-content.svelte +32 -0
- package/dist/ai/conversation/conversation-content.svelte.d.ts +8 -0
- package/dist/ai/conversation/conversation-empty-state.svelte +32 -0
- package/dist/ai/conversation/conversation-empty-state.svelte.d.ts +11 -0
- package/dist/ai/conversation/conversation-scroll-button.svelte +27 -0
- package/dist/ai/conversation/conversation-scroll-button.svelte.d.ts +6 -0
- package/dist/ai/conversation/conversation.svelte +21 -0
- package/dist/ai/conversation/conversation.svelte.d.ts +8 -0
- package/dist/ai/conversation/index.d.ts +5 -0
- package/dist/ai/conversation/index.js +5 -0
- package/dist/ai/copy-button.svelte +42 -0
- package/dist/ai/copy-button.svelte.d.ts +8 -0
- package/dist/ai/image.svelte +19 -0
- package/dist/ai/image.svelte.d.ts +8 -0
- package/dist/ai/index.d.ts +29 -0
- package/dist/ai/index.js +31 -0
- package/dist/ai/inline-citation/index.d.ts +1 -0
- package/dist/ai/inline-citation/index.js +1 -0
- package/dist/ai/inline-citation/inline-citation.svelte +66 -0
- package/dist/ai/inline-citation/inline-citation.svelte.d.ts +11 -0
- package/dist/ai/loader.svelte +8 -0
- package/dist/ai/loader.svelte.d.ts +6 -0
- package/dist/ai/message/branch.svelte.d.ts +10 -0
- package/dist/ai/message/branch.svelte.js +28 -0
- package/dist/ai/message/context.d.ts +6 -0
- package/dist/ai/message/context.js +1 -0
- package/dist/ai/message/index.d.ts +8 -0
- package/dist/ai/message/index.js +7 -0
- package/dist/ai/message/message-branch-content.svelte +24 -0
- package/dist/ai/message/message-branch-content.svelte.d.ts +10 -0
- package/dist/ai/message/message-branch-selector.svelte +25 -0
- package/dist/ai/message/message-branch-selector.svelte.d.ts +6 -0
- package/dist/ai/message/message-branch.svelte +25 -0
- package/dist/ai/message/message-branch.svelte.d.ts +9 -0
- package/dist/ai/message/message-content.svelte +24 -0
- package/dist/ai/message/message-content.svelte.d.ts +8 -0
- package/dist/ai/message/message-toolbar.svelte +23 -0
- package/dist/ai/message/message-toolbar.svelte.d.ts +8 -0
- package/dist/ai/message/message.svelte +27 -0
- package/dist/ai/message/message.svelte.d.ts +10 -0
- package/dist/ai/model-selector/index.d.ts +1 -0
- package/dist/ai/model-selector/index.js +1 -0
- package/dist/ai/model-selector/model-selector.svelte +61 -0
- package/dist/ai/model-selector/model-selector.svelte.d.ts +15 -0
- package/dist/ai/open-in-chat/index.d.ts +1 -0
- package/dist/ai/open-in-chat/index.js +1 -0
- package/dist/ai/open-in-chat/open-in-chat.svelte +41 -0
- package/dist/ai/open-in-chat/open-in-chat.svelte.d.ts +32 -0
- package/dist/ai/plan/index.d.ts +3 -0
- package/dist/ai/plan/index.js +3 -0
- package/dist/ai/plan/plan-content.svelte +13 -0
- package/dist/ai/plan/plan-content.svelte.d.ts +8 -0
- package/dist/ai/plan/plan-header.svelte +22 -0
- package/dist/ai/plan/plan-header.svelte.d.ts +9 -0
- package/dist/ai/plan/plan.svelte +23 -0
- package/dist/ai/plan/plan.svelte.d.ts +10 -0
- package/dist/ai/prompt-input/attachments.svelte.d.ts +27 -0
- package/dist/ai/prompt-input/attachments.svelte.js +60 -0
- package/dist/ai/prompt-input/index.d.ts +7 -0
- package/dist/ai/prompt-input/index.js +7 -0
- package/dist/ai/prompt-input/prompt-input-add-attachments.svelte +12 -0
- package/dist/ai/prompt-input/prompt-input-add-attachments.svelte.d.ts +6 -0
- package/dist/ai/prompt-input/prompt-input-attachments.svelte +40 -0
- package/dist/ai/prompt-input/prompt-input-attachments.svelte.d.ts +18 -0
- package/dist/ai/prompt-input/prompt-input-submit.svelte +49 -0
- package/dist/ai/prompt-input/prompt-input-submit.svelte.d.ts +10 -0
- package/dist/ai/prompt-input/prompt-input-textarea.svelte +57 -0
- package/dist/ai/prompt-input/prompt-input-textarea.svelte.d.ts +7 -0
- package/dist/ai/prompt-input/prompt-input-toolbar.svelte +15 -0
- package/dist/ai/prompt-input/prompt-input-toolbar.svelte.d.ts +8 -0
- package/dist/ai/prompt-input/prompt-input.svelte +98 -0
- package/dist/ai/prompt-input/prompt-input.svelte.d.ts +17 -0
- package/dist/ai/queue/index.d.ts +2 -0
- package/dist/ai/queue/index.js +2 -0
- package/dist/ai/queue/queue-item.svelte +26 -0
- package/dist/ai/queue/queue-item.svelte.d.ts +9 -0
- package/dist/ai/queue/queue.svelte +14 -0
- package/dist/ai/queue/queue.svelte.d.ts +8 -0
- package/dist/ai/reasoning/index.d.ts +3 -0
- package/dist/ai/reasoning/index.js +3 -0
- package/dist/ai/reasoning/reasoning-trigger.svelte +22 -0
- package/dist/ai/reasoning/reasoning-trigger.svelte.d.ts +9 -0
- package/dist/ai/reasoning/reasoning.svelte +52 -0
- package/dist/ai/reasoning/reasoning.svelte.d.ts +13 -0
- package/dist/ai/response/index.d.ts +2 -0
- package/dist/ai/response/index.js +2 -0
- package/dist/ai/response/repair.d.ts +7 -0
- package/dist/ai/response/repair.js +26 -0
- package/dist/ai/response/response.svelte +112 -0
- package/dist/ai/response/response.svelte.d.ts +10 -0
- package/dist/ai/shimmer.svelte +15 -0
- package/dist/ai/shimmer.svelte.d.ts +9 -0
- package/dist/ai/sources/index.d.ts +4 -0
- package/dist/ai/sources/index.js +4 -0
- package/dist/ai/sources/source.svelte +16 -0
- package/dist/ai/sources/source.svelte.d.ts +7 -0
- package/dist/ai/sources/sources-trigger.svelte +12 -0
- package/dist/ai/sources/sources-trigger.svelte.d.ts +8 -0
- package/dist/ai/sources/sources.svelte +15 -0
- package/dist/ai/sources/sources.svelte.d.ts +9 -0
- package/dist/ai/suggestion/index.d.ts +2 -0
- package/dist/ai/suggestion/index.js +2 -0
- package/dist/ai/suggestion/suggestion.svelte +25 -0
- package/dist/ai/suggestion/suggestion.svelte.d.ts +10 -0
- package/dist/ai/suggestion/suggestions.svelte +18 -0
- package/dist/ai/suggestion/suggestions.svelte.d.ts +8 -0
- package/dist/ai/task/index.d.ts +5 -0
- package/dist/ai/task/index.js +5 -0
- package/dist/ai/task/task-content.svelte +14 -0
- package/dist/ai/task/task-content.svelte.d.ts +8 -0
- package/dist/ai/task/task-item-file.svelte +8 -0
- package/dist/ai/task/task-item-file.svelte.d.ts +7 -0
- package/dist/ai/task/task-item.svelte +8 -0
- package/dist/ai/task/task-item.svelte.d.ts +8 -0
- package/dist/ai/task/task-trigger.svelte +12 -0
- package/dist/ai/task/task-trigger.svelte.d.ts +8 -0
- package/dist/ai/task/task.svelte +17 -0
- package/dist/ai/task/task.svelte.d.ts +11 -0
- package/dist/ai/tool/index.d.ts +5 -0
- package/dist/ai/tool/index.js +5 -0
- package/dist/ai/tool/tool-header.svelte +20 -0
- package/dist/ai/tool/tool-header.svelte.d.ts +9 -0
- package/dist/ai/tool/tool-input.svelte +10 -0
- package/dist/ai/tool/tool-input.svelte.d.ts +6 -0
- package/dist/ai/tool/tool-output.svelte +20 -0
- package/dist/ai/tool/tool-output.svelte.d.ts +7 -0
- package/dist/ai/tool/tool.svelte +41 -0
- package/dist/ai/tool/tool.svelte.d.ts +12 -0
- package/dist/ai/web-preview/index.d.ts +1 -0
- package/dist/ai/web-preview/index.js +1 -0
- package/dist/ai/web-preview/web-preview.svelte +48 -0
- package/dist/ai/web-preview/web-preview.svelte.d.ts +8 -0
- package/dist/ai/workflow/canvas.svelte +19 -0
- package/dist/ai/workflow/canvas.svelte.d.ts +11 -0
- package/dist/ai/workflow/index.d.ts +2 -0
- package/dist/ai/workflow/index.js +2 -0
- package/dist/ai/workflow/node.svelte +27 -0
- package/dist/ai/workflow/node.svelte.d.ts +9 -0
- package/dist/era-ui.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/ui/step/step-content.svelte +3 -3
- package/package.json +14 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { ComponentProps } from 'svelte';
|
|
4
|
+
import * as Tooltip from '../../ui/tooltip/index.js';
|
|
5
|
+
import { Button } from '../../ui/button/index.js';
|
|
6
|
+
import { cn } from '../../utils/index.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
tooltip,
|
|
10
|
+
label,
|
|
11
|
+
children,
|
|
12
|
+
class: className,
|
|
13
|
+
...restProps
|
|
14
|
+
}: ComponentProps<typeof Button> & {
|
|
15
|
+
/** Hover hint; also the accessible name when `label` is omitted. */
|
|
16
|
+
tooltip?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
children?: Snippet;
|
|
19
|
+
} = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
{#snippet button()}
|
|
23
|
+
<Button icon size="icon" aria-label={label ?? tooltip} class={cn(className)} {...restProps}>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</Button>
|
|
26
|
+
{/snippet}
|
|
27
|
+
|
|
28
|
+
{#if tooltip}
|
|
29
|
+
<Tooltip.Provider delayDuration={150}>
|
|
30
|
+
<Tooltip.Root>
|
|
31
|
+
<Tooltip.Trigger>
|
|
32
|
+
{#snippet child({ props })}
|
|
33
|
+
<span {...props}>{@render button()}</span>
|
|
34
|
+
{/snippet}
|
|
35
|
+
</Tooltip.Trigger>
|
|
36
|
+
<Tooltip.Content>{tooltip}</Tooltip.Content>
|
|
37
|
+
</Tooltip.Root>
|
|
38
|
+
</Tooltip.Provider>
|
|
39
|
+
{:else}
|
|
40
|
+
{@render button()}
|
|
41
|
+
{/if}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
import { Button } from '../../ui/button/index.js';
|
|
4
|
+
type $$ComponentProps = ComponentProps<typeof Button> & {
|
|
5
|
+
/** Hover hint; also the accessible name when `label` is omitted. */
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
};
|
|
10
|
+
declare const Action: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
11
|
+
type Action = ReturnType<typeof Action>;
|
|
12
|
+
export default Action;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import { cn } from '../../utils/index.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div class={cn('flex items-center gap-(--era-gap)', className)} {...restProps}>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const Actions: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type Actions = ReturnType<typeof Actions>;
|
|
8
|
+
export default Actions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { cn } from '../../utils/index.js';
|
|
4
|
+
let { children, class: className }: { children?: Snippet; class?: string } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class={cn('flex shrink-0 items-center gap-(--era-gap)', className)}>{@render children?.()}</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
children?: Snippet;
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const ArtifactActions: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ArtifactActions = ReturnType<typeof ArtifactActions>;
|
|
8
|
+
export default ArtifactActions;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import X from '@lucide/svelte/icons/x';
|
|
3
|
+
import { Button } from '../../ui/button/index.js';
|
|
4
|
+
let { onclick }: { onclick?: (e: MouseEvent) => void } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<Button icon size="icon" aria-label="Close" {onclick}>
|
|
8
|
+
<X class="size-(--era-h-xs)" />
|
|
9
|
+
</Button>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { cn } from '../../utils/index.js';
|
|
4
|
+
let { children, class: className }: { children?: Snippet; class?: string } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class={cn('min-h-0 flex-1 overflow-auto p-(--era-pad-md)', className)}>{@render children?.()}</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
children?: Snippet;
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const ArtifactContent: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ArtifactContent = ReturnType<typeof ArtifactContent>;
|
|
8
|
+
export default ArtifactContent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { cn } from '../../utils/index.js';
|
|
4
|
+
let { children, class: className }: { children?: Snippet; class?: string } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<p class={cn('truncate text-body text-muted', className)}>{@render children?.()}</p>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
children?: Snippet;
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const ArtifactDescription: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ArtifactDescription = ReturnType<typeof ArtifactDescription>;
|
|
8
|
+
export default ArtifactDescription;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import { cn } from '../../utils/index.js';
|
|
5
|
+
let { children, class: className, ...restProps }: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
class={cn(
|
|
10
|
+
'flex h-(--era-h-lg) shrink-0 items-center justify-between gap-(--era-gap) border-b border-divider-faded px-(--era-pad-sm)',
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...restProps}
|
|
14
|
+
>
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const ArtifactHeader: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ArtifactHeader = ReturnType<typeof ArtifactHeader>;
|
|
8
|
+
export default ArtifactHeader;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { cn } from '../../utils/index.js';
|
|
4
|
+
let { children, class: className }: { children?: Snippet; class?: string } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<p class={cn('truncate text-body font-medium text-bright', className)}>{@render children?.()}</p>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
children?: Snippet;
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const ArtifactTitle: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ArtifactTitle = ReturnType<typeof ArtifactTitle>;
|
|
8
|
+
export default ArtifactTitle;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import { cn } from '../../utils/index.js';
|
|
5
|
+
let { children, class: className, ...restProps }: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
class={cn(
|
|
10
|
+
'flex min-h-0 flex-col overflow-hidden rounded-(--era-rd-lg) bg-(--era-surface-bg) shadow-(--era-shadow-lg)',
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...restProps}
|
|
14
|
+
>
|
|
15
|
+
{@render children?.()}
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const Artifact: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type Artifact = ReturnType<typeof Artifact>;
|
|
8
|
+
export default Artifact;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Root } from './artifact.svelte';
|
|
2
|
+
export { default as Header } from './artifact-header.svelte';
|
|
3
|
+
export { default as Title } from './artifact-title.svelte';
|
|
4
|
+
export { default as Description } from './artifact-description.svelte';
|
|
5
|
+
export { default as Actions } from './artifact-actions.svelte';
|
|
6
|
+
export { default as Content } from './artifact-content.svelte';
|
|
7
|
+
export { default as Close } from './artifact-close.svelte';
|
|
8
|
+
export { Action } from '../actions/index.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Root } from './artifact.svelte';
|
|
2
|
+
export { default as Header } from './artifact-header.svelte';
|
|
3
|
+
export { default as Title } from './artifact-title.svelte';
|
|
4
|
+
export { default as Description } from './artifact-description.svelte';
|
|
5
|
+
export { default as Actions } from './artifact-actions.svelte';
|
|
6
|
+
export { default as Content } from './artifact-content.svelte';
|
|
7
|
+
export { default as Close } from './artifact-close.svelte';
|
|
8
|
+
export { Action } from '../actions/index.js';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Component } from 'svelte';
|
|
3
|
+
import type { IconProps } from '@lucide/svelte';
|
|
4
|
+
import Dot from '@lucide/svelte/icons/dot';
|
|
5
|
+
import { cn } from '../../utils/index.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
label,
|
|
9
|
+
description,
|
|
10
|
+
status = 'complete',
|
|
11
|
+
icon
|
|
12
|
+
}: {
|
|
13
|
+
label: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
status?: 'complete' | 'active' | 'pending';
|
|
16
|
+
icon?: Component<IconProps>;
|
|
17
|
+
} = $props();
|
|
18
|
+
|
|
19
|
+
const Icon = $derived(icon ?? Dot);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<!-- One reasoning step on the rail: icon column with a connector line, label
|
|
23
|
+
colored by status (active steps read brighter). -->
|
|
24
|
+
<div class="flex min-w-0 gap-(--era-gap)">
|
|
25
|
+
<div class="flex flex-col items-center">
|
|
26
|
+
<Icon
|
|
27
|
+
class={cn(
|
|
28
|
+
'size-(--era-h-xs) shrink-0',
|
|
29
|
+
status === 'active' ? 'text-bright' : status === 'pending' ? 'text-muted opacity-50' : 'text-muted'
|
|
30
|
+
)}
|
|
31
|
+
aria-hidden="true"
|
|
32
|
+
/>
|
|
33
|
+
<span class="w-px flex-1 bg-divider-faded"></span>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="flex min-w-0 flex-col gap-1 pb-(--era-gap)">
|
|
36
|
+
<span class={cn('text-body', status === 'active' ? 'text-bright' : 'text-fg')}>{label}</span>
|
|
37
|
+
{#if description}<span class="text-body text-muted">{description}</span>{/if}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
import type { IconProps } from '@lucide/svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
status?: 'complete' | 'active' | 'pending';
|
|
7
|
+
icon?: Component<IconProps>;
|
|
8
|
+
};
|
|
9
|
+
declare const ChainOfThoughtStep: Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type ChainOfThoughtStep = ReturnType<typeof ChainOfThoughtStep>;
|
|
11
|
+
export default ChainOfThoughtStep;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import Brain from '@lucide/svelte/icons/brain';
|
|
4
|
+
import * as Step from '../../ui/step/index.js';
|
|
5
|
+
import { cn } from '../../utils/index.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
open = $bindable(false),
|
|
9
|
+
streaming = false,
|
|
10
|
+
label = 'Chain of thought',
|
|
11
|
+
children,
|
|
12
|
+
class: className
|
|
13
|
+
}: {
|
|
14
|
+
open?: boolean;
|
|
15
|
+
streaming?: boolean;
|
|
16
|
+
label?: string;
|
|
17
|
+
children?: Snippet;
|
|
18
|
+
class?: string;
|
|
19
|
+
} = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Step.Root status={streaming ? 'running' : 'done'} bind:open class={cn(className)}>
|
|
23
|
+
<Step.Summary>
|
|
24
|
+
<Brain class="size-(--era-h-xs) shrink-0" aria-hidden="true" />
|
|
25
|
+
{label}
|
|
26
|
+
</Step.Summary>
|
|
27
|
+
<Step.Content class="bg-transparent p-0 shadow-none">
|
|
28
|
+
<div class="flex flex-col">{@render children?.()}</div>
|
|
29
|
+
</Step.Content>
|
|
30
|
+
</Step.Root>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
streaming?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
class?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const ChainOfThought: import("svelte").Component<$$ComponentProps, {}, "open">;
|
|
10
|
+
type ChainOfThought = ReturnType<typeof ChainOfThought>;
|
|
11
|
+
export default ChainOfThought;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import Bookmark from '@lucide/svelte/icons/bookmark';
|
|
4
|
+
import { Button } from '../ui/button/index.js';
|
|
5
|
+
import { Separator } from '../ui/separator/index.js';
|
|
6
|
+
import { cn } from '../utils/index.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
label = 'Restore checkpoint',
|
|
10
|
+
onRestore,
|
|
11
|
+
children,
|
|
12
|
+
class: className
|
|
13
|
+
}: {
|
|
14
|
+
label?: string;
|
|
15
|
+
onRestore?: () => void;
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
class?: string;
|
|
18
|
+
} = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class={cn('flex w-full items-center gap-(--era-gap) text-muted', className)}>
|
|
22
|
+
<Bookmark class="size-(--era-h-xs) shrink-0" aria-hidden="true" />
|
|
23
|
+
<Button variant="link" size="sm" onclick={onRestore}>
|
|
24
|
+
{#if children}{@render children()}{:else}{label}{/if}
|
|
25
|
+
</Button>
|
|
26
|
+
<Separator class="flex-1" />
|
|
27
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
label?: string;
|
|
4
|
+
onRestore?: () => void;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
class?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const Checkpoint: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type Checkpoint = ReturnType<typeof Checkpoint>;
|
|
10
|
+
export default Checkpoint;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { cn } from '../../utils/index.js';
|
|
4
|
+
let { children, class: className }: { children?: Snippet; class?: string } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class={cn('flex items-center justify-end gap-(--era-gap)', className)}>
|
|
8
|
+
{@render children?.()}
|
|
9
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
children?: Snippet;
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const ConfirmationActions: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ConfirmationActions = ReturnType<typeof ConfirmationActions>;
|
|
8
|
+
export default ConfirmationActions;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
/** Where an approval-gated tool call stands. */
|
|
3
|
+
export type ApprovalState = 'requested' | 'approved' | 'rejected';
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import type { Snippet } from 'svelte';
|
|
8
|
+
import ShieldQuestion from '@lucide/svelte/icons/shield-question';
|
|
9
|
+
import CircleCheck from '@lucide/svelte/icons/circle-check';
|
|
10
|
+
import CircleX from '@lucide/svelte/icons/circle-x';
|
|
11
|
+
import { cn } from '../../utils/index.js';
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
state: approval = 'requested',
|
|
15
|
+
children,
|
|
16
|
+
class: className
|
|
17
|
+
}: { state?: ApprovalState; children?: Snippet; class?: string } = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div
|
|
21
|
+
class={cn(
|
|
22
|
+
'flex min-w-0 flex-col gap-(--era-gap) rounded-(--era-rd-lg) bg-(--era-surface-bg) p-(--era-pad-sm) shadow-(--era-shadow)',
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
>
|
|
26
|
+
<div class="flex items-center gap-(--era-gap) text-body">
|
|
27
|
+
{#if approval === 'requested'}
|
|
28
|
+
<ShieldQuestion class="size-(--era-h-xs) shrink-0 text-warning" aria-hidden="true" />
|
|
29
|
+
{:else if approval === 'approved'}
|
|
30
|
+
<CircleCheck class="size-(--era-h-xs) shrink-0 text-success" aria-hidden="true" />
|
|
31
|
+
{:else}
|
|
32
|
+
<CircleX class="size-(--era-h-xs) shrink-0 text-destructive" aria-hidden="true" />
|
|
33
|
+
{/if}
|
|
34
|
+
<div class="min-w-0 flex-1 text-fg">{@render children?.()}</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Where an approval-gated tool call stands. */
|
|
2
|
+
export type ApprovalState = 'requested' | 'approved' | 'rejected';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
type $$ComponentProps = {
|
|
5
|
+
state?: ApprovalState;
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
class?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const Confirmation: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type Confirmation = ReturnType<typeof Confirmation>;
|
|
11
|
+
export default Confirmation;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as Popover from '../../ui/popover/index.js';
|
|
3
|
+
import { KV } from '../../ui/kv/index.js';
|
|
4
|
+
import { cn } from '../../utils/index.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
usedTokens,
|
|
8
|
+
maxTokens,
|
|
9
|
+
modelId,
|
|
10
|
+
class: className
|
|
11
|
+
}: {
|
|
12
|
+
usedTokens: number;
|
|
13
|
+
maxTokens: number;
|
|
14
|
+
modelId?: string;
|
|
15
|
+
class?: string;
|
|
16
|
+
} = $props();
|
|
17
|
+
|
|
18
|
+
const percent = $derived(maxTokens ? usedTokens / maxTokens : 0);
|
|
19
|
+
const fmt = new Intl.NumberFormat(undefined, { notation: 'compact' });
|
|
20
|
+
// Donut gauge geometry (r=10 viewBox ring).
|
|
21
|
+
const C = 2 * Math.PI * 10;
|
|
22
|
+
const offset = $derived(C * (1 - Math.min(percent, 1)));
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<Popover.Root>
|
|
26
|
+
<Popover.Trigger size="sm" class={cn('gap-(--era-gap) tabular-nums', className)}>
|
|
27
|
+
{Math.round(percent * 100)}%
|
|
28
|
+
<svg viewBox="0 0 24 24" class="size-(--era-h-xs) -rotate-90" aria-hidden="true">
|
|
29
|
+
<circle cx="12" cy="12" r="10" fill="none" stroke="var(--color-3)" stroke-width="3" />
|
|
30
|
+
<circle
|
|
31
|
+
cx="12"
|
|
32
|
+
cy="12"
|
|
33
|
+
r="10"
|
|
34
|
+
fill="none"
|
|
35
|
+
stroke="var(--color-primary)"
|
|
36
|
+
stroke-width="3"
|
|
37
|
+
stroke-dasharray={C}
|
|
38
|
+
stroke-dashoffset={offset}
|
|
39
|
+
stroke-linecap="round"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
|
+
</Popover.Trigger>
|
|
43
|
+
<Popover.Content align="end" class="flex w-56 flex-col gap-(--era-gap)">
|
|
44
|
+
{#if modelId}<p class="text-body text-muted">{modelId}</p>{/if}
|
|
45
|
+
<KV key="used" value={fmt.format(usedTokens)} />
|
|
46
|
+
<KV key="max" value={fmt.format(maxTokens)} />
|
|
47
|
+
<KV key="left" value={fmt.format(Math.max(0, maxTokens - usedTokens))} />
|
|
48
|
+
</Popover.Content>
|
|
49
|
+
</Popover.Root>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Root } from './context.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Root } from './context.svelte';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getContext, setContext } from 'svelte';
|
|
2
|
+
const KEY = Symbol('era-ai-conversation');
|
|
3
|
+
export function setConversationContext(stick) {
|
|
4
|
+
setContext(KEY, stick);
|
|
5
|
+
return stick;
|
|
6
|
+
}
|
|
7
|
+
export function getConversationContext() {
|
|
8
|
+
const ctx = getContext(KEY);
|
|
9
|
+
if (!ctx)
|
|
10
|
+
throw new Error('Conversation parts must be used inside <Conversation.Root>.');
|
|
11
|
+
return ctx;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import { cn } from '../../utils/index.js';
|
|
5
|
+
import { getConversationContext } from './context.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
children,
|
|
9
|
+
class: className,
|
|
10
|
+
...restProps
|
|
11
|
+
}: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
|
|
12
|
+
|
|
13
|
+
const stick = getConversationContext();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<!-- The scroll container + content column, both wired to the stick-to-bottom
|
|
17
|
+
engine (see stick-to-bottom.svelte.ts for the full contract). Normal DOM
|
|
18
|
+
order, role="log" — new messages are announced politely. -->
|
|
19
|
+
<div
|
|
20
|
+
{@attach stick.viewport}
|
|
21
|
+
role="log"
|
|
22
|
+
aria-live="polite"
|
|
23
|
+
class="h-full min-h-0 flex-1 overflow-y-auto overscroll-contain [overflow-anchor:none]"
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
{@attach stick.content}
|
|
27
|
+
class={cn('mx-auto flex w-full max-w-2xl flex-col gap-(--era-pad-lg) p-(--era-pad-md)', className)}
|
|
28
|
+
{...restProps}
|
|
29
|
+
>
|
|
30
|
+
{@render children?.()}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const ConversationContent: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ConversationContent = ReturnType<typeof ConversationContent>;
|
|
8
|
+
export default ConversationContent;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import { cn } from '../../utils/index.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
title = 'No messages yet',
|
|
8
|
+
description = 'Start the conversation below.',
|
|
9
|
+
icon,
|
|
10
|
+
children,
|
|
11
|
+
class: className,
|
|
12
|
+
...restProps
|
|
13
|
+
}: HTMLAttributes<HTMLDivElement> & {
|
|
14
|
+
title?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
icon?: Snippet;
|
|
17
|
+
children?: Snippet;
|
|
18
|
+
} = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
class={cn(
|
|
23
|
+
'flex flex-1 flex-col items-center justify-center gap-(--era-gap) p-(--era-pad-lg) text-center',
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...restProps}
|
|
27
|
+
>
|
|
28
|
+
{@render icon?.()}
|
|
29
|
+
<p class="text-body font-medium text-bright">{title}</p>
|
|
30
|
+
<p class="max-w-sm text-body text-muted">{description}</p>
|
|
31
|
+
{@render children?.()}
|
|
32
|
+
</div>
|