@salla.sa/ui-ai-kit-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cjs/ai-card.cjs.entry.js +25 -0
- package/dist/cjs/ai-chat-container.cjs.entry.js +138 -0
- package/dist/cjs/ai-chat-header.cjs.entry.js +79 -0
- package/dist/cjs/ai-chat-message.cjs.entry.js +164 -0
- package/dist/cjs/ai-icon.cjs.entry.js +25 -0
- package/dist/cjs/ai-link.cjs.entry.js +34 -0
- package/dist/cjs/ai-loading.cjs.entry.js +77 -0
- package/dist/cjs/ai-message-input.cjs.entry.js +65 -0
- package/dist/cjs/ai-rating.cjs.entry.js +57 -0
- package/dist/cjs/ai-suggestion.cjs.entry.js +31 -0
- package/dist/cjs/ai-voice-input.cjs.entry.js +233 -0
- package/dist/cjs/icon-registry-dmfLA-Dj.js +82 -0
- package/dist/cjs/index-DLJcLHFH.js +1622 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/ui-ai-kit.cjs.js +24 -0
- package/dist/collection/collection-manifest.json +23 -0
- package/dist/collection/components/ai-card/ai-card.css +40 -0
- package/dist/collection/components/ai-card/ai-card.js +70 -0
- package/dist/collection/components/ai-card/ai-card.stories.js +52 -0
- package/dist/collection/components/ai-chat-container/ai-chat-container.css +137 -0
- package/dist/collection/components/ai-chat-container/ai-chat-container.js +270 -0
- package/dist/collection/components/ai-chat-container/ai-chat-container.stories.js +160 -0
- package/dist/collection/components/ai-chat-header/ai-chat-header.css +186 -0
- package/dist/collection/components/ai-chat-header/ai-chat-header.js +311 -0
- package/dist/collection/components/ai-chat-header/ai-chat-header.stories.js +138 -0
- package/dist/collection/components/ai-chat-message/ai-chat-message.css +304 -0
- package/dist/collection/components/ai-chat-message/ai-chat-message.js +379 -0
- package/dist/collection/components/ai-chat-message/ai-chat-message.stories.js +164 -0
- package/dist/collection/components/ai-icon/ai-icon.css +9 -0
- package/dist/collection/components/ai-icon/ai-icon.js +76 -0
- package/dist/collection/components/ai-link/ai-link.css +62 -0
- package/dist/collection/components/ai-link/ai-link.js +119 -0
- package/dist/collection/components/ai-link/ai-link.stories.js +79 -0
- package/dist/collection/components/ai-loading/ai-loading.css +202 -0
- package/dist/collection/components/ai-loading/ai-loading.js +244 -0
- package/dist/collection/components/ai-loading/ai-loading.stories.js +145 -0
- package/dist/collection/components/ai-message-input/ai-message-input.css +175 -0
- package/dist/collection/components/ai-message-input/ai-message-input.js +192 -0
- package/dist/collection/components/ai-message-input/ai-message-input.stories.js +125 -0
- package/dist/collection/components/ai-rating/ai-rating.css +145 -0
- package/dist/collection/components/ai-rating/ai-rating.js +176 -0
- package/dist/collection/components/ai-rating/ai-rating.stories.js +78 -0
- package/dist/collection/components/ai-suggestion/ai-suggestion.css +69 -0
- package/dist/collection/components/ai-suggestion/ai-suggestion.js +93 -0
- package/dist/collection/components/ai-suggestion/ai-suggestion.stories.js +62 -0
- package/dist/collection/components/ai-voice-input/ai-voice-input.css +136 -0
- package/dist/collection/components/ai-voice-input/ai-voice-input.js +341 -0
- package/dist/collection/components/ai-voice-input/ai-voice-input.stories.js +118 -0
- package/dist/collection/index.js +10 -0
- package/dist/collection/utils/icon-registry.js +78 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/ai-card.d.ts +11 -0
- package/dist/components/ai-card.js +1 -0
- package/dist/components/ai-chat-container.d.ts +11 -0
- package/dist/components/ai-chat-container.js +1 -0
- package/dist/components/ai-chat-header.d.ts +11 -0
- package/dist/components/ai-chat-header.js +1 -0
- package/dist/components/ai-chat-message.d.ts +11 -0
- package/dist/components/ai-chat-message.js +1 -0
- package/dist/components/ai-icon.d.ts +11 -0
- package/dist/components/ai-icon.js +1 -0
- package/dist/components/ai-link.d.ts +11 -0
- package/dist/components/ai-link.js +1 -0
- package/dist/components/ai-loading.d.ts +11 -0
- package/dist/components/ai-loading.js +1 -0
- package/dist/components/ai-message-input.d.ts +11 -0
- package/dist/components/ai-message-input.js +1 -0
- package/dist/components/ai-rating.d.ts +11 -0
- package/dist/components/ai-rating.js +1 -0
- package/dist/components/ai-suggestion.d.ts +11 -0
- package/dist/components/ai-suggestion.js +1 -0
- package/dist/components/ai-voice-input.d.ts +11 -0
- package/dist/components/ai-voice-input.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-CWjXxYJI.js +1 -0
- package/dist/components/p-CY6emva2.js +1 -0
- package/dist/components/p-DYv5ef4M.js +1 -0
- package/dist/esm/ai-card.entry.js +23 -0
- package/dist/esm/ai-chat-container.entry.js +136 -0
- package/dist/esm/ai-chat-header.entry.js +77 -0
- package/dist/esm/ai-chat-message.entry.js +162 -0
- package/dist/esm/ai-icon.entry.js +23 -0
- package/dist/esm/ai-link.entry.js +32 -0
- package/dist/esm/ai-loading.entry.js +75 -0
- package/dist/esm/ai-message-input.entry.js +63 -0
- package/dist/esm/ai-rating.entry.js +55 -0
- package/dist/esm/ai-suggestion.entry.js +29 -0
- package/dist/esm/ai-voice-input.entry.js +231 -0
- package/dist/esm/icon-registry-DYv5ef4M.js +80 -0
- package/dist/esm/index-7hrZ8FOQ.js +1612 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/ui-ai-kit.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/ai-card/ai-card.d.ts +7 -0
- package/dist/types/components/ai-card/ai-card.stories.d.ts +7 -0
- package/dist/types/components/ai-chat-container/ai-chat-container.d.ts +28 -0
- package/dist/types/components/ai-chat-container/ai-chat-container.stories.d.ts +7 -0
- package/dist/types/components/ai-chat-header/ai-chat-header.d.ts +38 -0
- package/dist/types/components/ai-chat-header/ai-chat-header.stories.d.ts +8 -0
- package/dist/types/components/ai-chat-message/ai-chat-message.d.ts +27 -0
- package/dist/types/components/ai-chat-message/ai-chat-message.stories.d.ts +10 -0
- package/dist/types/components/ai-icon/ai-icon.d.ts +8 -0
- package/dist/types/components/ai-link/ai-link.d.ts +12 -0
- package/dist/types/components/ai-link/ai-link.stories.d.ts +8 -0
- package/dist/types/components/ai-loading/ai-loading.d.ts +33 -0
- package/dist/types/components/ai-loading/ai-loading.stories.d.ts +10 -0
- package/dist/types/components/ai-message-input/ai-message-input.d.ts +22 -0
- package/dist/types/components/ai-message-input/ai-message-input.stories.d.ts +13 -0
- package/dist/types/components/ai-rating/ai-rating.d.ts +17 -0
- package/dist/types/components/ai-rating/ai-rating.stories.d.ts +8 -0
- package/dist/types/components/ai-suggestion/ai-suggestion.d.ts +10 -0
- package/dist/types/components/ai-suggestion/ai-suggestion.stories.d.ts +8 -0
- package/dist/types/components/ai-voice-input/ai-voice-input.d.ts +43 -0
- package/dist/types/components/ai-voice-input/ai-voice-input.stories.d.ts +9 -0
- package/dist/types/components.d.ts +860 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/utils/icon-registry.d.ts +5 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/ui-ai-kit/index.esm.js +1 -0
- package/dist/ui-ai-kit/p-11facfad.entry.js +1 -0
- package/dist/ui-ai-kit/p-128a2ed4.entry.js +1 -0
- package/dist/ui-ai-kit/p-227bdb8f.entry.js +1 -0
- package/dist/ui-ai-kit/p-455daa17.entry.js +1 -0
- package/dist/ui-ai-kit/p-56163e8c.entry.js +1 -0
- package/dist/ui-ai-kit/p-6d21d0fd.entry.js +1 -0
- package/dist/ui-ai-kit/p-6ddcd77b.entry.js +1 -0
- package/dist/ui-ai-kit/p-7hrZ8FOQ.js +2 -0
- package/dist/ui-ai-kit/p-8e90143e.entry.js +1 -0
- package/dist/ui-ai-kit/p-9938c277.entry.js +1 -0
- package/dist/ui-ai-kit/p-DYv5ef4M.js +1 -0
- package/dist/ui-ai-kit/p-dc5b4a7f.entry.js +1 -0
- package/dist/ui-ai-kit/p-fb1702de.entry.js +1 -0
- package/dist/ui-ai-kit/ui-ai-kit.css +1 -0
- package/dist/ui-ai-kit/ui-ai-kit.esm.js +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +77 -0
- package/readme.md +111 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { iconRegistry } from "../../utils/icon-registry";
|
|
3
|
+
export class AiLoading {
|
|
4
|
+
/** Main mode switch */
|
|
5
|
+
mode = 'thinking';
|
|
6
|
+
/** Thinking mode status text */
|
|
7
|
+
statusText = 'جاري التفكير...';
|
|
8
|
+
/** Steps as JSON string array of LoadingStep */
|
|
9
|
+
steps = '[]';
|
|
10
|
+
/** Steps mode title */
|
|
11
|
+
headerTitle = 'خطة التنفيذ';
|
|
12
|
+
/** Steps mode expand state */
|
|
13
|
+
expanded = true;
|
|
14
|
+
/** Whether steps card is collapsible */
|
|
15
|
+
collapsible = true;
|
|
16
|
+
toggleExpand;
|
|
17
|
+
stepClick;
|
|
18
|
+
_expanded = true;
|
|
19
|
+
componentWillLoad() {
|
|
20
|
+
this._expanded = this.expanded;
|
|
21
|
+
}
|
|
22
|
+
renderIcon(name, width, height) {
|
|
23
|
+
const icon = iconRegistry[name];
|
|
24
|
+
if (!icon)
|
|
25
|
+
return null;
|
|
26
|
+
const svg = `<svg width="${width}" height="${height}" viewBox="${icon.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${icon.content}</svg>`;
|
|
27
|
+
return h("span", { class: "icon-wrap", innerHTML: svg });
|
|
28
|
+
}
|
|
29
|
+
renderSparkleAvatar() {
|
|
30
|
+
return h("div", { class: "sparkle-avatar" }, this.renderIcon('sparkle', 14, 14));
|
|
31
|
+
}
|
|
32
|
+
renderStepBadge(step, index) {
|
|
33
|
+
const isCompleted = step.status === 'completed';
|
|
34
|
+
return (h("div", { class: "step-badge-outer" }, h("div", { class: `step-badge-inner ${isCompleted ? 'completed' : ''}` }, isCompleted ? this.renderIcon('check', 14, 14) : h("span", { class: "step-number" }, index + 1))));
|
|
35
|
+
}
|
|
36
|
+
getStepsList() {
|
|
37
|
+
try {
|
|
38
|
+
return JSON.parse(this.steps) || [];
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
handleToggle() {
|
|
45
|
+
if (!this.collapsible)
|
|
46
|
+
return;
|
|
47
|
+
this._expanded = !this._expanded;
|
|
48
|
+
this.expanded = this._expanded;
|
|
49
|
+
this.toggleExpand.emit(this._expanded);
|
|
50
|
+
}
|
|
51
|
+
renderThinkingMode() {
|
|
52
|
+
return (h("div", { class: "thinking-row" }, this.renderSparkleAvatar(), h("span", { class: "shimmer-text" }, this.statusText)));
|
|
53
|
+
}
|
|
54
|
+
renderStepsMode() {
|
|
55
|
+
const stepsList = this.getStepsList();
|
|
56
|
+
const completedCount = stepsList.filter(s => s.status === 'completed').length;
|
|
57
|
+
const total = stepsList.length;
|
|
58
|
+
const allDone = total > 0 && completedCount === total;
|
|
59
|
+
return (h("div", { class: "steps-card" }, h("div", { class: `steps-header ${this.collapsible ? 'collapsible' : ''}`, onClick: () => this.handleToggle() }, this.renderSparkleAvatar(), h("div", { class: "steps-header-center" }, h("span", { class: "steps-title" }, this.headerTitle), total > 0 && h("span", { class: "progress-badge" }, allDone ? 'مكتمل' : `${completedCount}/${total}`)), this.collapsible && h("button", { class: `collapse-btn ${this._expanded ? 'expanded' : ''}` }, this.renderIcon('chevron-down', 20, 20))), this._expanded && stepsList.length > 0 && (h("div", { class: "steps-body" }, stepsList.map((step, i) => (h("div", { class: "step-row", onClick: () => this.stepClick.emit(step) }, h("div", { class: "step-badge-col" }, this.renderStepBadge(step, i), i < stepsList.length - 1 && h("div", { class: "step-separator" })), h("span", { class: "step-text" }, step.title))))))));
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
return h(Host, { key: '8a994758abe21c8a333088eeda498d158631bae6' }, this.mode === 'thinking' ? this.renderThinkingMode() : this.renderStepsMode());
|
|
63
|
+
}
|
|
64
|
+
static get is() { return "ai-loading"; }
|
|
65
|
+
static get encapsulation() { return "shadow"; }
|
|
66
|
+
static get originalStyleUrls() {
|
|
67
|
+
return {
|
|
68
|
+
"$": ["ai-loading.css"]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static get styleUrls() {
|
|
72
|
+
return {
|
|
73
|
+
"$": ["ai-loading.css"]
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
static get properties() {
|
|
77
|
+
return {
|
|
78
|
+
"mode": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "'thinking' | 'steps'",
|
|
83
|
+
"resolved": "\"steps\" | \"thinking\"",
|
|
84
|
+
"references": {}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": "Main mode switch"
|
|
91
|
+
},
|
|
92
|
+
"getter": false,
|
|
93
|
+
"setter": false,
|
|
94
|
+
"reflect": false,
|
|
95
|
+
"attribute": "mode",
|
|
96
|
+
"defaultValue": "'thinking'"
|
|
97
|
+
},
|
|
98
|
+
"statusText": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"mutable": false,
|
|
101
|
+
"complexType": {
|
|
102
|
+
"original": "string",
|
|
103
|
+
"resolved": "string",
|
|
104
|
+
"references": {}
|
|
105
|
+
},
|
|
106
|
+
"required": false,
|
|
107
|
+
"optional": false,
|
|
108
|
+
"docs": {
|
|
109
|
+
"tags": [],
|
|
110
|
+
"text": "Thinking mode status text"
|
|
111
|
+
},
|
|
112
|
+
"getter": false,
|
|
113
|
+
"setter": false,
|
|
114
|
+
"reflect": false,
|
|
115
|
+
"attribute": "status-text",
|
|
116
|
+
"defaultValue": "'\u062C\u0627\u0631\u064A \u0627\u0644\u062A\u0641\u0643\u064A\u0631...'"
|
|
117
|
+
},
|
|
118
|
+
"steps": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"mutable": false,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "string",
|
|
123
|
+
"resolved": "string",
|
|
124
|
+
"references": {}
|
|
125
|
+
},
|
|
126
|
+
"required": false,
|
|
127
|
+
"optional": false,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": "Steps as JSON string array of LoadingStep"
|
|
131
|
+
},
|
|
132
|
+
"getter": false,
|
|
133
|
+
"setter": false,
|
|
134
|
+
"reflect": false,
|
|
135
|
+
"attribute": "steps",
|
|
136
|
+
"defaultValue": "'[]'"
|
|
137
|
+
},
|
|
138
|
+
"headerTitle": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"mutable": false,
|
|
141
|
+
"complexType": {
|
|
142
|
+
"original": "string",
|
|
143
|
+
"resolved": "string",
|
|
144
|
+
"references": {}
|
|
145
|
+
},
|
|
146
|
+
"required": false,
|
|
147
|
+
"optional": false,
|
|
148
|
+
"docs": {
|
|
149
|
+
"tags": [],
|
|
150
|
+
"text": "Steps mode title"
|
|
151
|
+
},
|
|
152
|
+
"getter": false,
|
|
153
|
+
"setter": false,
|
|
154
|
+
"reflect": false,
|
|
155
|
+
"attribute": "header-title",
|
|
156
|
+
"defaultValue": "'\u062E\u0637\u0629 \u0627\u0644\u062A\u0646\u0641\u064A\u0630'"
|
|
157
|
+
},
|
|
158
|
+
"expanded": {
|
|
159
|
+
"type": "boolean",
|
|
160
|
+
"mutable": true,
|
|
161
|
+
"complexType": {
|
|
162
|
+
"original": "boolean",
|
|
163
|
+
"resolved": "boolean",
|
|
164
|
+
"references": {}
|
|
165
|
+
},
|
|
166
|
+
"required": false,
|
|
167
|
+
"optional": false,
|
|
168
|
+
"docs": {
|
|
169
|
+
"tags": [],
|
|
170
|
+
"text": "Steps mode expand state"
|
|
171
|
+
},
|
|
172
|
+
"getter": false,
|
|
173
|
+
"setter": false,
|
|
174
|
+
"reflect": false,
|
|
175
|
+
"attribute": "expanded",
|
|
176
|
+
"defaultValue": "true"
|
|
177
|
+
},
|
|
178
|
+
"collapsible": {
|
|
179
|
+
"type": "boolean",
|
|
180
|
+
"mutable": false,
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "boolean",
|
|
183
|
+
"resolved": "boolean",
|
|
184
|
+
"references": {}
|
|
185
|
+
},
|
|
186
|
+
"required": false,
|
|
187
|
+
"optional": false,
|
|
188
|
+
"docs": {
|
|
189
|
+
"tags": [],
|
|
190
|
+
"text": "Whether steps card is collapsible"
|
|
191
|
+
},
|
|
192
|
+
"getter": false,
|
|
193
|
+
"setter": false,
|
|
194
|
+
"reflect": false,
|
|
195
|
+
"attribute": "collapsible",
|
|
196
|
+
"defaultValue": "true"
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
static get states() {
|
|
201
|
+
return {
|
|
202
|
+
"_expanded": {}
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
static get events() {
|
|
206
|
+
return [{
|
|
207
|
+
"method": "toggleExpand",
|
|
208
|
+
"name": "toggleExpand",
|
|
209
|
+
"bubbles": true,
|
|
210
|
+
"cancelable": true,
|
|
211
|
+
"composed": true,
|
|
212
|
+
"docs": {
|
|
213
|
+
"tags": [],
|
|
214
|
+
"text": ""
|
|
215
|
+
},
|
|
216
|
+
"complexType": {
|
|
217
|
+
"original": "boolean",
|
|
218
|
+
"resolved": "boolean",
|
|
219
|
+
"references": {}
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
"method": "stepClick",
|
|
223
|
+
"name": "stepClick",
|
|
224
|
+
"bubbles": true,
|
|
225
|
+
"cancelable": true,
|
|
226
|
+
"composed": true,
|
|
227
|
+
"docs": {
|
|
228
|
+
"tags": [],
|
|
229
|
+
"text": ""
|
|
230
|
+
},
|
|
231
|
+
"complexType": {
|
|
232
|
+
"original": "LoadingStep",
|
|
233
|
+
"resolved": "LoadingStep",
|
|
234
|
+
"references": {
|
|
235
|
+
"LoadingStep": {
|
|
236
|
+
"location": "local",
|
|
237
|
+
"path": "/home/ahmed/Desktop/Salla/Dev/multi-agent/ui-ai-kit/packages/core/src/components/ai-loading/ai-loading.tsx",
|
|
238
|
+
"id": "src/components/ai-loading/ai-loading.tsx::LoadingStep"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}];
|
|
243
|
+
}
|
|
244
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Chat/Loading',
|
|
4
|
+
component: 'ai-loading',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {
|
|
7
|
+
mode: {
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
options: ['thinking', 'steps'],
|
|
10
|
+
description: 'Main mode switch',
|
|
11
|
+
},
|
|
12
|
+
statusText: {
|
|
13
|
+
control: 'text',
|
|
14
|
+
description: 'Thinking mode status text',
|
|
15
|
+
},
|
|
16
|
+
steps: {
|
|
17
|
+
control: 'text',
|
|
18
|
+
description: 'Steps as JSON string array',
|
|
19
|
+
},
|
|
20
|
+
headerTitle: {
|
|
21
|
+
control: 'text',
|
|
22
|
+
description: 'Steps card title',
|
|
23
|
+
},
|
|
24
|
+
expanded: {
|
|
25
|
+
control: 'boolean',
|
|
26
|
+
description: 'Steps card expand state',
|
|
27
|
+
},
|
|
28
|
+
collapsible: {
|
|
29
|
+
control: 'boolean',
|
|
30
|
+
description: 'Allow collapsing the steps card',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export default meta;
|
|
35
|
+
const stepsInProgress = JSON.stringify([
|
|
36
|
+
{ id: '1', title: 'البحث عن المعلومات المطلوبة', status: 'completed' },
|
|
37
|
+
{ id: '2', title: 'تحليل البيانات وإعداد التقرير', status: 'executing' },
|
|
38
|
+
{ id: '3', title: 'مراجعة النتائج والتحقق منها', status: 'pending' },
|
|
39
|
+
{ id: '4', title: 'إرسال التقرير النهائي', status: 'pending' },
|
|
40
|
+
]);
|
|
41
|
+
const stepsAllCompleted = JSON.stringify([
|
|
42
|
+
{ id: '1', title: 'البحث عن المعلومات المطلوبة', status: 'completed' },
|
|
43
|
+
{ id: '2', title: 'تحليل البيانات وإعداد التقرير', status: 'completed' },
|
|
44
|
+
{ id: '3', title: 'مراجعة النتائج والتحقق منها', status: 'completed' },
|
|
45
|
+
]);
|
|
46
|
+
export const Thinking = {
|
|
47
|
+
render: args => html `
|
|
48
|
+
<ai-loading
|
|
49
|
+
mode="${args.mode}"
|
|
50
|
+
status-text="${args.statusText}"
|
|
51
|
+
></ai-loading>
|
|
52
|
+
`,
|
|
53
|
+
args: {
|
|
54
|
+
mode: 'thinking',
|
|
55
|
+
statusText: 'جاري التفكير...',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export const ThinkingCustomText = {
|
|
59
|
+
render: args => html `
|
|
60
|
+
<ai-loading
|
|
61
|
+
mode="${args.mode}"
|
|
62
|
+
status-text="${args.statusText}"
|
|
63
|
+
></ai-loading>
|
|
64
|
+
`,
|
|
65
|
+
args: {
|
|
66
|
+
mode: 'thinking',
|
|
67
|
+
statusText: 'جاري معالجة طلبك...',
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
export const StepsInProgress = {
|
|
71
|
+
render: args => html `
|
|
72
|
+
<div style="min-width: 360px;">
|
|
73
|
+
<ai-loading
|
|
74
|
+
mode="${args.mode}"
|
|
75
|
+
.steps="${args.steps}"
|
|
76
|
+
?expanded="${args.expanded}"
|
|
77
|
+
?collapsible="${args.collapsible}"
|
|
78
|
+
@toggleExpand="${(e) => console.log('expand:', e.detail)}"
|
|
79
|
+
@stepClick="${(e) => console.log('step:', e.detail)}"
|
|
80
|
+
></ai-loading>
|
|
81
|
+
</div>
|
|
82
|
+
`,
|
|
83
|
+
args: {
|
|
84
|
+
mode: 'steps',
|
|
85
|
+
steps: stepsInProgress,
|
|
86
|
+
expanded: true,
|
|
87
|
+
collapsible: true,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
export const StepsAllCompleted = {
|
|
91
|
+
render: args => html `
|
|
92
|
+
<div style="min-width: 360px;">
|
|
93
|
+
<ai-loading
|
|
94
|
+
mode="${args.mode}"
|
|
95
|
+
.steps="${args.steps}"
|
|
96
|
+
?expanded="${args.expanded}"
|
|
97
|
+
?collapsible="${args.collapsible}"
|
|
98
|
+
></ai-loading>
|
|
99
|
+
</div>
|
|
100
|
+
`,
|
|
101
|
+
args: {
|
|
102
|
+
mode: 'steps',
|
|
103
|
+
steps: stepsAllCompleted,
|
|
104
|
+
expanded: true,
|
|
105
|
+
collapsible: true,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
export const StepsCollapsed = {
|
|
109
|
+
render: args => html `
|
|
110
|
+
<div style="min-width: 360px;">
|
|
111
|
+
<ai-loading
|
|
112
|
+
mode="${args.mode}"
|
|
113
|
+
.steps="${args.steps}"
|
|
114
|
+
?expanded="${args.expanded}"
|
|
115
|
+
?collapsible="${args.collapsible}"
|
|
116
|
+
></ai-loading>
|
|
117
|
+
</div>
|
|
118
|
+
`,
|
|
119
|
+
args: {
|
|
120
|
+
mode: 'steps',
|
|
121
|
+
steps: stepsInProgress,
|
|
122
|
+
expanded: false,
|
|
123
|
+
collapsible: true,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
export const StepsCustomTitle = {
|
|
127
|
+
render: args => html `
|
|
128
|
+
<div style="min-width: 360px;">
|
|
129
|
+
<ai-loading
|
|
130
|
+
mode="${args.mode}"
|
|
131
|
+
.steps="${args.steps}"
|
|
132
|
+
header-title="${args.headerTitle}"
|
|
133
|
+
?expanded="${args.expanded}"
|
|
134
|
+
?collapsible="${args.collapsible}"
|
|
135
|
+
></ai-loading>
|
|
136
|
+
</div>
|
|
137
|
+
`,
|
|
138
|
+
args: {
|
|
139
|
+
mode: 'steps',
|
|
140
|
+
steps: stepsInProgress,
|
|
141
|
+
headerTitle: 'خطوات المهمة',
|
|
142
|
+
expanded: true,
|
|
143
|
+
collapsible: true,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: var(--ai-font-family, "PingARLT", sans-serif);
|
|
4
|
+
width: 100%;
|
|
5
|
+
|
|
6
|
+
--ai-input-bg: var(--ai-bg-input, #ffffff);
|
|
7
|
+
--ai-input-border-color: var(--ai-border-default, #eeeeee);
|
|
8
|
+
--ai-input-text-color: var(--ai-text-primary, #333333);
|
|
9
|
+
--ai-input-placeholder-color: var(--ai-text-secondary, #737373);
|
|
10
|
+
--ai-voice-button-color: var(--ai-text-secondary, #737373);
|
|
11
|
+
--ai-send-button-bg: var(--ai-border-default, #eeeeee);
|
|
12
|
+
--ai-send-button-border: var(--ai-border-default, #eeeeee);
|
|
13
|
+
--ai-send-button-color: var(--ai-text-secondary, #737373);
|
|
14
|
+
--ai-send-button-active-color: var(--ai-text-primary, #333333);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Wrapper holds glow + container */
|
|
18
|
+
.wrapper {
|
|
19
|
+
position: relative;
|
|
20
|
+
padding: var(--ai-input-wrapper-padding, 16px);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Decorative gradient glow below the input */
|
|
24
|
+
.glow {
|
|
25
|
+
position: absolute;
|
|
26
|
+
bottom: 20px;
|
|
27
|
+
left: 39px;
|
|
28
|
+
right: 39px;
|
|
29
|
+
height: 29px;
|
|
30
|
+
border-radius: 9999px;
|
|
31
|
+
background: var(--ai-input-glow);
|
|
32
|
+
filter: blur(20px);
|
|
33
|
+
opacity: 0.9;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Main container — pill shaped */
|
|
38
|
+
.input-container {
|
|
39
|
+
position: relative;
|
|
40
|
+
background-color: var(--ai-input-bg, #ffffff);
|
|
41
|
+
border-radius: var(--ai-input-border-radius, 9999px);
|
|
42
|
+
border: 1px solid var(--ai-input-border-color, #eeeeee);
|
|
43
|
+
box-shadow: 0 1px 2px 0 var(--ai-input-shadow-color, rgba(18, 18, 23, 0.05));
|
|
44
|
+
padding: var(--ai-input-padding, 12px);
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.input-row {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: var(--ai-input-gap, 12px);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Action buttons (send + optional voice) */
|
|
55
|
+
.actions {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: var(--ai-actions-gap, 8px);
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Send Button */
|
|
63
|
+
.send-button {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
gap: 4px;
|
|
68
|
+
min-height: 32px;
|
|
69
|
+
max-height: 32px;
|
|
70
|
+
padding: 4px 8px;
|
|
71
|
+
border-radius: 32px;
|
|
72
|
+
border: 2px solid var(--ai-send-button-border, #eeeeee);
|
|
73
|
+
background-color: var(--ai-send-button-bg, #eeeeee);
|
|
74
|
+
color: var(--ai-send-button-color, #737373);
|
|
75
|
+
cursor: not-allowed;
|
|
76
|
+
transition:
|
|
77
|
+
background-color 0.2s ease,
|
|
78
|
+
border-color 0.2s ease,
|
|
79
|
+
color 0.2s ease;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.send-button.active {
|
|
84
|
+
background-color: var(--ai-send-button-active-bg, var(--ai-accent));
|
|
85
|
+
border-color: var(--ai-send-button-active-border, var(--ai-accent));
|
|
86
|
+
color: var(--ai-accent-text);
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.send-button.active:hover {
|
|
91
|
+
background-color: var(--ai-send-button-active-hover-bg, var(--ai-accent));
|
|
92
|
+
border-color: var(--ai-send-button-active-hover-border, var(--ai-accent));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.send-button:focus {
|
|
96
|
+
outline: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Voice Button */
|
|
100
|
+
.voice-button {
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
width: 32px;
|
|
105
|
+
height: 32px;
|
|
106
|
+
border-radius: 32px;
|
|
107
|
+
border: none;
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
color: var(--ai-voice-button-color, #737373);
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
transition:
|
|
112
|
+
background-color 0.2s ease,
|
|
113
|
+
color 0.2s ease;
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.voice-button:hover:not(:disabled) {
|
|
118
|
+
background-color: var(--ai-voice-button-hover-bg, rgba(0, 0, 0, 0.06));
|
|
119
|
+
color: var(--ai-voice-button-hover-color, var(--ai-text-secondary));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.voice-button:disabled {
|
|
123
|
+
cursor: not-allowed;
|
|
124
|
+
opacity: 0.5;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.voice-button:focus {
|
|
128
|
+
outline: none;
|
|
129
|
+
box-shadow: 0 0 0 2px var(--ai-focus-ring-color, var(--ai-focus-ring));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Textarea */
|
|
133
|
+
.textarea {
|
|
134
|
+
flex: 1;
|
|
135
|
+
resize: none;
|
|
136
|
+
outline: none;
|
|
137
|
+
border: none;
|
|
138
|
+
background: transparent;
|
|
139
|
+
font-size: var(--ai-input-font-size, 14px);
|
|
140
|
+
line-height: var(--ai-input-line-height, 20px);
|
|
141
|
+
color: var(--ai-input-text-color, #333333);
|
|
142
|
+
font-family: inherit;
|
|
143
|
+
min-height: 20px;
|
|
144
|
+
text-align: right;
|
|
145
|
+
direction: rtl;
|
|
146
|
+
padding: 0;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.textarea::placeholder {
|
|
151
|
+
color: var(--ai-input-placeholder-color, #737373);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.textarea:disabled {
|
|
155
|
+
cursor: not-allowed;
|
|
156
|
+
opacity: 0.6;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Active / focus state for container — matches Figma active state */
|
|
160
|
+
.input-container:focus-within {
|
|
161
|
+
border-color: var(--ai-input-focus-border-color, var(--ai-accent));
|
|
162
|
+
box-shadow: 0 0 10px 4px rgba(227, 255, 247, 0.4);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Disabled state */
|
|
166
|
+
:host([disabled]) .wrapper {
|
|
167
|
+
opacity: 0.6;
|
|
168
|
+
pointer-events: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* RTL Support */
|
|
172
|
+
:host([dir='ltr']) .textarea {
|
|
173
|
+
text-align: left;
|
|
174
|
+
direction: ltr;
|
|
175
|
+
}
|