@aiquants/menu-bar 1.21.0 → 1.22.1

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 CHANGED
@@ -1,6 +1,65 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 1.22.1 (2026-10-29)
4
+
5
+ ### Changed
6
+
7
+ - **The two links of `SessionInfo` (Profile and Google) are placed side by side.** In place of stacking them vertically in full-width rows (which consumed unnecessary vertical space), the links are arranged in two columns (`grid-cols-2`). With their text at the `caption` step (11px, `CAPTION_TEXT_CLASS_NAME`), the 6-character Japanese label 「プロフィール」 (66 to 67.3px) fits in one line within the 96px button (71px usable width), while maintaining the minimum 44 × 44px target size (WCAG 2.5.5). The card's vertical height is reduced by 50px (3.125rem).
8
+ - **The short-viewport scroll threshold is updated to 17.8125rem (285px).** With the more compact `SessionInfo` card height (reduced from 10.375rem + 3px to 7.25rem + 3px), the threshold for scrolling the whole drawer as one is lowered to 17.8125rem (header 8.25rem + 4px, footer 3.5rem + 1px, 2 rows of the list 5.75rem).
9
+ - `engines` declares pnpm `>=8.0.0` in place of npm.
10
+
11
+ ### Documentation
12
+
13
+ - Installation shows `pnpm add` only.
14
+
15
+ ## 1.22.0 (2026-10-26)
16
+
17
+ ### Changed
18
+
19
+ - **The drawer's controls and list rows draw their text at the `body` step (13px).** The footer's pin, theme and
20
+ sign-out buttons (11px), the theme button's icon (12px), the two links of `SessionInfo` (11px), the list's top-level
21
+ links and group headings (12px below a 40rem viewport) and the links inside a group (12px) now draw
22
+ `var(--aqmb-font-size-body, 0.8125rem)` (13px at the default root font size) on a
23
+ `var(--aqmb-line-height-body, 1.25rem)` (20px) line. From a 40rem viewport up, the top-level links and group headings
24
+ keep `text-sm` (14px).
25
+ - **The "Google Account" label of `SessionInfo` is at the `caption` step (11px).** It draws
26
+ `var(--aqmb-font-size-caption, 0.6875rem)` on a `var(--aqmb-line-height-caption, 1.25rem)` line instead of 10px, so
27
+ its line grows from 12.5px to 20px and the avatar row from 32px to 38px.
28
+ - **The two links of `SessionInfo` are stacked.** At 13px, 「プロフィール」 (about 78 to 80px) no longer fits the 71px
29
+ that a 96px link beside the other one leaves for its label, so each link is a row as wide as the card (198px in the
30
+ drawer's header) and at least 2.75rem (44px) tall. The card grows from 113px to 169px, and the drawer's list area
31
+ shrinks by as much.
32
+ - **Text sizes and line heights are in rem and follow page zoom and the root font-size setting.** The hand-written px
33
+ sizes (`text-[11px]`, `text-[10px]`) are gone. The package reads `--aqmb-font-size-body`, `--aqmb-line-height-body`,
34
+ `--aqmb-font-size-caption` and `--aqmb-line-height-caption` without declaring them, so a host can bind them on
35
+ `:root` to its own type scale (README, "Text Size").
36
+ - **On a short viewport the whole drawer scrolls as one.** The drawer is never taller than the viewport. At a
37
+ viewport height of 20.9375rem or less (335px at the default font size: the signed-in `SessionInfo` header, the footer and two
38
+ rows of the list), the header, the list and the footer scroll together, so the footer stays reachable at high zoom
39
+ (360 × 225 CSS px, a 1440 × 900 window at 400 %). On taller viewports the header and the footer stay in place and only
40
+ the list scrolls, as before. The list's region and scroll container take their layout from the new component
41
+ classes `.aiquants-menu-list-region` and `.aiquants-menu-list-scroller` instead of utilities.
42
+ - **Long labels wrap instead of being cut off.** A label of the list longer than its row (a top-level link, a group
43
+ heading or a link inside a group) wraps onto more lines, even inside an unbreakable word, and its row grows past
44
+ 2.75rem; the wrapper of a group's links no longer clips them (its `contain: content` and `white-space: nowrap` are
45
+ removed). The sign-out label wraps inside its button, which grows taller, when a root font size above the default
46
+ leaves it too little width; the footer's buttons have a minimum height of 2.75rem instead of a fixed one.
47
+ - **`SessionInfo` cuts no text to an ellipsis.** The user's name and the labels of the two links wrap onto more lines,
48
+ even inside an unbreakable word (`overflow-wrap: anywhere` on `.aiquants-session-card`), instead of being truncated,
49
+ and the card grows taller. The name loses its `title`, which only revealed a truncated name. At the default 16px root
50
+ every text stays on one line.
51
+ - **The footer row wraps.** When a large root font size no longer fits the pin, theme and sign-out buttons beside one
52
+ another in the 240px drawer (above a root of about 23px; at the 200 % text-size setting, a 32px root, the pin and
53
+ theme buttons share the first line and the sign-out button takes the second), the row wraps, with its gap as the row
54
+ gap, instead of overflowing sideways, and every button keeps at least 2.75rem. The sign-out button no longer shrinks
55
+ below its content (`min-width: 0` is removed). At the default root the row stays one line.
56
+ - **No control transitions every property any more.** The theme button, the `SessionInfo` card and its links, and
57
+ the submenu pin buttons transitioned every property (`transition-all`, `transition: all`), so right after a change of
58
+ the root font size their rem padding and minimum sizes moved for 0.15–0.3 s before settling. The theme button, the card
59
+ and the pin buttons now transition their colours only, and the links their colours and their press scale
60
+ (`transition`).
61
+
62
+ ## 1.21.0 (2026-10-25)
4
63
 
5
64
  ### Changed
6
65
 
package/README.md CHANGED
@@ -18,7 +18,7 @@ A React menu bar component with authentication support and theming for modern we
18
18
  ## Installation
19
19
 
20
20
  ```bash
21
- npm install @aiquants/menu-bar
21
+ pnpm add @aiquants/menu-bar
22
22
  ```
23
23
 
24
24
  Peer dependencies: `react` and `react-dom` `^19.2.7`, and `react-router-dom` `^7.7.1`. The package's `engines` field asks for Node.js 18 or later.
@@ -277,6 +277,34 @@ The drawing stays 24px and the box becomes 48 × 48 with 12px of inline padding,
277
277
 
278
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
279
 
280
+ The drawer is never taller than the viewport. On a viewport at most 17.8125rem tall (285px at the default font size: the signed-in `SessionInfo` header, the footer and two rows of the list), the header, the list and the footer scroll together as one, so nothing is cut off or out of reach at high zoom (for example 360 × 225 CSS px, a 1440 × 900 window at 400 %); on taller viewports the header and the footer stay in place and only the list scrolls.
281
+ The threshold is in rem, so it rises with the browser's default font-size setting as the drawer's parts do. With a header of your own that is taller than `SessionInfo`, the drawer still scrolls as a whole once the header and the footer alone no longer fit.
282
+
283
+ ## Text Size
284
+
285
+ The drawer's controls and list rows draw their text on two steps of a type scale, each read from a custom property with the step's default as its fallback. The defaults are in rem, so the text follows page zoom and the browser's root font-size setting.
286
+
287
+ | Custom property | Default | Text |
288
+ | --- | --- | --- |
289
+ | `--aqmb-font-size-body` | `0.8125rem` (13px at the default root font size) | The primary text of controls and rows: the footer's pin, theme and sign-out buttons, the list's links and group headings, and the links inside a group. From a viewport 40rem wide up, the list's top-level links and group headings use `text-sm` (0.875rem, 14px) instead |
290
+ | `--aqmb-line-height-body` | `1.25rem` (20px) | The line of that text |
291
+ | `--aqmb-font-size-caption` | `0.6875rem` (11px) | The links and supplementary "Google Account" label of `SessionInfo` |
292
+ | `--aqmb-line-height-caption` | `1.25rem` (20px) | The line of that text |
293
+
294
+ The package only reads these properties and never declares them, so a host can bind them on `:root`, for example to its own type scale:
295
+
296
+ ```css
297
+ :root {
298
+ --aqmb-font-size-body: var(--host-font-size-body);
299
+ --aqmb-line-height-body: var(--host-line-height-body);
300
+ --aqmb-font-size-caption: var(--host-font-size-caption);
301
+ --aqmb-line-height-caption: var(--host-line-height-caption);
302
+ }
303
+ ```
304
+
305
+ The drawer stays 240px wide. At the default sizes the sign-out label (about 78px) fits on one line beside the two 44px buttons with about 5px to spare; with a larger body size, or a root font size above 16px, it wraps inside its button, which grows taller, and above a root of about 23px the footer row wraps and the button takes a line of its own.
306
+ A label of the list longer than its row wraps the same way, even inside an unbreakable word, and its row grows past 2.75rem; the name and the links of `SessionInfo` wrap too, so no label is cut off.
307
+
280
308
  ## Theming
281
309
 
282
310
  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`.
@@ -472,8 +500,8 @@ The main menu bar component that includes:
472
500
 
473
501
  A standalone session information component that displays:
474
502
 
475
- - The user's avatar (a default icon when `photo` is empty), display name and a "Google Account" label
476
- - Two links rendered through the customizable `LinkComponent` (default: `DefaultLink`, a plain `<a>`): a profile link to `/` and a link to `https://myaccount.google.com/`
503
+ - The user's avatar (a default icon when `photo` is empty), display name and a "Google Account" label (at the caption step, see "Text Size"). The name and the label wrap, even inside an unbreakable word, rather than being cut to an ellipsis
504
+ - Two links rendered through the customizable `LinkComponent` (default: `DefaultLink`, a plain `<a>`): a profile link to `/` and a link to `https://myaccount.google.com/`. They are stacked, each a row as wide as the card and at least 2.75rem tall (44px at the default root font size), its label at the body step, wrapping onto more lines (the link growing taller) when a large root font size leaves it too little width
477
505
  - A "please sign in" card ("ログインしてください") when `user` is `null`
478
506
 
479
507
  The card carries `data-aqmb-session-card` in both states. Sign-out is not part of `SessionInfo`: it is the drawer's sign-out button, which calls `onClickSignout`.
@@ -506,7 +534,9 @@ Hand-written component classes use the `.aiquants-` prefix (the modifiers are th
506
534
 
507
535
  - `.aiquants-menu-bar` - Main container (with the theme class `light` or `dark`)
508
536
  - `.aiquants-menu-switch` - Open/close switch (`.aiquants-menu-switch-bars`, `.aiquants-menu-switch-bar`, `.aiquants-menu-switch-caption`)
509
- - `.aiquants-menu-content` - Drawer
537
+ - `.aiquants-menu-content` - Drawer (never taller than the viewport; it scrolls as a whole on a short one)
538
+ - `.aiquants-menu-list-region` - The list's region between the drawer's header and footer
539
+ - `.aiquants-menu-list-scroller` - The list's scroll container (`data-aqmb-menu-list`) on a tall viewport
510
540
  - `.aiquants-menu-list-item` - Menu item and group summary
511
541
  - `.aiquants-session-card` - Session information card
512
542