@cianfrani/ai-ui 0.1.0-alpha.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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +144 -0
  3. package/dist/ai-ui.js +3218 -0
  4. package/dist/types/index.d.ts +7 -0
  5. package/dist/types/lib/has-slot-controller.d.ts +21 -0
  6. package/dist/types/lib/tool-tone.d.ts +2 -0
  7. package/dist/types/native-styles.d.ts +5 -0
  8. package/dist/types/semantic/ai-conversation.d.ts +28 -0
  9. package/dist/types/semantic/ai-event.d.ts +91 -0
  10. package/dist/types/semantic/ai-message.d.ts +45 -0
  11. package/dist/types/semantic/ai-thinking.d.ts +41 -0
  12. package/dist/types/semantic/ai-tool-call.d.ts +59 -0
  13. package/dist/types/semantic/ai-tool-result.d.ts +44 -0
  14. package/dist/types/semantic/index.d.ts +6 -0
  15. package/dist/types/visual/avatar.d.ts +34 -0
  16. package/dist/types/visual/badge.d.ts +32 -0
  17. package/dist/types/visual/divider.d.ts +26 -0
  18. package/dist/types/visual/icon.d.ts +24 -0
  19. package/dist/types/visual/index.d.ts +9 -0
  20. package/dist/types/visual/markdown.d.ts +52 -0
  21. package/dist/types/visual/stack.d.ts +32 -0
  22. package/dist/types/visual/status.d.ts +33 -0
  23. package/dist/types/visual/surface.d.ts +34 -0
  24. package/dist/types/visual/text.d.ts +37 -0
  25. package/package.json +67 -0
  26. package/src/custom-elements.json +3741 -0
  27. package/src/index.ts +8 -0
  28. package/src/lib/has-slot-controller.ts +61 -0
  29. package/src/lib/tool-tone.ts +18 -0
  30. package/src/native-styles.ts +29 -0
  31. package/src/semantic/ai-conversation.ts +84 -0
  32. package/src/semantic/ai-event.ts +452 -0
  33. package/src/semantic/ai-message.ts +235 -0
  34. package/src/semantic/ai-thinking.ts +190 -0
  35. package/src/semantic/ai-tool-call.ts +513 -0
  36. package/src/semantic/ai-tool-result.ts +239 -0
  37. package/src/semantic/index.ts +6 -0
  38. package/src/visual/avatar.ts +163 -0
  39. package/src/visual/badge.ts +141 -0
  40. package/src/visual/divider.ts +97 -0
  41. package/src/visual/icon.ts +97 -0
  42. package/src/visual/index.ts +9 -0
  43. package/src/visual/markdown.ts +888 -0
  44. package/src/visual/stack.ts +115 -0
  45. package/src/visual/status.ts +170 -0
  46. package/src/visual/surface.ts +150 -0
  47. package/src/visual/text.ts +141 -0
@@ -0,0 +1,7 @@
1
+ import "./semantic";
2
+ import "./visual";
3
+ import "./native-styles";
4
+ export * from "./semantic/index";
5
+ export * from "./visual/index";
6
+ export * from "./lib/has-slot-controller";
7
+ export * from "./lib/tool-tone";
@@ -0,0 +1,21 @@
1
+ import type { ReactiveController, ReactiveControllerHost } from "lit";
2
+ /**
3
+ * Reactive controller that tracks whether named/default slots have content.
4
+ *
5
+ * Usage:
6
+ * private readonly hasSlot = new HasSlotController(this, "[default]");
7
+ * // then in render():
8
+ * this.hasSlot.test("[default]") // → boolean
9
+ */
10
+ export declare class HasSlotController implements ReactiveController {
11
+ host: ReactiveControllerHost & Element;
12
+ slotNames: string[];
13
+ constructor(host: ReactiveControllerHost & Element, ...slotNames: string[]);
14
+ private hasDefaultSlot;
15
+ private hasNamedSlot;
16
+ /** Test whether a slot has content. Use `"[default]"` for the default slot. */
17
+ test(slotName: string): boolean;
18
+ hostConnected(): void;
19
+ hostDisconnected(): void;
20
+ private handleSlotChange;
21
+ }
@@ -0,0 +1,2 @@
1
+ export type ToolTone = "read" | "write" | "edit" | "bash" | "generic";
2
+ export declare function getToolTone(name: string): ToolTone;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Baseline styles for native elements within ai-* shadow roots.
3
+ * Import and include in any ai component that renders native elements.
4
+ */
5
+ export declare const nativeStyles: import("lit").CSSResult;
@@ -0,0 +1,28 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Root ordered transcript container for message-first AI conversations.
4
+ *
5
+ * @slot - Ordered records: ai-message, ai-tool-call, ai-tool-result, ai-thinking, ai-event, or native elements.
6
+ *
7
+ * @cssprop --ai-conversation-background - Conversation background. Default: transparent
8
+ * @cssprop --ai-conversation-color - Default text color. Default: var(--ai-color-text)
9
+ * @cssprop --ai-conversation-gap - Vertical gap between direct child records. Default: var(--ai-space-lg)
10
+ * @cssprop --ai-conversation-compact-gap - Gap when density="compact". Default: var(--ai-space-sm)
11
+ * @cssprop --ai-conversation-live-border-color - Optional visual marker for live conversations. Default: transparent
12
+ */
13
+ export declare class AiConversation extends LitElement {
14
+ /** Spacing density for transcript rows. Invalid values fall back to comfortable. */
15
+ density: "comfortable" | "compact";
16
+ /** Whether this is a live/streaming region. Adds aria-live="polite" by default. */
17
+ live: boolean;
18
+ /** Accessible label for the conversation region. */
19
+ label: string;
20
+ static styles: import("lit").CSSResult;
21
+ private get normalizedDensity();
22
+ render(): import("lit-html").TemplateResult<1>;
23
+ }
24
+ declare global {
25
+ interface HTMLElementTagNameMap {
26
+ "ai-conversation": AiConversation;
27
+ }
28
+ }
@@ -0,0 +1,91 @@
1
+ import { LitElement } from "lit";
2
+ import type { TemplateResult } from "lit";
3
+ /**
4
+ * Payload of the `ai-show` / `ai-hide` events.
5
+ *
6
+ * These events share a name but are emitted by three different components with
7
+ * distinct payloads. The `source` field discriminates which component fired, so
8
+ * listeners can narrow safely:
9
+ *
10
+ * ```ts
11
+ * el.addEventListener("ai-show", (e) => {
12
+ * if (e.detail.source === "tool-call") {
13
+ * console.log(e.detail.id, e.detail.name); // typed
14
+ * }
15
+ * });
16
+ * ```
17
+ */
18
+ export type AiShowHideDetail = {
19
+ source: "event";
20
+ kind: string;
21
+ } | {
22
+ source: "thinking";
23
+ redacted: boolean;
24
+ } | {
25
+ source: "tool-call";
26
+ open: boolean;
27
+ id: string;
28
+ name: string;
29
+ };
30
+ /**
31
+ * Non-message, non-operation transcript event.
32
+ *
33
+ * Represents status changes, model switches, checkpoints, notes,
34
+ * system messages, errors, or custom events within an AI transcript.
35
+ *
36
+ * @slot summary - Custom summary/label override
37
+ * @slot meta - Timestamps, source labels
38
+ * @slot - Default: event content
39
+ *
40
+ * @fires ai-show - Dispatched when opened. Bubbles, composed.
41
+ * @fires ai-hide - Dispatched when closed. Bubbles, composed.
42
+ *
43
+ * @cssprop --ai-event-background-color - Event background. Default: transparent
44
+ * @cssprop --ai-event-text-color - Event text color. Default: var(--ai-color-text-muted)
45
+ * @cssprop --ai-event-border-color - Event border color. Default: var(--ai-color-border)
46
+ * @cssprop --ai-event-border-width - Event border width. Default: 0
47
+ * @cssprop --ai-event-border-radius - Event border radius. Default: 0
48
+ * @cssprop --ai-event-content-gap - Content gap. Default: var(--ai-space-sm)
49
+ * @cssprop --ai-event-content-indent - Expanded content indentation. Default: clamp(20px, 7vw, 58px)
50
+ * @cssprop --ai-event-rule-color - Divider rule color. Default: subtle muted text color
51
+ * @cssprop --ai-event-open-rule-color - Divider rule color when expanded. Default: stronger muted text color
52
+ * @cssprop --ai-event-meta-color - Meta slot text color. Default: var(--ai-color-text-muted)
53
+ * @cssprop --ai-event-info-color - Info severity color. Default: var(--ai-color-info)
54
+ * @cssprop --ai-event-warning-color - Warning severity color. Default: var(--ai-color-warning)
55
+ * @cssprop --ai-event-error-color - Error severity color. Default: var(--ai-color-error)
56
+ */
57
+ export declare class AiEvent extends LitElement {
58
+ /** Event kind. */
59
+ kind: "status" | "model-change" | "checkpoint" | "note" | "system" | "error" | "custom";
60
+ /** Severity level — controls accent color. */
61
+ severity: "info" | "warning" | "error";
62
+ /** Origin source identifier. */
63
+ source: string;
64
+ /** ID of the element this event pertains to (maps to `for` attribute). */
65
+ htmlFor: string;
66
+ /** Whether the event details are expanded. */
67
+ open: boolean;
68
+ private _details;
69
+ /** Expand the event details. */
70
+ show(): void;
71
+ /** Collapse the event details. */
72
+ hide(): void;
73
+ /** Toggle open state. Optionally force open/closed. */
74
+ toggle(force?: boolean): void;
75
+ private _prevOpen;
76
+ updated(): void;
77
+ private _onToggle;
78
+ private get _severityColor();
79
+ private get _kindLabel();
80
+ render(): TemplateResult;
81
+ static styles: import("lit").CSSResult;
82
+ }
83
+ declare global {
84
+ interface HTMLElementTagNameMap {
85
+ "ai-event": AiEvent;
86
+ }
87
+ interface HTMLElementEventMap {
88
+ "ai-show": CustomEvent<AiShowHideDetail>;
89
+ "ai-hide": CustomEvent<AiShowHideDetail>;
90
+ }
91
+ }
@@ -0,0 +1,45 @@
1
+ import { LitElement } from "lit";
2
+ export type AiMessageRole = "user" | "assistant" | "system" | "tool";
3
+ export type AiMessageStatus = "pending" | "running" | "success" | "error" | "cancelled" | "unknown";
4
+ /**
5
+ * Message-first transcript record with role-specific pi-ui presentation.
6
+ *
7
+ * @slot - Content blocks, usually ai-markdown, ai-thinking, ai-tool-call, ai-tool-result, or ai-event.
8
+ * @slot meta - Timestamp, model, or other metadata. Prefer native <time>.
9
+ * @slot avatar - Optional actor avatar.
10
+ * @slot actor - Optional actor label.
11
+ *
12
+ * @cssprop --ai-message-background - Message body background. Default: transparent
13
+ * @cssprop --ai-message-color - Message text color. Default: inherit
14
+ * @cssprop --ai-message-border-color - Optional message border color. Default: transparent
15
+ * @cssprop --ai-message-border-width - Optional border width. Default: 0
16
+ * @cssprop --ai-message-radius - Optional message radius. Default: 0
17
+ * @cssprop --ai-message-gap - Gap between slotted content blocks. Default: var(--spacing-xs)
18
+ * @cssprop --ai-message-user-background - User bubble background. Default: var(--accent)
19
+ * @cssprop --ai-message-user-color - User bubble color. Default: var(--text-on-accent)
20
+ * @cssprop --ai-message-user-max-width - User bubble max width. Default: min(90%, 640px)
21
+ * @cssprop --ai-message-assistant-rail-color - Assistant rail color.
22
+ * @cssprop --ai-message-assistant-label-color - Assistant label color. Default: var(--text-muted)
23
+ * @cssprop --ai-message-meta-color - Meta text color. Default: var(--text-muted)
24
+ */
25
+ export declare class AiMessage extends LitElement {
26
+ /** Message author/source role. Unknown values render as system-style rows. */
27
+ role: "user" | "assistant" | "system" | "tool";
28
+ /** Optional associated record id; maps to native `for` attribute. */
29
+ htmlFor: string;
30
+ /** Message lifecycle status. */
31
+ status: "pending" | "running" | "success" | "error" | "cancelled" | "unknown";
32
+ /** ISO-ish timestamp for metadata/association; visual formatting is left to slotted meta. */
33
+ timestamp: string;
34
+ /** Display label for role chrome. */
35
+ label: string;
36
+ static styles: import("lit").CSSResult;
37
+ private get normalizedRole();
38
+ private get actorLabel();
39
+ render(): import("lit-html").TemplateResult<1>;
40
+ }
41
+ declare global {
42
+ interface HTMLElementTagNameMap {
43
+ "ai-message": AiMessage;
44
+ }
45
+ }
@@ -0,0 +1,41 @@
1
+ import { LitElement } from "lit";
2
+ import "./ai-tool-call";
3
+ /**
4
+ * Specialized assistant content block for model reasoning.
5
+ *
6
+ * @slot - Thinking content if content property is not set.
7
+ * @slot meta - Optional metadata.
8
+ *
9
+ * @fires ai-show - Emitted when disclosure opens. Bubbles, composed.
10
+ * @fires ai-hide - Emitted when disclosure closes. Bubbles, composed.
11
+ *
12
+ * @cssprop --ai-thinking-color - Thinking content color.
13
+ * @cssprop --ai-thinking-muted-color - Muted/placeholder color.
14
+ * @cssprop --ai-thinking-max-height - Max scroll height. Default: 140px
15
+ * @cssprop --ai-thinking-summary-color - Summary color.
16
+ */
17
+ export declare class AiThinking extends LitElement {
18
+ /** Thinking text to render. Prefer property binding for streaming content. */
19
+ content: string;
20
+ /** Origin of the thinking block. */
21
+ source: "model" | "assistant" | "unknown";
22
+ /** Thinking exists but is not available. */
23
+ redacted: boolean;
24
+ /** Whether the disclosure is expanded. */
25
+ open: boolean;
26
+ /** Optional summary headline. Defaults to a first-sentence summary of content. */
27
+ headline: string;
28
+ static styles: import("lit").CSSResult;
29
+ show(): void;
30
+ hide(): void;
31
+ toggle(force?: boolean): void;
32
+ private handleShow;
33
+ private handleHide;
34
+ protected updated(changed: Map<string, unknown>): void;
35
+ render(): import("lit-html").TemplateResult<1>;
36
+ }
37
+ declare global {
38
+ interface HTMLElementTagNameMap {
39
+ "ai-thinking": AiThinking;
40
+ }
41
+ }
@@ -0,0 +1,59 @@
1
+ import { LitElement, nothing } from "lit";
2
+ export type ToolCallKind = "tool" | "shell" | "file" | "search" | "delegate" | "network" | "custom" | "unknown";
3
+ export type ToolCallEffect = "read" | "write" | "mixed" | "unknown";
4
+ export type ToolCallStatus = "pending" | "running" | "success" | "error" | "cancelled" | "unknown";
5
+ /**
6
+ * Specialized assistant content block for a tool call.
7
+ *
8
+ * @slot summary - Custom summary row/header
9
+ * @slot input - Tool input/arguments; native <pre><code> is recommended.
10
+ * @slot - Result/details content, commonly nested ai-tool-result.
11
+ *
12
+ * @fires ai-show - Emitted when disclosure opens. Bubbles, composed.
13
+ * @fires ai-hide - Emitted when disclosure closes. Bubbles, composed.
14
+ *
15
+ * @cssprop --ai-tool-call-background - Tool call background.
16
+ * @cssprop --ai-tool-call-color - Tool call text color.
17
+ * @cssprop --ai-tool-call-border-color - Tool call border color.
18
+ * @cssprop --ai-tool-call-summary-background - Summary row background.
19
+ * @cssprop --ai-tool-call-input-background - Input slot background.
20
+ * @cssprop --ai-tool-call-status-color - Generic status color.
21
+ * @cssprop --ai-tool-call-success-color - Success status color.
22
+ * @cssprop --ai-tool-call-error-color - Error status color.
23
+ * @cssprop --ai-tool-call-running-color - Running status color.
24
+ */
25
+ export declare class AiToolCall extends LitElement {
26
+ static styles: import("lit").CSSResult;
27
+ id: string;
28
+ name: string;
29
+ label: string;
30
+ kind: "tool" | "shell" | "file" | "search" | "delegate" | "network" | "custom" | "unknown";
31
+ effect: "read" | "write" | "mixed" | "unknown";
32
+ headline: string;
33
+ subline: string;
34
+ status: "pending" | "running" | "success" | "error" | "cancelled" | "unknown";
35
+ open: boolean;
36
+ private readonly hasSlot;
37
+ private get tone();
38
+ private get badgeText();
39
+ private get headlineText();
40
+ private get hasBodyContent();
41
+ private get hasInputContent();
42
+ private get hasSummaryContent();
43
+ private get isExpandable();
44
+ private get hasVisibleHeaderContent();
45
+ show(): void;
46
+ hide(): void;
47
+ toggle(force?: boolean): void;
48
+ private emitToggle;
49
+ private handleToggle;
50
+ protected updated(changed: Map<string, unknown>): void;
51
+ private renderIcon;
52
+ private renderHeaderContent;
53
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
54
+ }
55
+ declare global {
56
+ interface HTMLElementTagNameMap {
57
+ "ai-tool-call": AiToolCall;
58
+ }
59
+ }
@@ -0,0 +1,44 @@
1
+ import { LitElement } from "lit";
2
+ export type ToolResultStatus = "success" | "error" | "cancelled" | "unknown";
3
+ export type ToolResultChannel = "result" | "stdout" | "stderr" | "log" | "unknown";
4
+ export declare function normalizeToolOutput(content: string): string;
5
+ /**
6
+ * Specialized runtime/tool output content block.
7
+ *
8
+ * @slot - Output content. If absent and content is set, renders normalized output in <pre>.
9
+ * @slot meta - Optional source/channel/truncation metadata.
10
+ *
11
+ * @cssprop --ai-tool-result-color - Output text color.
12
+ * @cssprop --ai-tool-result-background - Output background.
13
+ * @cssprop --ai-tool-result-meta-color - Meta slot text color.
14
+ * @cssprop --ai-tool-result-error-color - Error text color.
15
+ * @cssprop --ai-tool-result-code-color - Code/output text color.
16
+ * @cssprop --ai-tool-result-code-font - Code/output font family.
17
+ * @cssprop --ai-tool-result-max-height - Maximum output height. Default: 240px
18
+ */
19
+ export declare class AiToolResult extends LitElement {
20
+ /** Associated ai-tool-call[id]. Missing/mismatched ids are allowed. */
21
+ htmlFor: string;
22
+ /** Tool/result source name. */
23
+ name: string;
24
+ /** Result status. */
25
+ status: "success" | "error" | "cancelled" | "unknown";
26
+ /** Output channel. */
27
+ channel: "result" | "stdout" | "stderr" | "log" | "unknown";
28
+ /** MIME/content type hint. */
29
+ contentType: string;
30
+ /** Raw output content. Prefer property binding for large content. */
31
+ content: string;
32
+ /** Whether the rendered output was truncated upstream. */
33
+ truncated: boolean;
34
+ private readonly hasSlot;
35
+ static styles: import("lit").CSSResult;
36
+ private get hasDefaultContent();
37
+ private get hasMetaContent();
38
+ render(): import("lit-html").TemplateResult<1>;
39
+ }
40
+ declare global {
41
+ interface HTMLElementTagNameMap {
42
+ "ai-tool-result": AiToolResult;
43
+ }
44
+ }
@@ -0,0 +1,6 @@
1
+ export * from "./ai-conversation";
2
+ export * from "./ai-message";
3
+ export * from "./ai-tool-call";
4
+ export * from "./ai-tool-result";
5
+ export * from "./ai-thinking";
6
+ export * from "./ai-event";
@@ -0,0 +1,34 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Actor/agent identity marker.
4
+ *
5
+ * @slot - Custom avatar content/icon.
6
+ *
7
+ * @cssprop --size - Avatar width/height.
8
+ * @cssprop --background-color - Fallback background.
9
+ * @cssprop --text-color - Initials/icon color.
10
+ * @cssprop --border-color - Border color.
11
+ * @cssprop --border-radius - Avatar radius.
12
+ * @cssprop --font-size - Initials font size.
13
+ * @cssprop --font-weight - Initials font weight. Default: 700
14
+ */
15
+ export declare class AiAvatar extends LitElement {
16
+ /** Image source URL. When set, renders an <img>. */
17
+ src: string;
18
+ /** Display name. Used for initials fallback and img alt text. */
19
+ name: string;
20
+ /** Size preset. */
21
+ size: "sm" | "md" | "lg";
22
+ /** Semantic color tone. */
23
+ tone: "neutral" | "accent" | "user" | "assistant" | "agent";
24
+ static styles: import("lit").CSSResult;
25
+ render(): import("lit-html").TemplateResult<1>;
26
+ protected updated(): void;
27
+ private getInitials;
28
+ private getToneColors;
29
+ }
30
+ declare global {
31
+ interface HTMLElementTagNameMap {
32
+ "ai-avatar": AiAvatar;
33
+ }
34
+ }
@@ -0,0 +1,32 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Compact semantic label/status chip.
4
+ *
5
+ * @slot - Badge label.
6
+ *
7
+ * @cssprop --background-color - Badge background.
8
+ * @cssprop --text-color - Badge text color.
9
+ * @cssprop --border-color - Badge border color.
10
+ * @cssprop --border-radius - Badge radius.
11
+ * @cssprop --dot-color - Leading dot color.
12
+ * @cssprop --font-size - Font size.
13
+ * @cssprop --font-weight - Font weight. Default: 600
14
+ * @cssprop --inline-gap - Gap between dot/content.
15
+ */
16
+ export declare class AiBadge extends LitElement {
17
+ /** Semantic color tone. */
18
+ tone: "neutral" | "accent" | "success" | "warning" | "error" | "info";
19
+ /** Size preset. */
20
+ size: "sm" | "md";
21
+ /** Whether to show a leading dot indicator. */
22
+ dot: boolean;
23
+ static styles: import("lit").CSSResult;
24
+ render(): import("lit-html").TemplateResult<1>;
25
+ protected updated(): void;
26
+ private getToneColors;
27
+ }
28
+ declare global {
29
+ interface HTMLElementTagNameMap {
30
+ "ai-badge": AiBadge;
31
+ }
32
+ }
@@ -0,0 +1,26 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Separator/section marker.
4
+ *
5
+ * @slot - Optional label/content centered in divider.
6
+ *
7
+ * @cssprop --line-color - Divider line color.
8
+ * @cssprop --line-width - Divider thickness.
9
+ * @cssprop --text-color - Label text color.
10
+ * @cssprop --label-background-color - Label background to mask line.
11
+ * @cssprop --label-gap - Gap between line and label.
12
+ */
13
+ export declare class AiDivider extends LitElement {
14
+ /** Axis of the divider line. */
15
+ orientation: "horizontal" | "vertical";
16
+ /** Visual prominence of the divider. */
17
+ tone: "subtle" | "default" | "strong";
18
+ static styles: import("lit").CSSResult;
19
+ render(): import("lit-html").TemplateResult<1>;
20
+ protected updated(): void;
21
+ }
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ "ai-divider": AiDivider;
25
+ }
26
+ }
@@ -0,0 +1,24 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Consistent icon sizing/tone wrapper.
4
+ *
5
+ * @slot - SVG/icon content.
6
+ *
7
+ * @cssprop --size - Icon width/height.
8
+ * @cssprop --color - Icon color.
9
+ */
10
+ export declare class AiIcon extends LitElement {
11
+ /** Size preset. */
12
+ size: "xs" | "sm" | "md" | "lg";
13
+ /** Semantic color tone. */
14
+ tone: "default" | "muted" | "accent" | "success" | "warning" | "error";
15
+ static styles: import("lit").CSSResult;
16
+ render(): import("lit-html").TemplateResult<1>;
17
+ protected updated(): void;
18
+ private getToneColor;
19
+ }
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ "ai-icon": AiIcon;
23
+ }
24
+ }
@@ -0,0 +1,9 @@
1
+ export * from "./stack";
2
+ export * from "./surface";
3
+ export * from "./text";
4
+ export * from "./markdown";
5
+ export * from "./badge";
6
+ export * from "./status";
7
+ export * from "./avatar";
8
+ export * from "./icon";
9
+ export * from "./divider";
@@ -0,0 +1,52 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Markdown content renderer. Parses and renders markdown source.
4
+ *
5
+ * @slot - Fallback content if content property is empty.
6
+ *
7
+ * @cssprop --ai-markdown-color - Body text color.
8
+ * @cssprop --ai-markdown-link-color - Link color.
9
+ * @cssprop --ai-markdown-code-background - Inline/block code background.
10
+ * @cssprop --ai-markdown-code-color - Code text color.
11
+ * @cssprop --ai-markdown-border-color - Blockquote/table/pre border.
12
+ * @cssprop --ai-markdown-heading-color - Heading color.
13
+ * @cssprop --ai-markdown-gap - Vertical rhythm between markdown blocks.
14
+ */
15
+ export declare class AiMarkdown extends LitElement {
16
+ static styles: import("lit").CSSResult;
17
+ /** Markdown content to render. Does NOT reflect (large content). */
18
+ content: string;
19
+ /** Visual tone for prose style parity with pi-ui messages. */
20
+ tone: "assistant" | "user" | "system" | "tool";
21
+ /** Whether the content is trusted (affects link behavior). */
22
+ trusted: boolean;
23
+ private parseInlines;
24
+ private renderInline;
25
+ private parseTableRow;
26
+ private parseTableAligns;
27
+ private isTableSeparator;
28
+ private indentLevel;
29
+ private parseBlocks;
30
+ private parseCodeBlock;
31
+ private parseHeadingBlock;
32
+ private parseBlockquoteBlock;
33
+ private parseListBlock;
34
+ private skipBlankLines;
35
+ private parseNestedChildren;
36
+ private collectList;
37
+ private countNestedLines;
38
+ private parseTableBlock;
39
+ private parseParagraphBlock;
40
+ private startsStructuredBlock;
41
+ private startsTable;
42
+ private isTableStart;
43
+ private renderBlocks;
44
+ private renderBlock;
45
+ private renderMarkdown;
46
+ render(): import("lit-html").TemplateResult<1>;
47
+ }
48
+ declare global {
49
+ interface HTMLElementTagNameMap {
50
+ "ai-markdown": AiMarkdown;
51
+ }
52
+ }
@@ -0,0 +1,32 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Flex layout primitive.
4
+ *
5
+ * @slot - Stack children.
6
+ *
7
+ * @cssprop --gap - Overrides computed gap.
8
+ * @cssprop --align-items - Overrides align-items.
9
+ * @cssprop --justify-content - Overrides justify-content.
10
+ */
11
+ export declare class AiStack extends LitElement {
12
+ /** Flex direction. */
13
+ direction: "row" | "column";
14
+ /** Gap between children. */
15
+ gap: "none" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
16
+ /** Cross-axis alignment. */
17
+ align: "start" | "center" | "end" | "stretch" | "baseline";
18
+ /** Main-axis justification. */
19
+ justify: "start" | "center" | "end" | "between" | "around" | "evenly";
20
+ /** Whether children wrap. */
21
+ wrap: boolean;
22
+ /** Whether to use inline-flex instead of flex. */
23
+ inline: boolean;
24
+ static styles: import("lit").CSSResult;
25
+ render(): import("lit-html").TemplateResult<1>;
26
+ protected updated(): void;
27
+ }
28
+ declare global {
29
+ interface HTMLElementTagNameMap {
30
+ "ai-stack": AiStack;
31
+ }
32
+ }
@@ -0,0 +1,33 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Status dot/icon indicator.
4
+ *
5
+ * @slot - Optional custom icon/content.
6
+ *
7
+ * @cssprop --size - Indicator size.
8
+ * @cssprop --color - Indicator color.
9
+ * @cssprop --idle-color - Idle color.
10
+ * @cssprop --running-color - Running color.
11
+ * @cssprop --success-color - Success color.
12
+ * @cssprop --error-color - Error color.
13
+ * @cssprop --cancelled-color - Cancelled color.
14
+ * @cssprop --pulse-duration - Running pulse duration. Default: 1.5s
15
+ */
16
+ export declare class AiStatus extends LitElement {
17
+ /** Current status state. */
18
+ state: "idle" | "running" | "success" | "error" | "cancelled" | "unknown";
19
+ /** Size preset. */
20
+ size: "xs" | "sm" | "md" | "lg";
21
+ /** Display variant — dot or icon. */
22
+ variant: "dot" | "icon";
23
+ static styles: import("lit").CSSResult;
24
+ render(): import("lit-html").TemplateResult<1>;
25
+ protected updated(): void;
26
+ private getStateColor;
27
+ private getFallbackIconPath;
28
+ }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ "ai-status": AiStatus;
32
+ }
33
+ }
@@ -0,0 +1,34 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * Themed container/surface.
4
+ *
5
+ * @slot - Surface content.
6
+ *
7
+ * @cssprop --background-color - Surface background.
8
+ * @cssprop --text-color - Surface text color.
9
+ * @cssprop --border-color - Border color.
10
+ * @cssprop --border-width - Border width.
11
+ * @cssprop --border-radius - Border radius.
12
+ * @cssprop --shadow - Box shadow.
13
+ * @cssprop --hover-background-color - Hover background when interactive.
14
+ * @cssprop --focus-ring - Focus ring for slotted/native focus styling.
15
+ */
16
+ export declare class AiSurface extends LitElement {
17
+ /** Visual variant. */
18
+ variant: "flat" | "outlined" | "raised" | "sunken";
19
+ /** Semantic color tone. */
20
+ tone: "neutral" | "accent" | "success" | "warning" | "error" | "info";
21
+ /** Border radius preset. */
22
+ radius: "none" | "sm" | "md" | "lg" | "pill";
23
+ /** Whether the surface is clickable/hoverable. */
24
+ interactive: boolean;
25
+ static styles: import("lit").CSSResult;
26
+ render(): import("lit-html").TemplateResult<1>;
27
+ protected updated(): void;
28
+ private getToneColors;
29
+ }
30
+ declare global {
31
+ interface HTMLElementTagNameMap {
32
+ "ai-surface": AiSurface;
33
+ }
34
+ }