@gemboss/ui 0.6.9 → 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/README.md CHANGED
@@ -360,6 +360,55 @@ The admin's "Search ⌘K" box for every surface, as a real form (works with no J
360
360
  - Shortcut on a page without React: `gembossUI.initSearch()` from `kit-plain.js` (⌘K / Ctrl+K and "/" focus it,
361
361
  Escape leaves it). "/" is ignored while another field has focus.
362
362
 
363
+ ## Public portal pieces (0.7.0)
364
+
365
+ For public surfaces laid out like the GemPages Featurebase board (GemFeedback) and for GemCommunity's
366
+ "Top contributors" (Chris, 04/10/2026: one leaderboard for both, with medals, in the kit).
367
+
368
+ ```tsx
369
+ import { Avatar, Dialog, Leaderboard, Podium, SearchDialog, ThemeToggle, themeScript, TopbarNav } from "@gemboss/ui";
370
+
371
+ <Topbar>
372
+ <div className="gemboss-topbar-start"><BrandLockup name="GemFeedback" href="/" />
373
+ <TopbarNav as={Link} items={[{ href: "/", label: "Feedback", active: true }, { href: "/roadmap", label: "Roadmap" }]} /></div>
374
+ <div className="gemboss-topbar-center" />
375
+ <div className="gemboss-topbar-end"><SearchDialog search={find} initial={trending} fallbackHref="/?q=" /><ThemeToggle /></div>
376
+ </Topbar>
377
+ <head><script dangerouslySetInnerHTML={{ __html: themeScript }} /></head> // no white flash in dark
378
+ <Leaderboard title="Most helpful" rows={[{ key, name, value, avatar, href }]} unit="votes" viewAll={{ href, label }} />
379
+ <Dialog open={open} onClose={close} title="Sign in">…</Dialog>
380
+ ```
381
+
382
+ - `TopbarNav`: section tabs in the topbar after the brand, the active one underlined on the topbar's
383
+ edge. A topbar holding tabs drops the centre search column (`:has(.gb-topnav)`), so the tabs get the
384
+ room. 36px under a mouse, 44px under a finger. Under 600px the tabs fold into one button naming the
385
+ open tab, with the tabs in a list under it (a row that scrolls sideways hid the third tab at 390).
386
+ - `SearchDialog`: the topbar search button opening a 640px popup (Featurebase's, the admin's ⌘K).
387
+ `initial` before typing, `search(q)` while typing (150 ms debounce, latest answer wins); ↑ ↓ Enter
388
+ Esc; ⌘K / Ctrl+K and "/" open it. Results are links; without JavaScript the button goes to
389
+ `fallbackHref`.
390
+ - `Dialog`: the kit's native `<dialog class="ui-modal">` (see kit-plain.css) driven by `open`; a
391
+ backdrop click closes it, focus returns to the opener.
392
+ - `ThemeToggle` + `themeScript`: `data-theme="dark|light"` on <html>, remembered in localStorage
393
+ (`gemboss-theme`), the OS's choice until then. `theme-dark.css` (in `gemboss-ui.css`) redefines every `--gemboss-*` colour under
394
+ `[data-theme="dark"]` (a test fails if a colour token is left out), so every kit class follows.
395
+ Opt-in: a surface without it (the admin) stays light.
396
+ - `Avatar` (24 · 32 · 40 · 56): picture or initials on one of eight tones picked from the name.
397
+ - `Leaderboard`: 🥇 🥈 🥉 then the rank, avatar, name, count; the leader's count in gold; nothing at
398
+ all when empty. `Podium`: the first three, second · first · third.
399
+ - `initialsOf` moved to `initials.ts` (plain, not "use client") so server components can call it; it is
400
+ still exported from the package and from account.tsx.
401
+ - **Without the whole kit (0.7.2):** a surface with its own skin (GemCommunity) takes only these pieces'
402
+ CSS: `@gemboss/ui/gemboss-tokens.css` (variables only, no rule) + `@gemboss/ui/portal.css`. `Avatar`,
403
+ `Leaderboard` and `Podium` read nothing but `--gemboss-*` tokens (a test holds that), so they look the
404
+ same as on GemFeedback without `gemboss-ui.css` restyling the rest of the page. `SearchDialog` and
405
+ `Dialog` still need `ui.css` (the modal). `portal.css` holds no rule on `:root`, `html` or `body`; the dark palette is its own file,
406
+ `theme-dark.css`, so a surface that uses `data-theme` for something else (GemCommunity's sign-in pages) is not
407
+ turned dark by importing the leaderboard.
408
+ - Rows take `current` (the viewer's own row: tinted, and read as "Minh, you" via `currentLabel`), `badge`
409
+ (after the name, e.g. a level) and `id` (a `#me` anchor). `title` may be left out on a page whose own
410
+ `<h1>` names the board; pass `label` then. Screen-reader text uses `.gb-sr-only`, styled in portal.css.
411
+
363
412
  ## Report pages (0.4.0)
364
413
 
365
414
  Plain CSS in `kit-plain.css` for a numbers page written by hand (first user: gemnews `/admin`, 03/10/2026; that page moved to GemCommunity the same day, so gemnews no longer takes the package). The