@hubpav/hwio-ui 0.7.0 → 0.7.2

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": "@hubpav/hwio-ui",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "HARDWARIO web design system for Astro: DaisyUI 5 themes generated from the brand tokens, the Tailwind entry stylesheet and the HWio* components.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,10 +31,10 @@
31
31
  "build": "node scripts/build-themes.mjs"
32
32
  },
33
33
  "dependencies": {
34
- "@hubpav/hwio-brand": "0.7.0",
35
- "@hubpav/hwio-web-runtime": "0.7.0",
36
- "@hubpav/hwio-web-worker": "0.7.0",
37
- "daisyui": "5.7.28"
34
+ "@hubpav/hwio-brand": "0.7.2",
35
+ "@hubpav/hwio-web-runtime": "0.7.2",
36
+ "@hubpav/hwio-web-worker": "0.7.2",
37
+ "daisyui": "5.7.47"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "astro": "^7.0.0",
@@ -3,6 +3,11 @@
3
3
  * Sticky site header: logo slot, primary nav (flat links, or mega items whose `mega:<key>` slot opens as a
4
4
  * full-width panel under the bar), CTAs, language switcher, theme toggle, and a DaisyUI drawer for small
5
5
  * screens, where a mega item lists its `children` as a collapsible group instead.
6
+ *
7
+ * The drawer is opened and closed by real buttons (`data-hwio-drawer-toggle`), so Enter and Space work; the
8
+ * nav runtime keeps the checkbox, `aria-expanded` and focus in sync (into the panel on open, back to the
9
+ * trigger on close, Escape closes). Below `sm` the bar drops the language dropdown (the drawer carries the
10
+ * pills), so logo, theme toggle and the 48 px trigger fit a 320 px viewport without horizontal overflow.
6
11
  */
7
12
  import type { HWioCta, HWioLinkItem } from '../types';
8
13
  import HWioButton from './HWioButton.astro';
@@ -63,7 +68,7 @@ const linkAttrs = (item: HWioLinkItem) => (item.external ? { target: '_blank', r
63
68
 
64
69
  <div class="ml-auto flex items-center gap-2">
65
70
  {showThemeToggle && <HWioThemeToggle label={labels.theme ?? 'Theme'} />}
66
- {languages.length > 1 && <HWioLanguageSwitcher items={languages} label={labels.languages ?? 'Language'} />}
71
+ {languages.length > 1 && <HWioLanguageSwitcher items={languages} label={labels.languages ?? 'Language'} class="max-sm:hidden" />}
67
72
  <div class={bp.ctas}>
68
73
  {ctas.map((cta) => (
69
74
  <HWioButton href={cta.href} external={cta.external} variant={CTA_VARIANT[cta.variant ?? 'primary']} size="sm" track={cta.track ?? { id: 'header-cta', location: 'header' }} class={cta.icon ? '2xl:px-4 px-2.5' : ''} aria-label={cta.icon ? cta.label : undefined} title={cta.icon ? cta.label : undefined}>
@@ -73,17 +78,18 @@ const linkAttrs = (item: HWioLinkItem) => (item.external ? { target: '_blank', r
73
78
  ))}
74
79
  </div>
75
80
  <div class={bp.drawer}>
76
- <input id={id} type="checkbox" class="drawer-toggle" />
81
+ {/* The checkbox only drives DaisyUI's CSS; the buttons are the controls, so it leaves the tab order and the a11y tree. */}
82
+ <input id={id} type="checkbox" class="drawer-toggle" tabindex="-1" aria-hidden="true" />
77
83
  <div class="drawer-content">
78
- <label for={id} class="btn btn-ghost btn-square drawer-button" aria-label={labels.menu} aria-controls={`${id}-panel`} aria-expanded="false" tabindex="0" role="button">
84
+ <button type="button" class="btn btn-ghost btn-square drawer-button" aria-label={labels.menu} aria-controls={`${id}-panel`} aria-expanded="false" data-hwio-drawer-toggle={id}>
79
85
  <HWioIcon name="menu" size="lg" />
80
- </label>
86
+ </button>
81
87
  </div>
82
88
  <div class="drawer-side z-[60]">
83
89
  <label for={id} aria-label={labels.close} class="drawer-overlay"></label>
84
90
  <div id={`${id}-panel`} class="menu min-h-full w-80 max-w-[85vw] gap-2 bg-base-100 p-6 text-base-content">
85
91
  <div class="flex justify-end">
86
- <label for={id} class="btn btn-ghost btn-square btn-sm" aria-label={labels.close} tabindex="0" role="button"><HWioIcon name="close" /></label>
92
+ <button type="button" class="btn btn-ghost btn-square btn-sm" aria-label={labels.close} aria-controls={`${id}-panel`} aria-expanded="false" data-hwio-drawer-toggle={id}><HWioIcon name="close" /></button>
87
93
  </div>
88
94
  <ul class="menu w-full text-base">
89
95
  {nav.map((item) => (
@@ -249,3 +249,18 @@
249
249
  /* Text links: themes whose primary is too light for text on the page ground (er3o teal) set
250
250
  --hwio-link to their text-safe hue; the default keeps DaisyUI's primary. */
251
251
  .btn-link { color: var(--hwio-link, var(--color-primary)); }
252
+ /* DaisyUI marks a focused menu item (header nav, drawer, the language dropdown's `.menu.dropdown-content`)
253
+ with a 10 % tint only and sets outline-style: none, on every `details > summary` unconditionally. That
254
+ fails WCAG 2.4.7; restore the system ring from the base layer. Same selector shape as DaisyUI's rule. */
255
+ .menu :where(li > :not(ul, menu, details, .menu-title), li > details > summary):focus-visible {
256
+ outline: 2px solid var(--color-secondary);
257
+ outline-offset: 2px;
258
+ }
259
+ /* DaisyUI 5.7.30+ paints a menu link carrying aria-current like .menu-active (the neutral fill). The
260
+ header marks the current page with its own label colour and bar (.hwio-nav-current) and the drawer
261
+ lists it as a plain row, so those links keep the ground; .menu-active items (the language dropdown)
262
+ keep DaisyUI's fill. currentColor as `color` inherits, so the nav's own colour utilities still win. */
263
+ .menu :where(li) > [aria-current]:not([aria-current='false'], [aria-current=''], .menu-active, .btn) {
264
+ --menu-active-bg: transparent;
265
+ --menu-active-fg: currentColor;
266
+ }