@aleph-alpha/chat-kit 1.9.1 → 1.11.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 (29) hide show
  1. package/dist/{CkInput.vue_vue_type_script_setup_true_lang-CHPs-R5p.js → CkInput.vue_vue_type_script_setup_true_lang-C1Jnn1fK.js} +251 -56
  2. package/dist/components/base/CkFileItemsList/CkFileItemRow.vue.d.ts +33 -0
  3. package/dist/components/base/CkFileItemsList/CkFileItemRow.vue.d.ts.map +1 -0
  4. package/dist/components/base/CkFileItemsList/CkFileItemsList.stories.d.ts +42 -0
  5. package/dist/components/base/CkFileItemsList/CkFileItemsList.stories.d.ts.map +1 -0
  6. package/dist/components/base/CkFileItemsList/CkFileItemsList.vue.d.ts +38 -0
  7. package/dist/components/base/CkFileItemsList/CkFileItemsList.vue.d.ts.map +1 -0
  8. package/dist/components/base/CkFileItemsList/index.d.ts +3 -0
  9. package/dist/components/base/CkFileItemsList/index.d.ts.map +1 -0
  10. package/dist/components/base/CkFileItemsList/types.d.ts +59 -0
  11. package/dist/components/base/CkFileItemsList/types.d.ts.map +1 -0
  12. package/dist/components/base/index.d.ts +2 -0
  13. package/dist/components/base/index.d.ts.map +1 -1
  14. package/dist/components/index.d.ts +2 -2
  15. package/dist/components/index.d.ts.map +1 -1
  16. package/dist/components/index.js +15 -14
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +15 -14
  20. package/package.json +3 -3
  21. package/src/components/base/CkFileItemsList/CkFileItemRow.vue +61 -0
  22. package/src/components/base/CkFileItemsList/CkFileItemsList.spec.ts +96 -0
  23. package/src/components/base/CkFileItemsList/CkFileItemsList.stories.ts +307 -0
  24. package/src/components/base/CkFileItemsList/CkFileItemsList.vue +168 -0
  25. package/src/components/base/CkFileItemsList/index.ts +2 -0
  26. package/src/components/base/CkFileItemsList/types.ts +64 -0
  27. package/src/components/base/index.ts +6 -0
  28. package/src/components/index.ts +4 -0
  29. package/src/index.ts +4 -0
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, computed, normalizeClass, useAttrs, useSlots, withModifiers, resolveDynamicComponent, toRefs, h, useId, useTemplateRef, createTextVNode, createSlots, normalizeProps, guardReactiveProps } from "vue";
2
2
  import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-ftC52m7f.js";
3
- import { UiButton, UiTooltip, UiIcon, Primitive, UiPopover, UiPopoverTrigger, UiPopoverContent, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
4
- const _hoisted_1$9 = {
3
+ import { UiButton, UiTooltip, UiIcon, UiFileItem, UiPopover, UiPopoverTrigger, UiFileType, UiPopoverContent, Primitive, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
4
+ const _hoisted_1$a = {
5
5
  xmlns: "http://www.w3.org/2000/svg",
6
6
  width: "16",
7
7
  height: "16",
@@ -12,31 +12,31 @@ const _hoisted_1$9 = {
12
12
  "stroke-linecap": "round",
13
13
  "stroke-linejoin": "round"
14
14
  };
15
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
15
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
16
16
  ...{ name: "CkSendIcon" },
17
17
  __name: "CkSendIcon",
18
18
  setup(__props) {
19
19
  return (_ctx, _cache) => {
20
- return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._cache[0] || (_cache[0] = [
20
+ return openBlock(), createElementBlock("svg", _hoisted_1$a, [..._cache[0] || (_cache[0] = [
21
21
  createElementVNode("path", { d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z" }, null, -1),
22
22
  createElementVNode("path", { d: "M6 12h16" }, null, -1)
23
23
  ])]);
24
24
  };
25
25
  }
26
26
  });
27
- const _hoisted_1$8 = {
27
+ const _hoisted_1$9 = {
28
28
  xmlns: "http://www.w3.org/2000/svg",
29
29
  width: "16",
30
30
  height: "16",
31
31
  viewBox: "0 0 16 16",
32
32
  fill: "none"
33
33
  };
34
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
34
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
35
35
  ...{ name: "CkStopIcon" },
36
36
  __name: "CkStopIcon",
37
37
  setup(__props) {
38
38
  return (_ctx, _cache) => {
39
- return openBlock(), createElementBlock("svg", _hoisted_1$8, [..._cache[0] || (_cache[0] = [
39
+ return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._cache[0] || (_cache[0] = [
40
40
  createElementVNode("path", {
41
41
  d: "M13.3335 3.33301C13.3335 2.96482 13.035 2.66634 12.6668 2.66634H3.3335C2.96531 2.66634 2.66683 2.96482 2.66683 3.33301V12.6663C2.66683 13.0345 2.96531 13.333 3.3335 13.333H12.6668C13.035 13.333 13.3335 13.0345 13.3335 12.6663V3.33301ZM14.6668 12.6663C14.6668 13.7709 13.7714 14.6663 12.6668 14.6663H3.3335C2.22893 14.6663 1.3335 13.7709 1.3335 12.6663V3.33301C1.3335 2.22844 2.22893 1.33301 3.3335 1.33301H12.6668C13.7714 1.33301 14.6668 2.22844 14.6668 3.33301V12.6663Z",
42
42
  fill: "#1D1D1B"
@@ -45,37 +45,37 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
45
45
  };
46
46
  }
47
47
  });
48
- const _hoisted_1$7 = { class: "flex w-full items-start gap-2" };
49
- const _hoisted_2$4 = {
48
+ const _hoisted_1$8 = { class: "flex w-full items-start gap-2" };
49
+ const _hoisted_2$5 = {
50
50
  key: 0,
51
51
  class: "flex flex-shrink-0 items-center justify-center"
52
52
  };
53
- const _hoisted_3$3 = { class: "text-core-content-primary flex min-w-0 flex-1 flex-col gap-2" };
54
- const _hoisted_4$2 = {
53
+ const _hoisted_3$4 = { class: "text-core-content-primary flex min-w-0 flex-1 flex-col gap-2" };
54
+ const _hoisted_4$3 = {
55
55
  key: 0,
56
56
  class: "text-sm font-bold"
57
57
  };
58
- const _hoisted_5$2 = {
58
+ const _hoisted_5$3 = {
59
59
  key: 1,
60
60
  class: "flex items-center"
61
61
  };
62
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
62
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
63
63
  ...{ name: "CkAgentMessage" },
64
64
  __name: "CkAgentMessage",
65
65
  setup(__props) {
66
66
  return (_ctx, _cache) => {
67
- return openBlock(), createElementBlock("div", _hoisted_1$7, [
68
- _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
67
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
68
+ _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
69
69
  renderSlot(_ctx.$slots, "icon")
70
70
  ])) : createCommentVNode("", true),
71
- createElementVNode("div", _hoisted_3$3, [
72
- _ctx.$slots.header ? (openBlock(), createElementBlock("span", _hoisted_4$2, [
71
+ createElementVNode("div", _hoisted_3$4, [
72
+ _ctx.$slots.header ? (openBlock(), createElementBlock("span", _hoisted_4$3, [
73
73
  renderSlot(_ctx.$slots, "header")
74
74
  ])) : createCommentVNode("", true),
75
75
  createElementVNode("div", null, [
76
76
  renderSlot(_ctx.$slots, "default")
77
77
  ]),
78
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
78
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5$3, [
79
79
  renderSlot(_ctx.$slots, "footer")
80
80
  ])) : createCommentVNode("", true)
81
81
  ])
@@ -83,16 +83,16 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
83
83
  };
84
84
  }
85
85
  });
86
- const _hoisted_1$6 = ["data-message-row"];
87
- const _hoisted_2$3 = {
86
+ const _hoisted_1$7 = ["data-message-row"];
87
+ const _hoisted_2$4 = {
88
88
  key: 0,
89
89
  class: "flex justify-end"
90
90
  };
91
- const _hoisted_3$2 = {
91
+ const _hoisted_3$3 = {
92
92
  key: 1,
93
93
  class: "flex justify-start"
94
94
  };
95
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
95
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
96
96
  ...{ name: "CkConversationLayout" },
97
97
  __name: "CkConversationLayout",
98
98
  props: {
@@ -232,12 +232,12 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
232
232
  key: message.id,
233
233
  "data-message-row": message.role
234
234
  }, [
235
- message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
235
+ message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
236
236
  renderSlot(_ctx.$slots, "user-message", { message })
237
- ])) : (openBlock(), createElementBlock("div", _hoisted_3$2, [
237
+ ])) : (openBlock(), createElementBlock("div", _hoisted_3$3, [
238
238
  renderSlot(_ctx.$slots, "agent-message", { message })
239
239
  ]))
240
- ], 8, _hoisted_1$6);
240
+ ], 8, _hoisted_1$7);
241
241
  }), 128)),
242
242
  hasBottomSpacer.value ? (openBlock(), createElementBlock("div", {
243
243
  key: 0,
@@ -248,7 +248,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
248
248
  };
249
249
  }
250
250
  });
251
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
251
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
252
252
  ...{
253
253
  name: "CkMessageActionButton"
254
254
  },
@@ -272,11 +272,11 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
272
272
  };
273
273
  }
274
274
  });
275
- const _hoisted_1$5 = {
275
+ const _hoisted_1$6 = {
276
276
  class: "sr-only",
277
277
  "aria-live": "polite"
278
278
  };
279
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
279
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
280
280
  ...{
281
281
  name: "CkCopyMessageActionButton"
282
282
  },
@@ -333,7 +333,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
333
333
  "delay-duration": 0
334
334
  }, {
335
335
  default: withCtx(() => [
336
- createVNode(unref(_sfc_main$d), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
336
+ createVNode(unref(_sfc_main$f), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
337
337
  disabled: __props.disabled,
338
338
  onClick: handleClick
339
339
  }), {
@@ -360,7 +360,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
360
360
  ]),
361
361
  _: 1
362
362
  }, 16, ["disabled"]),
363
- createElementVNode("span", _hoisted_1$5, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
363
+ createElementVNode("span", _hoisted_1$6, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
364
364
  ]),
365
365
  _: 1
366
366
  }, 8, ["open", "content"]);
@@ -374,9 +374,9 @@ const _export_sfc = (sfc, props) => {
374
374
  }
375
375
  return target;
376
376
  };
377
- const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-f77a1193"]]);
378
- const _hoisted_1$4 = ["aria-label"];
379
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
377
+ const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-f77a1193"]]);
378
+ const _hoisted_1$5 = ["aria-label"];
379
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
380
380
  ...{
381
381
  name: "CkFeedbackButton"
382
382
  },
@@ -431,7 +431,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
431
431
  "delay-duration": 0
432
432
  }, {
433
433
  default: withCtx(() => [
434
- createVNode(unref(_sfc_main$d), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
434
+ createVNode(unref(_sfc_main$f), mergeProps({ ariaLabel: thumbsUpLabel.value }, {
435
435
  "aria-pressed": isUpSelected.value,
436
436
  "aria-disabled": __props.locked || void 0,
437
437
  disabled: isUpDisabled.value,
@@ -461,7 +461,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
461
461
  "delay-duration": 0
462
462
  }, {
463
463
  default: withCtx(() => [
464
- createVNode(unref(_sfc_main$d), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
464
+ createVNode(unref(_sfc_main$f), mergeProps({ ariaLabel: thumbsDownLabel.value }, {
465
465
  "aria-pressed": isDownSelected.value,
466
466
  "aria-disabled": __props.locked || void 0,
467
467
  disabled: isDownDisabled.value,
@@ -484,11 +484,205 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
484
484
  ]),
485
485
  _: 1
486
486
  }, 8, ["content"])
487
- ], 8, _hoisted_1$4);
487
+ ], 8, _hoisted_1$5);
488
+ };
489
+ }
490
+ });
491
+ const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-245705b8"]]);
492
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
493
+ ...{
494
+ name: "CkFileItemRow",
495
+ inheritAttrs: false
496
+ },
497
+ __name: "CkFileItemRow",
498
+ props: {
499
+ file: {},
500
+ size: {},
501
+ isRemovable: { type: Boolean },
502
+ removeLabel: {},
503
+ disabled: { type: Boolean }
504
+ },
505
+ emits: ["remove"],
506
+ setup(__props, { emit: __emit }) {
507
+ const emit = __emit;
508
+ return (_ctx, _cache) => {
509
+ return renderSlot(_ctx.$slots, "default", {
510
+ file: __props.file,
511
+ remove: () => emit("remove"),
512
+ size: __props.size,
513
+ isRemovable: __props.isRemovable,
514
+ removeLabel: __props.removeLabel,
515
+ disabled: __props.disabled
516
+ }, () => [
517
+ createVNode(unref(UiFileItem), {
518
+ filename: __props.file.filename,
519
+ "type-label": __props.file.typeLabel,
520
+ "size-label": __props.file.sizeLabel,
521
+ progress: __props.file.progress ?? null,
522
+ error: __props.file.error ?? null,
523
+ "media-icon": __props.file.mediaIcon,
524
+ "media-tone": __props.file.mediaTone,
525
+ size: __props.size,
526
+ removable: __props.isRemovable && !__props.disabled,
527
+ "remove-label": __props.removeLabel,
528
+ disabled: __props.disabled,
529
+ onRemove: _cache[0] || (_cache[0] = ($event) => emit("remove"))
530
+ }, null, 8, ["filename", "type-label", "size-label", "progress", "error", "media-icon", "media-tone", "size", "removable", "remove-label", "disabled"])
531
+ ]);
532
+ };
533
+ }
534
+ });
535
+ const _hoisted_1$4 = ["aria-label"];
536
+ const _hoisted_2$3 = ["onClick"];
537
+ const _hoisted_3$2 = ["disabled", "aria-label"];
538
+ const _hoisted_4$2 = ["aria-label"];
539
+ const _hoisted_5$2 = ["onClick"];
540
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
541
+ ...{
542
+ name: "CkFileItemsList"
543
+ },
544
+ __name: "CkFileItemsList",
545
+ props: {
546
+ files: {},
547
+ maxInline: { default: 3 },
548
+ size: { default: "small" },
549
+ isRemovable: { type: Boolean, default: false },
550
+ removeLabel: { default: "Remove file" },
551
+ disabled: { type: Boolean, default: false },
552
+ triggerLabel: { default: void 0 },
553
+ triggerAriaLabel: { default: void 0 },
554
+ listLabel: { default: void 0 },
555
+ popoverClass: { default: void 0 }
556
+ },
557
+ emits: ["remove", "item-click"],
558
+ setup(__props, { emit: __emit }) {
559
+ const props = __props;
560
+ const emit = __emit;
561
+ const isCollapsed = computed(() => props.files.length > props.maxInline);
562
+ const isOpen = ref(false);
563
+ function isRowDisabled(file) {
564
+ return props.disabled || file.disabled === true;
565
+ }
566
+ const defaultTriggerLabel = computed(() => `${props.files.length} files`);
567
+ const resolvedTriggerLabel = computed(
568
+ () => props.triggerLabel ?? defaultTriggerLabel.value
569
+ );
570
+ const resolvedTriggerAriaLabel = computed(
571
+ () => props.triggerAriaLabel ?? props.triggerLabel ?? defaultTriggerLabel.value
572
+ );
573
+ function handleRemove(file) {
574
+ if (isRowDisabled(file)) return;
575
+ emit("remove", file.id);
576
+ }
577
+ function handleRowClick(file, event) {
578
+ if (isRowDisabled(file)) return;
579
+ const target = event.target;
580
+ if (target?.closest('button, a, [role="button"]')) return;
581
+ emit("item-click", file, event);
582
+ if (isOpen.value) isOpen.value = false;
583
+ }
584
+ return (_ctx, _cache) => {
585
+ return !isCollapsed.value ? (openBlock(), createElementBlock("ul", {
586
+ key: 0,
587
+ "data-slot": "file-items-list",
588
+ class: "m-0 flex w-full min-w-0 list-none flex-wrap items-center gap-2 p-0",
589
+ "aria-label": __props.listLabel
590
+ }, [
591
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.files, (file) => {
592
+ return openBlock(), createElementBlock("li", {
593
+ key: file.id,
594
+ class: "min-w-0 max-w-64 flex-1 basis-0",
595
+ onClick: ($event) => handleRowClick(file, $event)
596
+ }, [
597
+ createVNode(_sfc_main$c, {
598
+ file,
599
+ size: __props.size,
600
+ "is-removable": __props.isRemovable,
601
+ "remove-label": __props.removeLabel,
602
+ disabled: isRowDisabled(file),
603
+ onRemove: ($event) => handleRemove(file)
604
+ }, {
605
+ default: withCtx((bindings) => [
606
+ renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, bindings))
607
+ ]),
608
+ _: 3
609
+ }, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
610
+ ], 8, _hoisted_2$3);
611
+ }), 128))
612
+ ], 8, _hoisted_1$4)) : (openBlock(), createBlock(unref(UiPopover), {
613
+ key: 1,
614
+ open: isOpen.value,
615
+ "onUpdate:open": _cache[0] || (_cache[0] = ($event) => isOpen.value = $event)
616
+ }, {
617
+ default: withCtx(() => [
618
+ createVNode(unref(UiPopoverTrigger), { "as-child": "" }, {
619
+ default: withCtx(() => [
620
+ createElementVNode("button", {
621
+ type: "button",
622
+ "data-slot": "file-items-list-trigger",
623
+ disabled: __props.disabled,
624
+ class: normalizeClass(["relative flex w-full max-w-64 min-w-0 items-center gap-3 rounded-xl bg-background-surface-muted-subtle text-left transition-colors hover:bg-background-surface-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-background-surface-muted-subtle", __props.size === "small" ? "p-2" : "p-3"]),
625
+ "aria-label": resolvedTriggerAriaLabel.value
626
+ }, [
627
+ createVNode(unref(UiFileType), {
628
+ icon: "paperclip",
629
+ tone: "default"
630
+ }),
631
+ createElementVNode("span", {
632
+ class: normalizeClass(["min-w-0 flex-1 truncate text-content-on-surface-primary", __props.size === "small" ? "label-12-medium" : "body-14-medium"])
633
+ }, toDisplayString(resolvedTriggerLabel.value), 3),
634
+ createVNode(unref(UiIcon), {
635
+ name: "chevron-down",
636
+ size: 16,
637
+ "aria-hidden": "true",
638
+ class: normalizeClass(["shrink-0 text-content-on-surface-muted transition-transform", isOpen.value && "rotate-180"])
639
+ }, null, 8, ["class"])
640
+ ], 10, _hoisted_3$2)
641
+ ]),
642
+ _: 1
643
+ }),
644
+ createVNode(unref(UiPopoverContent), {
645
+ align: "start",
646
+ "side-offset": 4,
647
+ class: normalizeClass(["w-64 p-2", __props.popoverClass])
648
+ }, {
649
+ default: withCtx(() => [
650
+ createElementVNode("ul", {
651
+ "data-slot": "file-items-list-collapsed",
652
+ class: "m-0 flex list-none flex-col gap-2 p-0",
653
+ "aria-label": __props.listLabel
654
+ }, [
655
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.files, (file) => {
656
+ return openBlock(), createElementBlock("li", {
657
+ key: file.id,
658
+ class: "min-w-0 max-w-64",
659
+ onClick: ($event) => handleRowClick(file, $event)
660
+ }, [
661
+ createVNode(_sfc_main$c, {
662
+ file,
663
+ size: __props.size,
664
+ "is-removable": __props.isRemovable,
665
+ "remove-label": __props.removeLabel,
666
+ disabled: isRowDisabled(file),
667
+ onRemove: ($event) => handleRemove(file)
668
+ }, {
669
+ default: withCtx((bindings) => [
670
+ renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, bindings))
671
+ ]),
672
+ _: 3
673
+ }, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
674
+ ], 8, _hoisted_5$2);
675
+ }), 128))
676
+ ], 8, _hoisted_4$2)
677
+ ]),
678
+ _: 3
679
+ }, 8, ["class"])
680
+ ]),
681
+ _: 3
682
+ }, 8, ["open"]));
488
683
  };
489
684
  }
490
685
  });
491
- const CkFeedbackButton = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-245705b8"]]);
492
686
  const CHAT_HISTORY_ACTIVE_INDICATOR_CLASS = "ui-active-indicator";
493
687
  const _hoisted_1$3 = ["data-active"];
494
688
  const _hoisted_2$2 = { class: "min-w-0 flex-1" };
@@ -1066,7 +1260,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1066
1260
  return message.content.filter((c) => c.type === "text").map((c) => c.text).join("");
1067
1261
  }
1068
1262
  return (_ctx, _cache) => {
1069
- return openBlock(), createBlock(_sfc_main$e, { messages: __props.messages }, {
1263
+ return openBlock(), createBlock(_sfc_main$g, { messages: __props.messages }, {
1070
1264
  "user-message": withCtx(({ message }) => [
1071
1265
  createElementVNode("div", {
1072
1266
  class: normalizeClass({ "ml-8": hasIcon.value })
@@ -1085,7 +1279,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1085
1279
  ]),
1086
1280
  "agent-message": withCtx(({ message }) => [
1087
1281
  renderSlot(_ctx.$slots, "agent-message", { message }, () => [
1088
- createVNode(_sfc_main$f, null, createSlots({
1282
+ createVNode(_sfc_main$h, null, createSlots({
1089
1283
  footer: withCtx(() => [
1090
1284
  renderSlot(_ctx.$slots, "agent-message-footer", { message }, () => [
1091
1285
  getMessageText(message) && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageActionButton, {
@@ -1328,7 +1522,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1328
1522
  }, {
1329
1523
  default: withCtx(() => [
1330
1524
  renderSlot(_ctx.$slots, "stop-icon", {}, () => [
1331
- createVNode(_sfc_main$g)
1525
+ createVNode(_sfc_main$i)
1332
1526
  ])
1333
1527
  ]),
1334
1528
  _: 3
@@ -1338,7 +1532,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1338
1532
  }), {
1339
1533
  default: withCtx(() => [
1340
1534
  renderSlot(_ctx.$slots, "send-icon", {}, () => [
1341
- createVNode(_sfc_main$h)
1535
+ createVNode(_sfc_main$j)
1342
1536
  ])
1343
1537
  ]),
1344
1538
  _: 3
@@ -1368,21 +1562,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1368
1562
  });
1369
1563
  export {
1370
1564
  CkCopyMessageActionButton as C,
1371
- _sfc_main$f as _,
1565
+ _sfc_main$h as _,
1372
1566
  _sfc_main$2 as a,
1373
- _sfc_main$e as b,
1567
+ _sfc_main$g as b,
1374
1568
  CkFeedbackButton as c,
1375
- _sfc_main$1 as d,
1376
- _sfc_main$a as e,
1377
- _sfc_main$9 as f,
1378
- _sfc_main as g,
1379
- _sfc_main$8 as h,
1380
- _sfc_main$d as i,
1381
- _sfc_main$7 as j,
1382
- _sfc_main$5 as k,
1383
- _sfc_main$4 as l,
1384
- _sfc_main$6 as m,
1385
- _sfc_main$h as n,
1386
- _sfc_main$g as o,
1387
- _sfc_main$3 as p
1569
+ _sfc_main$b as d,
1570
+ _sfc_main$1 as e,
1571
+ _sfc_main$a as f,
1572
+ _sfc_main$9 as g,
1573
+ _sfc_main as h,
1574
+ _sfc_main$8 as i,
1575
+ _sfc_main$f as j,
1576
+ _sfc_main$7 as k,
1577
+ _sfc_main$5 as l,
1578
+ _sfc_main$4 as m,
1579
+ _sfc_main$6 as n,
1580
+ _sfc_main$j as o,
1581
+ _sfc_main$i as p,
1582
+ _sfc_main$3 as q
1388
1583
  };
@@ -0,0 +1,33 @@
1
+ import { type UiFileItemSize } from '@aleph-alpha/ui-library';
2
+ import type { CkFileEntry } from './types';
3
+ type __VLS_Props = {
4
+ file: CkFileEntry;
5
+ size: UiFileItemSize;
6
+ isRemovable: boolean;
7
+ removeLabel: string;
8
+ disabled: boolean;
9
+ };
10
+ type __VLS_Slots = {
11
+ default?: (props: {
12
+ file: CkFileEntry;
13
+ remove: () => void;
14
+ size: UiFileItemSize;
15
+ isRemovable: boolean;
16
+ removeLabel: string;
17
+ disabled: boolean;
18
+ }) => unknown;
19
+ };
20
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ remove: () => any;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
+ onRemove?: (() => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
28
+ type __VLS_WithSlots<T, S> = T & {
29
+ new (): {
30
+ $slots: S;
31
+ };
32
+ };
33
+ //# sourceMappingURL=CkFileItemRow.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CkFileItemRow.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFileItemsList/CkFileItemRow.vue"],"names":[],"mappings":"AAgEA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAS3C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AASF,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAChB,IAAI,EAAE,WAAW,CAAC;QAClB,MAAM,EAAE,MAAM,IAAI,CAAC;QACnB,IAAI,EAAE,cAAc,CAAC;QACrB,WAAW,EAAE,OAAO,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,KAAK,OAAO,CAAC;CACf,CAAC;AA2EF,QAAA,MAAM,UAAU;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import CkFileItemsList from './CkFileItemsList.vue';
3
+ declare const meta: Meta<typeof CkFileItemsList>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof CkFileItemsList>;
6
+ /**
7
+ * Up to `maxInline` (default `3`) files are rendered inline as a horizontal
8
+ * row of `UiFileItem`s.
9
+ */
10
+ export declare const Inline: Story;
11
+ /**
12
+ * When the list overflows `maxInline`, the component collapses to a single
13
+ * popover trigger. Click it to reveal the full vertical list of files.
14
+ */
15
+ export declare const Collapsed: Story;
16
+ /**
17
+ * Each row exposes a remove control when `isRemovable` is `true`. The component
18
+ * emits `remove` with the corresponding file `id`.
19
+ */
20
+ export declare const Removable: Story;
21
+ /**
22
+ * Use the `item` scoped slot to replace the row rendering entirely. The
23
+ * default renders `UiFileItem`; overriding it lets consumers render any
24
+ * component (router links, custom chips, project-specific file rows, …)
25
+ * while still receiving the file data and a pre-bound `remove` handler.
26
+ */
27
+ export declare const CustomItem: Story;
28
+ /**
29
+ * Listen for `item-click` to make rows actionable (open a file viewer,
30
+ * navigate, etc.). Clicks on the remove button — or on any `<button>` /
31
+ * `<a>` rendered via the `#item` slot — are excluded so they don't double
32
+ * fire. The popover auto-closes after a click in the collapsed state.
33
+ */
34
+ export declare const Clickable: Story;
35
+ /**
36
+ * Set `disabled` on the list (or `disabled: true` on individual `CkFileEntry`)
37
+ * to make rows `inert` while a response streams or a network request is in
38
+ * flight. Disabled rows do not emit `remove` or `item-click`, and the
39
+ * collapsed trigger button itself is `disabled`.
40
+ */
41
+ export declare const Disabled: Story;
42
+ //# sourceMappingURL=CkFileItemsList.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CkFileItemsList.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFileItemsList/CkFileItemsList.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,eAAe,MAAM,uBAAuB,CAAC;AAGpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAoBtC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAC;AAqE9C;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAWpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAiBvB,CAAC;AAsBF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAC;AAmBF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,KAwBvB,CAAC;AAiBF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,KAiCtB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { type UiFileItemSize } from '@aleph-alpha/ui-library';
2
+ import type { CkFileEntry, CkFileItemsListProps } from './types';
3
+ type __VLS_Slots = {
4
+ item: (props: {
5
+ file: CkFileEntry;
6
+ remove: () => void;
7
+ size: UiFileItemSize;
8
+ isRemovable: boolean;
9
+ removeLabel: string;
10
+ disabled: boolean;
11
+ }) => unknown;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<CkFileItemsListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
+ remove: (id: string | number) => any;
15
+ "item-click": (file: CkFileEntry, originalEvent: MouseEvent) => any;
16
+ }, string, import("vue").PublicProps, Readonly<CkFileItemsListProps> & Readonly<{
17
+ onRemove?: ((id: string | number) => any) | undefined;
18
+ "onItem-click"?: ((file: CkFileEntry, originalEvent: MouseEvent) => any) | undefined;
19
+ }>, {
20
+ size: UiFileItemSize;
21
+ disabled: boolean;
22
+ isRemovable: boolean;
23
+ removeLabel: string;
24
+ maxInline: number;
25
+ triggerLabel: string;
26
+ triggerAriaLabel: string;
27
+ listLabel: string;
28
+ popoverClass: string;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
33
+ type __VLS_WithSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
38
+ //# sourceMappingURL=CkFileItemsList.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CkFileItemsList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFileItemsList/CkFileItemsList.vue"],"names":[],"mappings":"AA2KA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EACV,WAAW,EAEX,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAwBjB,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,CAAC,KAAK,EAAE;QACZ,IAAI,EAAE,WAAW,CAAC;QAClB,MAAM,EAAE,MAAM,IAAI,CAAC;QACnB,IAAI,EAAE,cAAc,CAAC;QACrB,WAAW,EAAE,OAAO,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,OAAO,CAAC;KACnB,KAAK,OAAO,CAAC;CACf,CAAC;AAsVF,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as CkFileItemsList } from './CkFileItemsList.vue';
2
+ export type * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkFileItemsList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,mBAAmB,SAAS,CAAC"}