@aiquants/menu-bar 1.19.1 → 1.21.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ### Changed
6
+
7
+ - **The drawer's controls are 44px targets under every pointer.** With a mouse, a pen or a finger alike, the footer's
8
+ pin, theme and sign-out buttons, every link of the menu list (which fills its row), the group headings and their pin
9
+ buttons, and the links of `SessionInfo` are at least 2.75rem × 2.75rem (44 × 44px at the default root font size,
10
+ WCAG 2.5.5), so the drawer has one layout on every device. The compact sizes a fine pointer had are removed: 1.75rem
11
+ footer buttons, list links and group headings the size of their text in rows with block padding, pin buttons the size
12
+ of their 13px icon, and `SessionInfo` links one line of text tall. The rows have no block padding, so a row is exactly
13
+ its target. A host that sized anything to the old desktop drawer sees taller rows and a taller footer.
14
+ - **Tailwind hosts no longer need Tailwind CSS v4.1.** The drawer carries no `pointer-coarse:` utilities any more, so
15
+ any Tailwind CSS v4 build generates all of its classes.
16
+ - **The switch's box stays the host's decision, under every pointer.** `--aqmb-switch-target-size` keeps its default
17
+ `0px` and the package never raises it on its own: set it to at least 44px where your band holds the box. The README's
18
+ example now sets 48px in a 56px band without a media query. Nothing in the package stays coarse-only.
19
+
20
+ ## 1.20.0 (2026-10-24)
21
+
22
+ ### Added
23
+
24
+ - **`--aqmb-switch-target-size` sets the minimum side T of the switch's box (default `0px`).** The box you press is
25
+ B = max(S, T), where S is `--aqmb-switch-size`; the drawing keeps the side S and stands centred across the box (an
26
+ inline padding of (B − S) / 2), and the caption's column stands centred in the box when it fits. With the default the
27
+ box is the drawing, exactly as before, so a host that sets nothing sees no change, also under a coarse pointer: the
28
+ package never raises T on its own, since the band around the switch belongs to the host. To meet WCAG 2.5.5 (AAA) on
29
+ touch screens, set T to at least 44px under `@media (pointer: coarse)` where the band holds the box (the README shows
30
+ a 56px band holding a 48px box), and derive anything laid out beside the switch from the box
31
+ `max(var(--aqmb-switch-size), var(--aqmb-switch-target-size))` rather than from S.
32
+
33
+ ### Changed
34
+
35
+ - **The drawer's controls are 44px targets under a coarse pointer.** Under `@media (pointer: coarse)` the footer's pin,
36
+ theme and sign-out buttons, every link of the menu list (which then fills its row), the group headings and their pin
37
+ buttons, and the links of `SessionInfo` are at least 2.75rem × 2.75rem (44 × 44px at the default root font size, WCAG
38
+ 2.5.5). The rows lose their block padding there, so a row is exactly its target. With a fine pointer every size stays
39
+ as it was. Tailwind hosts generate these `pointer-coarse:` utilities from the package's `dist` like the others (they
40
+ need Tailwind CSS v4.1 or later); the standalone stylesheet carries them.
package/README.md CHANGED
@@ -225,7 +225,7 @@ In both setups the component classes sit in the `components` layer and the utili
225
225
 
226
226
  ## Menu Switch Custom Properties
227
227
 
228
- The open/close switch is a square box with four bars that turn into a cross while the drawer is open, over a "menu" / "close" caption. Its whole drawing lives in the package stylesheet, and it carries no utility classes, so every custom property below takes effect. The defaults are declared on `:root`; override them on `:root` (or any ancestor of the menu bar).
228
+ The open/close switch is a square box with four bars that turn into a cross while the drawer is open, over a "menu" / "close" caption. The drawing has the side S; the box you press has the side B = max(S, T), where T is a target size you may set, with the drawing centred across it. Its whole drawing lives in the package stylesheet, and it carries no utility classes, so every custom property below takes effect. The defaults are declared on `:root`; override them on `:root` (or any ancestor of the menu bar).
229
229
 
230
230
  | Property | Default | Effect |
231
231
  | --- | --- | --- |
@@ -235,7 +235,8 @@ The open/close switch is a square box with four bars that turn into a cross whil
235
235
  | `--aqmb-switch-left` | `auto` | `left` of the switch |
236
236
  | `--aqmb-switch-bottom` | `auto` | `bottom` of the switch |
237
237
  | `--aqmb-switch-z-index` | `calc(infinity)` | `z-index` of the switch. The default computes to the largest integer the browser supports (2147483647 in Chromium), which keeps the switch above the drawer (`z-index` 2147483642) and the backdrop (2147483640) |
238
- | `--aqmb-switch-size` | `27px` | Side S of the switch's square box; every length of the drawing derives from it |
238
+ | `--aqmb-switch-size` | `27px` | Side S of the switch's drawing; every length of the drawing derives from it |
239
+ | `--aqmb-switch-target-size` | `0px` | Minimum side T of the box you press: the box is B = max(S, T), and the drawing keeps its size, centred across the box by an inline padding of (B − S) / 2. The default leaves B = S. The package never raises it on its own, under any pointer: only you know whether a larger box fits the band around the switch |
239
240
  | `--aqmb-switch-caption-display` | `block` | `display` of the caption; `none` hides it |
240
241
 
241
242
  The `z-index` default is `calc(infinity)` rather than a number because Lightning CSS, which Tailwind v4 builds pass stylesheets through, writes the numbers of custom-property values and `var()` fallbacks with 6 significant digits: `2147483647` would reach the browser as `2147480000`, below the drawer. An override in a stylesheet that also goes through Lightning CSS is rounded the same way when it has 7 or more significant digits. A small value such as `50` is kept as written, and stacks the switch below the drawer and the backdrop.
@@ -244,8 +245,8 @@ How the drawing follows S:
244
245
 
245
246
  - The bars are S/9 thick, at 0, 2S/9, 4S/9 and 6S/9 of a stack 7S/9 high. While open, the outer bars become 32S/27 wide and 4S/27 thick and cross at ±45°; the inner bars fade out.
246
247
  - The caption's top edge is S/2 + 0.5rem below the top of the stack.
247
- - With the caption shown (the default) and S below 48px (at a 16px root font size), the column of bars and caption is taller than the box: it starts at the box's top and the caption hangs below the box.
248
- - With `--aqmb-switch-caption-display: none`, the bars are centred in the box and nothing is drawn above or below it. The cross can still extend slightly past the box's right edge, as it does in the default drawing.
248
+ - The column of bars and caption is S/2 + 1.5rem tall. With the caption shown (the default) and a box B below that (B = S below 48px at a 16px root font size), the column is taller than the box: it starts at the box's top and the caption hangs below the box. In a box that holds it (the default S = 27px in a 44px box, for one), the column stands centred in the box.
249
+ - With `--aqmb-switch-caption-display: none`, the bars are centred in the box (their stack starts (B − 7S/9) / 2 below its top) and nothing is drawn above or below it. The cross can still extend slightly past the box's right edge, as it does in the default drawing.
249
250
  - The default `27px` gives 3px bars spaced 6px apart, a 32px × 4px cross, and a caption 21.5px below the top of the box.
250
251
  - The switch draws in black, and in white on the dark theme and while the drawer is open. Its keyboard focus ring is a 2px outline in the same colour at a 2px offset, so it occupies 4px around the box.
251
252
 
@@ -261,6 +262,21 @@ Example — fit the switch into a 32px header bar (4px + 24px line box + 4px):
261
262
 
262
263
  The box sits on the bar's 24px line box, and the focus ring (0 to 32px from the top) stays inside the bar. Adjust `--aqmb-switch-right` to align it horizontally.
263
264
 
265
+ Example — a 44px target (WCAG 2.5.5, AAA), the same under every pointer. Set the target size to at least 44px where your band allows it, and grow the band to hold the box. A 32px bar built as 4px + line box + 4px on a 4px lattice keeps its height on that lattice when the line box becomes the smallest multiple of 8px that is at least 44px, 48px, so the band becomes 4px + 48px + 4px = 56px:
266
+
267
+ ```css
268
+ :root {
269
+ --aqmb-switch-size: 24px;
270
+ --aqmb-switch-caption-display: none;
271
+ --aqmb-switch-top: 4px;
272
+ --aqmb-switch-target-size: 48px;
273
+ }
274
+ ```
275
+
276
+ The drawing stays 24px and the box becomes 48 × 48 with 12px of inline padding, at 4px from the top; its focus ring spans 0 to 56px, exactly the band. Anything you lay out beside the switch should reserve the box B rather than the drawing S (for example `max(var(--aqmb-switch-size), var(--aqmb-switch-target-size))`).
277
+
278
+ Under every pointer (a mouse, a pen or a finger) the drawer's own controls are at least 2.75rem × 2.75rem (44 × 44 px at the default root font size): the footer's pin, theme and sign-out buttons, every link of the list (it fills its row, and the rows have no block padding of their own), the group headings and their pin buttons, and the links of `SessionInfo`.
279
+
264
280
  ## Theming
265
281
 
266
282
  The menu bar supports both light and dark themes. The hand-written styles are scoped with the `.aiquants-menu-bar` class; the utility classes and Tailwind theme variables of the standalone build are global (see "Styling (CSS)"). The root element carries the theme as a class: `.aiquants-menu-bar.light` or `.aiquants-menu-bar.dark`.