Skip to content

ui 0.6.0: shared AppearanceControl, LanguageOptions and PreferencesMenu - #12

Merged
rrolf merged 2 commits into
mainfrom
feat/ui-preferences-menu
Oct 1, 2026
Merged

rrolf merged 2 commits into
mainfrom
feat/ui-preferences-menu

Conversation

@rrolf

@rrolf rrolf commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

For virtUOS/ausleihbar#35. AbstimmBAR can switch over later, and the nearly line-for-line identical code in both tools goes away.

New in @basicbar/ui 0.6.0

  • AppearanceControl(): Auto / Light / Dark as a labelled role="group" of menuitemradio rows with aria-checked. State comes from useTheme().
  • LanguageOptions({ onChange?, onPicked?, heading? }): one menuitemradio row per supported language, in its own labelled group.
    • No "Auto" entry. Until the user picks a language, the UI follows the system (i18next detector), and the list marks the language actually shown.
    • A pick is binding: i18next caches it. The app can also store it server-side via onChange, for example for emails.
  • PreferencesMenu({ onLanguageChange? }): a round preferences button (SlidersHorizontal, aria-label "Preferences", aria-haspopup/aria-expanded) opening a menu with language and appearance, split by a role="separator".
    • It closes on an outside click, on Escape and after a language pick, and focus returns to the button.
    • It is meant for logged-out visitors. In account menus, LanguageOptions and AppearanceControl are placed directly.
  • README: a new section, and the Tailwind content example now includes ./node_modules/@basicbar/ui/dist/**/*.js. Without it the component classes are missing in the consumer.
  • CHANGELOG: ui 0.6.0, additive. Consumers add the translation key "Preferences".

Tests

  • npm run build and tsc --noEmit pass.
  • Ausleihbar was checked with the packed tgz:
    • Signed-in account menu: "Sprache" and "Darstellung" groups; switching the language changes the UI and saves it in the browser (lang) and on the account.
    • Logged-out header: "Anmelden" and "Einstellungen"; Escape closes, focus returns.
    • At 390 px the header fits without horizontal scrolling.

Release after merge

Tag ui/v0.6.0.

🤖 Generated with Claude Code

rrolf and others added 2 commits September 30, 2026 22:48
…nu (ausleihbar#35)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d glob

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant