@aleph-alpha/chat-kit 5.1.0 → 5.2.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.
@@ -2257,9 +2257,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2257
2257
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
2258
2258
  createElementVNode("form", {
2259
2259
  class: normalizeClass([
2260
- "border-border-surface-default bg-background-input-strong min-h-17 grid items-center gap-x-0 gap-y-5 border p-4 transition-[border-radius] duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] ",
2260
+ "ck-prompt-form border-border-surface-default bg-background-input-strong grid items-center gap-x-0 gap-y-5 border transition-[border-radius] duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] ",
2261
2261
  hasMultipleRows.value ? "rounded-2xl" : "rounded-3xl",
2262
- isKeyboardFocused.value ? "border-border-surface-focus-ring ring-border-surface-focus-ring/40 ring-2" : "ck-prompt-form"
2262
+ isKeyboardFocused.value ? "border-border-surface-focus-ring ring-border-surface-focus-ring/40 ring-2" : "ck-prompt-shadow"
2263
2263
  ]),
2264
2264
  style: normalizeStyle({
2265
2265
  gridTemplateColumns: "auto 1fr auto",
@@ -2316,7 +2316,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2316
2316
  };
2317
2317
  }
2318
2318
  });
2319
- const CkPromptInput = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-d828da46"]]);
2319
+ const CkPromptInput = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-c6b78cec"]]);
2320
2320
  const _hoisted_1$2 = {
2321
2321
  key: 0,
2322
2322
  class: "text-center text-content-on-surface-muted text-xs font-normal leading-4"
package/dist/chat-kit.css CHANGED
@@ -89,18 +89,21 @@
89
89
  variant (≤320px container) and the Desktop variant (≥768px container) rather
90
90
  than snapping at a breakpoint. Range = 768 − 320 = 448; each term is
91
91
  `clamp(mobile, calc(mobile + (100cqw − 320px) × span / 448), desktop)`. */
92
- .ck-prompt-root[data-v-d828da46] {
92
+ .ck-prompt-root[data-v-c6b78cec] {
93
93
  container-type: inline-size;
94
94
  }
95
-
96
- /* Solea two-layer drop shadow — warm grey + subtle orange tint. Matches the
97
- `shadow/md/{1,2}` tokens from the design system; the generic `shadow-md`
98
- utility from preset-wind4 uses a cold black-based shadow instead. */
99
- .ck-prompt-form[data-v-d828da46] {
95
+ .ck-prompt-form[data-v-c6b78cec] {
100
96
  /* 8px (mobile) → 16px (desktop) */
101
97
  padding: clamp(8px, calc(8px + (100cqw - 320px) * 8 / 448), 16px);
102
98
  /* 52px → 68px (= 36px button + 2× padding) */
103
99
  min-height: clamp(52px, calc(52px + (100cqw - 320px) * 16 / 448), 68px);
100
+ }
101
+
102
+ /* Solea two-layer drop shadow — warm grey + subtle orange tint. Matches the
103
+ `shadow/md/{1,2}` tokens from the design system; the generic `shadow-md`
104
+ utility from preset-wind4 uses a cold black-based shadow instead. Applied
105
+ only when the field is not keyboard-focused; the focus ring replaces it. */
106
+ .ck-prompt-shadow[data-v-c6b78cec] {
104
107
  box-shadow:
105
108
  0 4px 6px -2px rgba(112, 95, 90, 0.1),
106
109
  0 6px 14px -2px rgba(248, 94, 43, 0.05);
@@ -109,7 +112,7 @@
109
112
  /* 14px → 16px font, 20px → 24px line-height, 120px → 144px (6 lines) cap.
110
113
  `adjustHeight` reads the resolved line-height from the DOM so the auto-grow
111
114
  math tracks these fluid values. */
112
- .ck-prompt-textarea[data-v-d828da46] {
115
+ .ck-prompt-textarea[data-v-c6b78cec] {
113
116
  font-size: clamp(14px, calc(14px + (100cqw - 320px) * 2 / 448), 16px);
114
117
  line-height: clamp(20px, calc(20px + (100cqw - 320px) * 4 / 448), 24px);
115
118
  max-height: clamp(120px, calc(120px + (100cqw - 320px) * 24 / 448), 144px);
@@ -118,17 +121,17 @@
118
121
  /* Slim styled scrollbar for the multi-line textarea — matches Figma's 4 px
119
122
  muted-default track. Firefox uses the native `scrollbar-*` properties;
120
123
  Chromium/WebKit needs the `::-webkit-scrollbar` pseudo-elements. */
121
- .ck-prompt-textarea[data-v-d828da46] {
124
+ .ck-prompt-textarea[data-v-c6b78cec] {
122
125
  scrollbar-width: thin;
123
126
  scrollbar-color: rgba(166, 141, 133, 0.3) transparent;
124
127
  }
125
- .ck-prompt-textarea[data-v-d828da46]::-webkit-scrollbar {
128
+ .ck-prompt-textarea[data-v-c6b78cec]::-webkit-scrollbar {
126
129
  width: 4px;
127
130
  }
128
- .ck-prompt-textarea[data-v-d828da46]::-webkit-scrollbar-track {
131
+ .ck-prompt-textarea[data-v-c6b78cec]::-webkit-scrollbar-track {
129
132
  background: transparent;
130
133
  }
131
- .ck-prompt-textarea[data-v-d828da46]::-webkit-scrollbar-thumb {
134
+ .ck-prompt-textarea[data-v-c6b78cec]::-webkit-scrollbar-thumb {
132
135
  background: rgba(166, 141, 133, 0.3);
133
136
  border-radius: 9999px;
134
137
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CkPromptInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkPromptInput/CkPromptInput.vue"],"names":[],"mappings":"AA2QA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA8GlD,iBAAS,MAAM,IAAI,IAAI,CAKtB;AASD,iBAAS,KAAK,IAAI,IAAI,CAErB;AAmLD,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAU,EAAE,OAAO;;;;CAAU,EAAE,OAAO,IAAW,CAAE;AACjF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAClD;IAAE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACnD;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACpD;IAAE,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wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -33,6 +33,12 @@ export declare const NoIcon: Story;
33
33
  * your own branded icon.
34
34
  */
35
35
  export declare const WithCustomIcon: Story;
36
+ /**
37
+ * A conversation with an in-flight assistant reply. The final message's
38
+ * `status: 'sending'` swaps its avatar for the loading icon (a spinner by
39
+ * default; set `agent-loading-image` to show a custom loading avatar instead).
40
+ */
41
+ export declare const WithLoadingIcon: Story;
36
42
  /**
37
43
  * Overrides `#agent-message-footer` to add real action buttons next to each
38
44
  * assistant reply: `CkCopyMessageButton` for clipboard copy and
@@ -1 +1 @@
1
- {"version":3,"file":"CkConversation.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkConversation/CkConversation.stories.ts"],"names":[],"mappings":"AASA,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AA4G3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAkCrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAiRnC;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,EAAE,KAerB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAYtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KASpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,KAe5B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAmC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAiBnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAiBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,KA4GjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAmBvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAoDjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC"}
1
+ {"version":3,"file":"CkConversation.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkConversation/CkConversation.stories.ts"],"names":[],"mappings":"AASA,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAwI3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAkCrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4SnC;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,EAAE,KAerB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAYtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KASpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,KAe5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KAU7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAmC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAiBnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAiBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,KA4GjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAmBvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAoDjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { _, a, C, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y } from "../CkHistory.vue_vue_type_script_setup_true_lang-vlUZ_Tw1.js";
1
+ import { _, a, C, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y } from "../CkHistory.vue_vue_type_script_setup_true_lang-BxzHdcxY.js";
2
2
  export {
3
3
  _ as CkAgentMessage,
4
4
  a as CkAgentMessageHeader,
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { u } from "./useMessageHandler-N50Yj-NU.js";
2
2
  import { C, d, p, u as u2, a } from "./useChatKitLabels-zMFV7aEz.js";
3
3
  import { S, c, d as d2, a as a2, u as u3, b, e, f } from "./index-CyrVnbS9.js";
4
- import { _, a as a3, C as C2, b as b2, c as c2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t, u as u4, v, w, x, y, z } from "./CkHistory.vue_vue_type_script_setup_true_lang-vlUZ_Tw1.js";
4
+ import { _, a as a3, C as C2, b as b2, c as c2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s, t, u as u4, v, w, x, y, z } from "./CkHistory.vue_vue_type_script_setup_true_lang-BxzHdcxY.js";
5
5
  export {
6
6
  C as CHAT_KIT_LABELS,
7
7
  _ as CkAgentMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleph-alpha/chat-kit",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Chat kit package for building chat interfaces with Vue",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -106,8 +106,8 @@
106
106
  "vue-tsc": "^3.2.4",
107
107
  "wait-on": "9.0.3",
108
108
  "@aleph-alpha/eslint-config-frontend": "0.7.0",
109
- "@aleph-alpha/tsconfig-frontend": "0.7.0",
110
- "@aleph-alpha/prettier-config-frontend": "2.1.0"
109
+ "@aleph-alpha/prettier-config-frontend": "2.1.0",
110
+ "@aleph-alpha/tsconfig-frontend": "0.7.0"
111
111
  },
112
112
  "scripts": {
113
113
  "build": "vite build && vue-tsc --project tsconfig.build.json --declaration --emitDeclarationOnly --outDir dist",
@@ -160,11 +160,11 @@ defineExpose({ focus, submit });
160
160
  <div class="ck-prompt-root flex flex-col gap-2">
161
161
  <form
162
162
  :class="[
163
- 'border-border-surface-default bg-background-input-strong min-h-17 grid items-center gap-x-0 gap-y-5 border p-4 transition-[border-radius] duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] ',
163
+ 'ck-prompt-form border-border-surface-default bg-background-input-strong grid items-center gap-x-0 gap-y-5 border transition-[border-radius] duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] ',
164
164
  hasMultipleRows ? 'rounded-2xl' : 'rounded-3xl',
165
165
  isKeyboardFocused
166
166
  ? 'border-border-surface-focus-ring ring-border-surface-focus-ring/40 ring-2'
167
- : 'ck-prompt-form',
167
+ : 'ck-prompt-shadow',
168
168
  ]"
169
169
  :style="{
170
170
  gridTemplateColumns: 'auto 1fr auto',
@@ -222,14 +222,18 @@ defineExpose({ focus, submit });
222
222
  container-type: inline-size;
223
223
  }
224
224
 
225
- /* Solea two-layer drop shadow — warm grey + subtle orange tint. Matches the
226
- `shadow/md/{1,2}` tokens from the design system; the generic `shadow-md`
227
- utility from preset-wind4 uses a cold black-based shadow instead. */
228
225
  .ck-prompt-form {
229
226
  /* 8px (mobile) → 16px (desktop) */
230
227
  padding: clamp(8px, calc(8px + (100cqw - 320px) * 8 / 448), 16px);
231
228
  /* 52px → 68px (= 36px button + 2× padding) */
232
229
  min-height: clamp(52px, calc(52px + (100cqw - 320px) * 16 / 448), 68px);
230
+ }
231
+
232
+ /* Solea two-layer drop shadow — warm grey + subtle orange tint. Matches the
233
+ `shadow/md/{1,2}` tokens from the design system; the generic `shadow-md`
234
+ utility from preset-wind4 uses a cold black-based shadow instead. Applied
235
+ only when the field is not keyboard-focused; the focus ring replaces it. */
236
+ .ck-prompt-shadow {
233
237
  box-shadow:
234
238
  0 4px 6px -2px rgba(112, 95, 90, 0.1),
235
239
  0 6px 14px -2px rgba(248, 94, 43, 0.05);
@@ -116,6 +116,34 @@ const sampleMessages: BaseMessage[] = [
116
116
  },
117
117
  ];
118
118
 
119
+ /**
120
+ * A conversation whose final assistant turn is still being generated. The
121
+ * message `status` of `'sending'` (or `'started'`) drives the loading icon —
122
+ * a spinner by default, or `agentLoadingImage` when provided.
123
+ */
124
+ const loadingMessages: BaseMessage[] = [
125
+ {
126
+ id: '1',
127
+ role: 'user',
128
+ content: [
129
+ text(
130
+ "Find the lessons learned from the 'Digital Transformation Phase 1' project.",
131
+ ),
132
+ ],
133
+ createdAt: now,
134
+ status: 'completed',
135
+ },
136
+ {
137
+ id: '2',
138
+ role: 'assistant',
139
+ content: [
140
+ { type: 'text', id: 'a-loading', text: '', status: 'in_progress' },
141
+ ],
142
+ createdAt: now,
143
+ status: 'sending',
144
+ },
145
+ ];
146
+
119
147
  const meta: Meta<typeof CkConversation> = {
120
148
  title: 'Composed/CkConversation',
121
149
  component: CkConversation,
@@ -248,6 +276,33 @@ const messages: BaseMessage[] = [/* ... */];
248
276
  </CkConversation>
249
277
  </template>`;
250
278
 
279
+ const withLoadingIconTemplateSource = `<script setup lang="ts">
280
+ import { CkConversation } from '@aleph-alpha/chat-kit';
281
+ import type { BaseMessage } from '@aleph-alpha/chat-kit';
282
+
283
+ const messages: BaseMessage[] = [
284
+ {
285
+ id: '1',
286
+ role: 'user',
287
+ content: [{ type: 'text', id: 't1', text: 'Find the lessons learned.', status: 'completed' }],
288
+ createdAt: new Date(),
289
+ status: 'completed',
290
+ },
291
+ {
292
+ id: '2',
293
+ role: 'assistant',
294
+ // A 'sending' / 'started' status renders the loading icon (spinner by default).
295
+ content: [{ type: 'text', id: 't2', text: '', status: 'in_progress' }],
296
+ createdAt: new Date(),
297
+ status: 'sending',
298
+ },
299
+ ];
300
+ </script>
301
+
302
+ <template>
303
+ <CkConversation :messages="messages" agent-avatar-fallback="AI" style="height: 100%;" />
304
+ </template>`;
305
+
251
306
  const withFooterActionsTemplateSource = `<script setup lang="ts">
252
307
  import { ref } from 'vue';
253
308
  import {
@@ -522,6 +577,23 @@ export const WithCustomIcon: Story = {
522
577
  parameters: { docs: { source: { code: withCustomIconTemplateSource } } },
523
578
  };
524
579
 
580
+ /**
581
+ * A conversation with an in-flight assistant reply. The final message's
582
+ * `status: 'sending'` swaps its avatar for the loading icon (a spinner by
583
+ * default; set `agent-loading-image` to show a custom loading avatar instead).
584
+ */
585
+ export const WithLoadingIcon: Story = {
586
+ render: () => ({
587
+ components: { CkConversation },
588
+ setup() {
589
+ return { messages: loadingMessages };
590
+ },
591
+ template:
592
+ '<CkConversation :messages="messages" agent-avatar-fallback="AI" style="height: 100%;" />',
593
+ }),
594
+ parameters: { docs: { source: { code: withLoadingIconTemplateSource } } },
595
+ };
596
+
525
597
  /**
526
598
  * Overrides `#agent-message-footer` to add real action buttons next to each
527
599
  * assistant reply: `CkCopyMessageButton` for clipboard copy and