@dogsbay/ui 0.2.0-beta.152 → 0.2.0-beta.153

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.152",
3
+ "version": "0.2.0-beta.153",
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.152",
26
- "@dogsbay/primitives": "0.2.0-beta.152",
27
- "@dogsbay/icons": "0.2.0-beta.152"
25
+ "@dogsbay/icons": "0.2.0-beta.153",
26
+ "@dogsbay/primitives": "0.2.0-beta.153",
27
+ "@dogsbay/elements": "0.2.0-beta.153"
28
28
  },
29
29
  "files": [
30
30
  "src",
@@ -57,7 +57,7 @@ function splitCodeBlocks(html: string): Segment[] {
57
57
  }
58
58
  ---
59
59
 
60
- <table class="api-params w-full text-sm border-collapse not-prose">
60
+ <table class="api-params w-full text-sm border-collapse">
61
61
  <thead>
62
62
  <tr class="border-b border-border">
63
63
  <th class="py-3 px-4 text-left font-semibold text-muted-foreground uppercase tracking-wider text-xs w-[140px]">Parameter</th>
@@ -18,7 +18,7 @@ const slug = name.toLowerCase().replace(/[^\w]/g, "-").replace(/-+/g, "-");
18
18
  const HeadingTag = `h${level}` as any;
19
19
  ---
20
20
 
21
- <div class="api-symbol not-prose" data-kind={kind}>
21
+ <div class="api-symbol" data-kind={kind}>
22
22
  <div class="api-symbol-heading">
23
23
  <span class={`api-badge api-badge-${badgeKind}`}>{badgeKind}</span>
24
24
  <HeadingTag id={slug} class="!mt-0 !mb-0 !border-0">
@@ -22,6 +22,11 @@ interface Props {
22
22
  variant?: "sidebar" | "floating" | "inset";
23
23
  collapsible?: "offcanvas" | "icon" | "none";
24
24
  defaultOpen?: boolean;
25
+ /**
26
+ * The sidebar is a navigation landmark (`<nav>`), named by this label, so its content (the
27
+ * site name or logo too) is in a landmark: axe's `region` rule. Default "Sidebar".
28
+ */
29
+ label?: string;
25
30
  class?: string;
26
31
  [key: string]: unknown;
27
32
  }
@@ -31,6 +36,7 @@ const {
31
36
  variant = "sidebar",
32
37
  collapsible = "offcanvas",
33
38
  defaultOpen = true,
39
+ label = "Sidebar",
34
40
  class: className,
35
41
  ...rest
36
42
  } = Astro.props;
@@ -60,7 +66,8 @@ const mobileSideClass = side === "left" ? "left-0" : "right-0";
60
66
  ---
61
67
 
62
68
  {collapsible === "none" ? (
63
- <div
69
+ <nav
70
+ aria-label={label}
64
71
  data-component="sidebar"
65
72
  data-collapsible="none"
66
73
  data-side={side}
@@ -70,7 +77,7 @@ const mobileSideClass = side === "left" ? "left-0" : "right-0";
70
77
  {...rest}
71
78
  >
72
79
  <slot />
73
- </div>
80
+ </nav>
74
81
  ) : (
75
82
  <div
76
83
  data-component="sidebar"
@@ -89,7 +96,8 @@ const mobileSideClass = side === "left" ? "left-0" : "right-0";
89
96
  data-side={side}
90
97
  >
91
98
  <div class={`${sidebarGap()} ${gapIconClass}`} />
92
- <div
99
+ <nav
100
+ aria-label={label}
93
101
  class={`${sidebarContainer()} ${containerVariantClass} ${sideClass} ${className || ""}`}
94
102
  data-side={side}
95
103
  {...rest}
@@ -97,17 +105,19 @@ const mobileSideClass = side === "left" ? "left-0" : "right-0";
97
105
  <div class={`${sidebarInner()} ${innerVariantClass}`} data-sidebar="sidebar-inner">
98
106
  <slot />
99
107
  </div>
100
- </div>
108
+ </nav>
101
109
  </div>
102
110
 
103
111
  {/* Mobile backdrop + sidebar shell (content moved here by JS) */}
104
112
  <div class="fixed inset-0 z-50 bg-black/80" data-sidebar-mobile-backdrop hidden></div>
105
- <div
113
+ {/* A landmark too: the content moves here while it is open */}
114
+ <nav
115
+ aria-label={label}
106
116
  class={`fixed inset-y-0 z-50 flex h-svh w-[18rem] flex-col bg-sidebar p-0 text-sidebar-foreground ${mobileSideClass}`}
107
117
  data-sidebar-mobile
108
118
  data-state="closed"
109
119
  hidden
110
120
  >
111
- </div>
121
+ </nav>
112
122
  </div>
113
123
  )}
@@ -26,7 +26,8 @@ const { class: className, caption, ...rest } = Astro.props;
26
26
  const captionClass = "mb-2 text-left text-sm font-medium text-foreground";
27
27
  ---
28
28
 
29
- <div class={tableContainer()}>
29
+ {/* Focusable, so a table wider than the screen scrolls from the keyboard (axe `scrollable-region-focusable`), as render-html's */}
30
+ <div class={tableContainer()} tabindex="0">
30
31
  <table class={table({ class: className })} {...rest}>
31
32
  {Astro.slots.has("caption") ? (
32
33
  <caption class={captionClass}><slot name="caption" /></caption>