@dogsbay/ui 0.2.0-beta.124 → 0.2.0-beta.126

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@dogsbay/ui",
3
- "version": "0.2.0-beta.124",
3
+ "version": "0.2.0-beta.126",
4
4
  "description": "Accessible UI components for Astro, inspired by Base UI and shadcn",
5
5
  "type": "module",
6
6
  "exports": {
@@ -22,9 +22,9 @@
22
22
  "katex": "^0.16.47",
23
23
  "maplibre-gl": "^5.24.0",
24
24
  "shiki": "^4.3.1",
25
- "@dogsbay/elements": "0.2.0-beta.124",
26
- "@dogsbay/icons": "0.2.0-beta.124",
27
- "@dogsbay/primitives": "0.2.0-beta.124"
25
+ "@dogsbay/elements": "0.2.0-beta.126",
26
+ "@dogsbay/icons": "0.2.0-beta.126",
27
+ "@dogsbay/primitives": "0.2.0-beta.126"
28
28
  },
29
29
  "files": [
30
30
  "src",
@@ -30,16 +30,20 @@ const initials =
30
30
  .join("")
31
31
  .slice(0, 2)
32
32
  .toUpperCase();
33
+ // The name is on the avatar itself, so it is read whether the image loads, fails or was never given:
34
+ // the initials stand in visually only, and a failed image is hidden with its alt.
35
+ // An author's own aria-label wins (an empty one does not); the role is ours, as in render-html.
36
+ const label = alt ? { role: "img", "aria-label": (rest["aria-label"] as string | undefined) || alt } : {};
33
37
  ---
34
38
 
35
- <span class={avatar({ class: className })} {...rest}>
39
+ <span class={avatar({ class: className })} {...rest} {...label}>
36
40
  {
37
41
  src ? (
38
42
  <>
39
43
  <img
40
44
  class={avatarImage()}
41
45
  src={src}
42
- alt={alt}
46
+ alt=""
43
47
  width="40"
44
48
  height="40"
45
49
  onerror="this.hidden=true;this.nextElementSibling.hidden=false"