@tylertech/forge-ai 0.15.2 → 0.15.3-dev.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/custom-elements.json +8266 -6476
- package/dist/ai-artifact-card/ai-artifact-card.d.ts +75 -0
- package/dist/ai-artifact-card/ai-artifact-card.mjs +142 -0
- package/dist/ai-artifact-card/ai-artifact-card.scss.mjs +283 -0
- package/dist/ai-artifact-card/index.d.ts +1 -0
- package/dist/ai-artifact-card/index.mjs +5 -0
- package/dist/ai-artifact-card-group/ai-artifact-card-group.d.ts +57 -0
- package/dist/ai-artifact-card-group/ai-artifact-card-group.mjs +137 -0
- package/dist/ai-artifact-card-group/ai-artifact-card-group.scss.mjs +173 -0
- package/dist/ai-artifact-card-group/index.d.ts +1 -0
- package/dist/ai-artifact-card-group/index.mjs +5 -0
- package/dist/ai-assistant-response/ai-assistant-response.mjs +25 -2
- package/dist/ai-chatbot/ag-ui-adapter.mjs +1 -1
- package/dist/ai-chatbot/agent-adapter.d.ts +108 -1
- package/dist/ai-chatbot/agent-adapter.mjs +22 -0
- package/dist/ai-chatbot/ai-chatbot-base.d.ts +26 -0
- package/dist/ai-chatbot/ai-chatbot-base.mjs +136 -3
- package/dist/ai-chatbot/index.d.ts +2 -2
- package/dist/ai-chatbot/message-state-controller.d.ts +10 -1
- package/dist/ai-chatbot/message-state-controller.mjs +78 -20
- package/dist/ai-chatbot/types.d.ts +199 -1
- package/dist/ai-chatbot/utils.mjs +3 -1
- package/dist/ai-chatbot-launcher/ai-chatbot-launcher.mjs +0 -2
- package/dist/ai-message-thread/ai-message-thread.d.ts +1 -0
- package/dist/ai-message-thread/ai-message-thread.mjs +35 -3
- package/dist/ai-steps/ai-steps.d.ts +67 -0
- package/dist/ai-steps/ai-steps.mjs +163 -0
- package/dist/ai-steps/ai-steps.scss.mjs +4 -0
- package/dist/ai-steps/index.d.ts +1 -0
- package/dist/ai-steps/index.mjs +5 -0
- package/dist/ai-tool-call-indicator/ai-tool-call-indicator.mjs +1 -1
- package/dist/core/chatbot-core-controller.d.ts +2 -0
- package/dist/core/chatbot-core-controller.mjs +99 -4
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +9 -0
- package/dist/tools/ai-mcp-app/ai-mcp-app.d.ts +69 -0
- package/dist/tools/ai-mcp-app/ai-mcp-app.mjs +574 -0
- package/dist/tools/ai-mcp-app/ai-mcp-app.scss.mjs +4 -0
- package/dist/tools/ai-mcp-app/index.d.ts +3 -0
- package/dist/tools/ai-mcp-app/index.mjs +6 -0
- package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.d.ts +61 -0
- package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.mjs +156 -0
- package/dist/tools/ai-mcp-app/mcp-app-bridge-types.d.ts +123 -0
- package/dist/tools/ai-mcp-app/mcp-app-bridge.d.ts +41 -0
- package/dist/tools/ai-mcp-app/mcp-app-bridge.mjs +293 -0
- package/dist/tools/ai-mcp-app/mcp-app-context.d.ts +46 -0
- package/dist/tools/ai-mcp-app/mcp-app-context.mjs +5 -0
- package/dist/tools/ai-steps/ai-steps-definition.d.ts +2 -0
- package/dist/tools/ai-steps/ai-steps-definition.mjs +50 -0
- package/dist/tools/ai-steps/ai-steps.d.ts +28 -0
- package/dist/tools/ai-steps/ai-steps.mjs +49 -0
- package/dist/tools/ai-steps/ai-steps.scss.mjs +4 -0
- package/dist/tools/ai-steps/index.d.ts +2 -0
- package/dist/tools/ai-steps/index.mjs +6 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.mjs +5 -1
- package/dist/utils/inert-outside.d.ts +7 -0
- package/dist/utils/inert-outside.mjs +28 -0
- package/package.json +4 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { LitElement, TemplateResult, CSSResult } from 'lit';
|
|
2
|
+
declare global {
|
|
3
|
+
interface HTMLElementTagNameMap {
|
|
4
|
+
'forge-ai-artifact-card': AiArtifactCardComponent;
|
|
5
|
+
}
|
|
6
|
+
interface HTMLElementEventMap {
|
|
7
|
+
'forge-ai-artifact-card-open': CustomEvent<ForgeAiArtifactCardOpenEventData>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export interface ForgeAiArtifactCardOpenEventData {
|
|
11
|
+
assetId: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const AiArtifactCardComponentTagName: keyof HTMLElementTagNameMap;
|
|
14
|
+
/** Set by `forge-ai-artifact-card-group` on cards it has collapsed. Cleared when the card leaves a group. */
|
|
15
|
+
export declare const AI_ARTIFACT_CARD_COLLAPSED_ATTRIBUTE = "data-collapsed";
|
|
16
|
+
/**
|
|
17
|
+
* @tag forge-ai-artifact-card
|
|
18
|
+
*
|
|
19
|
+
* @summary A compact, clickable card representing an artifact an agent produced.
|
|
20
|
+
*
|
|
21
|
+
* @description
|
|
22
|
+
* Displays a leading icon, two lines of truncating text, and a trailing action glyph inside a single
|
|
23
|
+
* button that covers the whole card. Activating it emits an event; the consumer decides what
|
|
24
|
+
* opens. Placed in a `forge-ai-artifact-card-group`, it renders as a row of that list. The component
|
|
25
|
+
* is presentational — it holds no knowledge of what the artifact is or where it lives.
|
|
26
|
+
*
|
|
27
|
+
* @slot icon - The leading icon, shown inside a bordered tile. Replaces the default artifact glyph.
|
|
28
|
+
* @slot action-icon - The trailing action glyph. Replaces the default arrow, and unlike the arrow stays
|
|
29
|
+
* visible while `active`, so consumers that collapse on a second activation can show a matching glyph.
|
|
30
|
+
*
|
|
31
|
+
* @event {CustomEvent<ForgeAiArtifactCardOpenEventData>} forge-ai-artifact-card-open - Fired
|
|
32
|
+
* when the card is activated by click, Enter, or Space. Not fired while disabled.
|
|
33
|
+
*
|
|
34
|
+
* @cssproperty --forge-ai-artifact-card-accent-color - Color of the active border and ring
|
|
35
|
+
* @cssproperty --forge-ai-artifact-card-background - Background color of the card
|
|
36
|
+
* @cssproperty --forge-ai-artifact-card-border-radius - Corner radius of the card
|
|
37
|
+
* @cssproperty --forge-ai-artifact-card-padding - Padding inside the card
|
|
38
|
+
* @cssproperty --forge-ai-artifact-card-gap - Gap between the icon and the text
|
|
39
|
+
*/
|
|
40
|
+
export declare class AiArtifactCardComponent extends LitElement {
|
|
41
|
+
#private;
|
|
42
|
+
static styles: CSSResult;
|
|
43
|
+
/**
|
|
44
|
+
* The primary line of text. Truncates to a single line.
|
|
45
|
+
*/
|
|
46
|
+
titleText: string;
|
|
47
|
+
/**
|
|
48
|
+
* The secondary line of text. Truncates to a single line.
|
|
49
|
+
*/
|
|
50
|
+
subtitleText: string;
|
|
51
|
+
/**
|
|
52
|
+
* Describes what activating the card does, for assistive technology only. Appended to the button's
|
|
53
|
+
* accessible name after the title and subtitle. Set it when activation does something other than
|
|
54
|
+
* open, such as collapsing an already-open artifact ("Collapse report"). Omit it and the name is
|
|
55
|
+
* just the card text.
|
|
56
|
+
*/
|
|
57
|
+
actionLabel?: string;
|
|
58
|
+
/**
|
|
59
|
+
* An opaque identifier echoed back in the open event detail. The component never
|
|
60
|
+
* interprets it.
|
|
61
|
+
*/
|
|
62
|
+
assetId: string;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the artifact this card points at is the one currently being viewed. Exposed to
|
|
65
|
+
* assistive technology as `aria-current`.
|
|
66
|
+
*/
|
|
67
|
+
active: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the card can be activated.
|
|
70
|
+
*/
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
private _grouped;
|
|
73
|
+
connectedCallback(): void;
|
|
74
|
+
render(): TemplateResult;
|
|
75
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { unsafeCSS, LitElement, html, nothing } from "lit";
|
|
2
|
+
import { property, state, customElement } from "lit/decorators.js";
|
|
3
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
4
|
+
import styles from "./ai-artifact-card.scss.mjs";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __typeError = (msg) => {
|
|
8
|
+
throw TypeError(msg);
|
|
9
|
+
};
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result) __defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
19
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
20
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
21
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
22
|
+
var _defaultIcon, _arrowIcon, _AiArtifactCardComponent_instances, detectGroup_fn, handleClick_fn, actionLabel_get;
|
|
23
|
+
const AiArtifactCardComponentTagName = "forge-ai-artifact-card";
|
|
24
|
+
const AI_ARTIFACT_CARD_COLLAPSED_ATTRIBUTE = "data-collapsed";
|
|
25
|
+
const GROUP_TAG_NAME = "forge-ai-artifact-card-group";
|
|
26
|
+
let AiArtifactCardComponent = class extends LitElement {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
__privateAdd(this, _AiArtifactCardComponent_instances);
|
|
30
|
+
this.titleText = "";
|
|
31
|
+
this.subtitleText = "";
|
|
32
|
+
this.assetId = "";
|
|
33
|
+
this.active = false;
|
|
34
|
+
this.disabled = false;
|
|
35
|
+
this._grouped = false;
|
|
36
|
+
__privateAdd(this, _defaultIcon, html`
|
|
37
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">
|
|
38
|
+
<path
|
|
39
|
+
d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z" />
|
|
40
|
+
</svg>
|
|
41
|
+
`);
|
|
42
|
+
__privateAdd(this, _arrowIcon, html`
|
|
43
|
+
<svg class="arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" fill="none" aria-hidden="true">
|
|
44
|
+
<path
|
|
45
|
+
d="M5.25 5.25H12.75V12.75M5.25 12.75L12.75 5.25"
|
|
46
|
+
stroke="currentColor"
|
|
47
|
+
stroke-width="1.5"
|
|
48
|
+
stroke-linecap="round"
|
|
49
|
+
stroke-linejoin="round" />
|
|
50
|
+
</svg>
|
|
51
|
+
`);
|
|
52
|
+
}
|
|
53
|
+
connectedCallback() {
|
|
54
|
+
super.connectedCallback();
|
|
55
|
+
__privateMethod(this, _AiArtifactCardComponent_instances, detectGroup_fn).call(this);
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return html`
|
|
59
|
+
<button
|
|
60
|
+
class=${classMap({ "artifact-card": true, "artifact-card--grouped": this._grouped })}
|
|
61
|
+
type="button"
|
|
62
|
+
aria-current=${this.active ? "true" : nothing}
|
|
63
|
+
?disabled=${this.disabled}
|
|
64
|
+
@click=${__privateMethod(this, _AiArtifactCardComponent_instances, handleClick_fn)}>
|
|
65
|
+
<span class="icon" aria-hidden="true">
|
|
66
|
+
<slot name="icon">${__privateGet(this, _defaultIcon)}</slot>
|
|
67
|
+
</span>
|
|
68
|
+
<span class="text">
|
|
69
|
+
<span class="title">${this.titleText}</span>
|
|
70
|
+
<span class="subtitle">${this.subtitleText}</span>
|
|
71
|
+
</span>
|
|
72
|
+
<span class="action" aria-hidden="true">
|
|
73
|
+
<slot name="action-icon">${__privateGet(this, _arrowIcon)}</slot>
|
|
74
|
+
</span>
|
|
75
|
+
${__privateGet(this, _AiArtifactCardComponent_instances, actionLabel_get)}
|
|
76
|
+
<span class="focus-indicator"></span>
|
|
77
|
+
</button>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
_defaultIcon = /* @__PURE__ */ new WeakMap();
|
|
82
|
+
_arrowIcon = /* @__PURE__ */ new WeakMap();
|
|
83
|
+
_AiArtifactCardComponent_instances = /* @__PURE__ */ new WeakSet();
|
|
84
|
+
detectGroup_fn = function() {
|
|
85
|
+
this._grouped = this.parentElement?.tagName.toLowerCase() === GROUP_TAG_NAME;
|
|
86
|
+
if (this._grouped) {
|
|
87
|
+
this.setAttribute("role", "listitem");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (this.getAttribute("role") === "listitem") {
|
|
91
|
+
this.removeAttribute("role");
|
|
92
|
+
}
|
|
93
|
+
this.removeAttribute(AI_ARTIFACT_CARD_COLLAPSED_ATTRIBUTE);
|
|
94
|
+
};
|
|
95
|
+
handleClick_fn = function() {
|
|
96
|
+
if (this.disabled) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.dispatchEvent(
|
|
100
|
+
new CustomEvent("forge-ai-artifact-card-open", {
|
|
101
|
+
detail: { assetId: this.assetId },
|
|
102
|
+
bubbles: true,
|
|
103
|
+
composed: true
|
|
104
|
+
})
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
actionLabel_get = function() {
|
|
108
|
+
if (!this.actionLabel) {
|
|
109
|
+
return nothing;
|
|
110
|
+
}
|
|
111
|
+
return html`<span class="sr-only">${this.actionLabel}</span>`;
|
|
112
|
+
};
|
|
113
|
+
AiArtifactCardComponent.styles = unsafeCSS(styles);
|
|
114
|
+
__decorateClass([
|
|
115
|
+
property({ attribute: "title-text" })
|
|
116
|
+
], AiArtifactCardComponent.prototype, "titleText", 2);
|
|
117
|
+
__decorateClass([
|
|
118
|
+
property({ attribute: "subtitle-text" })
|
|
119
|
+
], AiArtifactCardComponent.prototype, "subtitleText", 2);
|
|
120
|
+
__decorateClass([
|
|
121
|
+
property({ attribute: "action-label" })
|
|
122
|
+
], AiArtifactCardComponent.prototype, "actionLabel", 2);
|
|
123
|
+
__decorateClass([
|
|
124
|
+
property({ attribute: "asset-id" })
|
|
125
|
+
], AiArtifactCardComponent.prototype, "assetId", 2);
|
|
126
|
+
__decorateClass([
|
|
127
|
+
property({ type: Boolean, reflect: true })
|
|
128
|
+
], AiArtifactCardComponent.prototype, "active", 2);
|
|
129
|
+
__decorateClass([
|
|
130
|
+
property({ type: Boolean, reflect: true })
|
|
131
|
+
], AiArtifactCardComponent.prototype, "disabled", 2);
|
|
132
|
+
__decorateClass([
|
|
133
|
+
state()
|
|
134
|
+
], AiArtifactCardComponent.prototype, "_grouped", 2);
|
|
135
|
+
AiArtifactCardComponent = __decorateClass([
|
|
136
|
+
customElement(AiArtifactCardComponentTagName)
|
|
137
|
+
], AiArtifactCardComponent);
|
|
138
|
+
export {
|
|
139
|
+
AI_ARTIFACT_CARD_COLLAPSED_ATTRIBUTE,
|
|
140
|
+
AiArtifactCardComponent,
|
|
141
|
+
AiArtifactCardComponentTagName
|
|
142
|
+
};
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
const styles = `/* prettier-ignore */
|
|
2
|
+
@keyframes fadein {
|
|
3
|
+
from {
|
|
4
|
+
opacity: 0;
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
@keyframes forge-focus-indicator-outward-grow {
|
|
11
|
+
from {
|
|
12
|
+
outline-width: 0;
|
|
13
|
+
}
|
|
14
|
+
to {
|
|
15
|
+
outline-width: var(--_focus-indicator-active-width);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
@keyframes forge-focus-indicator-outward-shrink {
|
|
19
|
+
from {
|
|
20
|
+
outline-width: var(--_focus-indicator-active-width);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
@keyframes forge-focus-indicator-inward-grow {
|
|
24
|
+
from {
|
|
25
|
+
border-width: 0;
|
|
26
|
+
}
|
|
27
|
+
to {
|
|
28
|
+
border-width: var(--_focus-indicator-active-width);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
@keyframes forge-focus-indicator-inward-shrink {
|
|
32
|
+
from {
|
|
33
|
+
border-width: var(--_focus-indicator-active-width);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
:host {
|
|
37
|
+
--_accent-color: var(--forge-ai-artifact-card-accent-color, var(--forge-theme-primary, #3f51b5));
|
|
38
|
+
--_border-radius: var(--forge-ai-artifact-card-border-radius, 12px);
|
|
39
|
+
display: block;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([hidden]),
|
|
43
|
+
:host([data-collapsed]) {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/*
|
|
48
|
+
* Hover and press feedback come from the Forge state layer. The active ring is drawn outside the border
|
|
49
|
+
* with a spread shadow rather than a thicker border, so the card's layout never shifts between states.
|
|
50
|
+
*/
|
|
51
|
+
.artifact-card {
|
|
52
|
+
position: relative;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
width: 100%;
|
|
56
|
+
min-height: 64px;
|
|
57
|
+
gap: var(--forge-ai-artifact-card-gap, var(--forge-spacing-small, 12px));
|
|
58
|
+
padding: var(--forge-ai-artifact-card-padding, var(--forge-spacing-xsmall, 8px) var(--forge-spacing-small, 12px));
|
|
59
|
+
border: 1px solid var(--forge-theme-outline, #e0e0e0);
|
|
60
|
+
border-radius: var(--_border-radius);
|
|
61
|
+
background: var(--forge-ai-artifact-card-background, var(--forge-theme-surface, #ffffff));
|
|
62
|
+
color: inherit;
|
|
63
|
+
font: inherit;
|
|
64
|
+
text-align: start;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
outline: none;
|
|
67
|
+
transition: box-shadow 150ms ease, border-color 150ms ease;
|
|
68
|
+
--_state-layer-display: var(--forge-state-layer-display, flex);
|
|
69
|
+
--_state-layer-color: var(--forge-state-layer-color, var(--forge-theme-on-surface, #000000));
|
|
70
|
+
--_state-layer-hover-color: var(--forge-state-layer-hover-color, var(--_state-layer-color));
|
|
71
|
+
--_state-layer-hover-opacity: var(--forge-state-layer-hover-opacity, 0.08);
|
|
72
|
+
--_state-layer-pressed-color: var(--forge-state-layer-pressed-color, var(--_state-layer-color));
|
|
73
|
+
--_state-layer-pressed-opacity: var(--forge-state-layer-pressed-opacity, 0.12);
|
|
74
|
+
--_state-layer-hover-duration: var(--forge-state-layer-hover-duration, 15ms);
|
|
75
|
+
--_state-layer-pressed-duration: var(--forge-state-layer-pressed-duration, 105ms);
|
|
76
|
+
--_state-layer-animation-duration: var(--forge-state-layer-animation-duration, 375ms);
|
|
77
|
+
}
|
|
78
|
+
.artifact-card::before {
|
|
79
|
+
opacity: 0;
|
|
80
|
+
position: absolute;
|
|
81
|
+
backface-visibility: hidden;
|
|
82
|
+
transform: translateZ(0);
|
|
83
|
+
background-color: var(--_state-layer-hover-color);
|
|
84
|
+
inset: 0;
|
|
85
|
+
transition: opacity var(--_state-layer-hover-duration) linear, background-color var(--_state-layer-hover-duration) linear;
|
|
86
|
+
--_state-layer-hover-duration: var(--forge-state-layer-hover-duration, 100ms);
|
|
87
|
+
content: "";
|
|
88
|
+
opacity: 0;
|
|
89
|
+
border-radius: inherit;
|
|
90
|
+
}
|
|
91
|
+
.artifact-card:hover::before {
|
|
92
|
+
background-color: var(--_state-layer-hover-color);
|
|
93
|
+
opacity: var(--_state-layer-hover-opacity);
|
|
94
|
+
}
|
|
95
|
+
.artifact-card:active::before {
|
|
96
|
+
opacity: var(--_state-layer-pressed-opacity);
|
|
97
|
+
transition-duration: var(--_state-layer-pressed-duration);
|
|
98
|
+
--_state-layer-pressed-opacity: var(--forge-state-layer-pressed-opacity, 0.18);
|
|
99
|
+
}
|
|
100
|
+
.artifact-card:disabled {
|
|
101
|
+
opacity: 0.5;
|
|
102
|
+
cursor: default;
|
|
103
|
+
}
|
|
104
|
+
.artifact-card:disabled::before {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([active]) .artifact-card {
|
|
109
|
+
border-color: color-mix(in srgb, var(--_accent-color) 40%, transparent);
|
|
110
|
+
background: var(--forge-theme-surface-container-minimum, #f5f5f5);
|
|
111
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--_accent-color) 8%, transparent);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.focus-indicator {
|
|
115
|
+
position: absolute;
|
|
116
|
+
display: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.artifact-card:focus-visible .focus-indicator {
|
|
120
|
+
--_focus-indicator-display: var(--forge-focus-indicator-display, flex);
|
|
121
|
+
--_focus-indicator-width: var(--forge-focus-indicator-width, var(--forge-border-medium, 2px));
|
|
122
|
+
--_focus-indicator-active-width: var(--forge-focus-indicator-active-width, 6px);
|
|
123
|
+
--_focus-indicator-color: var(--forge-focus-indicator-color, var(--forge-theme-primary, #3f51b5));
|
|
124
|
+
--_focus-indicator-shape: var(--forge-focus-indicator-shape, calc(var(--forge-shape-extra-small, 1px) * var(--forge-shape-factor, 1)));
|
|
125
|
+
--_focus-indicator-duration: var(--forge-focus-indicator-duration, var(--forge-animation-duration-long4, 600ms));
|
|
126
|
+
--_focus-indicator-easing: var(--forge-focus-indicator-easing, var(--forge-animation-easing-emphasized, cubic-bezier(0.2, 0, 0, 1)));
|
|
127
|
+
--_focus-indicator-shape-start-start: var(--forge-focus-indicator-shape-start-start, var(--_focus-indicator-shape));
|
|
128
|
+
--_focus-indicator-shape-start-end: var(--forge-focus-indicator-shape-start-end, var(--_focus-indicator-shape));
|
|
129
|
+
--_focus-indicator-shape-end-end: var(--forge-focus-indicator-shape-end-end, var(--_focus-indicator-shape));
|
|
130
|
+
--_focus-indicator-shape-end-start: var(--forge-focus-indicator-shape-end-start, var(--_focus-indicator-shape));
|
|
131
|
+
--_focus-indicator-outward-offset: var(--forge-focus-indicator-outward-offset, var(--forge-spacing-xxsmall, 4px));
|
|
132
|
+
--_focus-indicator-inward-offset: var(--forge-focus-indicator-inward-offset, 0px);
|
|
133
|
+
--_focus-indicator-offset-block: var(--forge-focus-indicator-offset-block, 0);
|
|
134
|
+
--_focus-indicator-offset-inline: var(--forge-focus-indicator-offset-inline, 0);
|
|
135
|
+
animation-delay: 0s, calc(var(--_focus-indicator-duration) * 0.25);
|
|
136
|
+
animation-duration: calc(var(--_focus-indicator-duration) * 0.25), calc(var(--_focus-indicator-duration) * 0.75);
|
|
137
|
+
animation-timing-function: var(--_focus-indicator-easing);
|
|
138
|
+
box-sizing: border-box;
|
|
139
|
+
color: var(--_focus-indicator-color);
|
|
140
|
+
display: none;
|
|
141
|
+
pointer-events: none;
|
|
142
|
+
position: absolute;
|
|
143
|
+
margin-block: var(--_focus-indicator-offset-block);
|
|
144
|
+
margin-inline: var(--_focus-indicator-offset-inline);
|
|
145
|
+
animation-name: forge-focus-indicator-inward-grow, forge-focus-indicator-inward-shrink;
|
|
146
|
+
border-end-end-radius: calc(var(--_focus-indicator-shape-end-end) - var(--_focus-indicator-inward-offset));
|
|
147
|
+
border-end-start-radius: calc(var(--_focus-indicator-shape-end-start) - var(--_focus-indicator-inward-offset));
|
|
148
|
+
border-start-end-radius: calc(var(--_focus-indicator-shape-start-end) - var(--_focus-indicator-inward-offset));
|
|
149
|
+
border-start-start-radius: calc(var(--_focus-indicator-shape-start-start) - var(--_focus-indicator-inward-offset));
|
|
150
|
+
border: var(--_focus-indicator-width) solid currentColor;
|
|
151
|
+
inset: var(--_focus-indicator-inward-offset);
|
|
152
|
+
display: block;
|
|
153
|
+
--forge-focus-indicator-shape: var(--_border-radius);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.icon {
|
|
157
|
+
display: flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
flex-shrink: 0;
|
|
161
|
+
box-sizing: border-box;
|
|
162
|
+
width: var(--forge-spacing-xlarge, 32px);
|
|
163
|
+
height: var(--forge-spacing-xlarge, 32px);
|
|
164
|
+
border: 1px solid var(--forge-theme-outline, #e0e0e0);
|
|
165
|
+
border-radius: 6px;
|
|
166
|
+
background: var(--forge-theme-surface-container-minimum, #f5f5f5);
|
|
167
|
+
color: var(--forge-theme-text-high, rgba(0, 0, 0, 0.87));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.icon svg,
|
|
171
|
+
.icon ::slotted(*) {
|
|
172
|
+
display: block;
|
|
173
|
+
width: 16px;
|
|
174
|
+
height: 16px;
|
|
175
|
+
fill: currentColor;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.text {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
flex: 1;
|
|
182
|
+
min-width: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.title {
|
|
186
|
+
-moz-osx-font-smoothing: grayscale;
|
|
187
|
+
-webkit-font-smoothing: antialiased;
|
|
188
|
+
font-family: var(--forge-typography-body1-font-family, var(--forge-typography-font-family, "Roboto", sans-serif));
|
|
189
|
+
font-size: var(--forge-typography-body1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-font-size-scale, 0.875)));
|
|
190
|
+
font-weight: var(--forge-typography-body1-font-weight, 400);
|
|
191
|
+
line-height: var(--forge-typography-body1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-line-height-scale, 1.125)));
|
|
192
|
+
letter-spacing: var(--forge-typography-body1-letter-spacing, 0.0357142857em);
|
|
193
|
+
text-transform: var(--forge-typography-body1-text-transform, inherit);
|
|
194
|
+
text-decoration: var(--forge-typography-body1-text-decoration, inherit);
|
|
195
|
+
white-space: nowrap;
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
text-overflow: ellipsis;
|
|
198
|
+
font-weight: 500;
|
|
199
|
+
color: var(--forge-theme-text-high, rgba(0, 0, 0, 0.87));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.subtitle {
|
|
203
|
+
-moz-osx-font-smoothing: grayscale;
|
|
204
|
+
-webkit-font-smoothing: antialiased;
|
|
205
|
+
font-family: var(--forge-typography-label1-font-family, var(--forge-typography-font-family, "Roboto", sans-serif));
|
|
206
|
+
font-size: var(--forge-typography-label1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, 0.75)));
|
|
207
|
+
font-weight: var(--forge-typography-label1-font-weight, 400);
|
|
208
|
+
line-height: var(--forge-typography-label1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));
|
|
209
|
+
letter-spacing: var(--forge-typography-label1-letter-spacing, 0.0357142857em);
|
|
210
|
+
text-transform: var(--forge-typography-label1-text-transform, inherit);
|
|
211
|
+
text-decoration: var(--forge-typography-label1-text-decoration, inherit);
|
|
212
|
+
white-space: nowrap;
|
|
213
|
+
overflow: hidden;
|
|
214
|
+
text-overflow: ellipsis;
|
|
215
|
+
color: var(--forge-theme-text-medium, rgba(0, 0, 0, 0.6));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.action {
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
flex-shrink: 0;
|
|
223
|
+
width: var(--forge-spacing-xlarge, 32px);
|
|
224
|
+
height: var(--forge-spacing-xlarge, 32px);
|
|
225
|
+
color: var(--forge-theme-text-medium, rgba(0, 0, 0, 0.6));
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.action svg,
|
|
229
|
+
.action ::slotted(*) {
|
|
230
|
+
display: block;
|
|
231
|
+
width: 18px;
|
|
232
|
+
height: 18px;
|
|
233
|
+
fill: currentColor;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/*
|
|
237
|
+
* The default arrow promises the card opens something, which the active card already is. Its space is
|
|
238
|
+
* kept so the text doesn't reflow when a card becomes active. Slotted action icons stay visible.
|
|
239
|
+
*/
|
|
240
|
+
:host([active]) .arrow {
|
|
241
|
+
visibility: hidden;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.sr-only {
|
|
245
|
+
position: absolute;
|
|
246
|
+
width: 1px;
|
|
247
|
+
height: 1px;
|
|
248
|
+
padding: 0;
|
|
249
|
+
margin: -1px;
|
|
250
|
+
overflow: hidden;
|
|
251
|
+
clip: rect(0, 0, 0, 0);
|
|
252
|
+
white-space: nowrap;
|
|
253
|
+
border: 0;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/*
|
|
257
|
+
* Inside a group the card becomes a list row: the group draws the border, corners, and dividers,
|
|
258
|
+
* so the row gives those up and shows active as a fill rather than a ring.
|
|
259
|
+
*/
|
|
260
|
+
.artifact-card--grouped {
|
|
261
|
+
min-height: var(--forge-spacing-xxxlarge, 56px);
|
|
262
|
+
border: none;
|
|
263
|
+
border-radius: 0;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/*
|
|
267
|
+
* Square, because the group clips its rows to its own rounded corners. The group hands the top and bottom
|
|
268
|
+
* rows its inner radius so their rings follow the curve instead of being cut off.
|
|
269
|
+
*/
|
|
270
|
+
.artifact-card--grouped:focus-visible .focus-indicator {
|
|
271
|
+
--forge-focus-indicator-shape-start-start: var(--_forge-ai-artifact-card-group-start-radius, 0px);
|
|
272
|
+
--forge-focus-indicator-shape-start-end: var(--_forge-ai-artifact-card-group-start-radius, 0px);
|
|
273
|
+
--forge-focus-indicator-shape-end-start: var(--_forge-ai-artifact-card-group-end-radius, 0px);
|
|
274
|
+
--forge-focus-indicator-shape-end-end: var(--_forge-ai-artifact-card-group-end-radius, 0px);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
:host([active]) .artifact-card--grouped {
|
|
278
|
+
background: color-mix(in srgb, var(--_accent-color) 8%, transparent);
|
|
279
|
+
box-shadow: none;
|
|
280
|
+
}`;
|
|
281
|
+
export {
|
|
282
|
+
styles as default
|
|
283
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AiArtifactCardComponent, AiArtifactCardComponentTagName, type ForgeAiArtifactCardOpenEventData } from './ai-artifact-card';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult, CSSResult } from 'lit';
|
|
2
|
+
declare global {
|
|
3
|
+
interface HTMLElementTagNameMap {
|
|
4
|
+
'forge-ai-artifact-card-group': AiArtifactCardGroupComponent;
|
|
5
|
+
}
|
|
6
|
+
interface HTMLElementEventMap {
|
|
7
|
+
'forge-ai-artifact-card-group-toggle': CustomEvent<ForgeAiArtifactCardGroupToggleEventData>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export interface ForgeAiArtifactCardGroupToggleEventData {
|
|
11
|
+
expanded: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const AiArtifactCardGroupComponentTagName: keyof HTMLElementTagNameMap;
|
|
14
|
+
/**
|
|
15
|
+
* @tag forge-ai-artifact-card-group
|
|
16
|
+
*
|
|
17
|
+
* @summary Presents several artifact cards as a single list that collapses past a set count.
|
|
18
|
+
*
|
|
19
|
+
* @description
|
|
20
|
+
* Wraps `forge-ai-artifact-card` elements in one bordered container with dividers between them.
|
|
21
|
+
* Cards inside a group switch to a flatter row style on their own. When there are more cards than
|
|
22
|
+
* `visibleCount`, the extras are collapsed behind a toggle that expands and collapses the list. Each
|
|
23
|
+
* card still emits its own open event. Cards a consumer has set `hidden` on stay hidden and are not
|
|
24
|
+
* counted; collapsing uses a separate marker so the two never clobber each other.
|
|
25
|
+
*
|
|
26
|
+
* @slot - The `forge-ai-artifact-card` elements to list. Other elements are not styled as rows and
|
|
27
|
+
* break the list semantics, so keep the slot to cards.
|
|
28
|
+
*
|
|
29
|
+
* @event {CustomEvent<ForgeAiArtifactCardGroupToggleEventData>} forge-ai-artifact-card-group-toggle -
|
|
30
|
+
* Fired when the user expands or collapses the list with the toggle.
|
|
31
|
+
*
|
|
32
|
+
* @cssproperty --forge-ai-artifact-card-group-border-radius - Corner radius of the group
|
|
33
|
+
*/
|
|
34
|
+
export declare class AiArtifactCardGroupComponent extends LitElement {
|
|
35
|
+
#private;
|
|
36
|
+
static styles: CSSResult;
|
|
37
|
+
/**
|
|
38
|
+
* How many cards show while the list is collapsed. Values below 1 are treated as 1, and
|
|
39
|
+
* non-numeric values fall back to the default of 3.
|
|
40
|
+
*/
|
|
41
|
+
visibleCount: number;
|
|
42
|
+
/**
|
|
43
|
+
* Whether every card is showing.
|
|
44
|
+
*/
|
|
45
|
+
expanded: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Label of the toggle while collapsed. `{count}` is replaced with the number of hidden cards.
|
|
48
|
+
*/
|
|
49
|
+
showMoreText: string;
|
|
50
|
+
/**
|
|
51
|
+
* Label of the toggle while expanded.
|
|
52
|
+
*/
|
|
53
|
+
showLessText: string;
|
|
54
|
+
private _cards;
|
|
55
|
+
updated(changedProperties: PropertyValues<this>): void;
|
|
56
|
+
render(): TemplateResult;
|
|
57
|
+
}
|