@bagelink/vue 1.15.645 → 1.15.649

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.15.645",
4
+ "version": "1.15.649",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -37,6 +37,21 @@ const statusColor = computed(() => (props.status === true ? 'green' : props.stat
37
37
  // Dot scales with the avatar but stays within sane bounds.
38
38
  const dotSize = computed(() => Math.max(7, Math.min(14, Math.round(resolvedSize.value * 0.28))))
39
39
 
40
+ /** Accessible names for the presence dot's known tones. */
41
+ const STATUS_LABELS: Record<string, string> = {
42
+ green: 'Online',
43
+ gray: 'Offline',
44
+ orange: 'Away',
45
+ red: 'Busy',
46
+ }
47
+
48
+ // A bare <span title> is not announced by screen readers, so the dot carries a
49
+ // real accessible name — from `statusTitle` when given, else the tone's meaning.
50
+ const statusLabel = computed(() => {
51
+ if (!statusColor.value) { return '' }
52
+ return props.statusTitle || STATUS_LABELS[statusColor.value] || 'Status'
53
+ })
54
+
40
55
  const radius = computed(() => {
41
56
  if (!props.square) { return '1000px' } // circle (default)
42
57
  if (props.square === true) { return 'var(--bgl-btn-border-radius)' }
@@ -59,14 +74,15 @@ const themed = computed(() => props.color
59
74
  :class="innerClass"
60
75
  :style="{ width: `${resolvedSize}px`, height: `${resolvedSize}px`, borderRadius: radius, ...themed }"
61
76
  >
62
- <Image v-if="src" :src="src" :alt="alt || name" />
77
+ <Image v-if="src" :src="src" :alt="alt ?? name ?? ''" />
63
78
  <Icon v-else-if="icon" :icon="icon" :size="resolvedSize / 40" />
64
79
  <p v-else :style="{ 'line-height': '1', 'font-size': `calc(1.5rem * ${resolvedSize} / 50)` }" class="">
65
80
  {{ (fallback || initials(name || '')).toUpperCase() }}
66
81
  </p>
67
82
  </div>
68
83
  <span
69
- v-if="statusColor" class="avatar-status" :title="statusTitle"
84
+ v-if="statusColor" class="avatar-status" role="img"
85
+ :aria-label="statusLabel" :title="statusLabel"
70
86
  :style="{ width: `${dotSize}px`, height: `${dotSize}px`, background: `var(--bgl-${statusColor})` }"
71
87
  />
72
88
  </div>
@@ -208,7 +208,7 @@ const iconStyle = computed(() => {
208
208
  <span
209
209
  v-if="iconRenderType === 'material'" :key="`material-${iconRender}`" class="bgl_icon-font notranslate"
210
210
  :class="[animateClass, roundClass, roundPairClass, softClass, { 'color-white keep-white': round && !soft && isRawCssColor }]"
211
- :style="iconStyle" translate="no"
211
+ :style="iconStyle" aria-hidden="true" translate="no"
212
212
  >
213
213
  {{ iconRender }}
214
214
  </span>
@@ -225,7 +225,7 @@ const iconStyle = computed(() => {
225
225
  'far': !fill && !isFaBrand,
226
226
  'color-white keep-white': round && !soft && isRawCssColor,
227
227
  },
228
- ]" :style="iconStyle"
228
+ ]" :style="iconStyle" aria-hidden="true"
229
229
  translate="no"
230
230
  />
231
231
  </Transition>