@aleph-alpha/chat-kit 5.7.0 → 5.8.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/{CkHistory.vue_vue_type_script_setup_true_lang-YHwE2DYx.js → CkHistory.vue_vue_type_script_setup_true_lang-DG96wNug.js} +20 -12
- package/dist/components/base/CkModelSelector/CkModelSelector.stories.d.ts +6 -0
- package/dist/components/base/CkModelSelector/CkModelSelector.stories.d.ts.map +1 -1
- package/dist/components/base/CkModelSelector/CkModelSelector.vue.d.ts.map +1 -1
- package/dist/components/base/CkModelSelector/types.d.ts +6 -0
- package/dist/components/base/CkModelSelector/types.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/base/CkModelSelector/CkModelSelector.spec.ts +23 -0
- package/src/components/base/CkModelSelector/CkModelSelector.stories.ts +20 -0
- package/src/components/base/CkModelSelector/CkModelSelector.vue +8 -1
- package/src/components/base/CkModelSelector/types.ts +6 -0
|
@@ -730,7 +730,7 @@ const _hoisted_5$3 = {
|
|
|
730
730
|
key: 0,
|
|
731
731
|
class: "body-16-regular"
|
|
732
732
|
};
|
|
733
|
-
const _hoisted_6$
|
|
733
|
+
const _hoisted_6$3 = {
|
|
734
734
|
key: 0,
|
|
735
735
|
"data-slot": "drop-zone-errors",
|
|
736
736
|
class: "pointer-events-none fixed bottom-6 left-1/2 z-50 max-w-[36rem] -translate-x-1/2 flex list-inside list-disc flex-col gap-1 rounded-md border border-border-surface-default bg-background-surface-default p-3 text-sm text-content-on-surface-secondary",
|
|
@@ -912,7 +912,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
912
912
|
}),
|
|
913
913
|
createVNode(Transition, { name: "ck-drop-overlay" }, {
|
|
914
914
|
default: withCtx(() => [
|
|
915
|
-
__props.showErrors && errors.value.length ? (openBlock(), createElementBlock("ul", _hoisted_6$
|
|
915
|
+
__props.showErrors && errors.value.length ? (openBlock(), createElementBlock("ul", _hoisted_6$3, [
|
|
916
916
|
(openBlock(true), createElementBlock(Fragment, null, renderList(errors.value, (msg, i) => {
|
|
917
917
|
return openBlock(), createElementBlock("li", { key: i }, toDisplayString(msg), 1);
|
|
918
918
|
}), 128))
|
|
@@ -1471,11 +1471,11 @@ const _hoisted_5$2 = {
|
|
|
1471
1471
|
key: 1,
|
|
1472
1472
|
class: "label-12-medium w-full truncate text-content-on-status-error-inverse"
|
|
1473
1473
|
};
|
|
1474
|
-
const _hoisted_6$
|
|
1474
|
+
const _hoisted_6$2 = {
|
|
1475
1475
|
key: 2,
|
|
1476
1476
|
class: "label-12-medium w-full truncate text-content-on-surface-muted"
|
|
1477
1477
|
};
|
|
1478
|
-
const _hoisted_7$
|
|
1478
|
+
const _hoisted_7$2 = ["aria-label"];
|
|
1479
1479
|
const _hoisted_8$1 = ["onClick"];
|
|
1480
1480
|
const ITEM_GAP = 8;
|
|
1481
1481
|
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
@@ -1650,7 +1650,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1650
1650
|
"model-value": aggregateProgress.value,
|
|
1651
1651
|
class: "h-1 w-full",
|
|
1652
1652
|
"aria-label": `${resolvedTriggerLabel.value} upload progress`
|
|
1653
|
-
}, null, 8, ["model-value", "aria-label"])) : hasFailures.value ? (openBlock(), createElementBlock("span", _hoisted_5$2, toDisplayString(failedStatusLabel.value), 1)) : __props.triggerLabel ? (openBlock(), createElementBlock("span", _hoisted_6$
|
|
1653
|
+
}, null, 8, ["model-value", "aria-label"])) : hasFailures.value ? (openBlock(), createElementBlock("span", _hoisted_5$2, toDisplayString(failedStatusLabel.value), 1)) : __props.triggerLabel ? (openBlock(), createElementBlock("span", _hoisted_6$2, toDisplayString(countStatusLabel.value), 1)) : createCommentVNode("", true)
|
|
1654
1654
|
])),
|
|
1655
1655
|
createVNode(unref(UiIcon), {
|
|
1656
1656
|
name: "chevron-down",
|
|
@@ -1695,7 +1695,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1695
1695
|
}, 8, ["file", "size", "is-removable", "remove-label", "disabled", "onRemove"])
|
|
1696
1696
|
], 12, _hoisted_8$1);
|
|
1697
1697
|
}), 128))
|
|
1698
|
-
], 8, _hoisted_7$
|
|
1698
|
+
], 8, _hoisted_7$2)
|
|
1699
1699
|
]),
|
|
1700
1700
|
_: 3
|
|
1701
1701
|
}, 8, ["class"])
|
|
@@ -1718,11 +1718,11 @@ const _hoisted_5$1 = {
|
|
|
1718
1718
|
key: 0,
|
|
1719
1719
|
class: "truncate"
|
|
1720
1720
|
};
|
|
1721
|
-
const _hoisted_6 = {
|
|
1721
|
+
const _hoisted_6$1 = {
|
|
1722
1722
|
key: 1,
|
|
1723
1723
|
"aria-hidden": "true"
|
|
1724
1724
|
};
|
|
1725
|
-
const _hoisted_7 = {
|
|
1725
|
+
const _hoisted_7$1 = {
|
|
1726
1726
|
key: 2,
|
|
1727
1727
|
class: "truncate"
|
|
1728
1728
|
};
|
|
@@ -1863,8 +1863,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
1863
1863
|
props.metaStart || props.metaEnd || _ctx.$slots.meta ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
1864
1864
|
renderSlot(_ctx.$slots, "meta", {}, () => [
|
|
1865
1865
|
props.metaStart ? (openBlock(), createElementBlock("span", _hoisted_5$1, toDisplayString(props.metaStart), 1)) : createCommentVNode("", true),
|
|
1866
|
-
props.metaStart && props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_6, "|")) : createCommentVNode("", true),
|
|
1867
|
-
props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(props.metaEnd), 1)) : createCommentVNode("", true)
|
|
1866
|
+
props.metaStart && props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_6$1, "|")) : createCommentVNode("", true),
|
|
1867
|
+
props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(props.metaEnd), 1)) : createCommentVNode("", true)
|
|
1868
1868
|
])
|
|
1869
1869
|
])) : createCommentVNode("", true)
|
|
1870
1870
|
])
|
|
@@ -2004,7 +2004,12 @@ const _hoisted_1$4 = ["disabled", "aria-expanded", "aria-label"];
|
|
|
2004
2004
|
const _hoisted_2$2 = { class: "min-w-0 max-w-[10rem] truncate" };
|
|
2005
2005
|
const _hoisted_3$1 = ["aria-label"];
|
|
2006
2006
|
const _hoisted_4$1 = ["aria-selected", "onClick"];
|
|
2007
|
-
const _hoisted_5 = { class: "min-w-0 flex-1
|
|
2007
|
+
const _hoisted_5 = { class: "flex min-w-0 flex-1 flex-col" };
|
|
2008
|
+
const _hoisted_6 = { class: "min-w-0 truncate" };
|
|
2009
|
+
const _hoisted_7 = {
|
|
2010
|
+
key: 0,
|
|
2011
|
+
class: "min-w-0 truncate text-xs text-content-on-surface-muted"
|
|
2012
|
+
};
|
|
2008
2013
|
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
2009
2014
|
...{ name: "CkModelSelector" },
|
|
2010
2015
|
__name: "CkModelSelector",
|
|
@@ -2092,7 +2097,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
2092
2097
|
class: "relative flex w-full items-center gap-2 rounded-sm py-2 pr-8 pl-3 text-left body-14-regular text-content-on-surface-primary outline-none hover:bg-background-surface-muted-subtle focus-visible:ring-2 focus-visible:ring-ring",
|
|
2093
2098
|
onClick: ($event) => select(model.id)
|
|
2094
2099
|
}, [
|
|
2095
|
-
createElementVNode("span", _hoisted_5,
|
|
2100
|
+
createElementVNode("span", _hoisted_5, [
|
|
2101
|
+
createElementVNode("span", _hoisted_6, toDisplayString(model.label), 1),
|
|
2102
|
+
model.sublabel ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(model.sublabel), 1)) : createCommentVNode("", true)
|
|
2103
|
+
]),
|
|
2096
2104
|
model.id === __props.selectedModelId ? (openBlock(), createBlock(unref(UiIcon), {
|
|
2097
2105
|
key: 0,
|
|
2098
2106
|
name: "check",
|
|
@@ -17,4 +17,10 @@ export declare const Placeholder: Story;
|
|
|
17
17
|
* Disabled trigger — e.g. while the model list is still loading.
|
|
18
18
|
*/
|
|
19
19
|
export declare const Disabled: Story;
|
|
20
|
+
/**
|
|
21
|
+
* Rows can carry an optional `sublabel` — a muted second line for secondary
|
|
22
|
+
* metadata like a serving revision or provider. It shows only in the dropdown;
|
|
23
|
+
* the trigger stays label-only. Rows without one render just the label.
|
|
24
|
+
*/
|
|
25
|
+
export declare const WithSublabels: Story;
|
|
20
26
|
//# sourceMappingURL=CkModelSelector.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkModelSelector.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/CkModelSelector.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,eAAe,MAAM,uBAAuB,CAAC;AASpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAyBtC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAC;AAoC9C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAGzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAGtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"CkModelSelector.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/CkModelSelector.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,eAAe,MAAM,uBAAuB,CAAC;AASpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAyBtC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAC;AAoC9C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAGzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAGtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KAa3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CkModelSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/CkModelSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CkModelSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/CkModelSelector.vue"],"names":[],"mappings":"AAwIA,OAAO,KAAK,EAAwB,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAiS1E,QAAA,MAAM,YAAY;;;;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -19,6 +19,12 @@ export interface CkModelOption {
|
|
|
19
19
|
id: string;
|
|
20
20
|
/** Display name shown in the trigger and the option row. */
|
|
21
21
|
label: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional secondary line shown muted beneath `label` in the dropdown row
|
|
24
|
+
* (e.g. a serving revision or provider). Not shown on the trigger, which
|
|
25
|
+
* stays label-only. Rows without one render just the label.
|
|
26
|
+
*/
|
|
27
|
+
sublabel?: string;
|
|
22
28
|
}
|
|
23
29
|
export interface CkModelSelectorProps {
|
|
24
30
|
/** Models to choose from. The dropdown trigger is still rendered when empty. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkModelSelector/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,gFAAgF;IAChF,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAClC,0CAA0C;IAC1C,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,wBAAwB,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;CACxC"}
|
package/dist/components/index.js
CHANGED
|
@@ -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, z } from "../CkHistory.vue_vue_type_script_setup_true_lang-
|
|
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, z } from "../CkHistory.vue_vue_type_script_setup_true_lang-DG96wNug.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-Tellov3w.js";
|
|
2
2
|
import { C, d, p, u as u2, b } from "./useChatKitLabels-CMOr3Kjq.js";
|
|
3
3
|
import { S, c, d as d2, f, u as u3, a, b as b2, e } from "./index-Dn4ctxk8.js";
|
|
4
|
-
import { _, a as a2, C as C2, b as b3, 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, A } from "./CkHistory.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _, a as a2, C as C2, b as b3, 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, A } from "./CkHistory.vue_vue_type_script_setup_true_lang-DG96wNug.js";
|
|
5
5
|
export {
|
|
6
6
|
C as CHAT_KIT_LABELS,
|
|
7
7
|
_ as CkAgentMessage,
|
package/package.json
CHANGED
|
@@ -46,6 +46,29 @@ describe('CkModelSelector', () => {
|
|
|
46
46
|
expect(emitted('update:selectedModelId')).toEqual([['kimi']]);
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
+
it('renders a sublabel beneath the label when a model has one', async () => {
|
|
50
|
+
const user = userEvent.setup();
|
|
51
|
+
render(CkModelSelector, {
|
|
52
|
+
props: {
|
|
53
|
+
models: [
|
|
54
|
+
{ id: 'kimi', label: 'Kimi' },
|
|
55
|
+
{ id: 'phoenix', label: 'Phoenix', sublabel: '20260708-ash' },
|
|
56
|
+
] satisfies CkModelOption[],
|
|
57
|
+
selectedModelId: 'phoenix',
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
await user.click(screen.getByRole('button', { name: TRIGGER_LABEL }));
|
|
62
|
+
|
|
63
|
+
// The sublabel sits inside the option row alongside its label.
|
|
64
|
+
const phoenix = await screen.findByRole('option', { name: /Phoenix/ });
|
|
65
|
+
expect(phoenix).toHaveTextContent('20260708-ash');
|
|
66
|
+
// A model without a sublabel shows only its label.
|
|
67
|
+
expect(
|
|
68
|
+
await screen.findByRole('option', { name: 'Kimi' }),
|
|
69
|
+
).toHaveTextContent(/^Kimi$/);
|
|
70
|
+
});
|
|
71
|
+
|
|
49
72
|
it('does not re-emit when the already-selected model is clicked', async () => {
|
|
50
73
|
const user = userEvent.setup();
|
|
51
74
|
const { emitted } = render(CkModelSelector, {
|
|
@@ -99,3 +99,23 @@ export const Disabled: Story = {
|
|
|
99
99
|
args: { disabled: true },
|
|
100
100
|
render: renderStory,
|
|
101
101
|
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Rows can carry an optional `sublabel` — a muted second line for secondary
|
|
105
|
+
* metadata like a serving revision or provider. It shows only in the dropdown;
|
|
106
|
+
* the trigger stays label-only. Rows without one render just the label.
|
|
107
|
+
*/
|
|
108
|
+
export const WithSublabels: Story = {
|
|
109
|
+
args: {
|
|
110
|
+
models: [
|
|
111
|
+
{ id: 'kimi', label: 'Kimi' },
|
|
112
|
+
{ id: 'phoenix', label: 'Phoenix', sublabel: '20260708-ash' },
|
|
113
|
+
{
|
|
114
|
+
id: 'phoenix-no-think',
|
|
115
|
+
label: 'Phoenix (no thinking)',
|
|
116
|
+
sublabel: '20260708-ash',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
render: renderStory,
|
|
121
|
+
};
|
|
@@ -98,7 +98,14 @@ function select(id: string) {
|
|
|
98
98
|
class="relative flex w-full items-center gap-2 rounded-sm py-2 pr-8 pl-3 text-left body-14-regular text-content-on-surface-primary outline-none hover:bg-background-surface-muted-subtle focus-visible:ring-2 focus-visible:ring-ring"
|
|
99
99
|
@click="select(model.id)"
|
|
100
100
|
>
|
|
101
|
-
<span class="min-w-0 flex-1
|
|
101
|
+
<span class="flex min-w-0 flex-1 flex-col">
|
|
102
|
+
<span class="min-w-0 truncate">{{ model.label }}</span>
|
|
103
|
+
<span
|
|
104
|
+
v-if="model.sublabel"
|
|
105
|
+
class="min-w-0 truncate text-xs text-content-on-surface-muted"
|
|
106
|
+
>{{ model.sublabel }}</span
|
|
107
|
+
>
|
|
108
|
+
</span>
|
|
102
109
|
<UiIcon
|
|
103
110
|
v-if="model.id === selectedModelId"
|
|
104
111
|
name="check"
|
|
@@ -19,6 +19,12 @@ export interface CkModelOption {
|
|
|
19
19
|
id: string;
|
|
20
20
|
/** Display name shown in the trigger and the option row. */
|
|
21
21
|
label: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional secondary line shown muted beneath `label` in the dropdown row
|
|
24
|
+
* (e.g. a serving revision or provider). Not shown on the trigger, which
|
|
25
|
+
* stays label-only. Rows without one render just the label.
|
|
26
|
+
*/
|
|
27
|
+
sublabel?: string;
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
export interface CkModelSelectorProps {
|