@meistrari/tela-build 1.83.0 → 1.84.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/components/tela/chat/pure-text-input/chat-text-input.vue +6 -0
  3. package/components/tela/chat/text-input/index.vue +6 -0
  4. package/components/tela/chat/text-message/index.vue +5 -0
  5. package/components/tela/collapsible-section-with-actions.vue +2 -2
  6. package/components/tela/combobox/combobox.vue +4 -0
  7. package/components/tela/confirm-button/confirm-button.vue +6 -0
  8. package/components/tela/copy-button.vue +5 -0
  9. package/components/tela/dialog/dialog.vue +5 -1
  10. package/components/tela/disclaimer/disclaimer.vue +4 -0
  11. package/components/tela/file-upload/file-upload.vue +3 -0
  12. package/components/tela/header/leading/leading-trigger.vue +3 -0
  13. package/components/tela/header/trailing/pagination/pagination-next-button.vue +3 -0
  14. package/components/tela/header/trailing/pagination/pagination-prev-button.vue +3 -0
  15. package/components/tela/header/trailing/trailing-actions.vue +3 -0
  16. package/components/tela/icon-button/icon-button.mdx +8 -1
  17. package/components/tela/icon-button/icon-button.vue +3 -0
  18. package/components/tela/input/input.mdx +1 -1
  19. package/components/tela/input/input.vue +6 -2
  20. package/components/tela/modal/modal.mdx +1 -1
  21. package/components/tela/modal/modal.vue +6 -5
  22. package/components/tela/multiple-select/multiple-select.vue +3 -0
  23. package/components/tela/playback-timeline/playback-timeline.vue +1 -0
  24. package/components/tela/preview/preview-floating-bar.vue +3 -0
  25. package/components/tela/preview/preview-select-variable.vue +3 -1
  26. package/components/tela/sheet/sheet-content.vue +3 -0
  27. package/components/tela/sheet/sheet.client.vue +5 -1
  28. package/components/tela/side-sheet/side-sheet.vue +5 -1
  29. package/components/tela/sidebar/sidebar-user.vue +3 -0
  30. package/components/tela/star-button.vue +4 -0
  31. package/components/tela/tags/tags-select.vue +16 -0
  32. package/components/tela/transparent-input.vue +3 -0
  33. package/components/tela/uploader/uploader-file-list.vue +5 -0
  34. package/components/tela/uploader/uploader-preview.vue +3 -0
  35. package/components/tela/uploader/uploader-variable-assignment.vue +5 -1
  36. package/components/tela/uploader/uploader.vue +5 -1
  37. package/composables/tela-labels.ts +69 -0
  38. package/docs/interfaces.md +7 -0
  39. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@ Latest updates and announcements.
8
8
 
9
9
  ## October 7, 2026
10
10
 
11
+ - [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.
12
+ - [Uploader](/patterns/uploader) disclosure controls use a single named button with the expanded state.
13
+ - [Input](/components/input) clear buttons and tooltips use the shared translated label unless `clearLabel` is provided.
14
+ - [Tags Select](/components/tags) color buttons expose their selected state. Chat reply controls use a label that stays accurate when expanded or collapsed.
11
15
  - [Header](/patterns/header) keeps icon-based step numbers available to screen readers.
12
16
  - [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
17
 
@@ -86,6 +90,8 @@ Full-bleed viewers that draw their own header (file previews, detail pages) use
86
90
 
87
91
  ## September 25, 2026
88
92
 
93
+ - [Icon Button](/components/icon-button) adds a `label` prop, rendered as the button's `aria-label`.
94
+ - 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
95
  - [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
96
 
91
97
  - [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
- <button ml-2px>
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
- </button>
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" />
@@ -2,11 +2,14 @@
2
2
  const emit = defineEmits<{
3
3
  (e: 'click'): void
4
4
  }>()
5
+
6
+ const labels = useTelaLabels()
5
7
  </script>
6
8
 
7
9
  <template>
8
10
  <TelaIconButton
9
11
  icon="i-ph-x"
12
+ :label="labels.close"
10
13
  size="md"
11
14
  color="secondary"
12
15
  icon-class="text-neutral-950"
@@ -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
- - Always pair with a visible label or tooltip so the action is discoverable by screen readers.
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 // default: 'Clear'; pass a translated label from the host app
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="clearLabel"
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` (default `"Close"`); pass a translated string in localized apps.
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
- :aria-label="closeLabel"
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
- :aria-label="closeLabel"
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 />
@@ -14,12 +14,16 @@ defineOptions({
14
14
  defineProps<{
15
15
  overlayClass?: string
16
16
  title?: string
17
+ /** Accessible name for the close button. Defaults to the `close` label from `provideTelaLabels`. */
18
+ closeLabel?: string
17
19
  }>()
18
20
 
19
21
  const emit = defineEmits<{
20
22
  close: []
21
23
  }>()
22
24
 
25
+ const labels = useTelaLabels()
26
+
23
27
  const open = defineModel<boolean>()
24
28
 
25
29
  watch(open, (value) => {
@@ -42,7 +46,7 @@ watch(open, (value) => {
42
46
  v-bind="$attrs"
43
47
  >
44
48
  <DialogClose as-child>
45
- <TelaIconButton absolute right-24px top-24px icon="i-ph-x" size="sm" color="secondary" outline-none />
49
+ <TelaIconButton absolute right-24px top-24px icon="i-ph-x" :label="closeLabel ?? labels.close" size="sm" color="secondary" outline-none />
46
50
  </DialogClose>
47
51
 
48
52
  <div v-if="title" body-16-semibold>
@@ -10,12 +10,15 @@ defineProps<{
10
10
  onClick: () => void
11
11
  }[]
12
12
  }>()
13
+
14
+ const labels = useTelaLabels()
13
15
  </script>
14
16
 
15
17
  <template>
16
18
  <TelaDropdownMenuRoot>
17
19
  <TelaDropdownMenuTrigger as-child>
18
20
  <button
21
+ :aria-label="labels.userMenu"
19
22
  :class="cn('group', image ? 'ring-transparent focus-within:ring-border-strong' : 'ring-border-strong focus-within:ring-border-accent')"
20
23
  rounded-full overflow-hidden ring-0.5px
21
24
  >
@@ -14,6 +14,8 @@ const emit = defineEmits<{
14
14
  'update:modelValue': [boolean]
15
15
  }>()
16
16
 
17
+ const labels = useTelaLabels()
18
+
17
19
  const shouldExplode = ref(false)
18
20
 
19
21
  watch(() => props.modelValue, (newValue, oldValue) => {
@@ -32,6 +34,8 @@ watch(() => props.modelValue, (newValue, oldValue) => {
32
34
  <TelaIconButton
33
35
  :icon="modelValue ? 'i-ph-star-fill' : 'i-ph-star-light'"
34
36
  color="secondary"
37
+ :label="labels.favorite"
38
+ :aria-pressed="modelValue"
35
39
  :size="size"
36
40
  :class="cn(modelValue && 'hover:bg-amber-100!', props.class)"
37
41
  :icon-class="cn('relative z-1', modelValue ? 'text-amber-400!' : (props.inactiveIconClass ?? 'text-neutral-400!'))"
@@ -481,6 +481,8 @@ const SPRING_CONFIG = {
481
481
  } as const
482
482
 
483
483
  updateAllCreatedTags()
484
+
485
+ const labels = useTelaLabels()
484
486
  </script>
485
487
 
486
488
  <template>
@@ -541,6 +543,7 @@ updateAllCreatedTags()
541
543
  <button
542
544
  v-if="allCreatedTags.length > 0"
543
545
  flex items-center justify-center w-24px h-24px rounded-6px hover:bg-muted ml--6px mt--4px duration-40 ease-out
546
+ :aria-label="labels.back"
544
547
  @click="handleBackToTags"
545
548
  >
546
549
  <TelaIcon name="i-ph-arrow-left" size="16px" color="icon" />
@@ -561,6 +564,9 @@ updateAllCreatedTags()
561
564
  <button
562
565
  v-for="color in ALL_COLORS"
563
566
  :key="color"
567
+ type="button"
568
+ :aria-label="labels.selectColor(color)"
569
+ :aria-pressed="selectedColorsForNewTag === color"
564
570
  w-20px h-20px rounded-6px flex items-center justify-center hover:bg-lowered
565
571
  @click="handleSelectColor(color)"
566
572
  >
@@ -585,6 +591,8 @@ updateAllCreatedTags()
585
591
  </h5>
586
592
  <button
587
593
  v-if="props.isEditable"
594
+ type="button"
595
+ :aria-label="labels.create"
588
596
  flex items-center justify-center w-24px h-24px rounded-6px hover:bg-muted mr--4px duration-40 ease-out
589
597
  @click="handleCreateMore"
590
598
  >
@@ -603,6 +611,7 @@ updateAllCreatedTags()
603
611
  <button
604
612
  v-if="props.isEditable"
605
613
  class="group opacity-0 group-hover/tag:opacity-100" flex items-center justify-center w-17px h-17px rounded-5px hover:bg-lowered
614
+ :aria-label="labels.edit"
606
615
  @click.stop="handleEditTag(tag)"
607
616
  >
608
617
  <TelaIcon name="i-ph-pencil-simple" size="12px" color="icon-subtle group-hover:icon" />
@@ -616,6 +625,8 @@ updateAllCreatedTags()
616
625
  <div flex="~ col" gap-4px>
617
626
  <div flex items-center justify-between ml--6px>
618
627
  <button
628
+ type="button"
629
+ :aria-label="labels.back"
619
630
  flex items-center justify-center w-24px h-24px rounded-6px hover:bg-muted duration-40 ease-out
620
631
  @click="cancelEditTag"
621
632
  >
@@ -623,6 +634,8 @@ updateAllCreatedTags()
623
634
  </button>
624
635
 
625
636
  <button
637
+ type="button"
638
+ :aria-label="labels.deleteTag"
626
639
  class="group"
627
640
  flex items-center justify-center w-24px h-24px rounded-6px hover:bg-btn-danger duration-40 ease-out mb--1px mr--5px
628
641
  @click="deleteTag"
@@ -645,6 +658,9 @@ updateAllCreatedTags()
645
658
  <button
646
659
  v-for="color in ALL_COLORS"
647
660
  :key="color"
661
+ type="button"
662
+ :aria-label="labels.selectColor(color)"
663
+ :aria-pressed="editingTagColor === color"
648
664
  w-20px h-20px rounded-6px flex items-center justify-center hover:bg-lowered
649
665
  @click="handleSelectColorForEdit(color)"
650
666
  >
@@ -105,6 +105,8 @@ onMounted(() => {
105
105
  onUnmounted(() => {
106
106
  document.removeEventListener('mousedown', handleClickOutside)
107
107
  })
108
+
109
+ const labels = useTelaLabels()
108
110
  </script>
109
111
 
110
112
  <template>
@@ -144,6 +146,7 @@ onUnmounted(() => {
144
146
  v-if="!isEditing"
145
147
  :size="editIconSize || 'xs'"
146
148
  icon="i-ph-pencil-simple"
149
+ :label="labels.edit"
147
150
  color="secondary"
148
151
  @click="onStartEditing"
149
152
  />
@@ -42,6 +42,8 @@ const emit = defineEmits<{
42
42
  (e: 'moveFile', targetItem: ItemDefinition): void
43
43
  (e: 'addNewItem'): void
44
44
  }>()
45
+
46
+ const labels = useTelaLabels()
45
47
  </script>
46
48
 
47
49
  <template>
@@ -65,6 +67,7 @@ const emit = defineEmits<{
65
67
  size="xs"
66
68
  color="secondary"
67
69
  icon="i-ph-arrows-out-line-horizontal-bold"
70
+ :label="labels.openPreview"
68
71
  icon-class="text-gray-400 transition-all ease-in-out group-hover:text-gray-500"
69
72
  @click="emit('openPreview', fileItem.fileWithStatus.file, fileItem.fileWithStatus.fileUrl, fileItem.variableName)"
70
73
  />
@@ -115,6 +118,7 @@ const emit = defineEmits<{
115
118
  size="sm"
116
119
  color="secondary"
117
120
  icon="i-ph-dots-three-bold"
121
+ :label="labels.moreActions"
118
122
  class="!p-6px"
119
123
  icon-class="text-gray-400 transition-all ease-in-out group-data-[state=open]:text-gray-500 group-hover:text-gray-500"
120
124
  />
@@ -125,6 +129,7 @@ const emit = defineEmits<{
125
129
  size="xs"
126
130
  color="secondary"
127
131
  icon="i-ph-arrow-left-bold"
132
+ :label="labels.back"
128
133
  class="!p-4px"
129
134
  @pointerdown.stop
130
135
  @click.stop="emit('setActiveAction', null)"
@@ -20,6 +20,8 @@ const emit = defineEmits<{
20
20
  (e: 'update:modelValue', value: boolean): void
21
21
  }>()
22
22
 
23
+ const labels = useTelaLabels()
24
+
23
25
  const currentFile = computed<PreviewFile | null>(() => {
24
26
  if (!props.file)
25
27
  return null
@@ -85,6 +87,7 @@ function closeModal() {
85
87
  <template #header-actions>
86
88
  <TelaIconButton
87
89
  icon="i-ph-x"
90
+ :label="labels.close"
88
91
  size="md"
89
92
  color="secondary"
90
93
  button-class="!p-4px"
@@ -62,6 +62,8 @@ function textEditorBindings(variableName: string) {
62
62
  },
63
63
  }
64
64
  }
65
+
66
+ const labels = useTelaLabels()
65
67
  </script>
66
68
 
67
69
  <template>
@@ -76,9 +78,10 @@ function textEditorBindings(variableName: string) {
76
78
  {{ variable.name }}{{ variable.isRequired ? '*' : '' }}
77
79
  </span>
78
80
  </div>
79
- <TelaCollapsibleTrigger class="group">
81
+ <TelaCollapsibleTrigger as-child class="group">
80
82
  <TelaIconButton
81
83
  icon="i-ph-caret-down-bold"
84
+ :label="labels.expand"
82
85
  size="sm"
83
86
  color="secondary"
84
87
  class="!p-3px"
@@ -112,6 +115,7 @@ function textEditorBindings(variableName: string) {
112
115
  size="sm"
113
116
  color="secondary"
114
117
  icon="i-ph-x-bold"
118
+ :label="labels.remove"
115
119
  class="!p-4px"
116
120
  icon-class="text-gray-400"
117
121
  @click.stop="emit('unassignFile', fileWithStatus, variable.name)"
@@ -871,6 +871,8 @@ function updateEditorFilesMap(itemId: string, variableName: string, htmlContent:
871
871
  editorFilesMap.value.set(itemKey, filesMap)
872
872
  })
873
873
  }
874
+
875
+ const labels = useTelaLabels()
874
876
  </script>
875
877
 
876
878
  <template>
@@ -941,12 +943,14 @@ function updateEditorFilesMap(itemId: string, variableName: string, htmlContent:
941
943
  size="sm"
942
944
  color="secondary"
943
945
  icon="i-ph-dots-three-bold"
946
+ :label="labels.moreActions"
944
947
  icon-class="text-gray-400 transition-all ease-in-out group-data-[state=open]:text-gray-500 group-hover:text-gray-500"
945
948
  />
946
949
  </TelaDropdownMenu>
947
- <TelaCollapsibleTrigger class="group">
950
+ <TelaCollapsibleTrigger as-child class="group">
948
951
  <TelaIconButton
949
952
  icon="i-ph-caret-down-bold"
953
+ :label="labels.expand"
950
954
  size="sm"
951
955
  color="secondary"
952
956
  icon-class="text-gray-400 transition-all ease-in-out group-data-[state=open]:rotate-180 group-hover:text-gray-500"
@@ -0,0 +1,69 @@
1
+ import type { ComputedRef, InjectionKey, MaybeRefOrGetter } from 'vue'
2
+ import { computed, inject, provide, toValue } from 'vue'
3
+
4
+ /** Accessible names for icon-only controls. Lookup order: component prop > `provideTelaLabels()` > English default. */
5
+ export interface TelaLabels {
6
+ close: string
7
+ moreActions: string
8
+ userMenu: string
9
+ previous: string
10
+ next: string
11
+ edit: string
12
+ favorite: string
13
+ copy: string
14
+ clear: string
15
+ remove: string
16
+ confirm: string
17
+ cancel: string
18
+ create: string
19
+ send: string
20
+ sending: string
21
+ sent: string
22
+ back: string
23
+ expand: string
24
+ openPreview: string
25
+ play: string
26
+ pause: string
27
+ toggleReplies: string
28
+ deleteTag: string
29
+ selectColor: (color: string) => string
30
+ }
31
+
32
+ export const DEFAULT_TELA_LABELS: TelaLabels = {
33
+ close: 'Close',
34
+ moreActions: 'More actions',
35
+ userMenu: 'User menu',
36
+ previous: 'Previous',
37
+ next: 'Next',
38
+ edit: 'Edit',
39
+ favorite: 'Favorite',
40
+ copy: 'Copy',
41
+ clear: 'Clear',
42
+ remove: 'Remove',
43
+ confirm: 'Confirm',
44
+ cancel: 'Cancel',
45
+ create: 'Create',
46
+ send: 'Send',
47
+ sending: 'Sending',
48
+ sent: 'Sent',
49
+ back: 'Back',
50
+ expand: 'Expand',
51
+ openPreview: 'Open preview',
52
+ play: 'Play',
53
+ pause: 'Pause',
54
+ toggleReplies: 'Replies',
55
+ deleteTag: 'Delete tag',
56
+ selectColor: color => `Select ${color}`,
57
+ }
58
+
59
+ const TELA_LABELS_KEY: InjectionKey<MaybeRefOrGetter<Partial<TelaLabels>>> = Symbol('tela-labels')
60
+
61
+ export function provideTelaLabels(labels: MaybeRefOrGetter<Partial<TelaLabels>>) {
62
+ provide(TELA_LABELS_KEY, labels)
63
+ }
64
+
65
+ export function useTelaLabels(): ComputedRef<TelaLabels> {
66
+ const provided = inject(TELA_LABELS_KEY, {})
67
+
68
+ return computed(() => ({ ...DEFAULT_TELA_LABELS, ...toValue(provided) }))
69
+ }
@@ -212,6 +212,13 @@ This table is the source of truth for layout templates. Rules:
212
212
 
213
213
  - **Never** use `color="primary"` on `TelaIconButton` — always `color="secondary"`
214
214
  - The default is `primary`, so always set it explicitly
215
+ - **Always** pass `label` (translated) — it's the button's `aria-label`
216
+
217
+ ### Accessible names
218
+
219
+ - Every icon-only control needs an accessible name: `label` on `TelaIconButton`, `aria-label` on a raw `<button>`
220
+ - Icon-only controls inside Tela Build components read their names from `useTelaLabels()`, with English defaults. The app translates them once with `provideTelaLabels()` in `app.vue`; add new keys to `TelaLabels` in `composables/tela-labels.ts`, not hardcoded strings
221
+ - Components that expose a specific prop (e.g. `closeLabel` on `TelaModal`, `TelaDialog`, `TelaSheet`, `TelaSideSheet`) let a single usage override the provided name
215
222
 
216
223
  ### Select
217
224
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/tela-build",
3
- "version": "1.83.0",
3
+ "version": "1.84.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "app.config.ts",