@meistrari/tela-build 1.103.1 → 1.104.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 +13 -0
- 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/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Latest updates and announcements.
|
|
4
4
|
|
|
5
|
+
## November 18, 2026
|
|
6
|
+
|
|
7
|
+
- [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.
|
|
8
|
+
|
|
9
|
+
## November 17, 2026
|
|
10
|
+
|
|
11
|
+
- [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.
|
|
12
|
+
- [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`).
|
|
13
|
+
- [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`.
|
|
14
|
+
- [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.
|
|
15
|
+
- [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.
|
|
16
|
+
- [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`).
|
|
17
|
+
|
|
5
18
|
## November 16, 2026
|
|
6
19
|
|
|
7
20
|
- [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.
|
|
@@ -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
|
|
|
@@ -8,6 +8,8 @@ type ComboboxOptions = ComboboxOption[]
|
|
|
8
8
|
|
|
9
9
|
const props = withDefaults(defineProps<{
|
|
10
10
|
modelValue?: string
|
|
11
|
+
/** @deprecated Has no effect: every combobox uses the compact layout. Kept so existing `:compact` usages don't break. */
|
|
12
|
+
compact?: boolean
|
|
11
13
|
fallbackLabel?: string
|
|
12
14
|
placeholder?: string
|
|
13
15
|
inputPlaceholder?: string
|
|
@@ -18,7 +20,6 @@ const props = withDefaults(defineProps<{
|
|
|
18
20
|
size: 'xs' | 'sm' | 'md'
|
|
19
21
|
backgroundClass: string
|
|
20
22
|
}
|
|
21
|
-
compact?: boolean
|
|
22
23
|
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
23
24
|
align?: 'start' | 'center' | 'end'
|
|
24
25
|
hasGroupingLabels?: boolean
|
|
@@ -47,6 +48,7 @@ const props = withDefaults(defineProps<{
|
|
|
47
48
|
labelMultimodal?: string
|
|
48
49
|
labelInputMax?: string
|
|
49
50
|
labelOutputMax?: string
|
|
51
|
+
labelCost?: string
|
|
50
52
|
allowCreate?: boolean
|
|
51
53
|
labelCreate?: string
|
|
52
54
|
labelCreateDescription?: string
|
|
@@ -54,7 +56,6 @@ const props = withDefaults(defineProps<{
|
|
|
54
56
|
labelCreatePlaceholder?: string
|
|
55
57
|
loading?: boolean
|
|
56
58
|
}>(), {
|
|
57
|
-
compact: true,
|
|
58
59
|
align: 'start',
|
|
59
60
|
hasGroupingLabels: true,
|
|
60
61
|
disablePortal: false,
|
|
@@ -75,8 +76,9 @@ const props = withDefaults(defineProps<{
|
|
|
75
76
|
labelToClear: 'to clear',
|
|
76
77
|
labelClear: 'Clear',
|
|
77
78
|
labelMultimodal: 'Multimodal',
|
|
78
|
-
labelInputMax: 'Input
|
|
79
|
-
labelOutputMax: 'Output
|
|
79
|
+
labelInputMax: 'Input',
|
|
80
|
+
labelOutputMax: 'Output',
|
|
81
|
+
labelCost: 'Cost',
|
|
80
82
|
allowCreate: false,
|
|
81
83
|
labelCreate: 'Create new',
|
|
82
84
|
labelCreatePlaceholder: 'Name',
|
|
@@ -127,6 +129,14 @@ const currentOption = computed<ComboboxOption>(() => {
|
|
|
127
129
|
return props.options[0] ?? { label: props.placeholder || props.labelSelect, value: '' }
|
|
128
130
|
})
|
|
129
131
|
|
|
132
|
+
const showTriggerIcon = computed(() => props.labelIconVisible
|
|
133
|
+
&& currentOption.value.value !== ''
|
|
134
|
+
&& Boolean(currentOption.value.icon || currentOption.value.externalIconSrc))
|
|
135
|
+
|
|
136
|
+
function iconScaleClass(option: ComboboxOption) {
|
|
137
|
+
return /^(?:DeepSeek|Gemini)/.test(option.label) ? 'scale-75' : undefined
|
|
138
|
+
}
|
|
139
|
+
|
|
130
140
|
const tabs = computed(() => {
|
|
131
141
|
const allTabs = props.options.reduce((acc, option) => {
|
|
132
142
|
if (option.tabs) {
|
|
@@ -153,7 +163,17 @@ const tabs = computed(() => {
|
|
|
153
163
|
|
|
154
164
|
const hasGroups = computed(() => props.options.some(option => option.group))
|
|
155
165
|
|
|
156
|
-
const
|
|
166
|
+
const showCost = computed(() => props.options.some(option => option.cost !== undefined))
|
|
167
|
+
const showTokens = computed(() => props.options.some(option => option.maxInputTokens || option.maxOutputTokens))
|
|
168
|
+
const isTable = computed(() => showCost.value || showTokens.value)
|
|
169
|
+
|
|
170
|
+
const triggerText = computed(() => {
|
|
171
|
+
const text = currentOption.value.triggerLabel || currentOption.value.label
|
|
172
|
+
|
|
173
|
+
return isTable.value ? text.replace(/^Claude\s+/i, '') : text
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
const hasTabs = computed(() => !isTable.value && props.options.some(option => option.tabs && option.tabs.length > 0))
|
|
157
177
|
|
|
158
178
|
const groupedOptions = computed(() => {
|
|
159
179
|
if (props.loading)
|
|
@@ -202,6 +222,23 @@ const groupedOptions = computed(() => {
|
|
|
202
222
|
|
|
203
223
|
const isEmpty = computed(() => groupedOptions.value.every(group => group.children.length === 0))
|
|
204
224
|
|
|
225
|
+
const noResultsParts = computed(() => {
|
|
226
|
+
const term = search.value.trim()
|
|
227
|
+
|
|
228
|
+
if (!term || !props.labelNoResultsWithSearch)
|
|
229
|
+
return { before: '', search: props.labelNoResults, after: '' }
|
|
230
|
+
|
|
231
|
+
const marker = '\u0000'
|
|
232
|
+
const text = props.labelNoResultsWithSearch(marker)
|
|
233
|
+
|
|
234
|
+
if (!text.includes(marker))
|
|
235
|
+
return { before: '', search: props.labelNoResultsWithSearch(search.value), after: '' }
|
|
236
|
+
|
|
237
|
+
const [before = '', after = ''] = text.split(marker)
|
|
238
|
+
|
|
239
|
+
return { before, search: search.value, after }
|
|
240
|
+
})
|
|
241
|
+
|
|
205
242
|
const showCreateOption = computed(() => props.allowCreate && !isCreating.value && search.value.trim().length > 0 && isEmpty.value)
|
|
206
243
|
|
|
207
244
|
const createOption = computed(() => {
|
|
@@ -305,6 +342,19 @@ function handleFormatNumber(value: number | undefined) {
|
|
|
305
342
|
return value
|
|
306
343
|
}
|
|
307
344
|
|
|
345
|
+
function formatTokens(value?: number) {
|
|
346
|
+
if (!value)
|
|
347
|
+
return '–'
|
|
348
|
+
|
|
349
|
+
if (value >= 1_000_000)
|
|
350
|
+
return `${Number((value / 1_000_000).toFixed(1))}M`
|
|
351
|
+
|
|
352
|
+
if (value >= 1000)
|
|
353
|
+
return `${Math.round(value / 1000)}K`
|
|
354
|
+
|
|
355
|
+
return String(value)
|
|
356
|
+
}
|
|
357
|
+
|
|
308
358
|
function renderCostIndicator(cost: number | undefined) {
|
|
309
359
|
if (cost === undefined)
|
|
310
360
|
return null
|
|
@@ -417,47 +467,38 @@ const labels = useTelaLabels()
|
|
|
417
467
|
<TelaComboboxTrigger
|
|
418
468
|
as="button"
|
|
419
469
|
tabindex="0"
|
|
420
|
-
:class="
|
|
421
|
-
!compact && 'w-full !py-2.5 pl-3 pr-3',
|
|
422
|
-
props.triggerClass,
|
|
423
|
-
)"
|
|
470
|
+
:class="props.triggerClass"
|
|
424
471
|
>
|
|
425
|
-
<div
|
|
426
|
-
<div v-if="
|
|
427
|
-
<
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
:is="currentOption.icon"
|
|
431
|
-
v-else
|
|
432
|
-
:class="cn('shrink-0', (currentOption?.label.startsWith('DeepSeek') || currentOption?.label.startsWith('Gemini')) && 'scale-75')"
|
|
433
|
-
/>
|
|
434
|
-
</div>
|
|
435
|
-
<div v-if="!currentOption?.icon && currentOption?.externalIconSrc">
|
|
436
|
-
<img :src="currentOption.externalIconSrc" :alt="labelModelIconAlt || currentOption?.label" class="w-16px h-16px">
|
|
437
|
-
</div>
|
|
472
|
+
<div class="flex items-center gap-1">
|
|
473
|
+
<div v-if="showTriggerIcon" :class="cn('shrink-0', props.iconClass)">
|
|
474
|
+
<TelaIcon v-if="typeof currentOption.icon === 'string'" :name="currentOption.icon" :color="colorIcon" />
|
|
475
|
+
<Component :is="currentOption.icon" v-else-if="currentOption.icon" :class="iconScaleClass(currentOption)" />
|
|
476
|
+
<img v-else :src="currentOption.externalIconSrc" :alt="labelModelIconAlt || currentOption.label" class="size-16px">
|
|
438
477
|
</div>
|
|
439
478
|
<span :class="cn('truncate text-primary group-data-[state=open]:text-secondary', props.labelClass)">
|
|
440
|
-
{{
|
|
479
|
+
{{ triggerText }}
|
|
441
480
|
</span>
|
|
442
481
|
</div>
|
|
443
482
|
</TelaComboboxTrigger>
|
|
444
483
|
</TelaComboboxAnchor>
|
|
445
|
-
<TelaComboboxList :class="cn('z-999',
|
|
446
|
-
<
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
<
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
484
|
+
<TelaComboboxList :class="cn('z-999', isTable ? 'w-[min(360px,calc(100vw-32px))]' : 'w-440px', props.contentClass)" :disable-portal="props.disablePortal" :side="side" :align="align">
|
|
485
|
+
<div v-if="hasSearchbar" :class="isTable && '[&_span]:pl-16px'">
|
|
486
|
+
<TelaComboboxInput
|
|
487
|
+
v-model="search"
|
|
488
|
+
:placeholder="inputPlaceholder || labelSearchPlaceholder"
|
|
489
|
+
:class="isTable && 'h-40px pl-35px'"
|
|
490
|
+
>
|
|
491
|
+
<template v-if="allowCreate && !isCreating" #deleteSearchValue>
|
|
492
|
+
<TelaIconButton
|
|
493
|
+
icon="i-ph-plus"
|
|
494
|
+
:label="labels.create"
|
|
495
|
+
size="sm"
|
|
496
|
+
color="secondary"
|
|
497
|
+
@click="startCreating"
|
|
498
|
+
/>
|
|
499
|
+
</template>
|
|
500
|
+
</TelaComboboxInput>
|
|
501
|
+
</div>
|
|
461
502
|
<slot name="dropdown-status" />
|
|
462
503
|
<TelaTabsRoot v-if="hasTabs" v-model="selectedTab">
|
|
463
504
|
<TelaTabsList class="sticky z-10 top-0 shrink-0 flex gap-2 w-full">
|
|
@@ -467,19 +508,15 @@ const labels = useTelaLabels()
|
|
|
467
508
|
</TelaTabsTrigger>
|
|
468
509
|
</TelaTabsList>
|
|
469
510
|
</TelaTabsRoot>
|
|
470
|
-
<div :class="cn('
|
|
511
|
+
<div :class="cn('overflow-y-auto no-scrollbar', isTable ? 'max-h-188px pt-6px pb-4px' : ['max-h-262px', hasTabs && 'pt-2'])">
|
|
471
512
|
<div v-if="isCreating || showCreateOption" :class="cn('px-4px pt-4px', isEmpty && 'pb-4px')">
|
|
472
513
|
<div
|
|
473
514
|
v-if="isCreating"
|
|
474
|
-
flex items-center h-36px rounded-12px
|
|
475
|
-
|
|
476
|
-
'outline-solid outline-[1px] outline-offset-[-1px] outline-border',
|
|
477
|
-
!compact && 'px-6px',
|
|
478
|
-
compact ? 'gap-2' : 'gap-1.5',
|
|
479
|
-
)"
|
|
515
|
+
flex items-center h-36px rounded-12px pl-6px pr-4px
|
|
516
|
+
class="outline-solid outline-[1px] outline-offset-[-1px] outline-border gap-2px"
|
|
480
517
|
>
|
|
481
518
|
<div w-5 h-5 shrink-0 flex items-center justify-center>
|
|
482
|
-
<TelaIcon name="i-ph-plus" color="icon-tertiary" />
|
|
519
|
+
<TelaIcon name="i-ph-plus" size="14px" color="icon-tertiary" />
|
|
483
520
|
</div>
|
|
484
521
|
<input
|
|
485
522
|
ref="createInputEl"
|
|
@@ -487,7 +524,7 @@ const labels = useTelaLabels()
|
|
|
487
524
|
:placeholder="labelCreatePlaceholder"
|
|
488
525
|
min-w-0 flex-1 bg-transparent text-primary outline-none
|
|
489
526
|
placeholder:text-tertiary
|
|
490
|
-
|
|
527
|
+
class="body-14-regular"
|
|
491
528
|
@keydown="onCreateKeydown"
|
|
492
529
|
>
|
|
493
530
|
<TelaIconButton
|
|
@@ -503,15 +540,15 @@ const labels = useTelaLabels()
|
|
|
503
540
|
:key="search"
|
|
504
541
|
:value="createOption"
|
|
505
542
|
:text-value="search"
|
|
506
|
-
|
|
543
|
+
class="py-8px pl-6px!"
|
|
507
544
|
@select="(e) => { e.preventDefault(); startCreating() }"
|
|
508
545
|
>
|
|
509
|
-
<div flex items-center min-w-0
|
|
546
|
+
<div flex items-center min-w-0 gap-2px>
|
|
510
547
|
<div w-5 h-5 shrink-0 flex items-center justify-center>
|
|
511
|
-
<TelaIcon name="i-ph-plus" color="icon-tertiary" />
|
|
548
|
+
<TelaIcon name="i-ph-plus" size="14px" color="icon-tertiary" />
|
|
512
549
|
</div>
|
|
513
550
|
<div flex flex-col min-w-0>
|
|
514
|
-
<span
|
|
551
|
+
<span truncate text-tertiary :class="cn('body-14-medium', labelItemClass)">{{ createOption.label }}</span>
|
|
515
552
|
<span v-if="labelCreateDescription" font-normal text-sm leading-none text-tertiary truncate :class="descriptionClass">
|
|
516
553
|
{{ labelCreateDescription }}
|
|
517
554
|
</span>
|
|
@@ -522,14 +559,16 @@ const labels = useTelaLabels()
|
|
|
522
559
|
<slot v-if="loading" name="loading" />
|
|
523
560
|
<TelaComboboxEmpty
|
|
524
561
|
v-else-if="isEmpty && !showCreateOption && !isCreating"
|
|
525
|
-
class="flex flex-col items-center justify-center gap-
|
|
562
|
+
class="flex flex-col items-center justify-center gap-16px px-7"
|
|
526
563
|
>
|
|
527
|
-
<div class="flex flex-col items-center justify-center gap-
|
|
564
|
+
<div class="flex w-full min-w-0 flex-col items-center justify-center gap-8px">
|
|
528
565
|
<TelaIcon name="i-ph-smiley-sad" size="24px" class="text-tertiary" />
|
|
529
|
-
<
|
|
530
|
-
{{
|
|
531
|
-
|
|
532
|
-
|
|
566
|
+
<h4 class="flex max-w-full heading-h4-semibold leading-none">
|
|
567
|
+
<span class="shrink-0 whitespace-pre">{{ noResultsParts.before }}</span>
|
|
568
|
+
<span class="min-w-0 truncate">{{ noResultsParts.search }}</span>
|
|
569
|
+
<span class="shrink-0 whitespace-pre">{{ noResultsParts.after }}</span>
|
|
570
|
+
</h4>
|
|
571
|
+
<span v-if="search.trim()" class="inline-flex items-center gap-1.5 body-12-regular text-secondary">
|
|
533
572
|
{{ labelPress }}
|
|
534
573
|
<div class="flex items-center gap-1">
|
|
535
574
|
<div class="p-2px bg-lowered rounded">
|
|
@@ -549,22 +588,64 @@ const labels = useTelaLabels()
|
|
|
549
588
|
{{ labelClear }}
|
|
550
589
|
</TelaButton>
|
|
551
590
|
</TelaComboboxEmpty>
|
|
552
|
-
<template v-for="group in groupedOptions" :key="group.heading">
|
|
553
|
-
<TelaComboboxGroup :heading="group.heading" :class="revealOptions && 'combobox-reveal'">
|
|
554
|
-
<TelaComboboxLabel v-if="!
|
|
591
|
+
<template v-for="(group, groupIndex) in groupedOptions" :key="group.heading">
|
|
592
|
+
<TelaComboboxGroup :heading="group.heading" :class="cn(revealOptions && 'combobox-reveal', isTable && 'px-4px py-0 [&+&]:mt-4px')">
|
|
593
|
+
<TelaComboboxLabel v-if="isTable" class="flex h-20px items-center gap-24px py-0 pl-12px pr-8px font-semibold !text-10px !leading-12px text-secondary">
|
|
594
|
+
<span class="min-w-0 flex-1 truncate">{{ hasGroupingLabels ? group.heading : '' }}</span>
|
|
595
|
+
<span v-if="groupIndex === 0" class="flex shrink-0 items-center gap-16px">
|
|
596
|
+
<span v-if="showCost" class="w-40px">{{ labelCost }}</span>
|
|
597
|
+
<template v-if="showTokens">
|
|
598
|
+
<span class="w-40px">{{ labelInputMax }}</span>
|
|
599
|
+
<span class="w-40px">{{ labelOutputMax }}</span>
|
|
600
|
+
</template>
|
|
601
|
+
</span>
|
|
602
|
+
</TelaComboboxLabel>
|
|
603
|
+
<TelaComboboxLabel v-else-if="!search.trim() && hasGroupingLabels">
|
|
555
604
|
{{ group.heading }}
|
|
556
605
|
</TelaComboboxLabel>
|
|
557
606
|
<template v-for="item in group.children" :key="item.value">
|
|
558
607
|
<TelaComboboxItem
|
|
608
|
+
v-if="isTable"
|
|
609
|
+
:value="item"
|
|
610
|
+
:text-value="[item.label, item.description].filter(Boolean).join(' ')"
|
|
611
|
+
class="group gap-24px py-8px"
|
|
612
|
+
>
|
|
613
|
+
<span class="flex min-w-0 flex-1 items-center gap-6px">
|
|
614
|
+
<span v-if="item.icon" class="flex size-20px shrink-0 items-center justify-center [&_svg]:!size-15px">
|
|
615
|
+
<TelaIcon v-if="typeof item.icon === 'string'" :name="item.icon" :color="colorIcon" />
|
|
616
|
+
<Component :is="item.icon" v-else />
|
|
617
|
+
</span>
|
|
618
|
+
<img v-else-if="item.externalIconSrc" :src="item.externalIconSrc" :alt="item.label" class="size-20px shrink-0">
|
|
619
|
+
<span class="truncate body-12-semibold text-primary">{{ item.label }}</span>
|
|
620
|
+
</span>
|
|
621
|
+
<span class="flex shrink-0 items-center gap-8px">
|
|
622
|
+
<span v-if="showCost" class="w-48px pr-8px text-10px font-semibold leading-none tracking-[0.5px]">
|
|
623
|
+
<template v-if="item.cost !== undefined">
|
|
624
|
+
<span class="text-primary">{{ renderCostIndicator(item.cost)?.blackSymbols }}</span>
|
|
625
|
+
<span class="text-neutral-300">{{ renderCostIndicator(item.cost)?.graySymbols }}</span>
|
|
626
|
+
</template>
|
|
627
|
+
</span>
|
|
628
|
+
<span
|
|
629
|
+
v-if="showTokens"
|
|
630
|
+
class="flex items-center gap-16px text-11px font-semibold leading-none tracking-normal uppercase"
|
|
631
|
+
:class="item.value === modelValue ? 'text-primary' : 'text-tertiary group-data-[highlighted]:text-primary'"
|
|
632
|
+
>
|
|
633
|
+
<span class="w-40px">{{ formatTokens(item.maxInputTokens) }}</span>
|
|
634
|
+
<span class="w-40px">{{ formatTokens(item.maxOutputTokens) }}</span>
|
|
635
|
+
</span>
|
|
636
|
+
</span>
|
|
637
|
+
</TelaComboboxItem>
|
|
638
|
+
<TelaComboboxItem
|
|
639
|
+
v-else
|
|
559
640
|
:ref="(el) => item.children?.length && setNestedItemRef(item.value, el)"
|
|
560
641
|
:value="item"
|
|
561
|
-
|
|
642
|
+
class="group py-8px"
|
|
562
643
|
@mouseenter="handleItemMouseEnter(item)"
|
|
563
644
|
@select="(e) => item.children?.length && e.preventDefault()"
|
|
564
645
|
>
|
|
565
|
-
<div class="flex items-center">
|
|
566
|
-
<div
|
|
567
|
-
<div v-if="item.icon" class="
|
|
646
|
+
<div class="flex min-w-0 items-center">
|
|
647
|
+
<div class="flex min-w-0 max-w-full w-270px items-center gap-6px">
|
|
648
|
+
<div v-if="item.icon" class="size-20px shrink-0 flex items-center justify-center">
|
|
568
649
|
<TelaIcon
|
|
569
650
|
v-if="typeof item.icon === 'string'" :name="item.icon" :color="colorIcon" :size="iconWithBackground?.size"
|
|
570
651
|
:background-class="iconWithBackground?.backgroundClass"
|
|
@@ -572,27 +653,27 @@ const labels = useTelaLabels()
|
|
|
572
653
|
<Component
|
|
573
654
|
:is="item.icon"
|
|
574
655
|
v-else
|
|
575
|
-
:class="
|
|
656
|
+
:class="iconScaleClass(item)"
|
|
576
657
|
/>
|
|
577
658
|
</div>
|
|
578
659
|
<div v-if="!item.icon && item?.externalIconSrc">
|
|
579
660
|
<img :src="item.externalIconSrc" :alt="item.label" class="w-5 h-5">
|
|
580
661
|
</div>
|
|
581
|
-
<div class="flex flex-col">
|
|
582
|
-
<div class="flex items-center gap-
|
|
583
|
-
<span :class="cn('
|
|
662
|
+
<div class="flex min-w-0 flex-col">
|
|
663
|
+
<div class="flex min-w-0 items-center gap-4px">
|
|
664
|
+
<span :class="cn('truncate body-14-medium', labelItemClass)">{{ item.label }}</span>
|
|
584
665
|
<TelaBadge v-if="item.isMultiModal" variant="filled" class="py-[2px] bg-muted" text-class="leading-none">
|
|
585
666
|
{{ labelMultimodal }}
|
|
586
667
|
</TelaBadge>
|
|
587
668
|
<TelaBadge v-if="item.badge" text-class="leading-none">
|
|
588
669
|
{{ item.badge }}
|
|
589
670
|
</TelaBadge>
|
|
590
|
-
<span v-if="item.cost !== undefined" class="text-10px font-
|
|
671
|
+
<span v-if="item.cost !== undefined" class="text-10px font-semibold ml-1px">
|
|
591
672
|
<span class="text-primary">{{ renderCostIndicator(item.cost)?.blackSymbols }}</span>
|
|
592
673
|
<span class="text-neutral-300">{{ renderCostIndicator(item.cost)?.graySymbols }}</span>
|
|
593
674
|
</span>
|
|
594
675
|
</div>
|
|
595
|
-
<span v-if="item.description" :class="cn('
|
|
676
|
+
<span v-if="item.description" :class="cn('body-12-regular text-balance leading-none text-secondary', descriptionClass)">
|
|
596
677
|
{{ item.description }}
|
|
597
678
|
</span>
|
|
598
679
|
<slot name="tags" :option="item" />
|
|
@@ -617,7 +698,7 @@ const labels = useTelaLabels()
|
|
|
617
698
|
</div>
|
|
618
699
|
</div>
|
|
619
700
|
</div>
|
|
620
|
-
<div class="flex gap-
|
|
701
|
+
<div class="flex gap-8px items-center">
|
|
621
702
|
<TelaIcon v-if="item.children?.length" name="i-ph-caret-right" size="14px" color="icon-tertiary" />
|
|
622
703
|
<TelaComboboxIndicator v-else>
|
|
623
704
|
<TelaIcon name="i-ph-check" size="14px" />
|
|
@@ -637,14 +718,11 @@ const labels = useTelaLabels()
|
|
|
637
718
|
<div
|
|
638
719
|
v-for="child in item.children"
|
|
639
720
|
:key="child.value"
|
|
640
|
-
|
|
641
|
-
'relative flex cursor-pointer select-none justify-between items-center rounded-lg px-2 py-2 text-sm font-medium text-primary outline-none hover:bg-muted',
|
|
642
|
-
!compact && '!px-1.5',
|
|
643
|
-
)"
|
|
721
|
+
class="relative flex cursor-pointer select-none justify-between items-center rounded-8px p-8px body-12-medium text-primary outline-none hover:bg-muted"
|
|
644
722
|
@click.stop="handleChildSelect(child, $event)"
|
|
645
723
|
>
|
|
646
|
-
<div
|
|
647
|
-
<div v-if="child.icon" class="
|
|
724
|
+
<div class="flex items-center gap-8px">
|
|
725
|
+
<div v-if="child.icon" class="size-20px shrink-0 flex items-center justify-center">
|
|
648
726
|
<TelaIcon
|
|
649
727
|
v-if="typeof child.icon === 'string'" :name="child.icon" :color="colorIcon" :size="iconWithBackground?.size"
|
|
650
728
|
:background-class="iconWithBackground?.backgroundClass"
|
|
@@ -652,8 +730,8 @@ const labels = useTelaLabels()
|
|
|
652
730
|
<Component :is="child.icon" v-else />
|
|
653
731
|
</div>
|
|
654
732
|
<div class="flex flex-col">
|
|
655
|
-
<span :class="cn('font-medium truncate max-w-140px
|
|
656
|
-
<span v-if="child.description" :class="cn('
|
|
733
|
+
<span :class="cn('font-medium truncate max-w-140px body-12-semibold', labelItemClass)">{{ child.label }}</span>
|
|
734
|
+
<span v-if="child.description" :class="cn('body-12-regular text-secondary', descriptionClass)">
|
|
657
735
|
{{ child.description }}
|
|
658
736
|
</span>
|
|
659
737
|
</div>
|