@aleph-alpha/chat-kit 1.7.0 → 1.10.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/dist/{CkInput.vue_vue_type_script_setup_true_lang-C5C09u0z.js → CkInput.vue_vue_type_script_setup_true_lang-CR3lzV0q.js} +252 -57
- package/dist/adapters/responses-api.d.ts +22 -0
- package/dist/adapters/responses-api.d.ts.map +1 -1
- package/dist/adapters/responses-api.js +9 -5
- package/dist/components/base/CkFileItemsList/CkFileItemRow.vue.d.ts +33 -0
- package/dist/components/base/CkFileItemsList/CkFileItemRow.vue.d.ts.map +1 -0
- package/dist/components/base/CkFileItemsList/CkFileItemsList.stories.d.ts +42 -0
- package/dist/components/base/CkFileItemsList/CkFileItemsList.stories.d.ts.map +1 -0
- package/dist/components/base/CkFileItemsList/CkFileItemsList.vue.d.ts +38 -0
- package/dist/components/base/CkFileItemsList/CkFileItemsList.vue.d.ts.map +1 -0
- package/dist/components/base/CkFileItemsList/index.d.ts +3 -0
- package/dist/components/base/CkFileItemsList/index.d.ts.map +1 -0
- package/dist/components/base/CkFileItemsList/types.d.ts +59 -0
- package/dist/components/base/CkFileItemsList/types.d.ts.map +1 -0
- package/dist/components/base/CkHistoryItem/activeIndicator.d.ts +2 -12
- package/dist/components/base/CkHistoryItem/activeIndicator.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +2 -0
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +15 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -14
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -5
- package/src/adapters/responses-api.spec.ts +51 -0
- package/src/adapters/responses-api.ts +36 -5
- package/src/components/base/CkFileItemsList/CkFileItemRow.vue +61 -0
- package/src/components/base/CkFileItemsList/CkFileItemsList.spec.ts +96 -0
- package/src/components/base/CkFileItemsList/CkFileItemsList.stories.ts +307 -0
- package/src/components/base/CkFileItemsList/CkFileItemsList.vue +168 -0
- package/src/components/base/CkFileItemsList/index.ts +2 -0
- package/src/components/base/CkFileItemsList/types.ts +64 -0
- package/src/components/base/CkHistoryItem/activeIndicator.ts +2 -13
- package/src/components/base/index.ts +6 -0
- package/src/components/index.ts +4 -0
- package/src/index.ts +4 -0
- package/src/types.ts +8 -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,
|
|
4
|
-
const _hoisted_1$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
49
|
-
const _hoisted_2$
|
|
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$
|
|
54
|
-
const _hoisted_4$
|
|
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$
|
|
58
|
+
const _hoisted_5$3 = {
|
|
59
59
|
key: 1,
|
|
60
60
|
class: "flex items-center"
|
|
61
61
|
};
|
|
62
|
-
const _sfc_main$
|
|
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$
|
|
68
|
-
_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
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$
|
|
72
|
-
_ctx.$slots.header ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
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$
|
|
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$
|
|
87
|
-
const _hoisted_2$
|
|
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$
|
|
91
|
+
const _hoisted_3$3 = {
|
|
92
92
|
key: 1,
|
|
93
93
|
class: "flex justify-start"
|
|
94
94
|
};
|
|
95
|
-
const _sfc_main$
|
|
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$
|
|
235
|
+
message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
|
|
236
236
|
renderSlot(_ctx.$slots, "user-message", { message })
|
|
237
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_3$
|
|
237
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
238
238
|
renderSlot(_ctx.$slots, "agent-message", { message })
|
|
239
239
|
]))
|
|
240
|
-
], 8, _hoisted_1$
|
|
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$
|
|
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$
|
|
275
|
+
const _hoisted_1$6 = {
|
|
276
276
|
class: "sr-only",
|
|
277
277
|
"aria-live": "polite"
|
|
278
278
|
};
|
|
279
|
-
const _sfc_main$
|
|
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$
|
|
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$
|
|
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$
|
|
378
|
-
const _hoisted_1$
|
|
379
|
-
const _sfc_main$
|
|
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$
|
|
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$
|
|
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,12 +484,206 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
484
484
|
]),
|
|
485
485
|
_: 1
|
|
486
486
|
}, 8, ["content"])
|
|
487
|
-
], 8, _hoisted_1$
|
|
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-full 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-full 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",
|
|
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
|
|
492
|
-
const CHAT_HISTORY_ACTIVE_INDICATOR_CLASS = 'before:absolute before:z-10 before:top-1/2 before:left-0 before:h-1/2 before:w-0.5 before:-translate-y-1/2 before:origin-left before:scale-x-0 before:rounded-full before:bg-background-accent-default before:opacity-0 before:transition-[transform,opacity] before:duration-200 before:ease-linear before:content-[""] data-[active=true]:before:scale-x-100 data-[active=true]:before:opacity-100';
|
|
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" };
|
|
495
689
|
const _hoisted_3$1 = { class: "truncate body-14-regular text-content-on-surface-primary" };
|
|
@@ -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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
1565
|
+
_sfc_main$h as _,
|
|
1372
1566
|
_sfc_main$2 as a,
|
|
1373
|
-
_sfc_main$
|
|
1567
|
+
_sfc_main$g as b,
|
|
1374
1568
|
CkFeedbackButton as c,
|
|
1375
|
-
_sfc_main$
|
|
1376
|
-
_sfc_main$
|
|
1377
|
-
_sfc_main$
|
|
1378
|
-
_sfc_main as g,
|
|
1379
|
-
_sfc_main
|
|
1380
|
-
_sfc_main$
|
|
1381
|
-
_sfc_main$
|
|
1382
|
-
_sfc_main$
|
|
1383
|
-
_sfc_main$
|
|
1384
|
-
_sfc_main$
|
|
1385
|
-
_sfc_main$
|
|
1386
|
-
_sfc_main$
|
|
1387
|
-
_sfc_main$
|
|
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
|
};
|
|
@@ -93,6 +93,22 @@ export interface ResponseToolDescriptor {
|
|
|
93
93
|
* today; extend it as new tool kinds are introduced upstream.
|
|
94
94
|
*/
|
|
95
95
|
export type ResponseOutputToolType = 'mcp_list_tools' | 'mcp_call' | 'tool_call' | 'function_call' | 'web_search_call' | 'file_search_call' | 'code_interpreter_call' | 'image_generation_call' | 'local_shell_call';
|
|
96
|
+
/**
|
|
97
|
+
* Server-provided rendering hints for a tool invocation. The server emits a
|
|
98
|
+
* human-readable `text` (e.g. "Searching the web…") and a lucide.dev `icon`
|
|
99
|
+
* name to display alongside the tool, plus a `phase` describing the current
|
|
100
|
+
* lifecycle stage so the UI can swap labels/icons as the call progresses.
|
|
101
|
+
*
|
|
102
|
+
* Only `'done'` is received in a response today.
|
|
103
|
+
*/
|
|
104
|
+
export interface ResponseOutputToolDisplay {
|
|
105
|
+
/** Human-readable label to render for the tool (server-controlled). */
|
|
106
|
+
text: string;
|
|
107
|
+
/** Lucide.dev icon name to render next to the label. */
|
|
108
|
+
icon: string;
|
|
109
|
+
/** Lifecycle phase of the tool call. */
|
|
110
|
+
phase: 'done';
|
|
111
|
+
}
|
|
96
112
|
/**
|
|
97
113
|
* Tool-related output produced during a Responses-API turn. Covers tool
|
|
98
114
|
* discovery (`mcp_list_tools`), invocation (`mcp_call`, `function_call`,
|
|
@@ -116,6 +132,12 @@ export interface ResponseOutputTool {
|
|
|
116
132
|
call_id?: string;
|
|
117
133
|
/** Tool result payload (shape depends on the tool kind). */
|
|
118
134
|
output?: unknown;
|
|
135
|
+
/**
|
|
136
|
+
* Optional server-provided display hints (label, icon, phase). When
|
|
137
|
+
* present, `responsesToTree` forwards `text` and `icon` onto the
|
|
138
|
+
* resulting `MessageToolContent` so the UI can render them directly.
|
|
139
|
+
*/
|
|
140
|
+
display?: ResponseOutputToolDisplay;
|
|
119
141
|
[key: string]: unknown;
|
|
120
142
|
}
|
|
121
143
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses-api.d.ts","sourceRoot":"","sources":["../../src/adapters/responses-api.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,UAAU,CAAC;AAMlB;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,O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AAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QACnC,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;KACpC,CAAC;IACF,YAAY,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,EAAE,CAAC;CACxB;AAiKD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,gBAAgB,CAkE7E"}
|
|
@@ -20,6 +20,14 @@ function extractReasoningSummary(parts) {
|
|
|
20
20
|
function textPart(text, id) {
|
|
21
21
|
return { type: "text", id: id ?? generateId(), text, status: "completed" };
|
|
22
22
|
}
|
|
23
|
+
function toolPart(out) {
|
|
24
|
+
return {
|
|
25
|
+
type: "tool",
|
|
26
|
+
id: out.id,
|
|
27
|
+
name: out.name ?? out.type,
|
|
28
|
+
...out.display ? { text: out.display.text, icon: out.display.icon } : {}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
23
31
|
function toAssistantParts(resp) {
|
|
24
32
|
const parts = [];
|
|
25
33
|
for (const out of resp.output ?? []) {
|
|
@@ -47,11 +55,7 @@ function toAssistantParts(resp) {
|
|
|
47
55
|
case "mcp_call":
|
|
48
56
|
case "function_call":
|
|
49
57
|
case "tool_call": {
|
|
50
|
-
parts.push(
|
|
51
|
-
type: "tool",
|
|
52
|
-
id: out.id,
|
|
53
|
-
name: out.name ?? out.type
|
|
54
|
-
});
|
|
58
|
+
parts.push(toolPart(out));
|
|
55
59
|
break;
|
|
56
60
|
}
|
|
57
61
|
}
|
|
@@ -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"}
|