@meistrari/tela-build 1.80.0 → 1.81.1
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 +7 -0
- package/components/tela/chat/chat-body.test.ts +82 -0
- package/components/tela/chat/chat-body.vue +7 -3
- package/components/tela/chat/conversation/conversation.test.ts +38 -0
- package/components/tela/chat/conversation/conversation.vue +4 -2
- package/components/tela/date-range-picker.vue +1 -1
- package/components/tela/dropdown-menu/DropdownMenu.vue +1 -1
- package/components/tela/dropdown-menu/DropdownMenuContent.vue +1 -1
- package/components/tela/dropdown-menu/DropdownMenuItem.vue +5 -7
- package/components/tela/header/header.mdx +1 -1
- package/components/tela/header/trailing/trailing-actions.vue +1 -1
- package/components/tela/multiple-select/multiple-select.vue +1 -1
- package/components/tela/sidebar/sidebar-user.vue +1 -1
- package/components/tela/sidebar/sidebar.mdx +1 -1
- package/components/tela/transparent-input.vue +3 -3
- package/css/animations.css +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Latest updates and announcements.
|
|
4
4
|
|
|
5
|
+
## October 7, 2026
|
|
6
|
+
|
|
7
|
+
- [Chat](/templates/chat) bodies and conversations no longer use `:has()` selectors to detect the docked prompt input and to place the scroll fog. `TelaChatBody` sets `data-has-prompt-input` on itself, and `TelaChatConversation` marks its scroll-area viewport with `data-chat-conversation-viewport` and `data-scroll-fog`. Every DOM change inside a long conversation re-tested those selectors; in a 3,000-event transcript this cuts style recalculation per streamed text delta from about 17ms to 4ms. Padding, scrollbar insets, and the fog look the same.
|
|
8
|
+
|
|
5
9
|
## October 6, 2026
|
|
6
10
|
|
|
11
|
+
- [Dropdown Menu](/components/dropdown-menu), [Multiple Select](/components/multiple-select) and Date Range Picker content scale in from their trigger again. They are built on `radix-vue`, which sets `--radix-*-content-transform-origin`, but read the `--reka-*` variable instead and animated from their center.
|
|
12
|
+
- [Dropdown Menu](/components/dropdown-menu) items no longer accept `color="positive"`; leave `color` unset for the default style. `TelaSidebarUser` and [Header](/components/header) trailing actions follow suit, and `TelaSidebarUser` action `color` is now optional.
|
|
13
|
+
- `TelaTransparentInput` input text is lighter (580 → 540), its focus underline uses the `border-strong` token instead of `gray-300`, and errors use `text-error` instead of `red-900`.
|
|
7
14
|
- [Typography](/typography) `body-20-*` (and the `3xl` font size) is tighter: line height 32 → 24px and letter spacing -0.2 → -0.55px.
|
|
8
15
|
|
|
9
16
|
## October 5, 2026
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// @vitest-environment happy-dom
|
|
2
|
+
import { defineComponent, h, nextTick, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
3
|
+
import { mount } from '@vue/test-utils'
|
|
4
|
+
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
5
|
+
import ChatBody from './chat-body.vue'
|
|
6
|
+
|
|
7
|
+
vi.stubGlobal('ref', ref)
|
|
8
|
+
vi.stubGlobal('onMounted', onMounted)
|
|
9
|
+
vi.stubGlobal('onBeforeUnmount', onBeforeUnmount)
|
|
10
|
+
vi.stubGlobal('ResizeObserver', class {
|
|
11
|
+
observe() {}
|
|
12
|
+
unobserve() {}
|
|
13
|
+
disconnect() {}
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
async function flushMutations() {
|
|
17
|
+
await nextTick()
|
|
18
|
+
await new Promise(resolve => setTimeout(resolve, 0))
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function mountChatBody(dock: () => ReturnType<typeof h> | null) {
|
|
22
|
+
const Host = defineComponent({
|
|
23
|
+
setup: () => () => h(ChatBody, null, {
|
|
24
|
+
default: () => [h('div', { 'data-chat-conversation': '' }), dock()],
|
|
25
|
+
}),
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
return mount(Host, { attachTo: document.body })
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe('chat body', () => {
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
document.body.innerHTML = ''
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('marks the body when it docks a prompt input', async () => {
|
|
37
|
+
// Arrange
|
|
38
|
+
const wrapper = mountChatBody(() => h('div', { 'data-chat-prompt-input': '' }))
|
|
39
|
+
|
|
40
|
+
// Act
|
|
41
|
+
await flushMutations()
|
|
42
|
+
|
|
43
|
+
// Assert
|
|
44
|
+
expect(wrapper.get('[data-chat-body]').attributes()).toHaveProperty('data-has-prompt-input')
|
|
45
|
+
wrapper.unmount()
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('marks the body when the prompt input sits inside a composer stack', async () => {
|
|
49
|
+
// Arrange
|
|
50
|
+
const wrapper = mountChatBody(() => h('div', { 'data-chat-composer': '' }, [h('div', { 'data-chat-prompt-input': '' })]))
|
|
51
|
+
|
|
52
|
+
// Act
|
|
53
|
+
await flushMutations()
|
|
54
|
+
|
|
55
|
+
// Assert
|
|
56
|
+
expect(wrapper.get('[data-chat-body]').attributes()).toHaveProperty('data-has-prompt-input')
|
|
57
|
+
wrapper.unmount()
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it('follows the prompt input as it is added and removed', async () => {
|
|
61
|
+
// Arrange
|
|
62
|
+
const showInput = ref(false)
|
|
63
|
+
const wrapper = mountChatBody(() => showInput.value ? h('div', { 'data-chat-prompt-input': '' }) : null)
|
|
64
|
+
await flushMutations()
|
|
65
|
+
expect(wrapper.get('[data-chat-body]').attributes()).not.toHaveProperty('data-has-prompt-input')
|
|
66
|
+
|
|
67
|
+
// Act
|
|
68
|
+
showInput.value = true
|
|
69
|
+
await flushMutations()
|
|
70
|
+
|
|
71
|
+
// Assert
|
|
72
|
+
expect(wrapper.get('[data-chat-body]').attributes()).toHaveProperty('data-has-prompt-input')
|
|
73
|
+
|
|
74
|
+
// Act
|
|
75
|
+
showInput.value = false
|
|
76
|
+
await flushMutations()
|
|
77
|
+
|
|
78
|
+
// Assert
|
|
79
|
+
expect(wrapper.get('[data-chat-body]').attributes()).not.toHaveProperty('data-has-prompt-input')
|
|
80
|
+
wrapper.unmount()
|
|
81
|
+
})
|
|
82
|
+
})
|
|
@@ -17,6 +17,10 @@ let observedInput: HTMLElement | null = null
|
|
|
17
17
|
|
|
18
18
|
function bindInputObserver() {
|
|
19
19
|
const input = rootRef.value?.querySelector<HTMLElement>(DOCK_SELECTOR) ?? null
|
|
20
|
+
// Replaces `[data-chat-body]:has([data-chat-prompt-input])`: every DOM change in a long conversation
|
|
21
|
+
// re-tested that selector, which dominated style recalculation. The dock is or wraps the input.
|
|
22
|
+
const hasPromptInput = !!input && (input.matches('[data-chat-prompt-input]') || !!input.querySelector('[data-chat-prompt-input]'))
|
|
23
|
+
rootRef.value?.toggleAttribute('data-has-prompt-input', hasPromptInput)
|
|
20
24
|
|
|
21
25
|
if (input === observedInput)
|
|
22
26
|
return
|
|
@@ -68,7 +72,7 @@ onBeforeUnmount(() => {
|
|
|
68
72
|
--at-apply: 'pl-18px pr-12px py-16px';
|
|
69
73
|
}
|
|
70
74
|
|
|
71
|
-
[data-chat-body]
|
|
75
|
+
[data-chat-body][data-has-prompt-input] [data-chat-conversation] {
|
|
72
76
|
padding-bottom: calc(var(--chat-input-height, 64px) + 24px);
|
|
73
77
|
}
|
|
74
78
|
|
|
@@ -90,7 +94,7 @@ onBeforeUnmount(() => {
|
|
|
90
94
|
margin: 0 !important;
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
[data-chat-body]
|
|
97
|
+
[data-chat-body][data-has-prompt-input] .chat-conversation-scrollbar {
|
|
94
98
|
top: 8px !important;
|
|
95
99
|
bottom: calc(var(--chat-input-height, 64px) + 16px) !important;
|
|
96
100
|
height: auto !important;
|
|
@@ -100,7 +104,7 @@ onBeforeUnmount(() => {
|
|
|
100
104
|
--at-apply: 'pl-24px pr-16px py-16px';
|
|
101
105
|
}
|
|
102
106
|
|
|
103
|
-
[data-chat-body][data-variant='page']
|
|
107
|
+
[data-chat-body][data-variant='page'][data-has-prompt-input] [data-chat-conversation] {
|
|
104
108
|
padding-bottom: calc(var(--chat-input-height, 64px) + 32px);
|
|
105
109
|
}
|
|
106
110
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// @vitest-environment happy-dom
|
|
2
|
+
import { computed, nextTick, onMounted, ref } from 'vue'
|
|
3
|
+
import { mount } from '@vue/test-utils'
|
|
4
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
5
|
+
import { cn } from '../../../../lib/utils'
|
|
6
|
+
import ScrollArea from '../../scroll-area/scroll-area.vue'
|
|
7
|
+
import Conversation from './conversation.vue'
|
|
8
|
+
|
|
9
|
+
vi.stubGlobal('ref', ref)
|
|
10
|
+
vi.stubGlobal('computed', computed)
|
|
11
|
+
vi.stubGlobal('onMounted', onMounted)
|
|
12
|
+
vi.stubGlobal('nextTick', nextTick)
|
|
13
|
+
|
|
14
|
+
const scrollable = ref(false)
|
|
15
|
+
vi.stubGlobal('useScrollFog', () => ({ fogClass: computed(() => scrollable.value ? 'scroll-fog' : '') }))
|
|
16
|
+
|
|
17
|
+
describe('chat conversation', () => {
|
|
18
|
+
it('marks its scroll-area viewport directly, so the fog needs no `:has()` lookup', async () => {
|
|
19
|
+
// Arrange
|
|
20
|
+
const wrapper = mount(Conversation, {
|
|
21
|
+
props: { scrollArea: true },
|
|
22
|
+
slots: { default: () => 'Messages' },
|
|
23
|
+
global: { components: { TelaScrollArea: ScrollArea }, mocks: { cn } },
|
|
24
|
+
})
|
|
25
|
+
const viewport = () => wrapper.get('[data-reka-scroll-area-viewport]')
|
|
26
|
+
expect(viewport().attributes()).toHaveProperty('data-chat-conversation-viewport')
|
|
27
|
+
expect(viewport().attributes()).not.toHaveProperty('data-scroll-fog')
|
|
28
|
+
|
|
29
|
+
// Act
|
|
30
|
+
scrollable.value = true
|
|
31
|
+
await nextTick()
|
|
32
|
+
|
|
33
|
+
// Assert
|
|
34
|
+
expect(viewport().attributes()).toHaveProperty('data-scroll-fog')
|
|
35
|
+
expect(viewport().find('[data-chat-conversation]').text()).toBe('Messages')
|
|
36
|
+
wrapper.unmount()
|
|
37
|
+
})
|
|
38
|
+
})
|
|
@@ -59,6 +59,8 @@ const { fogClass } = useScrollFog(fogTarget, () => {
|
|
|
59
59
|
class="flex-1 min-h-0"
|
|
60
60
|
:class="[fogClass]"
|
|
61
61
|
scroll-thumb-class="chat-conversation-scrollbar"
|
|
62
|
+
data-chat-conversation-viewport
|
|
63
|
+
:data-scroll-fog="fogClass ? '' : undefined"
|
|
62
64
|
>
|
|
63
65
|
<div ref="contentRef" data-chat-conversation>
|
|
64
66
|
<slot />
|
|
@@ -78,7 +80,7 @@ const { fogClass } = useScrollFog(fogTarget, () => {
|
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
.scroll-fog[data-chat-conversation],
|
|
81
|
-
|
|
83
|
+
[data-chat-conversation-viewport][data-scroll-fog] {
|
|
82
84
|
--chat-fog-size: 28px;
|
|
83
85
|
mask: linear-gradient(
|
|
84
86
|
to bottom,
|
|
@@ -90,7 +92,7 @@ const { fogClass } = useScrollFog(fogTarget, () => {
|
|
|
90
92
|
/* Where scroll-driven animations exist, the fog retracts over the last 28px of scroll. */
|
|
91
93
|
@supports (animation-timeline: scroll()) {
|
|
92
94
|
.scroll-fog[data-chat-conversation],
|
|
93
|
-
|
|
95
|
+
[data-chat-conversation-viewport][data-scroll-fog] {
|
|
94
96
|
animation: fog-retract both linear;
|
|
95
97
|
animation-timeline: scroll(self);
|
|
96
98
|
animation-range: calc(100% - 28px) 100%;
|
|
@@ -115,7 +115,7 @@ const defaultLabel = computed(() => {
|
|
|
115
115
|
rounded-xl
|
|
116
116
|
bg-white
|
|
117
117
|
shadow-lg
|
|
118
|
-
class="popover-enter-exit origin-[var(--
|
|
118
|
+
class="popover-enter-exit origin-[var(--radix-popover-content-transform-origin)] will-change-[transform,opacity]"
|
|
119
119
|
>
|
|
120
120
|
<DateRangePickerArrow fill-white />
|
|
121
121
|
<DateRangePickerCalendar
|
|
@@ -16,7 +16,7 @@ const props = withDefaults(defineProps<{
|
|
|
16
16
|
iconSide?: 'left' | 'right'
|
|
17
17
|
trailingIcon?: string
|
|
18
18
|
group?: string
|
|
19
|
-
color?: '
|
|
19
|
+
color?: 'caution' | 'negative'
|
|
20
20
|
click: () => void
|
|
21
21
|
disabled?: boolean
|
|
22
22
|
preventClose?: boolean
|
|
@@ -30,7 +30,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
30
30
|
<DropdownMenuContent
|
|
31
31
|
:data-tela-escape-layer="escapeLayer ? '' : undefined"
|
|
32
32
|
v-bind="forwarded"
|
|
33
|
-
:class="cn('DropdownMenuContent popover-enter-exit origin-[var(--
|
|
33
|
+
:class="cn('DropdownMenuContent popover-enter-exit origin-[var(--radix-dropdown-menu-content-transform-origin)] z-50 min-w-60 overflow-hidden rounded-2xl border-[0.5px] border-gray-300 bg-white-1000 p-1 shadow-sm', props.class)"
|
|
34
34
|
>
|
|
35
35
|
<slot />
|
|
36
36
|
</DropdownMenuContent>
|
|
@@ -17,7 +17,7 @@ const props = defineProps<DropdownMenuItemProps & {
|
|
|
17
17
|
size?: string
|
|
18
18
|
backgroundClass?: string
|
|
19
19
|
}
|
|
20
|
-
color?: '
|
|
20
|
+
color?: 'caution' | 'negative'
|
|
21
21
|
checkbox?: {
|
|
22
22
|
modelValue: boolean
|
|
23
23
|
onChange: (value: boolean) => void
|
|
@@ -27,8 +27,7 @@ const props = defineProps<DropdownMenuItemProps & {
|
|
|
27
27
|
|
|
28
28
|
function getItemClasses(color?: typeof props.color) {
|
|
29
29
|
const itemClasses: Record<string, string> = {
|
|
30
|
-
default: 'focus:bg-
|
|
31
|
-
positive: 'focus:bg-gray-100 text-positive',
|
|
30
|
+
default: 'focus:bg-muted text-primary',
|
|
32
31
|
caution: 'focus:bg-amber-50 text-amber-500',
|
|
33
32
|
negative: 'focus:bg-red-100 text-red-500',
|
|
34
33
|
}
|
|
@@ -38,8 +37,7 @@ function getItemClasses(color?: typeof props.color) {
|
|
|
38
37
|
|
|
39
38
|
function getIconClasses(color?: typeof props.color) {
|
|
40
39
|
const iconClasses: Record<string, string> = {
|
|
41
|
-
default: 'text-
|
|
42
|
-
positive: 'text-positive',
|
|
40
|
+
default: 'text-icon-secondary',
|
|
43
41
|
caution: 'text-caution',
|
|
44
42
|
negative: 'text-red-500',
|
|
45
43
|
}
|
|
@@ -104,7 +102,7 @@ const isIconImage = computed(() => {
|
|
|
104
102
|
:class="cn(
|
|
105
103
|
'group outline-none',
|
|
106
104
|
'relative flex gap-10px cursor-pointer select-none items-center rounded-xl px-3 py-1.5',
|
|
107
|
-
'text-body-14-medium font-460 outline-none focus:bg-
|
|
105
|
+
'text-body-14-medium font-460 outline-none focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-40',
|
|
108
106
|
inset && 'pl-8',
|
|
109
107
|
props.class,
|
|
110
108
|
)"
|
|
@@ -125,7 +123,7 @@ const isIconImage = computed(() => {
|
|
|
125
123
|
:class="cn(
|
|
126
124
|
'group outline-none',
|
|
127
125
|
'relative flex gap-10px cursor-pointer select-none items-center rounded-xl px-3 py-1.5',
|
|
128
|
-
'outline-none focus:bg-
|
|
126
|
+
'outline-none focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-40',
|
|
129
127
|
getItemClasses(props.color),
|
|
130
128
|
inset && 'pl-8',
|
|
131
129
|
props.class,
|
|
@@ -484,7 +484,7 @@ function handleSearchKeydown(e: KeyboardEvent) {
|
|
|
484
484
|
|
|
485
485
|
<SelectPortal>
|
|
486
486
|
<SelectContent
|
|
487
|
-
class="SelectContent popover-enter-exit origin-[var(--
|
|
487
|
+
class="SelectContent popover-enter-exit origin-[var(--radix-select-content-transform-origin)] bg-white rounded-10px"
|
|
488
488
|
flying-shadow
|
|
489
489
|
b="0.5px border" overflow-hidden
|
|
490
490
|
:side-offset="4"
|
|
@@ -130,7 +130,7 @@ onUnmounted(() => {
|
|
|
130
130
|
:disabled="disabled || (displayIcon && !isEditing)"
|
|
131
131
|
bg-transparent
|
|
132
132
|
:class="[
|
|
133
|
-
{ 'font-
|
|
133
|
+
{ 'font-540 text-18px': !disableDefaultStyling },
|
|
134
134
|
disabled ? 'opacity-50 cursor-not-allowed' : '',
|
|
135
135
|
inputClass,
|
|
136
136
|
]"
|
|
@@ -151,13 +151,13 @@ onUnmounted(() => {
|
|
|
151
151
|
<div
|
|
152
152
|
v-if="isEditing"
|
|
153
153
|
absolute
|
|
154
|
-
class="bg-
|
|
154
|
+
class="bg-border-strong"
|
|
155
155
|
op-0
|
|
156
156
|
left-0 right-0 bottom--2px h-1px
|
|
157
157
|
group-focus-within:op-100
|
|
158
158
|
transition
|
|
159
159
|
/>
|
|
160
|
-
<div v-if="error" top-2.5rem absolute font-medium text-
|
|
160
|
+
<div v-if="error" top-2.5rem absolute font-medium text-error text-8px bottom--12px flex items-center gap-3px whitespace-nowrap>
|
|
161
161
|
<div i-ph-info />
|
|
162
162
|
<span>{{ error }}</span>
|
|
163
163
|
</div>
|
package/css/animations.css
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Shared enter/exit animation for anchored overlay content (popover, combobox,
|
|
3
3
|
* select menu, dropdown, menubar). Add `popover-enter-exit` to the content
|
|
4
4
|
* element with an `origin-[var(--reka-*-content-transform-origin)]` class so
|
|
5
|
-
* the scale animates from the anchor side.
|
|
5
|
+
* the scale animates from the anchor side. Components built on `radix-vue`
|
|
6
|
+
* read `--radix-*-content-transform-origin` instead.
|
|
6
7
|
*/
|
|
7
8
|
.popover-enter-exit[data-state="open"] {
|
|
8
9
|
animation: slideDownAndFade 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|