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

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.122",
3
+ "version": "0.2.0-beta.124",
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.122",
26
- "@dogsbay/icons": "0.2.0-beta.122",
27
- "@dogsbay/primitives": "0.2.0-beta.122"
25
+ "@dogsbay/elements": "0.2.0-beta.124",
26
+ "@dogsbay/icons": "0.2.0-beta.124",
27
+ "@dogsbay/primitives": "0.2.0-beta.124"
28
28
  },
29
29
  "files": [
30
30
  "src",
@@ -32,6 +32,8 @@ export type BadgeVariant = keyof typeof BADGE_VARIANTS;
32
32
 
33
33
  /** The class list for a variant; an unknown variant gets the base classes only. */
34
34
  export function badgeClass(variant: string | undefined): string {
35
- const v = BADGE_VARIANTS[(variant ?? "default") as BadgeVariant];
35
+ // Own keys only: `toString` or `__proto__` must not read Object.prototype
36
+ const key = variant ?? "default";
37
+ const v = Object.prototype.hasOwnProperty.call(BADGE_VARIANTS, key) ? BADGE_VARIANTS[key as BadgeVariant] : undefined;
36
38
  return v ? `${BADGE_BASE} ${v}` : BADGE_BASE;
37
39
  }
@@ -3,7 +3,8 @@ import { tv } from "tailwind-variants";
3
3
  import Icon from "../icon/Icon.astro";
4
4
 
5
5
  const linkCard = tv({
6
- base: "group flex flex-col gap-1 rounded-lg border bg-card p-4 text-card-foreground shadow-sm transition-colors hover:bg-accent/50",
6
+ // not-prose: the page's link underline would otherwise run under every line of the card
7
+ base: "not-prose group flex flex-col gap-1 rounded-lg border bg-card p-4 text-card-foreground no-underline shadow-sm transition-colors hover:bg-accent/50",
7
8
  });
8
9
 
9
10
  const linkCardTitle = tv({
@@ -55,10 +55,10 @@ const embedUrl = `https://${domain}/embed/${id}?autoplay=1${params ? "&" + param
55
55
  tabindex="0"
56
56
  aria-label={`Play: ${title}`}
57
57
  >
58
- {/* Thumbnail */}
58
+ {/* Thumbnail: decorative, the button's label already says "Play: <title>" (axe image-redundant-alt) */}
59
59
  <img
60
60
  src={posterUrl}
61
- alt={title}
61
+ alt=""
62
62
  loading="lazy"
63
63
  class="absolute inset-0 h-full w-full object-cover transition-opacity duration-300 group-hover/yt:opacity-80"
64
64
  />