@meistrari/tela-build 1.81.0 → 1.82.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 +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/header/center/center-steps-item.vue +23 -21
- package/components/tela/header/header.mdx +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Latest updates and announcements.
|
|
4
4
|
|
|
5
|
+
## October 7, 2026
|
|
6
|
+
|
|
7
|
+
- [Header](/patterns/header) keeps icon-based step numbers available to screen readers.
|
|
8
|
+
- [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.
|
|
9
|
+
|
|
5
10
|
## October 6, 2026
|
|
6
11
|
|
|
7
12
|
- [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.
|
|
@@ -77,6 +82,8 @@ Full-bleed viewers that draw their own header (file previews, detail pages) use
|
|
|
77
82
|
|
|
78
83
|
## September 25, 2026
|
|
79
84
|
|
|
85
|
+
- [Header](/patterns/header) step numbers use the Phosphor `number-circle-*-bold` icons at 16px, colored `icon` (or `icon-tertiary` when disabled), matching the Figma library. Indexes above 9 keep the drawn ring, now in the same color as the number.
|
|
86
|
+
|
|
80
87
|
- [Radio Group](/components/radio-group) and `TelaRadioButton` share one look: `border-strong` border on `bg` (hover `border-accent` on `bg-subtle`), a 5px `neutral-900` border that pops in with a scale animation when checked, and `border`/`bg-muted` when disabled. `TelaRadioButton` now styles its `disabled` state, and `TelaRadioGroup` generates unique ids with `useId()`.
|
|
81
88
|
|
|
82
89
|
## September 24, 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%;
|
|
@@ -5,35 +5,37 @@ const props = defineProps<{
|
|
|
5
5
|
disabled?: boolean
|
|
6
6
|
}>()
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
// Full icon names are listed so UnoCSS can extract them statically
|
|
9
|
+
const NUMBER_CIRCLE_ICONS = [
|
|
10
|
+
'i-ph-number-circle-zero-bold',
|
|
11
|
+
'i-ph-number-circle-one-bold',
|
|
12
|
+
'i-ph-number-circle-two-bold',
|
|
13
|
+
'i-ph-number-circle-three-bold',
|
|
14
|
+
'i-ph-number-circle-four-bold',
|
|
15
|
+
'i-ph-number-circle-five-bold',
|
|
16
|
+
'i-ph-number-circle-six-bold',
|
|
17
|
+
'i-ph-number-circle-seven-bold',
|
|
18
|
+
'i-ph-number-circle-eight-bold',
|
|
19
|
+
'i-ph-number-circle-nine-bold',
|
|
20
|
+
]
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
ring: 'ring-neutral-700',
|
|
18
|
-
text: 'text-primary',
|
|
19
|
-
}
|
|
20
|
-
})
|
|
22
|
+
const iconName = computed(() => NUMBER_CIRCLE_ICONS[props.index])
|
|
21
23
|
|
|
22
|
-
const
|
|
23
|
-
if (props.disabled) {
|
|
24
|
-
return 'text-tertiary select-none'
|
|
25
|
-
}
|
|
24
|
+
const iconColor = computed(() => props.disabled ? 'text-icon-tertiary' : 'text-icon')
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
})
|
|
26
|
+
const textColor = computed(() => props.disabled ? 'text-tertiary select-none' : 'text-primary')
|
|
29
27
|
</script>
|
|
30
28
|
|
|
31
29
|
<template>
|
|
32
30
|
<div flex items-center gap-6px>
|
|
33
|
-
<div size-16px flex items-center justify-center shrink-0>
|
|
31
|
+
<div size-16px flex items-center justify-center shrink-0 :class="iconColor">
|
|
32
|
+
<template v-if="iconName">
|
|
33
|
+
<TelaIcon :name="iconName" size="16px" aria-hidden="true" />
|
|
34
|
+
<span sr-only>{{ index }}</span>
|
|
35
|
+
</template>
|
|
34
36
|
<div
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
v-else
|
|
38
|
+
size-12px flex items-center justify-center shrink-0 rounded-full ring-1.5px ring-current text-8px leading-none font-800
|
|
37
39
|
>
|
|
38
40
|
<span translate-y="-0.2px">{{ index }}</span>
|
|
39
41
|
</div>
|
|
@@ -208,11 +208,11 @@ Container for step indicators with muted background and 12px gap.
|
|
|
208
208
|
|
|
209
209
|
### TelaHeaderCenterStepsItem
|
|
210
210
|
|
|
211
|
-
Individual step with a numbered circle indicator and label.
|
|
211
|
+
Individual step with a numbered circle indicator and label. Indexes 0–9 render the Phosphor `number-circle-*-bold` icon at 16px (`icon`, or `icon-tertiary` when disabled); higher indexes fall back to a drawn ring with the number.
|
|
212
212
|
|
|
213
213
|
| Prop | Type | Default | Description |
|
|
214
214
|
|------|------|---------|-------------|
|
|
215
|
-
| `index` | `number` | - | Step number displayed in the circle |
|
|
215
|
+
| `index` | `number` | - | Step number displayed in the circle (0–9 use the Phosphor icon) |
|
|
216
216
|
| `label` | `string` | - | Step label text |
|
|
217
217
|
| `disabled` | `boolean` | `false` | Dims the step with tertiary colors |
|
|
218
218
|
|