@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/dist/components/Avatar.vue.d.ts.map +1 -1
- package/dist/components/Icon/Icon.vue.d.ts.map +1 -1
- package/dist/core.css +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.css +1 -1
- package/dist/index.mjs +17 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Avatar.vue +18 -2
- package/src/components/Icon/Icon.vue +2 -2
package/package.json
CHANGED
|
@@ -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
|
|
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"
|
|
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>
|