@meistrari/tela-build 1.83.0 → 1.85.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.mdx +1 -1
- package/components/tela/chat/pure-text-input/chat-text-input.vue +6 -0
- package/components/tela/chat/text-input/index.vue +6 -0
- package/components/tela/chat/text-message/index.vue +5 -0
- package/components/tela/collapsible-section-with-actions.vue +2 -2
- package/components/tela/combobox/combobox.vue +4 -0
- package/components/tela/confirm-button/confirm-button.vue +6 -0
- package/components/tela/copy-button.vue +5 -0
- package/components/tela/dialog/dialog.vue +5 -1
- package/components/tela/disclaimer/disclaimer.vue +4 -0
- package/components/tela/file-upload/file-upload.vue +3 -0
- package/components/tela/header/leading/leading-trigger.vue +3 -0
- package/components/tela/header/trailing/pagination/pagination-next-button.vue +3 -0
- package/components/tela/header/trailing/pagination/pagination-prev-button.vue +3 -0
- package/components/tela/header/trailing/trailing-actions.vue +3 -0
- package/components/tela/icon-button/icon-button.mdx +8 -1
- package/components/tela/icon-button/icon-button.vue +3 -0
- package/components/tela/input/input.mdx +1 -1
- package/components/tela/input/input.vue +6 -2
- package/components/tela/modal/modal.mdx +1 -1
- package/components/tela/modal/modal.vue +6 -5
- package/components/tela/multiple-select/multiple-select.vue +3 -0
- package/components/tela/playback-timeline/playback-timeline.vue +1 -0
- package/components/tela/preview/preview-floating-bar.vue +3 -0
- package/components/tela/preview/preview-select-variable.vue +3 -1
- package/components/tela/sheet/sheet-content.vue +3 -0
- package/components/tela/sheet/sheet.client.vue +5 -1
- package/components/tela/side-sheet/side-sheet.vue +5 -1
- package/components/tela/sidebar/sidebar-user.vue +3 -0
- package/components/tela/star-button.vue +4 -0
- package/components/tela/tags/tags-select.vue +16 -0
- package/components/tela/transparent-input.vue +3 -0
- package/components/tela/uploader/uploader-file-list.vue +5 -0
- package/components/tela/uploader/uploader-preview.vue +3 -0
- package/components/tela/uploader/uploader-variable-assignment.vue +5 -1
- package/components/tela/uploader/uploader.vue +5 -1
- package/components/tela/video-player/video-player.mdx +101 -0
- package/components/tela/video-player/video-player.vue +603 -0
- package/composables/tela-labels.ts +69 -0
- package/docs/interfaces.md +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,11 @@ Latest updates and announcements.
|
|
|
8
8
|
|
|
9
9
|
## October 7, 2026
|
|
10
10
|
|
|
11
|
+
- New [Video Player](/components/video-player) (`TelaVideoPlayer`): a video with custom controls for play/pause, volume, scrubbing, playback speed, captions, picture-in-picture and fullscreen, plus keyboard shortcuts. Accessible labels are English by default and translatable through `labels`.
|
|
12
|
+
- [Tags Select](/components/tags) back and edit buttons, [Sheet](/components/sheet) content close buttons, and the [Sidebar](/patterns/sidebar) user menu trigger receive shared translated accessible names automatically.
|
|
13
|
+
- [Uploader](/patterns/uploader) disclosure controls use a single named button with the expanded state.
|
|
14
|
+
- [Input](/components/input) clear buttons and tooltips use the shared translated label unless `clearLabel` is provided.
|
|
15
|
+
- [Tags Select](/components/tags) color buttons expose their selected state. Chat reply controls use a label that stays accurate when expanded or collapsed.
|
|
11
16
|
- [Header](/patterns/header) keeps icon-based step numbers available to screen readers.
|
|
12
17
|
- [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.
|
|
13
18
|
|
|
@@ -86,6 +91,8 @@ Full-bleed viewers that draw their own header (file previews, detail pages) use
|
|
|
86
91
|
|
|
87
92
|
## September 25, 2026
|
|
88
93
|
|
|
94
|
+
- [Icon Button](/components/icon-button) adds a `label` prop, rendered as the button's `aria-label`.
|
|
95
|
+
- Icon-only controls inside Tela Build components now have accessible names: close buttons (Modal, Dialog, Sheet, Side Sheet, Header, Disclaimer), pagination, more-actions menus, copy, favorite, edit, clear, remove, confirm/cancel and the Preview, Uploader, Tags Select, Combobox and chat buttons. Names come from `useTelaLabels()` with English defaults; apps translate them once with `provideTelaLabels()`. Modal, Dialog, Sheet and Side Sheet also accept `closeLabel`.
|
|
89
96
|
- [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.
|
|
90
97
|
|
|
91
98
|
- [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()`.
|
|
@@ -116,6 +116,8 @@ watch(displayMessage, (value) => {
|
|
|
116
116
|
showMentionModal.value = false
|
|
117
117
|
}
|
|
118
118
|
})
|
|
119
|
+
|
|
120
|
+
const labels = useTelaLabels()
|
|
119
121
|
</script>
|
|
120
122
|
|
|
121
123
|
<template>
|
|
@@ -133,6 +135,7 @@ watch(displayMessage, (value) => {
|
|
|
133
135
|
variant="ghost"
|
|
134
136
|
size="sm"
|
|
135
137
|
icon="i-ph-x-circle"
|
|
138
|
+
:label="labels.cancel"
|
|
136
139
|
color="secondary"
|
|
137
140
|
absolute top-8px right-8px
|
|
138
141
|
@click="$emit('cancelReply')"
|
|
@@ -164,6 +167,7 @@ watch(displayMessage, (value) => {
|
|
|
164
167
|
v-if="isSending"
|
|
165
168
|
color="primary"
|
|
166
169
|
icon="i-ph-circle-notch-light"
|
|
170
|
+
:label="labels.sending"
|
|
167
171
|
animate-spin
|
|
168
172
|
:disabled="true"
|
|
169
173
|
/>
|
|
@@ -171,6 +175,7 @@ watch(displayMessage, (value) => {
|
|
|
171
175
|
v-else
|
|
172
176
|
color="primary"
|
|
173
177
|
icon="i-ph-paper-plane-tilt"
|
|
178
|
+
:label="labels.send"
|
|
174
179
|
:disabled="!message.trim()"
|
|
175
180
|
@click="handleSubmit"
|
|
176
181
|
/>
|
|
@@ -179,6 +184,7 @@ watch(displayMessage, (value) => {
|
|
|
179
184
|
<TelaIconButton
|
|
180
185
|
color="primary"
|
|
181
186
|
icon="i-ph-check"
|
|
187
|
+
:label="labels.sent"
|
|
182
188
|
:disabled="true"
|
|
183
189
|
/>
|
|
184
190
|
</template>
|
|
@@ -133,6 +133,8 @@ watch(displayMessage, (value) => {
|
|
|
133
133
|
showMentionModal.value = false
|
|
134
134
|
}
|
|
135
135
|
})
|
|
136
|
+
|
|
137
|
+
const labels = useTelaLabels()
|
|
136
138
|
</script>
|
|
137
139
|
|
|
138
140
|
<template>
|
|
@@ -153,6 +155,7 @@ watch(displayMessage, (value) => {
|
|
|
153
155
|
variant="ghost"
|
|
154
156
|
size="xs"
|
|
155
157
|
icon="i-ph-x-circle"
|
|
158
|
+
:label="labels.cancel"
|
|
156
159
|
color="secondary"
|
|
157
160
|
absolute top-6px right-6px
|
|
158
161
|
@click="$emit('cancelReply')"
|
|
@@ -191,6 +194,7 @@ watch(displayMessage, (value) => {
|
|
|
191
194
|
v-if="isSending"
|
|
192
195
|
color="primary"
|
|
193
196
|
icon="i-ph-circle-notch-light"
|
|
197
|
+
:label="labels.sending"
|
|
194
198
|
animate-spin
|
|
195
199
|
:disabled="true"
|
|
196
200
|
/>
|
|
@@ -198,6 +202,7 @@ watch(displayMessage, (value) => {
|
|
|
198
202
|
v-else
|
|
199
203
|
color="primary"
|
|
200
204
|
icon="i-ph-paper-plane-tilt"
|
|
205
|
+
:label="labels.send"
|
|
201
206
|
:disabled="!message.trim()"
|
|
202
207
|
@click="handleSubmit"
|
|
203
208
|
/>
|
|
@@ -206,6 +211,7 @@ watch(displayMessage, (value) => {
|
|
|
206
211
|
<TelaIconButton
|
|
207
212
|
color="primary"
|
|
208
213
|
icon="i-ph-check"
|
|
214
|
+
:label="labels.sent"
|
|
209
215
|
:disabled="true"
|
|
210
216
|
/>
|
|
211
217
|
</template>
|
|
@@ -146,6 +146,8 @@ watch(isExpandedManually, async () => {
|
|
|
146
146
|
const height = await calculateTotalHeight(props)
|
|
147
147
|
heightValue.value = height
|
|
148
148
|
}, { immediate: true })
|
|
149
|
+
|
|
150
|
+
const labels = useTelaLabels()
|
|
149
151
|
</script>
|
|
150
152
|
|
|
151
153
|
<template>
|
|
@@ -246,6 +248,7 @@ watch(isExpandedManually, async () => {
|
|
|
246
248
|
size="3xs"
|
|
247
249
|
color="secondary"
|
|
248
250
|
icon="i-ph-dots-three-vertical-bold"
|
|
251
|
+
:label="labels.moreActions"
|
|
249
252
|
/>
|
|
250
253
|
</TelaDropdownMenu>
|
|
251
254
|
</div>
|
|
@@ -285,6 +288,8 @@ watch(isExpandedManually, async () => {
|
|
|
285
288
|
size="2xs"
|
|
286
289
|
color="secondary"
|
|
287
290
|
icon="i-ph-caret-down"
|
|
291
|
+
:label="labels.toggleReplies"
|
|
292
|
+
:aria-expanded="slotProps.isExpanded"
|
|
288
293
|
b="0.5px solid gray-300"
|
|
289
294
|
h-24px
|
|
290
295
|
w-24px
|
|
@@ -24,7 +24,7 @@ watch(isOpen, (newVal) => {
|
|
|
24
24
|
<div flex items-center gap-4px :class="titleClass">
|
|
25
25
|
<TelaCollapsibleTrigger class="group" relative flex items-center focus:outline-none>
|
|
26
26
|
<div flex items-center gap-8px>
|
|
27
|
-
<
|
|
27
|
+
<span ml-2px flex>
|
|
28
28
|
<TelaIcon
|
|
29
29
|
name="i-ph-caret-down-bold"
|
|
30
30
|
w-24px h-24px
|
|
@@ -32,7 +32,7 @@ watch(isOpen, (newVal) => {
|
|
|
32
32
|
transition-all ease-in-out
|
|
33
33
|
class="group-data-[state=open]:rotate-180"
|
|
34
34
|
/>
|
|
35
|
-
</
|
|
35
|
+
</span>
|
|
36
36
|
<h5 heading-h5-semibold text-primary>
|
|
37
37
|
{{ title }}
|
|
38
38
|
</h5>
|
|
@@ -424,6 +424,8 @@ watch(innerValue, (raw) => {
|
|
|
424
424
|
emit('select', value)
|
|
425
425
|
emit('update:modelValue', value)
|
|
426
426
|
})
|
|
427
|
+
|
|
428
|
+
const labels = useTelaLabels()
|
|
427
429
|
</script>
|
|
428
430
|
|
|
429
431
|
<template>
|
|
@@ -469,6 +471,7 @@ watch(innerValue, (raw) => {
|
|
|
469
471
|
<template v-if="allowCreate && !isCreating" #deleteSearchValue>
|
|
470
472
|
<TelaIconButton
|
|
471
473
|
icon="i-ph-plus"
|
|
474
|
+
:label="labels.create"
|
|
472
475
|
size="sm"
|
|
473
476
|
color="secondary"
|
|
474
477
|
@click="startCreating"
|
|
@@ -508,6 +511,7 @@ watch(innerValue, (raw) => {
|
|
|
508
511
|
>
|
|
509
512
|
<TelaIconButton
|
|
510
513
|
icon="i-ph-check"
|
|
514
|
+
:label="labels.confirm"
|
|
511
515
|
size="xs"
|
|
512
516
|
:disabled="!createName.trim()"
|
|
513
517
|
@click="confirmCreating"
|
|
@@ -76,6 +76,8 @@ function onCancel() {
|
|
|
76
76
|
clearTimeout(timeoutId.value)
|
|
77
77
|
state.value = 'normal'
|
|
78
78
|
}
|
|
79
|
+
|
|
80
|
+
const labels = useTelaLabels()
|
|
79
81
|
</script>
|
|
80
82
|
|
|
81
83
|
<template>
|
|
@@ -88,12 +90,16 @@ function onCancel() {
|
|
|
88
90
|
<template v-else-if="state === 'confirming'">
|
|
89
91
|
{{ props.confirmMessage }}
|
|
90
92
|
<button
|
|
93
|
+
type="button"
|
|
94
|
+
:aria-label="labels.confirm"
|
|
91
95
|
class="hover:text-positive"
|
|
92
96
|
@click.stop="onConfirm"
|
|
93
97
|
>
|
|
94
98
|
<div i-ph-check-bold text-14px />
|
|
95
99
|
</button>
|
|
96
100
|
<button
|
|
101
|
+
type="button"
|
|
102
|
+
:aria-label="labels.cancel"
|
|
97
103
|
class="hover:text-red-500"
|
|
98
104
|
@click.stop="onCancel"
|
|
99
105
|
>
|
|
@@ -21,6 +21,10 @@ const emit = defineEmits<{
|
|
|
21
21
|
copy: []
|
|
22
22
|
}>()
|
|
23
23
|
|
|
24
|
+
const labels = useTelaLabels()
|
|
25
|
+
const attrs = useAttrs()
|
|
26
|
+
const ariaLabel = computed(() => typeof attrs['aria-label'] === 'string' ? attrs['aria-label'] : labels.value.copy)
|
|
27
|
+
|
|
24
28
|
const showConfirmationIcon = ref(false)
|
|
25
29
|
|
|
26
30
|
const variantStyles = computed(() => ({
|
|
@@ -77,6 +81,7 @@ const transition = {
|
|
|
77
81
|
<button
|
|
78
82
|
v-bind="$attrs"
|
|
79
83
|
type="button"
|
|
84
|
+
:aria-label="ariaLabel"
|
|
80
85
|
flex="~ " items-center justify-center
|
|
81
86
|
ease will-change-transform active:scale-94
|
|
82
87
|
class="group duration-80 transition-[background-color,border-color,color,transform]"
|
|
@@ -22,13 +22,16 @@ const props = withDefaults(defineProps<{
|
|
|
22
22
|
hideHeader?: boolean
|
|
23
23
|
overlayClass?: string
|
|
24
24
|
fullscreen?: boolean
|
|
25
|
+
/** Accessible name for the close button. Defaults to the `close` label from `provideTelaLabels`. */
|
|
26
|
+
closeLabel?: string
|
|
25
27
|
}>(), {
|
|
26
28
|
modalWidth: 'md',
|
|
27
29
|
})
|
|
30
|
+
|
|
28
31
|
const emit = defineEmits<{
|
|
29
32
|
close: []
|
|
30
33
|
}>()
|
|
31
|
-
|
|
34
|
+
const labels = useTelaLabels()
|
|
32
35
|
const open = defineModel<boolean>()
|
|
33
36
|
|
|
34
37
|
watch(open, (value) => {
|
|
@@ -102,6 +105,7 @@ const modalMaxWidth = computed(() => {
|
|
|
102
105
|
<DialogClose as-child>
|
|
103
106
|
<TelaIconButton
|
|
104
107
|
icon="i-ph-x" size="sm" color="secondary" outline-none
|
|
108
|
+
:label="closeLabel ?? labels.close"
|
|
105
109
|
:class="props.compact ? 'p-12px' : 'p-16px'"
|
|
106
110
|
/>
|
|
107
111
|
</DialogClose>
|
|
@@ -28,6 +28,8 @@ const emit = defineEmits<{
|
|
|
28
28
|
close: []
|
|
29
29
|
}>()
|
|
30
30
|
|
|
31
|
+
const labels = useTelaLabels()
|
|
32
|
+
|
|
31
33
|
// Use provided ref or create a local one
|
|
32
34
|
const localVisible = ref(true)
|
|
33
35
|
const isVisible = computed(() => props.visible ?? localVisible)
|
|
@@ -91,6 +93,8 @@ onMounted(() => {
|
|
|
91
93
|
|
|
92
94
|
<button
|
|
93
95
|
v-if="showCloseButton"
|
|
96
|
+
type="button"
|
|
97
|
+
:aria-label="labels.close"
|
|
94
98
|
p-0
|
|
95
99
|
m-0 border-none bg-transparent cursor-pointer flex
|
|
96
100
|
items-center justify-center hover:opacity-70
|
|
@@ -175,6 +175,8 @@ const fileTypesDisplay = computed(() => {
|
|
|
175
175
|
moreTooltip: types.slice(3).join(', '),
|
|
176
176
|
}
|
|
177
177
|
})
|
|
178
|
+
|
|
179
|
+
const telaLabels = useTelaLabels()
|
|
178
180
|
</script>
|
|
179
181
|
|
|
180
182
|
<template>
|
|
@@ -230,6 +232,7 @@ const fileTypesDisplay = computed(() => {
|
|
|
230
232
|
<button
|
|
231
233
|
type="button"
|
|
232
234
|
class="flex-shrink-0 p-1 hover:bg-gray-100 rounded transition-colors"
|
|
235
|
+
:aria-label="telaLabels.remove"
|
|
233
236
|
@click="removeFile(index)"
|
|
234
237
|
>
|
|
235
238
|
<TelaIcon name="i-ph-x-bold" size="12px" class="text-gray-500" />
|
|
@@ -6,11 +6,14 @@ defineProps<{
|
|
|
6
6
|
const emit = defineEmits<{
|
|
7
7
|
(e: 'click'): void
|
|
8
8
|
}>()
|
|
9
|
+
|
|
10
|
+
const labels = useTelaLabels()
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
13
|
<template>
|
|
12
14
|
<TelaIconButton
|
|
13
15
|
icon="i-ph-caret-right-bold"
|
|
16
|
+
:label="labels.next"
|
|
14
17
|
size="md"
|
|
15
18
|
color="secondary"
|
|
16
19
|
:icon-class="disabled ? 'text-icon-subtle' : 'text-icon'"
|
|
@@ -6,11 +6,14 @@ defineProps<{
|
|
|
6
6
|
const emit = defineEmits<{
|
|
7
7
|
(e: 'click'): void
|
|
8
8
|
}>()
|
|
9
|
+
|
|
10
|
+
const labels = useTelaLabels()
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
13
|
<template>
|
|
12
14
|
<TelaIconButton
|
|
13
15
|
icon="i-ph-caret-left-bold"
|
|
16
|
+
:label="labels.previous"
|
|
14
17
|
size="md"
|
|
15
18
|
color="secondary"
|
|
16
19
|
:icon-class="disabled ? 'text-icon-subtle' : 'text-icon'"
|
|
@@ -10,6 +10,8 @@ interface Item {
|
|
|
10
10
|
defineProps<{
|
|
11
11
|
items: Item[]
|
|
12
12
|
}>()
|
|
13
|
+
|
|
14
|
+
const labels = useTelaLabels()
|
|
13
15
|
</script>
|
|
14
16
|
|
|
15
17
|
<template>
|
|
@@ -18,6 +20,7 @@ defineProps<{
|
|
|
18
20
|
size="md"
|
|
19
21
|
color="secondary"
|
|
20
22
|
icon="i-ph-dots-three-bold"
|
|
23
|
+
:label="labels.moreActions"
|
|
21
24
|
button-class="!rounded-12px"
|
|
22
25
|
icon-class="text-neutral-950"
|
|
23
26
|
/>
|
|
@@ -10,6 +10,7 @@ An icon-only button for compact actions (toolbars, modal close buttons, inline c
|
|
|
10
10
|
|
|
11
11
|
- **Never** use `color="primary"` — always `color="secondary"`.
|
|
12
12
|
- The default is `primary`, so **always set `color` explicitly**.
|
|
13
|
+
- **Always pass `label`**. It becomes the button's `aria-label`, the only name a screen reader gets for an icon-only button.
|
|
13
14
|
|
|
14
15
|
## Examples
|
|
15
16
|
|
|
@@ -19,6 +20,7 @@ An icon-only button for compact actions (toolbars, modal close buttons, inline c
|
|
|
19
20
|
<TelaIconButton
|
|
20
21
|
icon="i-ph-gear"
|
|
21
22
|
color="secondary"
|
|
23
|
+
label="Settings"
|
|
22
24
|
/>
|
|
23
25
|
```
|
|
24
26
|
|
|
@@ -27,6 +29,7 @@ An icon-only button for compact actions (toolbars, modal close buttons, inline c
|
|
|
27
29
|
```vue
|
|
28
30
|
<TelaIconButton
|
|
29
31
|
icon="i-ph-x"
|
|
32
|
+
label="Close"
|
|
30
33
|
size="md"
|
|
31
34
|
color="secondary"
|
|
32
35
|
outline-none
|
|
@@ -40,6 +43,7 @@ An icon-only button for compact actions (toolbars, modal close buttons, inline c
|
|
|
40
43
|
```vue
|
|
41
44
|
<TelaIconButton
|
|
42
45
|
icon="i-ph-arrow-up-right"
|
|
46
|
+
label="Open example"
|
|
43
47
|
color="secondary"
|
|
44
48
|
to="https://example.com"
|
|
45
49
|
target="_blank"
|
|
@@ -51,6 +55,7 @@ An icon-only button for compact actions (toolbars, modal close buttons, inline c
|
|
|
51
55
|
```vue
|
|
52
56
|
<TelaIconButton
|
|
53
57
|
icon="i-ph-gear"
|
|
58
|
+
label="Settings"
|
|
54
59
|
color="secondary"
|
|
55
60
|
loading
|
|
56
61
|
/>
|
|
@@ -65,6 +70,7 @@ type IconButtonColor = 'primary' | 'secondary'
|
|
|
65
70
|
type IconButtonProps = {
|
|
66
71
|
color?: IconButtonColor
|
|
67
72
|
icon: string
|
|
73
|
+
label?: string // accessible name, rendered as aria-label
|
|
68
74
|
size?: IconButtonSize
|
|
69
75
|
outline?: boolean
|
|
70
76
|
disabled?: boolean
|
|
@@ -91,4 +97,5 @@ type IconButtonProps = {
|
|
|
91
97
|
## Accessibility
|
|
92
98
|
|
|
93
99
|
- Renders as a `<button>` (or `<NuxtLink>` when `to` is set).
|
|
94
|
-
-
|
|
100
|
+
- Pass `label` so the button has an accessible name (`aria-label`); a tooltip alone doesn't name it.
|
|
101
|
+
- Pass `aria-pressed` / `aria-expanded` as attributes for toggle and disclosure buttons; they fall through to the button.
|
|
@@ -4,6 +4,8 @@ import { NuxtLink } from '#components'
|
|
|
4
4
|
interface Props {
|
|
5
5
|
color?: 'primary' | 'secondary'
|
|
6
6
|
icon: string
|
|
7
|
+
/** Accessible name for the button. Icon-only buttons need one for screen readers. */
|
|
8
|
+
label?: string
|
|
7
9
|
size?: '3xs' | '2xs' | 'xs' | 'sm' | 'md'
|
|
8
10
|
outline?: boolean
|
|
9
11
|
disabled?: boolean
|
|
@@ -101,6 +103,7 @@ onLongPress(
|
|
|
101
103
|
:target="target"
|
|
102
104
|
:class="cn(style, buttonClass)"
|
|
103
105
|
:disabled="!to && disabled"
|
|
106
|
+
:aria-label="label"
|
|
104
107
|
data-allow-mismatch
|
|
105
108
|
>
|
|
106
109
|
<TelaIcon
|
|
@@ -148,7 +148,7 @@ type InputProps = {
|
|
|
148
148
|
disabled?: boolean
|
|
149
149
|
error?: string | false
|
|
150
150
|
showClearButton?: boolean
|
|
151
|
-
clearLabel?: string //
|
|
151
|
+
clearLabel?: string // overrides the shared useTelaLabels().clear label (English fallback: 'Clear')
|
|
152
152
|
tabindex?: number
|
|
153
153
|
autofocus?: boolean
|
|
154
154
|
autocomplete?: 'on' | 'off'
|
|
@@ -26,7 +26,6 @@ const props = withDefaults(defineProps<{
|
|
|
26
26
|
size?: 'sm' | 'md'
|
|
27
27
|
}>(), {
|
|
28
28
|
variant: 'default',
|
|
29
|
-
clearLabel: 'Clear',
|
|
30
29
|
})
|
|
31
30
|
|
|
32
31
|
const emit = defineEmits<{
|
|
@@ -35,6 +34,9 @@ const emit = defineEmits<{
|
|
|
35
34
|
'blur': [string]
|
|
36
35
|
}>()
|
|
37
36
|
|
|
37
|
+
const labels = useTelaLabels()
|
|
38
|
+
const resolvedClearLabel = computed(() => props.clearLabel ?? labels.value.clear)
|
|
39
|
+
|
|
38
40
|
const isTextarea = computed(() => props.type === 'textarea')
|
|
39
41
|
const attributes = computed(() => ({
|
|
40
42
|
type: isTextarea.value ? undefined : props.type,
|
|
@@ -208,7 +210,7 @@ defineExpose({
|
|
|
208
210
|
|
|
209
211
|
<div v-if="showClearButton && modelValue" class="top-60% -translate-y-60%" right-1 absolute>
|
|
210
212
|
<TelaTooltip
|
|
211
|
-
:content="
|
|
213
|
+
:content="resolvedClearLabel"
|
|
212
214
|
>
|
|
213
215
|
<button
|
|
214
216
|
hover:bg="#EBEFF199"
|
|
@@ -216,6 +218,8 @@ defineExpose({
|
|
|
216
218
|
p-4px rounded-full
|
|
217
219
|
class="group"
|
|
218
220
|
tabindex="-1"
|
|
221
|
+
type="button"
|
|
222
|
+
:aria-label="resolvedClearLabel"
|
|
219
223
|
@click="clearContent"
|
|
220
224
|
>
|
|
221
225
|
<TelaIcon name="i-ph-x-circle-light" text="#031E22" op-40 group-hover:op-100 transition />
|
|
@@ -346,7 +346,7 @@ To migrate a modal, replace `modal-width` with `size`, drop `compact`, `hide-div
|
|
|
346
346
|
- Focus is trapped inside the modal and returns to the trigger on close.
|
|
347
347
|
- Escape and outside clicks close the modal unless `prevent-close` is set.
|
|
348
348
|
- `title` and `description` become the dialog's `aria-labelledby` and `aria-describedby`. When the header is hidden, the title still labels the dialog through a visually hidden element.
|
|
349
|
-
- The close button is labelled by `close-label` (
|
|
349
|
+
- The close button is labelled by `close-label` when provided, or the shared `useTelaLabels().close` label (English fallback: `"Close"`).
|
|
350
350
|
- Open and close animations fall back to a fade when the user prefers reduced motion.
|
|
351
351
|
|
|
352
352
|
## Props
|
|
@@ -30,8 +30,6 @@ const props = withDefaults(defineProps<{
|
|
|
30
30
|
description?: string
|
|
31
31
|
/** Blocks Escape, outside clicks and the close button (e.g. while saving). Programmatic closes still work. */
|
|
32
32
|
preventClose?: boolean
|
|
33
|
-
/** Accessible label of the close button. */
|
|
34
|
-
closeLabel?: string
|
|
35
33
|
/** @deprecated Legacy layout only. Use `size`; see the Modal changelog entry. */
|
|
36
34
|
modalWidth?: 'sm' | 'md' | 'lg' | 'xl'
|
|
37
35
|
/** @deprecated Legacy layout only. Use `size`; see the Modal changelog entry. */
|
|
@@ -51,14 +49,16 @@ const props = withDefaults(defineProps<{
|
|
|
51
49
|
smallTitle?: boolean
|
|
52
50
|
titleClass?: string
|
|
53
51
|
hideEnterAnimation?: boolean
|
|
52
|
+
/** Accessible name for the close button. Defaults to the `close` label from `provideTelaLabels`. */
|
|
53
|
+
closeLabel?: string
|
|
54
54
|
}>(), {
|
|
55
|
-
closeLabel: 'Close',
|
|
56
55
|
modalWidth: 'md',
|
|
57
56
|
isCloseIcon: true,
|
|
58
57
|
isCloseIconAbsolute: false,
|
|
59
58
|
smallTitle: false,
|
|
60
59
|
hideEnterAnimation: false,
|
|
61
60
|
})
|
|
61
|
+
|
|
62
62
|
const emit = defineEmits<{
|
|
63
63
|
close: []
|
|
64
64
|
}>()
|
|
@@ -74,6 +74,7 @@ const slots = defineSlots<{
|
|
|
74
74
|
'footer'?: (props: SlotProps) => unknown
|
|
75
75
|
}>()
|
|
76
76
|
|
|
77
|
+
const labels = useTelaLabels()
|
|
77
78
|
const attrs = useAttrs()
|
|
78
79
|
|
|
79
80
|
const isLegacy = computed(() => !props.size)
|
|
@@ -270,7 +271,7 @@ function handleEscapeKeyDown(event: KeyboardEvent) {
|
|
|
270
271
|
<TelaIconButton
|
|
271
272
|
icon="i-ph-x" size="sm" color="secondary" button-class="text-gray-400 hover:text-gray-900"
|
|
272
273
|
:class="cn('p-6px', props.isCloseIconAbsolute && 'absolute right-20px top-20px')"
|
|
273
|
-
:
|
|
274
|
+
:label="closeLabel ?? labels.close"
|
|
274
275
|
:disabled="preventClose"
|
|
275
276
|
/>
|
|
276
277
|
</DialogClose>
|
|
@@ -343,7 +344,7 @@ function handleEscapeKeyDown(event: KeyboardEvent) {
|
|
|
343
344
|
size="md"
|
|
344
345
|
color="secondary"
|
|
345
346
|
button-class="!p-8px !rounded-12px text-icon"
|
|
346
|
-
:
|
|
347
|
+
:label="closeLabel ?? labels.close"
|
|
347
348
|
:disabled="preventClose"
|
|
348
349
|
/>
|
|
349
350
|
</DialogClose>
|
|
@@ -335,6 +335,8 @@ function handleSearchKeydown(e: KeyboardEvent) {
|
|
|
335
335
|
handleDeleteSearchValue()
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
+
|
|
339
|
+
const telaLabels = useTelaLabels()
|
|
338
340
|
</script>
|
|
339
341
|
|
|
340
342
|
<template>
|
|
@@ -390,6 +392,7 @@ function handleSearchKeydown(e: KeyboardEvent) {
|
|
|
390
392
|
<TelaIconButton
|
|
391
393
|
v-if="!readOnly"
|
|
392
394
|
icon="i-ph-trash text-gray-400"
|
|
395
|
+
:label="telaLabels.remove"
|
|
393
396
|
size="xs"
|
|
394
397
|
color="secondary"
|
|
395
398
|
@click.stop.prevent="removeSelection(option.value)"
|
|
@@ -249,6 +249,7 @@ const speeds: PlaybackSpeed[] = [0.5, 1, 2, 4]
|
|
|
249
249
|
:icon="isPlaying ? 'i-ph-pause-fill' : 'i-ph-play-fill'"
|
|
250
250
|
:disabled="totalRangeMs <= 0"
|
|
251
251
|
:title="isPlaying ? resolvedLabels.pause : resolvedLabels.play"
|
|
252
|
+
:label="isPlaying ? resolvedLabels.pause : resolvedLabels.play"
|
|
252
253
|
@click="togglePlay"
|
|
253
254
|
/>
|
|
254
255
|
|
|
@@ -135,6 +135,7 @@ const computedWidthContent = computed(() => {
|
|
|
135
135
|
<template v-if="variant === 'minimal'">
|
|
136
136
|
<TelaTooltipGroupTrigger variant="multiline">
|
|
137
137
|
<button
|
|
138
|
+
:aria-label="barLabels.download"
|
|
138
139
|
w-40px h-40px
|
|
139
140
|
flex
|
|
140
141
|
items-center
|
|
@@ -219,6 +220,7 @@ const computedWidthContent = computed(() => {
|
|
|
219
220
|
<template v-if="actions.handMode">
|
|
220
221
|
<TelaTooltipGroupTrigger variant="multiline">
|
|
221
222
|
<button
|
|
223
|
+
:aria-label="barLabels.handMode"
|
|
222
224
|
w-40px h-40px
|
|
223
225
|
flex
|
|
224
226
|
items-center
|
|
@@ -246,6 +248,7 @@ const computedWidthContent = computed(() => {
|
|
|
246
248
|
</template>
|
|
247
249
|
<TelaTooltipGroupTrigger v-if="actions.fullscreen" variant="multiline">
|
|
248
250
|
<button
|
|
251
|
+
:aria-label="barLabels.fullscreen"
|
|
249
252
|
w-40px h-40px
|
|
250
253
|
flex
|
|
251
254
|
items-center
|
|
@@ -136,6 +136,8 @@ function iconSrc(option: PreviewVariableOption): string {
|
|
|
136
136
|
|
|
137
137
|
return '/files/generic.svg'
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
const telaLabels = useTelaLabels()
|
|
139
141
|
</script>
|
|
140
142
|
|
|
141
143
|
<template>
|
|
@@ -175,7 +177,7 @@ function iconSrc(option: PreviewVariableOption): string {
|
|
|
175
177
|
:display-value="() => ''"
|
|
176
178
|
>
|
|
177
179
|
<template v-if="search.length > 0" #deleteSearchValue>
|
|
178
|
-
<button class="flex items-center justify-center" @mousedown.prevent @click.stop="handleDeleteSearchValue">
|
|
180
|
+
<button type="button" :aria-label="telaLabels.clear" class="flex items-center justify-center" @mousedown.prevent @click.stop="handleDeleteSearchValue">
|
|
179
181
|
<TelaIcon name="i-ph-x-circle" size="16px" class="text-gray-400" />
|
|
180
182
|
</button>
|
|
181
183
|
</template>
|
|
@@ -27,6 +27,8 @@ const props = defineProps<SheetContentProps>()
|
|
|
27
27
|
|
|
28
28
|
const emits = defineEmits<DialogContentEmits>()
|
|
29
29
|
|
|
30
|
+
const labels = useTelaLabels()
|
|
31
|
+
|
|
30
32
|
const delegatedProps = computed(() => {
|
|
31
33
|
const { class: _, side, ...delegated } = props
|
|
32
34
|
|
|
@@ -49,6 +51,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
49
51
|
<slot />
|
|
50
52
|
|
|
51
53
|
<DialogClose
|
|
54
|
+
:aria-label="labels.close"
|
|
52
55
|
class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-800"
|
|
53
56
|
>
|
|
54
57
|
<X class="w-4 h-4 text-muted-foreground" />
|
|
@@ -24,12 +24,16 @@ const props = defineProps<{
|
|
|
24
24
|
hideDividers?: boolean
|
|
25
25
|
overlayClass?: string
|
|
26
26
|
hideCloseButton?: boolean
|
|
27
|
+
/** Accessible name for the close button. Defaults to the `close` label from `provideTelaLabels`. */
|
|
28
|
+
closeLabel?: string
|
|
27
29
|
}>()
|
|
28
30
|
|
|
29
31
|
const emit = defineEmits<{
|
|
30
32
|
close: []
|
|
31
33
|
}>()
|
|
32
34
|
|
|
35
|
+
const labels = useTelaLabels()
|
|
36
|
+
|
|
33
37
|
const attrs = useAttrs()
|
|
34
38
|
|
|
35
39
|
const forwardedAttrs = computed(() => {
|
|
@@ -83,7 +87,7 @@ function handlePointerDownOutside(event: any) {
|
|
|
83
87
|
<DialogDescription />
|
|
84
88
|
</VisuallyHidden>
|
|
85
89
|
<DialogClose v-if="!hideCloseButton" as-child>
|
|
86
|
-
<TelaIconButton absolute right-32px top-32px icon="i-ph-x" size="md" color="secondary" text-18px outline-none rounded-full border="1 bordercolor/80" />
|
|
90
|
+
<TelaIconButton absolute right-32px top-32px icon="i-ph-x" :label="props.closeLabel ?? labels.close" size="md" color="secondary" text-18px outline-none rounded-full border="1 bordercolor/80" />
|
|
87
91
|
</DialogClose>
|
|
88
92
|
|
|
89
93
|
<slot />
|