@meistrari/tela-build 1.103.1 → 1.105.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/CHANGELOG.md +16 -0
- package/components/tela/animated/animated-number.vue +5 -52
- package/components/tela/chat/chat-model-selector.vue +128 -36
- package/components/tela/chat/chat.mdx +52 -25
- package/components/tela/chat/icons/anthropic.vue +2 -2
- package/components/tela/chat/icons/gemini.vue +1 -1
- package/components/tela/chat/icons/openai.vue +1 -1
- package/components/tela/combobox/combobox-empty.vue +1 -1
- package/components/tela/combobox/combobox.mdx +3 -21
- package/components/tela/combobox/combobox.vue +158 -80
- package/components/tela/onboarding-card/onboarding-card.mdx +122 -0
- package/components/tela/onboarding-card/onboarding-card.vue +194 -0
- package/nuxt.config.ts +1 -0
- package/package.json +1 -1
- package/types/index.ts +1 -0
- package/types/onboarding-card.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Latest updates and announcements.
|
|
4
4
|
|
|
5
|
+
## November 18, 2026
|
|
6
|
+
|
|
7
|
+
- Icons: `i-custom:assistantAvatar` is the Tela Assistant avatar: the Tela logomark in white on a 48% black rounded tile, drawn at 16×16. The assistant onboarding card uses it.
|
|
8
|
+
- [Animated Number](/components/animated-number) spaces its digits with the font's own tabular figures (`tabular-nums`) instead of padding each digit to the width of the widest one, which left wide gaps around narrow digits such as `1`. Digits still keep a steady width while they change, and the spacing now follows the typeface at every text size.
|
|
9
|
+
- [Chat → Model Selector](/templates/chat#model-selector) A selected reasoning level is now also cleared on mount when the selected model has no reasoning levels (empty `reasoning-options`), and when the host sets `v-model:reasoning` to a level the current `reasoning-options` don't include. Before, it was kept in both cases, so the parent could still send it. New `reasoningLoading` prop: while it is `true`, the level is kept, so hosts that load the levels asynchronously don't lose a saved level.
|
|
10
|
+
|
|
11
|
+
## November 17, 2026
|
|
12
|
+
|
|
13
|
+
- [Onboarding Card](/components/onboarding-card) is a new component for short, step-by-step feature introductions: a 280px card with an illustration from the `#thumb` slot, a title and a description per step, step dots that double as navigation, and "Skip" with a next arrow, or "Got it" on the last step. The current step is bound with `v-model:step`, and `skip` and `finish` leave dismissing to the host. All copy comes from `steps` and `labels`. The card has no entrance of its own, so the host animates it in (the docs show a `Motion` with `as-child`), and each step advances by itself after `duration` (default 5000ms, `0` turns it off) while the current dot fills like a progress bar. Hovering or keyboard focus pauses it, and the last step waits for the user. Between steps the illustration fades out and the next one remounts, so `#thumb` content can play its own entrance. Going to the last step, "Skip" fades out and the arrow widens into the finish button. Under `prefers-reduced-motion`, only the progress fill still moves.
|
|
14
|
+
- [Chat → Model Selector](/templates/chat#model-selector) When `reasoning-options` changes and no longer includes the selected level, `v-model:reasoning` is cleared, so the menu and the parent agree.
|
|
15
|
+
- [Combobox](/components/combobox) Table layout matches the design specs: group headings and the Cost / Input / Output headers are 10px semibold, provider icons are 15px inside their 20px box, and token limits are 11px uppercase on every row, in primary text on the selected and highlighted rows. The trigger drops the `Claude ` prefix (`Claude Opus 5` reads `Opus 5`).
|
|
16
|
+
- [Combobox](/components/combobox) Options that carry `cost` or token limits render as a table: a 360px panel, the first group heading carries `Cost` / `Input` / `Output` columns, and each row shows the icon, the label (12px semibold), the cost as five `$` and the input and output limits in fixed columns. Descriptions and the Multimodal badge are not shown in this layout; search still matches descriptions. The search icon and headings line up at 16px, and the tabs row is not shown (option `tabs` are ignored in this layout). The `Input` / `Output` headers reuse `labelInputMax` / `labelOutputMax` (defaults now `Input` / `Output`), and the new `labelCost` prop translates `Cost`.
|
|
17
|
+
- [Chat → Model Selector](/templates/chat#model-selector) **Breaking:** `TelaChatModelSelector` is now a Menubar, like the prompt input's action menu, instead of a combobox. The trigger shows the provider icon, the model's short name (`triggerLabel`, or the label without `Claude `) and the selected reasoning level in secondary text. The menu has a Model row and, when `reasoning-options` is not empty, a Reasoning row, each showing its current value and opening a submenu, plus **Use agent default**, which clears both. New: `v-model:reasoning`, `reasoningOptions`, `labelModel`, `labelReasoning`, `labelReasoningDefault`, `labelUseDefault` and `sideOffset` (default 6). Removed: `inputPlaceholder` and `tabLabels` (no search or tabs); option fields other than `value`, `label`, `triggerLabel` and `icon` are ignored.
|
|
18
|
+
- [Chat → Model Selector](/templates/chat#model-selector) The provider icons follow the design system: `TelaChatIconsAnthropic` is the orange Claude mark instead of the Anthropic wordmark, and `TelaChatIconsOpenai` and `TelaChatIconsGemini` fill their box like it, so the three line up in the model list.
|
|
19
|
+
- [Combobox](/components/combobox) The `compact` prop is deprecated and has no effect; every combobox uses the compact layout, which was already the default. Existing usages keep working, but drop `:compact` when you touch them. With `:compact="false"` the trigger no longer adds `w-full !py-2.5 pl-3 pr-3` (pass it through `trigger-class` if you need it), and the dropdown is always 440px wide (override it with `content-class`).
|
|
20
|
+
|
|
5
21
|
## November 16, 2026
|
|
6
22
|
|
|
7
23
|
- [Avatar](/components/avatar) `TelaAvatarGroup` keys its avatars by position instead of by `image`, so a group with several avatars without a picture no longer repeats the empty key, which logged Vue duplicate-key warnings and could show one person's initials on another's avatar when the list changed.
|
|
@@ -14,13 +14,9 @@ const LEAVE_ACTIVE = '!absolute left-0 top-0 pointer-events-none transition-[tra
|
|
|
14
14
|
const LEAVE_TO = 'opacity-0 [filter:blur(0.12em)] [transform:translateY(-0.45em)_scale(0.8)]'
|
|
15
15
|
const MOVE = 'transition-[transform,opacity,filter] duration-[280ms] ease-[cubic-bezier(0.22,1,0.36,1)]'
|
|
16
16
|
const WIDTH_ANIMATION = { duration: 280, easing: 'cubic-bezier(0.22, 1, 0.36, 1)' }
|
|
17
|
-
const DIGITS = [...'0123456789']
|
|
18
|
-
const DIGIT_TIGHTENING = 0.01
|
|
19
|
-
const DIGIT_PROBE = 'absolute invisible'
|
|
20
17
|
|
|
21
18
|
const root = ref<HTMLElement | null>(null)
|
|
22
19
|
const reducedMotion = ref(false)
|
|
23
|
-
const digitMargins = ref<Record<string, string>>({})
|
|
24
20
|
let widthAnimation: Animation | undefined
|
|
25
21
|
let integerDigits: { id: number, text: string }[] = []
|
|
26
22
|
let nextDigitId = 0
|
|
@@ -56,7 +52,7 @@ const cells = computed(() => {
|
|
|
56
52
|
let before = props.prefix ?? ''
|
|
57
53
|
let after = ''
|
|
58
54
|
|
|
59
|
-
const numberCells: { key: string, text: string
|
|
55
|
+
const numberCells: { key: string, text: string }[] = []
|
|
60
56
|
|
|
61
57
|
for (const part of parts) {
|
|
62
58
|
if (part.type === 'integer') {
|
|
@@ -64,12 +60,12 @@ const cells = computed(() => {
|
|
|
64
60
|
const digit = digits[digitIndex++]
|
|
65
61
|
|
|
66
62
|
if (digit)
|
|
67
|
-
numberCells.push({ key: `integer-${digit.id}`, text: digit.text
|
|
63
|
+
numberCells.push({ key: `integer-${digit.id}`, text: digit.text })
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
else if (part.type === 'fraction') {
|
|
71
67
|
for (const digit of part.value)
|
|
72
|
-
numberCells.push({ key: `fraction-${fractionIndex++}`, text: digit
|
|
68
|
+
numberCells.push({ key: `fraction-${fractionIndex++}`, text: digit })
|
|
73
69
|
}
|
|
74
70
|
else if (part.type === 'group') {
|
|
75
71
|
numberCells.push({ key: `group-${groupIndex++}`, text: part.value })
|
|
@@ -94,46 +90,7 @@ const cells = computed(() => {
|
|
|
94
90
|
]
|
|
95
91
|
})
|
|
96
92
|
|
|
97
|
-
function measureDigits() {
|
|
98
|
-
const element = root.value
|
|
99
|
-
|
|
100
|
-
if (!element)
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
const probes = DIGITS.map((digit) => {
|
|
104
|
-
const probe = document.createElement('span')
|
|
105
|
-
|
|
106
|
-
probe.className = DIGIT_PROBE
|
|
107
|
-
probe.textContent = digit
|
|
108
|
-
|
|
109
|
-
return probe
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
element.append(...probes)
|
|
113
|
-
|
|
114
|
-
const widths = probes.map(probe => Number.parseFloat(getComputedStyle(probe).width))
|
|
115
|
-
|
|
116
|
-
const fontSize = Number.parseFloat(getComputedStyle(element).fontSize)
|
|
117
|
-
|
|
118
|
-
for (const probe of probes)
|
|
119
|
-
probe.remove()
|
|
120
|
-
|
|
121
|
-
const widest = Math.max(...widths)
|
|
122
|
-
|
|
123
|
-
if (!(widest > 0) || !(fontSize > 0))
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
digitMargins.value = Object.fromEntries(DIGITS.map((digit, index) => [digit, `${(widest - (widths[index] ?? widest)) / 2 / fontSize - DIGIT_TIGHTENING}em`]))
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
onMounted(() => {
|
|
130
|
-
measureDigits()
|
|
131
|
-
document.fonts?.ready.then(measureDigits)
|
|
132
|
-
})
|
|
133
|
-
|
|
134
93
|
watch(text, async () => {
|
|
135
|
-
measureDigits()
|
|
136
|
-
|
|
137
94
|
reducedMotion.value = window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
138
95
|
|
|
139
96
|
const element = root.value
|
|
@@ -166,7 +123,7 @@ function pinLeavingCell(element: Element) {
|
|
|
166
123
|
ref="root"
|
|
167
124
|
role="img"
|
|
168
125
|
:aria-label="text"
|
|
169
|
-
class="relative inline-block whitespace-pre"
|
|
126
|
+
class="relative inline-block whitespace-pre tabular-nums"
|
|
170
127
|
>
|
|
171
128
|
<TransitionGroup
|
|
172
129
|
tag="span"
|
|
@@ -187,11 +144,7 @@ function pinLeavingCell(element: Element) {
|
|
|
187
144
|
:leave-active-class="LEAVE_ACTIVE"
|
|
188
145
|
:leave-to-class="LEAVE_TO"
|
|
189
146
|
>
|
|
190
|
-
<span
|
|
191
|
-
:key="cell.text"
|
|
192
|
-
class="inline-block"
|
|
193
|
-
:style="cell.isDigit ? { marginInline: digitMargins[cell.text] } : undefined"
|
|
194
|
-
>{{ cell.text }}</span>
|
|
147
|
+
<span :key="cell.text" class="inline-block">{{ cell.text }}</span>
|
|
195
148
|
</Transition>
|
|
196
149
|
</span>
|
|
197
150
|
</TransitionGroup>
|
|
@@ -4,61 +4,153 @@ import type { Component } from 'vue'
|
|
|
4
4
|
interface ModelOption {
|
|
5
5
|
value: string
|
|
6
6
|
label: string
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/** Shorter name for the trigger. Defaults to the label without the `Claude ` prefix. */
|
|
8
|
+
triggerLabel?: string
|
|
9
9
|
icon?: string | Component
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ReasoningOption {
|
|
13
|
+
value: string
|
|
14
|
+
label: string
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const props = withDefaults(defineProps<{
|
|
18
|
-
/** Model options, already resolved by the host (labels, provider icons
|
|
18
|
+
/** Model options, already resolved by the host (labels, provider icons). */
|
|
19
19
|
options: ModelOption[]
|
|
20
|
+
/** Reasoning levels the selected model supports. Empty hides the Reasoning row. */
|
|
21
|
+
reasoningOptions?: ReasoningOption[]
|
|
22
|
+
/** The host is still resolving `reasoningOptions`; the selected level is kept until it is `false`. */
|
|
23
|
+
reasoningLoading?: boolean
|
|
20
24
|
disabled?: boolean
|
|
21
25
|
placeholder?: string
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
labelModel?: string
|
|
27
|
+
labelReasoning?: string
|
|
28
|
+
/** Value shown on the Reasoning row while no level is picked. */
|
|
29
|
+
labelReasoningDefault?: string
|
|
30
|
+
/** Clears both selections. Hidden when empty. */
|
|
31
|
+
labelUseDefault?: string
|
|
25
32
|
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
26
33
|
align?: 'start' | 'center' | 'end'
|
|
34
|
+
sideOffset?: number
|
|
27
35
|
}>(), {
|
|
36
|
+
reasoningOptions: () => [],
|
|
28
37
|
placeholder: 'Auto',
|
|
29
|
-
|
|
38
|
+
labelModel: 'Model',
|
|
39
|
+
labelReasoning: 'Reasoning',
|
|
40
|
+
labelReasoningDefault: 'Default',
|
|
41
|
+
labelUseDefault: 'Use agent default',
|
|
30
42
|
side: 'top',
|
|
31
43
|
align: 'end',
|
|
32
|
-
|
|
33
|
-
all: 'All',
|
|
34
|
-
advanced: 'Advanced',
|
|
35
|
-
cheap: 'Economical',
|
|
36
|
-
multimodal: 'Multimodal',
|
|
37
|
-
}),
|
|
44
|
+
sideOffset: 6,
|
|
38
45
|
})
|
|
39
46
|
|
|
40
47
|
const model = defineModel<string | null>({ default: null })
|
|
48
|
+
const reasoning = defineModel<string | null>('reasoning', { default: null })
|
|
49
|
+
|
|
50
|
+
const selectedOption = computed(() => props.options.find(option => option.value === model.value))
|
|
51
|
+
const selectedReasoning = computed(() => props.reasoningOptions.find(option => option.value === reasoning.value))
|
|
52
|
+
const triggerLabel = computed(() => {
|
|
53
|
+
const option = selectedOption.value
|
|
54
|
+
if (!option)
|
|
55
|
+
return props.placeholder
|
|
56
|
+
return option.triggerLabel ?? option.label.replace(/^Claude\s+/i, '')
|
|
57
|
+
})
|
|
58
|
+
const hasSelection = computed(() => model.value !== null || reasoning.value !== null)
|
|
59
|
+
|
|
60
|
+
watch([reasoning, () => props.reasoningOptions, () => props.reasoningLoading], ([level, options, loading]) => {
|
|
61
|
+
if (loading)
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
if (level !== null && !options.some(option => option.value === level))
|
|
65
|
+
reasoning.value = null
|
|
66
|
+
}, { immediate: true })
|
|
41
67
|
|
|
42
|
-
|
|
43
|
-
|
|
68
|
+
const itemClass = 'gap-8px px-8px py-7px'
|
|
69
|
+
const valueItemClass = 'gap-2px px-8px! py-7px! text-primary'
|
|
70
|
+
|
|
71
|
+
const APPLY_DELAY_MS = 120
|
|
72
|
+
|
|
73
|
+
function choose(apply: () => void) {
|
|
74
|
+
setTimeout(apply, APPLY_DELAY_MS)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function resetToDefault() {
|
|
78
|
+
choose(() => {
|
|
79
|
+
model.value = null
|
|
80
|
+
reasoning.value = null
|
|
81
|
+
})
|
|
44
82
|
}
|
|
45
83
|
</script>
|
|
46
84
|
|
|
47
85
|
<template>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
86
|
+
<TelaMenubarRoot class="flex">
|
|
87
|
+
<TelaMenubarMenu>
|
|
88
|
+
<TelaMenubarTrigger
|
|
89
|
+
:disabled="disabled"
|
|
90
|
+
class="group gap-6px rounded-8px py-7px pl-10px pr-8px duration-80 data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
91
|
+
>
|
|
92
|
+
<span v-if="selectedOption?.icon" class="flex size-12px shrink-0 items-center justify-center [&_svg]:size-12px">
|
|
93
|
+
<TelaIcon v-if="typeof selectedOption.icon === 'string'" :name="selectedOption.icon" size="12px" />
|
|
94
|
+
<component :is="selectedOption.icon" v-else />
|
|
95
|
+
</span>
|
|
96
|
+
<span class="truncate whitespace-nowrap body-14-medium text-primary group-data-[state=open]:text-secondary">{{ triggerLabel }}</span>
|
|
97
|
+
<span v-if="selectedReasoning" class="shrink-0 whitespace-nowrap body-14-medium text-secondary">{{ selectedReasoning.label }}</span>
|
|
98
|
+
<TelaIcon
|
|
99
|
+
name="i-ph-caret-down"
|
|
100
|
+
size="15px"
|
|
101
|
+
color="icon-tertiary"
|
|
102
|
+
class="shrink-0 transition-transform ease-out duration-150 group-data-[state=open]:rotate-180"
|
|
103
|
+
/>
|
|
104
|
+
</TelaMenubarTrigger>
|
|
105
|
+
|
|
106
|
+
<TelaMenubarContent :side="side" :align="align" :side-offset="sideOffset" class="!min-w-260px w-260px z-999">
|
|
107
|
+
<TelaMenubarSub>
|
|
108
|
+
<TelaMenubarSubTrigger :class="valueItemClass">
|
|
109
|
+
<span class="min-w-0 flex-1 truncate">{{ labelModel }}</span>
|
|
110
|
+
<span class="mr-8px max-w-120px truncate body-14-regular text-tertiary">{{ selectedOption?.label ?? placeholder }}</span>
|
|
111
|
+
</TelaMenubarSubTrigger>
|
|
112
|
+
<TelaMenubarSubContent class="!min-w-220px w-220px z-1000 max-h-[min(360px,60vh)] overflow-y-auto no-scrollbar">
|
|
113
|
+
<TelaMenubarItem
|
|
114
|
+
v-for="option in options"
|
|
115
|
+
:key="option.value"
|
|
116
|
+
:class="itemClass"
|
|
117
|
+
@select="choose(() => model = option.value)"
|
|
118
|
+
>
|
|
119
|
+
<span v-if="option.icon" class="flex size-16px shrink-0 items-center justify-center [&_svg]:size-12px">
|
|
120
|
+
<TelaIcon v-if="typeof option.icon === 'string'" :name="option.icon" size="12px" />
|
|
121
|
+
<component :is="option.icon" v-else />
|
|
122
|
+
</span>
|
|
123
|
+
<span class="min-w-0 flex-1 truncate">{{ option.label }}</span>
|
|
124
|
+
<TelaIcon v-if="option.value === model" name="i-ph-check" size="14px" class="shrink-0 text-gray-400" />
|
|
125
|
+
</TelaMenubarItem>
|
|
126
|
+
</TelaMenubarSubContent>
|
|
127
|
+
</TelaMenubarSub>
|
|
128
|
+
|
|
129
|
+
<TelaMenubarSub v-if="reasoningOptions.length">
|
|
130
|
+
<TelaMenubarSubTrigger :class="valueItemClass">
|
|
131
|
+
<span class="min-w-0 flex-1 truncate">{{ labelReasoning }}</span>
|
|
132
|
+
<span class="mr-8px max-w-120px truncate body-14-regular text-tertiary">{{ selectedReasoning?.label ?? labelReasoningDefault }}</span>
|
|
133
|
+
</TelaMenubarSubTrigger>
|
|
134
|
+
<TelaMenubarSubContent class="!min-w-200px w-200px z-1000">
|
|
135
|
+
<TelaMenubarItem
|
|
136
|
+
v-for="option in reasoningOptions"
|
|
137
|
+
:key="option.value"
|
|
138
|
+
:class="itemClass"
|
|
139
|
+
@select="choose(() => reasoning = option.value)"
|
|
140
|
+
>
|
|
141
|
+
<span class="min-w-0 flex-1 truncate">{{ option.label }}</span>
|
|
142
|
+
<TelaIcon v-if="option.value === reasoning" name="i-ph-check" size="14px" class="shrink-0 text-gray-400" />
|
|
143
|
+
</TelaMenubarItem>
|
|
144
|
+
</TelaMenubarSubContent>
|
|
145
|
+
</TelaMenubarSub>
|
|
146
|
+
|
|
147
|
+
<template v-if="labelUseDefault">
|
|
148
|
+
<TelaMenubarSeparator class="mx-0 my-4px" />
|
|
149
|
+
<TelaMenubarItem :class="itemClass" :disabled="!hasSelection" @select="resetToDefault">
|
|
150
|
+
<span class="min-w-0 flex-1 truncate">{{ labelUseDefault }}</span>
|
|
151
|
+
</TelaMenubarItem>
|
|
152
|
+
</template>
|
|
153
|
+
</TelaMenubarContent>
|
|
154
|
+
</TelaMenubarMenu>
|
|
155
|
+
</TelaMenubarRoot>
|
|
64
156
|
</template>
|
|
@@ -36,10 +36,18 @@ const skills = [
|
|
|
36
36
|
{ id: 's2', label: 'Draft release announcement' },
|
|
37
37
|
]
|
|
38
38
|
const selectedModel = ref<string | null>('claude-fable-5')
|
|
39
|
+
const selectedReasoning = ref<string | null>('high')
|
|
39
40
|
const modelOptions = [
|
|
40
|
-
{ value: 'claude-fable-5', label: 'Fable 5',
|
|
41
|
-
{ value: 'claude-opus-5', label: 'Opus 5',
|
|
42
|
-
{ value: 'gpt-5-2', label: 'GPT-5.2',
|
|
41
|
+
{ value: 'claude-fable-5', label: 'Claude Fable 5', icon: TelaChatIconsAnthropic },
|
|
42
|
+
{ value: 'claude-opus-5', label: 'Claude Opus 5', icon: TelaChatIconsAnthropic },
|
|
43
|
+
{ value: 'gpt-5-2', label: 'GPT-5.2', icon: TelaChatIconsOpenai },
|
|
44
|
+
]
|
|
45
|
+
const reasoningOptions = [
|
|
46
|
+
{ value: 'low', label: 'Low' },
|
|
47
|
+
{ value: 'medium', label: 'Medium' },
|
|
48
|
+
{ value: 'high', label: 'High' },
|
|
49
|
+
{ value: 'xhigh', label: 'Extra high' },
|
|
50
|
+
{ value: 'max', label: 'Max' },
|
|
43
51
|
]
|
|
44
52
|
const conversationRef = ref()
|
|
45
53
|
|
|
@@ -124,7 +132,12 @@ function send() {
|
|
|
124
132
|
</TelaChatPromptInputActionMenu>
|
|
125
133
|
</TelaChatPromptInputTools>
|
|
126
134
|
<TelaChatPromptInputActions>
|
|
127
|
-
<TelaChatModelSelector
|
|
135
|
+
<TelaChatModelSelector
|
|
136
|
+
v-model="selectedModel"
|
|
137
|
+
v-model:reasoning="selectedReasoning"
|
|
138
|
+
:options="modelOptions"
|
|
139
|
+
:reasoning-options="reasoningOptions"
|
|
140
|
+
/>
|
|
128
141
|
<TelaChatPromptSubmitButton
|
|
129
142
|
:status="status"
|
|
130
143
|
:disabled="!draft.trim()"
|
|
@@ -683,25 +696,40 @@ const skills = [
|
|
|
683
696
|
|
|
684
697
|
### Model Selector
|
|
685
698
|
|
|
686
|
-
`TelaChatModelSelector` is a
|
|
699
|
+
`TelaChatModelSelector` is a Menubar (reka-ui), like the prompt input's action menu, that puts the model and its reasoning level in one toolbar control. The host resolves the options (from its own model catalog) including provider icons. The trigger shows the model's short name (`triggerLabel`, or the label without its `Claude ` prefix) followed by the selected reasoning level in secondary text; the menu has a **Model** row and, when `reasoning-options` is not empty, a **Reasoning** row, each showing its current value and opening a submenu. **Use agent default** clears both. Pass only the levels the selected model supports, and an empty list for models without reasoning: the Reasoning row disappears. Whenever `reasoning-options` does not include the selected level, `v-model:reasoning` is cleared, including on mount. If the host loads the levels asynchronously, pass `reasoning-loading` while they are loading so a saved level is not cleared before they arrive.
|
|
687
700
|
|
|
688
|
-
The
|
|
701
|
+
The menu defaults to `side="top" align="end"` — always keep those in a real chat UI, where the selector sits at the bottom of the screen. The demo opens downward only to stay inside the preview frame.
|
|
689
702
|
|
|
690
703
|
```vue
|
|
691
704
|
<script setup lang="ts">
|
|
692
705
|
import { TelaChatIconsAnthropic, TelaChatIconsGemini, TelaChatIconsOpenai } from '#components'
|
|
693
706
|
|
|
694
|
-
const selectedModel = ref<string | null>(
|
|
707
|
+
const selectedModel = ref<string | null>('claude-opus-5-5')
|
|
708
|
+
const selectedReasoning = ref<string | null>('high')
|
|
695
709
|
const options = [
|
|
696
|
-
{ value: 'claude-
|
|
697
|
-
{ value: 'claude-
|
|
698
|
-
{ value: 'gpt-5-2', label: 'GPT-5.2',
|
|
699
|
-
{ value: 'gemini-3-pro', label: 'Gemini 3 Pro',
|
|
710
|
+
{ value: 'claude-opus-5-5', label: 'Claude Opus 5.5', icon: TelaChatIconsAnthropic },
|
|
711
|
+
{ value: 'claude-sonnet-5-5', label: 'Claude Sonnet 5.5', icon: TelaChatIconsAnthropic },
|
|
712
|
+
{ value: 'gpt-5-2', label: 'GPT-5.2', icon: TelaChatIconsOpenai },
|
|
713
|
+
{ value: 'gemini-3-pro', label: 'Gemini 3 Pro', icon: TelaChatIconsGemini },
|
|
714
|
+
]
|
|
715
|
+
const reasoningOptions = [
|
|
716
|
+
{ value: 'low', label: 'Low' },
|
|
717
|
+
{ value: 'medium', label: 'Medium' },
|
|
718
|
+
{ value: 'high', label: 'High' },
|
|
719
|
+
{ value: 'xhigh', label: 'Extra high' },
|
|
720
|
+
{ value: 'max', label: 'Max' },
|
|
700
721
|
]
|
|
701
722
|
</script>
|
|
702
723
|
|
|
703
724
|
<template>
|
|
704
|
-
<TelaChatModelSelector
|
|
725
|
+
<TelaChatModelSelector
|
|
726
|
+
v-model="selectedModel"
|
|
727
|
+
v-model:reasoning="selectedReasoning"
|
|
728
|
+
:options="options"
|
|
729
|
+
:reasoning-options="reasoningOptions"
|
|
730
|
+
side="bottom"
|
|
731
|
+
align="start"
|
|
732
|
+
/>
|
|
705
733
|
</template>
|
|
706
734
|
```
|
|
707
735
|
|
|
@@ -1434,7 +1462,7 @@ import { TelaChatIconsAnthropic, TelaChatIconsGemini, TelaChatIconsOpenai } from
|
|
|
1434
1462
|
| `TelaChatPromptInputHints` | Keyboard hint rows (`@` to mention, `/` for actions). |
|
|
1435
1463
|
| `TelaChatSuggestions` / `TelaChatSuggestion` | Suggestion pills for empty states. |
|
|
1436
1464
|
| `TelaChatEmptyState` | Home/empty layout: greeting, content slot, bottom `#input` slot. |
|
|
1437
|
-
| `TelaChatModelSelector` | Model
|
|
1465
|
+
| `TelaChatModelSelector` | Model and reasoning menu (Menubar); options resolved by the host. |
|
|
1438
1466
|
| `TelaChatReasoningStep` | Collapsible reasoning/tool step row with status icon. |
|
|
1439
1467
|
| `TelaChatWidgetCard` | Card shell for tool-call widgets (title, icon, `TelaStatus`). |
|
|
1440
1468
|
| `TelaChatWidgetSources` / `TelaChatWidgetSource` | Reference rows cited by a tool widget (icon, title, domain, optional link). |
|
|
@@ -1623,26 +1651,25 @@ type SuggestionProps = {
|
|
|
1623
1651
|
type ModelOption = {
|
|
1624
1652
|
value: string
|
|
1625
1653
|
label: string
|
|
1626
|
-
|
|
1627
|
-
group?: string
|
|
1654
|
+
triggerLabel?: string // shorter name for the trigger; default: the label without 'Claude '
|
|
1628
1655
|
icon?: string | Component
|
|
1629
|
-
cost?: number
|
|
1630
|
-
maxInputTokens?: number
|
|
1631
|
-
maxOutputTokens?: number
|
|
1632
|
-
isMultiModal?: boolean
|
|
1633
|
-
tabs?: string[]
|
|
1634
1656
|
}
|
|
1635
1657
|
|
|
1636
1658
|
type ModelSelectorProps = {
|
|
1637
1659
|
options: ModelOption[]
|
|
1660
|
+
reasoningOptions?: { value: string, label: string }[] // empty hides the Reasoning row
|
|
1638
1661
|
disabled?: boolean
|
|
1639
|
-
placeholder?: string
|
|
1640
|
-
|
|
1641
|
-
|
|
1662
|
+
placeholder?: string // default: 'Auto'
|
|
1663
|
+
labelModel?: string // default: 'Model'
|
|
1664
|
+
labelReasoning?: string // default: 'Reasoning'
|
|
1665
|
+
labelReasoningDefault?: string // default: 'Default' — shown while reasoning is null
|
|
1666
|
+
labelUseDefault?: string // default: 'Use agent default' — empty string hides the item
|
|
1642
1667
|
side?: 'top' | 'right' | 'bottom' | 'left' // default: 'top' — ALWAYS keep 'top' in real chat UIs
|
|
1643
1668
|
align?: 'start' | 'center' | 'end' // default: 'end' — ALWAYS keep 'end' in real chat UIs
|
|
1669
|
+
sideOffset?: number // default: 6
|
|
1644
1670
|
}
|
|
1645
|
-
// v-model: string | null
|
|
1671
|
+
// v-model: string | null — selected model
|
|
1672
|
+
// v-model:reasoning: string | null — selected reasoning level
|
|
1646
1673
|
```
|
|
1647
1674
|
|
|
1648
1675
|
### Reasoning & Widgets
|
|
@@ -2013,7 +2040,7 @@ Where each primitive lives in `components/tela/chat/`. Component names come from
|
|
|
2013
2040
|
| --- | --- |
|
|
2014
2041
|
| `prompt-input/` | `TelaChatPromptInput` and its parts: textarea, toolbar, tools, action menu, attachments, hints. |
|
|
2015
2042
|
| `chat-prompt-submit-button.vue` | `TelaChatPromptSubmitButton`, the send control. |
|
|
2016
|
-
| `chat-model-selector.vue` | `TelaChatModelSelector`, model
|
|
2043
|
+
| `chat-model-selector.vue` | `TelaChatModelSelector`, model + reasoning menu for the toolbar. |
|
|
2017
2044
|
| `chat-working-indicator.vue` | `TelaChatWorkingIndicator`, running-turn row with elapsed time. |
|
|
2018
2045
|
| `chat-stop-run-button.vue` | `TelaChatStopRunButton`, replaces the prompt input while a turn runs. |
|
|
2019
2046
|
| `chat-animate-enter.vue` | `TelaChatAnimateEnter`, enter/exit preset for swapping the input and stop button. |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<svg viewBox="0 0 24 24" width="16" height="16" fill="
|
|
3
|
-
<path d="
|
|
2
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="#D97757" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M6.70 0 L7.70 0.15 L8.10 0.50 L9.50 3.80 L11.75 8.15 L12.05 9.15 L12.25 9.10 L12.35 7.15 L12.60 5.40 L12.90 1.75 L13.20 1 L13.40 0.75 L13.85 0.45 L14.05 0.40 L14.55 0.60 L15.05 1.30 L14.75 3.60 L14 6.95 L13.75 8.30 L13.80 8.50 L13.95 8.50 L14.30 8.15 L16.90 4.80 L18.65 2.95 L19 2.70 L20 2.70 L20.10 2.80 L20.75 3.80 L20.45 4.90 L17.25 9.05 L16.45 10.55 L16.55 10.65 L16.70 10.65 L19.80 9.95 L23 9.45 L23.75 9.80 L23.85 10.15 L23.60 10.80 L23.45 11 L16.45 12.55 L15.85 12.70 L15.80 12.80 L16 12.90 L17.65 13.05 L19.90 13.05 L22.70 13.30 L23.45 13.75 L23.65 14 L23.90 14.40 L23.85 14.85 L22.70 15.45 L22.45 15.45 L15.90 13.85 L15.75 13.85 L15.65 13.95 L17.05 15.35 L21.30 19.20 L21.40 19.80 L21.15 20.20 L20.75 20.15 L18.45 18.40 L15.90 16.20 L15.70 16.15 L15.65 16.35 L18.45 20.50 L18.55 21.25 L18.55 21.65 L18.45 21.85 L17.80 22.15 L17.15 22 L15.80 20.15 L14.30 17.90 L13.20 15.95 L13.05 16.10 L13 16.40 L12.40 23.10 L12.30 23.40 L12.05 23.65 L11.30 23.90 L10.75 23.45 L10.45 22.80 L10.45 22.65 L11.50 17.80 L11.75 15.90 L11.95 15.30 L11.90 15.25 L11.75 15.25 L11.55 15.45 L8.20 20.10 L6.40 22 L6.05 22.15 L5.30 21.80 L5.40 21.10 L9.50 15.75 L10.40 14.75 L10.55 14.45 L10.40 14.40 L4.15 18.50 L3 18.65 L2.55 18.20 L2.60 17.45 L2.80 17.25 L4.75 15.90 L9.30 13.40 L9.50 13.15 L9.50 13 L9.40 12.90 L5.45 12.80 L1 12.55 L0.55 12.45 L0 11.70 L0.05 11.40 L0.50 11.10 L4.60 11.40 L6.25 11.45 L9.05 11.80 L9.45 11.80 L9.55 11.70 L9.55 11.60 L9.30 11.35 L4.35 8.10 L3.25 7.25 L2.45 6.75 L2 6.20 L1.85 5.20 L2.20 4.80 L2.50 4.50 L3.55 4.60 L9.15 8.90 L9.30 8.90 L9.40 8.80 L7.90 5.90 L5.85 2.50 L5.75 2.20 L5.60 1.60 L5.60 1.10 L6.25 0.15Z" />
|
|
4
4
|
</svg>
|
|
5
5
|
</template>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<svg width="16" height="16" fill="currentColor" fill-rule="evenodd" viewBox="
|
|
2
|
+
<svg width="16" height="16" fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 24A14.304 14.304 0 000 12 14.304 14.304 0 0012 0a14.305 14.305 0 0012 12 14.305 14.305 0 00-12 12" /></svg>
|
|
3
3
|
</template>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="
|
|
2
|
+
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.75 3.75 16.5 16.5"><path fill="currentColor" d="M18.8545 10.5474C19.0334 10.0086 19.0953 9.43791 19.036 8.87334C18.9767 8.30877 18.7977 7.76335 18.5107 7.27352C18.0854 6.53313 17.4359 5.94695 16.6559 5.59949C15.876 5.25202 15.0058 5.16122 14.1709 5.34018C13.6966 4.81256 13.0917 4.41903 12.4172 4.19912C11.7426 3.97922 11.0221 3.94068 10.3279 4.08737C9.63377 4.23406 8.99043 4.56082 8.46252 5.03484C7.93461 5.50885 7.54072 6.11343 7.32041 6.78785C6.76419 6.90191 6.23872 7.13337 5.77912 7.46678C5.31951 7.80018 4.93637 8.22784 4.65528 8.72118C4.2253 9.46033 4.04153 10.3171 4.13054 11.1675C4.21955 12.018 4.57672 12.8181 5.15041 13.4522C4.97086 13.9907 4.90836 14.5614 4.96711 15.1259C5.02586 15.6905 5.2045 16.2361 5.49108 16.726C5.91697 17.4667 6.56703 18.053 7.34755 18.4005C8.12808 18.7479 8.99877 18.8386 9.83415 18.6594C10.211 19.0838 10.674 19.4229 11.1924 19.6541C11.7107 19.8852 12.2724 20.0032 12.8399 20C13.6956 20.0008 14.5295 19.7296 15.2211 19.2256C15.9127 18.7217 16.4263 18.011 16.6877 17.1961C17.2439 17.0819 17.7693 16.8503 18.2289 16.5169C18.6885 16.1835 19.0716 15.7559 19.3529 15.2627C19.7778 14.5247 19.9584 13.6711 19.8689 12.8242C19.7794 11.9773 19.4243 11.1803 18.8545 10.5474ZM12.8399 18.9528C12.139 18.9539 11.4601 18.7082 10.9223 18.2589L11.0169 18.2053L14.2024 16.3665C14.2817 16.32 14.3475 16.2537 14.3934 16.1741C14.4393 16.0944 14.4637 16.0042 14.4642 15.9123V11.421L15.8109 12.2001C15.8175 12.2035 15.8233 12.2084 15.8277 12.2144C15.8321 12.2204 15.835 12.2274 15.8362 12.2348V15.9565C15.8345 16.7507 15.5183 17.5118 14.9567 18.0734C14.3952 18.6349 13.634 18.9511 12.8399 18.9528ZM6.39941 16.2025C6.04793 15.5956 5.92173 14.8842 6.04301 14.1934L6.13768 14.2502L9.32635 16.089C9.40525 16.1353 9.49507 16.1597 9.58655 16.1597C9.67803 16.1597 9.76785 16.1353 9.84675 16.089L13.7419 13.8433V15.3982C13.7416 15.4063 13.7394 15.4142 13.7356 15.4213C13.7317 15.4284 13.7264 15.4345 13.7198 15.4392L10.4933 17.3001C9.8047 17.6968 8.98685 17.804 8.21929 17.5982C7.45173 17.3924 6.7972 16.8905 6.39941 16.2025ZM5.56048 9.26372C5.9144 8.6529 6.47304 8.187 7.13748 7.94852V11.7333C7.13628 11.8248 7.15964 11.9148 7.20513 11.9942C7.25062 12.0735 7.31656 12.1392 7.39608 12.1843L11.2723 14.4205L9.92561 15.1995C9.91833 15.2034 9.9102 15.2054 9.90195 15.2054C9.8937 15.2054 9.88557 15.2034 9.87828 15.1995L6.65808 13.3418C5.97079 12.9435 5.46938 12.2889 5.26366 11.5216C5.05794 10.7543 5.16467 9.93676 5.56048 9.24798V9.26372ZM16.6247 11.8342L12.7358 9.57598L14.0794 8.79998C14.0867 8.79611 14.0948 8.79409 14.1031 8.79409C14.1113 8.79409 14.1195 8.79611 14.1267 8.79998L17.3469 10.6608C17.8393 10.945 18.2407 11.3633 18.5043 11.8669C18.7678 12.3706 18.8826 12.9388 18.8354 13.5053C18.7881 14.0718 18.5806 14.6131 18.2372 15.0661C17.8938 15.5191 17.4286 15.8651 16.8959 16.0637V12.2788C16.8932 12.1876 16.8667 12.0986 16.8191 12.0206C16.7715 11.9427 16.7046 11.8785 16.6247 11.8342ZM17.9651 9.81885L17.8705 9.76205L14.6881 7.90752C14.6088 7.86093 14.5184 7.83637 14.4263 7.83637C14.3343 7.83637 14.2439 7.86093 14.1645 7.90752L10.2726 10.1531V8.59825C10.2718 8.59034 10.2731 8.58236 10.2764 8.57515C10.2798 8.56793 10.285 8.56175 10.2915 8.55725L13.5117 6.69952C14.0053 6.4152 14.5696 6.27728 15.1386 6.30189C15.7077 6.3265 16.258 6.51263 16.7251 6.83851C17.1923 7.16438 17.557 7.61653 17.7766 8.14207C17.9962 8.66761 18.0616 9.24482 17.9652 9.80618L17.9651 9.81885ZM9.53761 12.5753L8.19095 11.7994C8.18421 11.7954 8.17845 11.7899 8.17407 11.7834C8.16969 11.7768 8.16681 11.7694 8.16561 11.7616V8.04945C8.16636 7.47997 8.3292 6.92246 8.63512 6.44212C8.94103 5.96177 9.37736 5.57844 9.89311 5.33694C10.4089 5.09544 10.9827 5.00576 11.5475 5.07837C12.1124 5.15098 12.6449 5.38289 13.0827 5.74698L12.9881 5.80065L9.80261 7.63932C9.72333 7.68582 9.65751 7.75214 9.61161 7.83177C9.56571 7.9114 9.54131 8.0016 9.54081 8.09352L9.53761 12.5753ZM10.2693 10.9984L12.004 9.99852L13.7419 10.9984V12.998L12.0103 13.9978L10.2725 12.998L10.2693 10.9984Z" /></svg>
|
|
3
3
|
</template>
|
|
@@ -11,7 +11,7 @@ const delegatedProps = reactiveOmit(props, 'class')
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<template>
|
|
14
|
-
<ComboboxEmpty v-bind="delegatedProps" :class="cn('py-
|
|
14
|
+
<ComboboxEmpty v-bind="delegatedProps" :class="cn('py-8 text-center text-sm', props.class)">
|
|
15
15
|
<slot />
|
|
16
16
|
</ComboboxEmpty>
|
|
17
17
|
</template>
|
|
@@ -109,24 +109,6 @@ const options = [
|
|
|
109
109
|
/>
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
### Compact vs Non-Compact
|
|
113
|
-
|
|
114
|
-
```vue
|
|
115
|
-
<!-- Compact (default) -->
|
|
116
|
-
<TelaCombobox
|
|
117
|
-
v-model="selected"
|
|
118
|
-
:options="options"
|
|
119
|
-
:compact="true"
|
|
120
|
-
/>
|
|
121
|
-
|
|
122
|
-
<!-- Non-compact with more spacing -->
|
|
123
|
-
<TelaCombobox
|
|
124
|
-
v-model="selected"
|
|
125
|
-
:options="options"
|
|
126
|
-
:compact="false"
|
|
127
|
-
/>
|
|
128
|
-
```
|
|
129
|
-
|
|
130
112
|
### Custom Styling
|
|
131
113
|
|
|
132
114
|
```vue
|
|
@@ -268,7 +250,6 @@ type ComboboxProps = {
|
|
|
268
250
|
size: 'xs' | 'sm' | 'md'
|
|
269
251
|
backgroundClass: string
|
|
270
252
|
}
|
|
271
|
-
compact?: boolean
|
|
272
253
|
align?: 'start' | 'center' | 'end'
|
|
273
254
|
hasGroupingLabels?: boolean
|
|
274
255
|
colorIcon?: string
|
|
@@ -298,8 +279,9 @@ type ComboboxProps = {
|
|
|
298
279
|
labelToClear?: string
|
|
299
280
|
labelClear?: string
|
|
300
281
|
labelMultimodal?: string
|
|
301
|
-
labelInputMax?: string
|
|
302
|
-
labelOutputMax?: string
|
|
282
|
+
labelInputMax?: string // default: 'Input'
|
|
283
|
+
labelOutputMax?: string // default: 'Output'
|
|
284
|
+
labelCost?: string // default: 'Cost' — model table header
|
|
303
285
|
}
|
|
304
286
|
```
|
|
305
287
|
|