@krizaka/ui 3.74.0 → 3.76.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.
Files changed (286) hide show
  1. package/README.md +2 -6
  2. package/dist/blocks.css +2 -0
  3. package/dist/{chunk-GSQRSWOE.js → chunk-CEW3LQOZ.js} +520 -429
  4. package/dist/chunk-CEW3LQOZ.js.map +1 -0
  5. package/dist/{chunk-E4FMPPDL.js → chunk-WC3SO4CE.js} +2 -2
  6. package/dist/{chunk-KF7UB3LM.js → chunk-YQWYGQTV.js} +11 -9
  7. package/dist/{chunk-KF7UB3LM.js.map → chunk-YQWYGQTV.js.map} +1 -1
  8. package/dist/{chunk-M3GEYLMR.js → chunk-ZPOVOEO3.js} +1 -2
  9. package/dist/data-table.d.ts +1 -1
  10. package/dist/data-table.js +3 -3
  11. package/dist/filter-bar.d.ts +12 -4
  12. package/dist/filter-bar.js +1 -1
  13. package/dist/gallery-page.js +3 -3
  14. package/dist/genui.js +101 -35
  15. package/dist/genui.js.map +1 -1
  16. package/dist/language-switch.d.ts +9 -9
  17. package/dist/{lightbox-D5NAHFEA.js → lightbox-Q45BZ3HW.js} +3 -3
  18. package/dist/match-dialog.js +2 -2
  19. package/dist/motion.css +1 -25
  20. package/dist/native/list.js +1 -1
  21. package/dist/native/list.js.map +1 -1
  22. package/dist/native.d.ts +2 -54
  23. package/dist/native.js +464 -560
  24. package/dist/native.js.map +1 -1
  25. package/dist/nav-bar.js +1 -1
  26. package/dist/nav-bar.js.map +1 -1
  27. package/dist/product-page.js +3 -3
  28. package/dist/shop-gallery.js +1 -1
  29. package/dist/tag-selector.js +16 -10
  30. package/dist/tag-selector.js.map +1 -1
  31. package/dist/theme.d.ts +3 -1
  32. package/dist/theme.js +2 -1
  33. package/dist/theme.js.map +1 -1
  34. package/dist/vertical-video.js +1 -1
  35. package/dist/waveform.js.map +1 -1
  36. package/package.json +8 -84
  37. package/registry/account-menu.json +1 -1
  38. package/registry/account-settings.json +1 -1
  39. package/registry/achievement.json +1 -1
  40. package/registry/action-bar.json +1 -1
  41. package/registry/activity-feed.json +1 -1
  42. package/registry/agenda.json +1 -1
  43. package/registry/alert.json +1 -1
  44. package/registry/analysis-report.json +1 -1
  45. package/registry/anatomy-plate.json +1 -1
  46. package/registry/app-frame.json +2 -2
  47. package/registry/app-header.json +1 -1
  48. package/registry/app-shell.json +1 -1
  49. package/registry/argument-card.json +1 -1
  50. package/registry/auth-layout.json +1 -1
  51. package/registry/avatar.json +1 -1
  52. package/registry/badge.json +1 -1
  53. package/registry/bird-plate.json +1 -1
  54. package/registry/button.json +1 -1
  55. package/registry/captcha.json +1 -1
  56. package/registry/card-grid.json +1 -1
  57. package/registry/card.json +1 -1
  58. package/registry/catalogue-page.json +1 -1
  59. package/registry/changelog-page.json +1 -1
  60. package/registry/chapter.json +1 -1
  61. package/registry/chat.json +3 -3
  62. package/registry/checkbox.json +1 -1
  63. package/registry/chip-link.json +1 -1
  64. package/registry/chip-row.json +1 -1
  65. package/registry/chip.json +1 -1
  66. package/registry/choice-grid.json +1 -1
  67. package/registry/code-block.json +1 -1
  68. package/registry/collection-switcher.json +1 -1
  69. package/registry/combobox.json +1 -1
  70. package/registry/command.json +1 -1
  71. package/registry/comparison-table.json +1 -1
  72. package/registry/component-page.json +1 -1
  73. package/registry/confirm-button.json +1 -1
  74. package/registry/contact-page.json +1 -1
  75. package/registry/continue-prompt.json +1 -1
  76. package/registry/copy-button.json +1 -1
  77. package/registry/countdown.json +1 -1
  78. package/registry/cover-hero.json +1 -1
  79. package/registry/cta-panel.json +1 -1
  80. package/registry/dashboard-layout.json +1 -1
  81. package/registry/data-table.json +20 -20
  82. package/registry/date-picker.json +1 -1
  83. package/registry/decision-list.json +1 -1
  84. package/registry/description-list.json +1 -1
  85. package/registry/desktop-window.json +1 -1
  86. package/registry/detail-layout.json +1 -1
  87. package/registry/dialog.json +1 -1
  88. package/registry/docs-article-page.json +1 -1
  89. package/registry/docs-hub-page.json +1 -1
  90. package/registry/docs-layout.json +1 -1
  91. package/registry/docs-nav.json +1 -1
  92. package/registry/document-viewer.json +1 -1
  93. package/registry/doodle.json +1 -1
  94. package/registry/drop-overlay.json +1 -1
  95. package/registry/dropdown-menu.json +1 -1
  96. package/registry/elephant.json +1 -1
  97. package/registry/embed-facade.json +1 -1
  98. package/registry/empty-state.json +1 -1
  99. package/registry/engine-flow.json +1 -1
  100. package/registry/entity-header.json +1 -1
  101. package/registry/environment-notice.json +1 -1
  102. package/registry/error-page.json +1 -1
  103. package/registry/field.json +1 -1
  104. package/registry/file-upload.json +1 -1
  105. package/registry/filter-bar.json +2 -2
  106. package/registry/flock.json +1 -1
  107. package/registry/footnote.json +1 -1
  108. package/registry/force-update-screen.json +1 -1
  109. package/registry/form.json +1 -1
  110. package/registry/gallery-page.json +1 -1
  111. package/registry/genui.json +1 -1
  112. package/registry/glossary-term.json +1 -1
  113. package/registry/glossary.json +1 -1
  114. package/registry/glow-card.json +1 -1
  115. package/registry/goal-gauge.json +1 -1
  116. package/registry/grade-stamp.json +1 -1
  117. package/registry/image-cropper.json +1 -1
  118. package/registry/index.json +10 -185
  119. package/registry/kanban.json +1 -1
  120. package/registry/kbd.json +1 -1
  121. package/registry/kind-config-editor.json +1 -1
  122. package/registry/kpi-explained.json +1 -1
  123. package/registry/landing-page.json +1 -1
  124. package/registry/landscape.json +1 -1
  125. package/registry/language-switch.json +1 -1
  126. package/registry/legal-page.json +1 -1
  127. package/registry/link-card.json +1 -1
  128. package/registry/list.json +1 -1
  129. package/registry/loader.json +1 -1
  130. package/registry/longform-page.json +1 -1
  131. package/registry/maintenance-screen.json +1 -1
  132. package/registry/map.json +2 -2
  133. package/registry/margin-layout.json +1 -1
  134. package/registry/markdown.json +1 -1
  135. package/registry/marketing-layout.json +1 -1
  136. package/registry/mascot-quote.json +1 -1
  137. package/registry/mascot-state.json +1 -1
  138. package/registry/mascots.json +1 -1
  139. package/registry/match-dialog.json +1 -1
  140. package/registry/media-capture.json +1 -1
  141. package/registry/media-gallery.json +3 -14
  142. package/registry/meter.json +1 -1
  143. package/registry/money-input.json +1 -1
  144. package/registry/nav-bar.json +3 -3
  145. package/registry/next-actions.json +1 -1
  146. package/registry/notification-preferences.json +1 -1
  147. package/registry/number-ticker.json +1 -1
  148. package/registry/opening-hours.json +1 -1
  149. package/registry/page-header.json +1 -1
  150. package/registry/page-hero.json +1 -1
  151. package/registry/page-index.json +1 -1
  152. package/registry/page.json +1 -1
  153. package/registry/pagination.json +1 -1
  154. package/registry/pointer-light.json +1 -1
  155. package/registry/popover.json +1 -1
  156. package/registry/price-catalogue-editor.json +1 -1
  157. package/registry/pricing-page.json +1 -1
  158. package/registry/product-page.json +2 -6
  159. package/registry/profile-card.json +1 -1
  160. package/registry/progress.json +1 -1
  161. package/registry/promise-card.json +1 -1
  162. package/registry/promo-code-field.json +1 -1
  163. package/registry/proposal.json +1 -1
  164. package/registry/qr-code.json +1 -1
  165. package/registry/quota-meter.json +1 -1
  166. package/registry/radio-group.json +1 -1
  167. package/registry/rail-nav.json +2 -2
  168. package/registry/recipes.json +1 -1
  169. package/registry/retro-tv.json +2 -3
  170. package/registry/reviews.json +1 -1
  171. package/registry/router.json +1 -1
  172. package/registry/schema-form.json +1 -1
  173. package/registry/scroll-stage.json +1 -1
  174. package/registry/search-field.json +1 -1
  175. package/registry/section-backdrop.json +1 -1
  176. package/registry/separator.json +1 -1
  177. package/registry/service-card.json +1 -1
  178. package/registry/settings-layout.json +1 -1
  179. package/registry/shop-composer.json +1 -1
  180. package/registry/shop-gallery.json +3 -8
  181. package/registry/shop.json +2 -2
  182. package/registry/showcase.json +2 -7
  183. package/registry/signature.json +1 -1
  184. package/registry/site-cahier.json +1 -1
  185. package/registry/site-footer.json +2 -2
  186. package/registry/sites.json +1 -1
  187. package/registry/skeleton.json +1 -1
  188. package/registry/skip-link.json +1 -1
  189. package/registry/slider.json +1 -1
  190. package/registry/slot-picker.json +1 -1
  191. package/registry/slot.json +1 -1
  192. package/registry/specimen-tag.json +1 -1
  193. package/registry/speed-lines.json +1 -1
  194. package/registry/spinner.json +1 -1
  195. package/registry/split-view.json +1 -1
  196. package/registry/stage-banner.json +1 -1
  197. package/registry/stat.json +1 -1
  198. package/registry/status-chip.json +1 -1
  199. package/registry/status-page.json +1 -1
  200. package/registry/step-progress.json +1 -1
  201. package/registry/step-showcase.json +1 -1
  202. package/registry/stepper.json +1 -1
  203. package/registry/sticky-action.json +1 -1
  204. package/registry/stuck.json +1 -1
  205. package/registry/swipe-deck.json +3 -4
  206. package/registry/switch.json +1 -1
  207. package/registry/tabs.json +1 -1
  208. package/registry/tag-input.json +1 -1
  209. package/registry/tag-selector.json +2 -2
  210. package/registry/taped-photo.json +1 -1
  211. package/registry/terminal-replay.json +1 -1
  212. package/registry/text-style.json +1 -1
  213. package/registry/theme.json +4 -4
  214. package/registry/toast.json +1 -1
  215. package/registry/toc.json +1 -1
  216. package/registry/tooltip.json +1 -1
  217. package/registry/tree-view.json +1 -1
  218. package/registry/update-prompt.json +1 -1
  219. package/registry/upload-queue.json +1 -1
  220. package/registry/usage.json +1 -1
  221. package/registry/verified-badge.json +1 -1
  222. package/registry/versus-card.json +1 -1
  223. package/registry/vertical-video.json +2 -6
  224. package/registry/video-player.json +2 -7
  225. package/registry/video-trimmer.json +3 -4
  226. package/registry/virtual.json +1 -1
  227. package/registry/wall.json +3 -9
  228. package/registry/waveform.json +4 -9
  229. package/dist/audio-player.d.ts +0 -115
  230. package/dist/audio-player.js +0 -211
  231. package/dist/audio-player.js.map +0 -1
  232. package/dist/chunk-GSQRSWOE.js.map +0 -1
  233. package/dist/chunk-YKOLME7R.js +0 -126
  234. package/dist/chunk-YKOLME7R.js.map +0 -1
  235. package/dist/how-it-works-page.d.ts +0 -49
  236. package/dist/how-it-works-page.js +0 -28
  237. package/dist/how-it-works-page.js.map +0 -1
  238. package/dist/marquee.d.ts +0 -34
  239. package/dist/marquee.js +0 -52
  240. package/dist/marquee.js.map +0 -1
  241. package/dist/media-grid.d.ts +0 -246
  242. package/dist/media-grid.js +0 -468
  243. package/dist/media-grid.js.map +0 -1
  244. package/dist/photo-grid.d.ts +0 -123
  245. package/dist/photo-grid.js +0 -94
  246. package/dist/photo-grid.js.map +0 -1
  247. package/registry/audio-player.json +0 -300
  248. package/registry/examples/audio-player/podcast.d.ts +0 -4
  249. package/registry/examples/audio-player/podcast.js +0 -22
  250. package/registry/examples/audio-player/podcast.tsx +0 -19
  251. package/registry/examples/audio-player/voice-note.d.ts +0 -4
  252. package/registry/examples/audio-player/voice-note.js +0 -12
  253. package/registry/examples/audio-player/voice-note.tsx +0 -12
  254. package/registry/examples/how-it-works-page/orazaka.d.ts +0 -4
  255. package/registry/examples/how-it-works-page/orazaka.js +0 -30
  256. package/registry/examples/how-it-works-page/orazaka.tsx +0 -26
  257. package/registry/examples/marquee/cards.d.ts +0 -4
  258. package/registry/examples/marquee/cards.js +0 -23
  259. package/registry/examples/marquee/cards.tsx +0 -21
  260. package/registry/examples/marquee/logos.d.ts +0 -4
  261. package/registry/examples/marquee/logos.js +0 -12
  262. package/registry/examples/marquee/logos.tsx +0 -17
  263. package/registry/examples/media-grid/feed.d.ts +0 -4
  264. package/registry/examples/media-grid/feed.js +0 -31
  265. package/registry/examples/media-grid/feed.tsx +0 -30
  266. package/registry/examples/media-grid/loading.d.ts +0 -4
  267. package/registry/examples/media-grid/loading.js +0 -28
  268. package/registry/examples/media-grid/loading.tsx +0 -25
  269. package/registry/examples/media-grid/uniform.d.ts +0 -4
  270. package/registry/examples/media-grid/uniform.js +0 -29
  271. package/registry/examples/media-grid/uniform.tsx +0 -26
  272. package/registry/examples/photo-grid/native/profile-photos.d.ts +0 -4
  273. package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
  274. package/registry/examples/photo-grid/native/profile-photos.js +0 -27
  275. package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
  276. package/registry/examples/photo-grid/native/profile-photos.tsx +0 -24
  277. package/registry/examples/photo-grid/profile-photos.d.ts +0 -4
  278. package/registry/examples/photo-grid/profile-photos.js +0 -28
  279. package/registry/examples/photo-grid/profile-photos.tsx +0 -25
  280. package/registry/how-it-works-page.json +0 -258
  281. package/registry/marquee.json +0 -241
  282. package/registry/media-grid.json +0 -1034
  283. package/registry/photo-grid.json +0 -316
  284. /package/dist/{chunk-E4FMPPDL.js.map → chunk-WC3SO4CE.js.map} +0 -0
  285. /package/dist/{chunk-M3GEYLMR.js.map → chunk-ZPOVOEO3.js.map} +0 -0
  286. /package/dist/{lightbox-D5NAHFEA.js.map → lightbox-Q45BZ3HW.js.map} +0 -0
package/dist/nav-bar.js CHANGED
@@ -436,7 +436,7 @@ function ProductBarActions({ signIn, tryIt, signupOpen, linkAs: Link = "a", plac
436
436
  const { primary, secondary } = productBarActions({ signupOpen, hasTry: Boolean(tryIt) });
437
437
  const link = (kind) => kind === ProductBarAction.Try && tryIt ? tryIt : signIn;
438
438
  const panel = placement === "panel";
439
- const button = (kind, variant) => /* @__PURE__ */ jsx3(Button, { asChild: true, variant, size: panel ? "md" : "sm", className: panel ? variant === "primary" ? "mt-2 w-full font-bold" : "w-full" : variant === "primary" ? "ml-1 hidden font-bold md:inline-flex" : "hidden md:inline-flex", children: /* @__PURE__ */ jsx3(Link, { href: link(kind).href, children: link(kind).label }) }, kind);
439
+ const button = (kind, variant) => /* @__PURE__ */ jsx3(Button, { asChild: true, "data-signed-out-only": "", variant, size: panel ? "md" : "sm", className: panel ? variant === "primary" ? "mt-2 w-full font-bold" : "w-full" : variant === "primary" ? "ml-1 hidden font-bold md:inline-flex" : "hidden md:inline-flex", children: /* @__PURE__ */ jsx3(Link, { href: link(kind).href, children: link(kind).label }) }, kind);
440
440
  return /* @__PURE__ */ jsxs3(Fragment3, { children: [
441
441
  secondary ? button(secondary, "ghost") : null,
442
442
  button(primary, "primary")
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/nav-bar/me.ts","../src/nav-bar/nav-bar.tsx","../src/nav-bar/placement.ts","../src/nav-bar/session.tsx","../src/nav-bar/product-actions.tsx"],"sourcesContent":["// The « who is here » contract, the same for every product: `GET /api/me` answers 200 `{ signedIn, signupOpen, account? }`\n// with `Cache-Control: private, no-store` and `Vary: Cookie`. A public page asking who is there is not an error: signed\n// out is a 200 with `signedIn: false`, never a 401.\n\n/** The body of `GET /api/me`. `account` is the product's own shape, present only when `signedIn`. */\nexport interface MeResponse<TAccount = unknown> {\n signedIn: boolean;\n /** Whether the product accepts new accounts (its `signupOpen` setting). */\n signupOpen: boolean;\n account?: TAccount;\n}\n\n/** The headers of the answer: per-visitor, never cached, varying with the session cookie. */\nexport const meHeaders = { \"Cache-Control\": \"private, no-store\", Vary: \"Cookie\" } as const;\n\n/** The 200 answer of `GET /api/me` for a route handler. A signed-out visitor never gets an `account`. */\nexport function meResponse<TAccount>({ signedIn, signupOpen, account }: MeResponse<TAccount>): Response {\n const body: MeResponse<TAccount> = signedIn && account !== undefined ? { signedIn, signupOpen, account } : { signedIn: false, signupOpen };\n return new Response(JSON.stringify(body), { status: 200, headers: { ...meHeaders, \"Content-Type\": \"application/json\" } });\n}\n\n/** A Standard Schema of the body, for `krizakaFetch`: refuses anything that is not the contract. */\nexport const meSchema = {\n \"~standard\": {\n version: 1,\n vendor: \"krizaka\",\n validate(value: unknown) {\n const v = value as Partial<MeResponse> | null;\n if (v && typeof v === \"object\" && typeof v.signedIn === \"boolean\" && typeof v.signupOpen === \"boolean\" && (v.signedIn || !(\"account\" in v))) return { value: v as MeResponse };\n return { issues: [{ message: \"Expected { signedIn: boolean, signupOpen: boolean, account?: … }.\" }] };\n },\n },\n} as const;\n","// Client (scroll, a sliding indicator, menus). Radix NavigationMenu does the menus' semantics and keyboard (Enter, Space\n// and ↓ open; ↑ ↓ Home End walk; Escape closes and returns the focus; Tab out closes); this file draws the Krizaka bar:\n// a floating pill that tightens once the page scrolls, one light that glides to the item under the pointer or the\n// focus and rests on the current page, and a mobile panel that is a plain disclosure (no focus trap, Escape closes).\nimport { NavigationMenu as Nav, Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { FamilyMark, GitHubGlyph } from \"../family-mark\";\nimport { LanguageSwitch, type LanguageSwitchProps } from \"../language-switch/language-switch\";\nimport { type FamilyLabels, familyLabels, type OrgFacts, type Site, siteById, type SiteId, sitesByGroup } from \"../sites/sites\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { placePanel } from \"./placement\";\nimport { NavBarSession } from \"./session\";\n\nexport const navBar = tv({\n slots: {\n root:\n \"group/nav relative z-40 mx-auto flex h-14 w-full items-center gap-2 border-border-subtle bg-surface-1 \" +\n \"transition-[height,background-color,border-color,box-shadow] duration-300 motion-reduce:transition-none \" +\n \"data-compact:h-12 data-compact:border-border-default data-compact:bg-surface-1 data-compact:shadow-lg\",\n brand:\n \"mr-2 inline-flex shrink-0 items-center gap-2 font-display text-[15px] font-bold tracking-tight text-fg no-underline \" +\n \"rounded-md focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n items: \"relative hidden md:block\",\n list:\n \"group/list relative isolate flex items-center gap-0.5 \" +\n // The ink rule (Cahier, ADR-004): a pen line under the item that is pointed at or focused, resting on the current page.\n \"before:absolute before:left-0 before:top-0 before:-z-10 before:h-0.5 before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-[calc(var(--kz-ind-y)+var(--kz-ind-h)-6px)] \" +\n \"before:scale-x-[0.72] before:bg-fg before:opacity-0 before:transition-[translate,width,opacity] before:duration-300 motion-reduce:before:transition-none \" +\n \"data-[indicator=on]:before:opacity-100\",\n item:\n \"inline-flex h-9 select-none items-center gap-1 rounded-sm px-3.5 text-sm font-medium text-fg-secondary no-underline transition-colors \" +\n \"hover:text-fg data-active:text-fg data-[state=open]:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n // Before the light is ready (server render), the current page carries its own tint.\n \"group-not-data-[indicator=on]/list:data-active:underline group-not-data-[indicator=on]/list:data-active:decoration-2 group-not-data-[indicator=on]/list:data-active:underline-offset-8\",\n chevron: \"h-3.5 w-3.5 transition-transform duration-300 group-data-[state=open]/trigger:rotate-180 motion-reduce:transition-none\",\n viewport:\n // `left` is set by NavBarItems (--kz-menu-left): the panel's edge under its trigger, kept inside the page.\n \"kz-pop absolute left-[var(--kz-menu-left,0px)] top-full mt-2 h-(--radix-navigation-menu-viewport-height) w-(--radix-navigation-menu-viewport-width) origin-top-left overflow-hidden \" +\n \"rounded-2xl border border-border-default bg-surface-1 shadow-lg transition-[left,width,height] duration-300 motion-reduce:transition-none\",\n // Icon · title · a description of two lines at most. 28 rem (40 rem in two columns), never wider than the page\n // between its gutters, and never taller than the screen.\n panel: \"grid w-[min(28rem,calc(100vw-2rem))] max-h-[calc(100dvh-6rem)] gap-0.5 overflow-y-auto p-1.5\",\n panelWide: \"w-[min(40rem,calc(100vw-2rem))] md:grid-cols-2\",\n menuLink:\n \"group/link flex items-start gap-3 rounded-lg px-2.5 py-2 text-left no-underline outline-hidden transition-colors \" +\n \"hover:bg-surface-2 focus-visible:bg-surface-2 focus-visible:ring-2 focus-visible:ring-ring data-active:bg-accent-soft\",\n menuIcon:\n \"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border-default bg-surface-2 text-fg-accent \" +\n \"transition-[transform,border-color] duration-300 group-hover/link:-translate-y-0.5 group-hover/link:border-accent [&>svg]:h-4 [&>svg]:w-4 motion-reduce:transform-none\",\n menuTitle: \"block line-clamp-2 wrap-break-word text-sm font-semibold leading-5 text-fg\",\n // Two lines at most, wrapped at word boundaries — a longer one ends in an ellipsis, never cut mid-sentence.\n menuText: \"mt-0.5 block line-clamp-2 wrap-break-word text-xs leading-4 text-fg-secondary\",\n actions: \"ml-auto flex items-center gap-2\",\n toggle:\n \"inline-flex h-9 w-9 items-center justify-center rounded-sm border border-border-subtle bg-surface-2 text-fg md:hidden \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n mobile: \"kz-pop absolute inset-x-0 top-full mt-2 grid gap-1 rounded-2xl border border-border-default bg-surface-1 p-2 shadow-lg md:hidden\",\n mobileGroup: \"grid gap-0.5 [&+&]:mt-1 [&+&]:border-t [&+&]:border-border-subtle [&+&]:pt-2\",\n mobileGroupTitle: \"px-3 pb-1 pt-1 text-[11px] font-semibold text-fg-secondary\",\n mobileLink:\n \"flex items-center justify-between rounded-xl px-3 py-3 text-[15px] font-medium text-fg no-underline hover:bg-surface-2 \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-fg-accent\",\n // The family switcher: a chevron attached to the brand, its panel aligned on the bar's left edge.\n family: \"hidden md:block\",\n familyTrigger:\n \"group/trigger -ml-2 mr-1 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-sm text-fg-secondary transition-colors \" +\n \"hover:bg-surface-3 hover:text-fg data-[state=open]:bg-surface-3 data-[state=open]:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n familyViewport:\n \"kz-pop absolute left-0 top-full mt-2 h-(--radix-navigation-menu-viewport-height) w-(--radix-navigation-menu-viewport-width) origin-top-left overflow-hidden \" +\n \"rounded-2xl border border-border-default bg-surface-1 shadow-lg transition-[width,height] duration-300 motion-reduce:transition-none\",\n familyPanel: \"grid w-[min(92vw,42rem)] gap-x-2 gap-y-3 p-3 sm:grid-cols-2\",\n familyGroupTitle: \"px-3 pb-1 pt-1 text-[11px] font-semibold text-fg-secondary\",\n familyLink:\n \"group/link flex items-start gap-3 rounded-xl px-3 py-2.5 text-left no-underline outline-hidden transition-colors \" +\n \"hover:bg-surface-2 focus-visible:bg-surface-2 focus-visible:ring-2 focus-visible:ring-ring data-current:bg-accent-soft\",\n familyMark: \"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center text-fg\",\n familyName: \"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm font-semibold text-fg\",\n familyText: \"mt-0.5 block text-xs leading-relaxed text-fg-secondary\",\n familyTag: \"rounded-sm px-1.5 py-px text-[10px] font-semibold\",\n mobileFamily: \"mt-1 grid gap-2 border-t border-border-subtle px-1 pb-1 pt-3\",\n mobileFamilyLink:\n \"flex min-h-11 items-center gap-3 rounded-xl px-2 py-2 text-[15px] font-medium text-fg no-underline hover:bg-surface-2 \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-current:bg-accent-soft\",\n badge:\n \"hidden h-6 shrink-0 items-center gap-1 rounded-sm border border-border-subtle bg-surface-2 px-2 font-mono text-[11px] font-medium text-fg-secondary sm:inline-flex\",\n repo:\n \"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-sm text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n variants: {\n floating: {\n true: { root: \"max-w-5xl rounded-sm border pl-5 pr-2 data-compact:max-w-4xl\" },\n false: { root: \"border-b px-4 md:px-6\" },\n },\n },\n defaultVariants: { floating: true },\n});\nconst s = navBar();\n\ninterface NavBarContext {\n label: string;\n open: boolean;\n setOpen: (open: boolean) => void;\n panelId: string;\n}\nconst Context = React.createContext<NavBarContext | null>(null);\n/** The open menu of `NavBar.Items` (`\"\"`: none), so a plain link can close it when the pointer moves on to it. */\nconst ItemsContext = React.createContext<{ close: () => void }>({ close: () => {} });\n/** True inside `NavBar.Mobile`: the family renders as the panel's last group instead of a switcher. */\nconst MobileContext = React.createContext(false);\nconst useNavBar = () => {\n const ctx = React.useContext(Context);\n if (!ctx) throw new Error(\"NavBar parts must be inside <NavBar.Root>.\");\n return ctx;\n};\n\nexport type NavBarRootProps = React.ComponentProps<\"header\"> & {\n /** The accessible name of the navigation (“Main”) — passed translated. */\n label: string;\n /**\n * Pixels of scroll after which the bar tightens (denser, lower, lifted). `false`: never.\n * @default 24\n */\n compactAfter?: number | false;\n /**\n * A floating pill (the Krizaka bar) or a full-width bar with a hairline under it.\n * @default true\n */\n floating?: boolean;\n};\n\n/** The bar. Place it in a `sticky top-3` (floating) or `sticky top-0` wrapper — or let it scroll. */\nexport function NavBarRoot({ label, compactAfter = 24, floating = true, className, children, ...props }: NavBarRootProps) {\n const [compact, setCompact] = React.useState(false);\n const [open, setOpen] = React.useState(false);\n const panelId = React.useId();\n React.useEffect(() => {\n if (compactAfter === false) return;\n const onScroll = () => setCompact(window.scrollY > compactAfter);\n onScroll();\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n return () => window.removeEventListener(\"scroll\", onScroll);\n }, [compactAfter]);\n const ctx = React.useMemo(() => ({ label, open, setOpen, panelId }), [label, open, panelId]);\n return (\n <Context.Provider value={ctx}>\n <header data-compact={compact ? \"\" : undefined} data-floating={floating} className={navBar({ floating }).root({ className })} {...props}>\n {children}\n </header>\n </Context.Provider>\n );\n}\n\nexport type NavBarBrandProps = React.ComponentProps<\"a\"> & {\n /** Renders your link (a router `<Link>`) with the brand's look. */\n asChild?: boolean;\n /**\n * The organisation's facts (`org` of `@krizaka/org`): without children, the brand is the Krizaka mark and `org.brand.name`,\n * so no site writes the company's name by hand. Children, when given, win (a product's own brand).\n */\n org?: Pick<OrgFacts, \"brand\">;\n};\n\n/** The brand: a mark and a name, linking home. */\nexport function NavBarBrand({ asChild, className, org, children, ...props }: NavBarBrandProps) {\n const Comp = asChild ? Slot.Root : \"a\";\n const fromOrg = org && !asChild && children === undefined;\n return (\n <Comp className={s.brand({ className })} {...props}>\n {fromOrg ? (\n <>\n <FamilyMark mark={siteById(\"krizaka\").mark} size={22} />\n {org.brand.name}\n </>\n ) : (\n children\n )}\n </Comp>\n );\n}\n\nexport type NavBarItemsProps = Omit<React.ComponentProps<typeof Nav.Root>, \"orientation\">;\n\n/**\n * The desktop navigation: links and menus, with the light that glides between them. Hidden below `md` (see\n * `NavBar.Mobile`). A menu opens on click, Enter, Space or ↓ — or when the pointer rests on its trigger (hover intent,\n * `delayDuration`, 200 ms): passing over the bar opens nothing. While a menu is open the light stays on its trigger;\n * moving on to a plain link closes the menu, so the bar never shows two current items. A click outside or Escape closes.\n */\nexport function NavBarItems({ className, children, value: valueProp, defaultValue, onValueChange, delayDuration = 200, ...props }: NavBarItemsProps) {\n const { label } = useNavBar();\n const [inner, setInner] = React.useState(defaultValue ?? \"\");\n const value = valueProp ?? inner;\n const setValue = React.useCallback(\n (next: string) => {\n setInner(next);\n onValueChange?.(next);\n },\n [onValueChange],\n );\n const items = React.useMemo(() => ({ close: () => setValue(\"\") }), [setValue]);\n const { ref, handlers } = useSlidingIndicator<HTMLUListElement>({\n item: \"[data-nav-item]\",\n active: \"[data-nav-item][data-active]\",\n prefer: \"[data-nav-item][data-state=open]\",\n follow: true,\n });\n const root = React.useRef<HTMLElement>(null);\n const viewport = React.useRef<HTMLDivElement>(null);\n // The open panel sits under its trigger and stays inside the page (collision): measured when a menu opens, when\n // the panel changes size (another menu) and when the window does.\n React.useLayoutEffect(() => {\n const panel = viewport.current;\n const nav = root.current;\n if (!panel || !nav || !value) return;\n const place = () => {\n const trigger = nav.querySelector<HTMLElement>(\"[data-nav-item][data-state=open]\");\n const width = Number.parseFloat(panel.style.getPropertyValue(\"--radix-navigation-menu-viewport-width\"));\n if (!trigger || !Number.isFinite(width)) return;\n const left = `${placePanel({ trigger: trigger.getBoundingClientRect().left, root: nav.getBoundingClientRect().left, panel: width, window: document.documentElement.clientWidth })}px`;\n if (panel.style.getPropertyValue(\"--kz-menu-left\") !== left) panel.style.setProperty(\"--kz-menu-left\", left);\n };\n place();\n const watch = new MutationObserver(place);\n watch.observe(panel, { attributes: true, attributeFilter: [\"style\"] });\n window.addEventListener(\"resize\", place);\n return () => {\n watch.disconnect();\n window.removeEventListener(\"resize\", place);\n };\n }, [value]);\n return (\n <ItemsContext.Provider value={items}>\n <Nav.Root ref={root} aria-label={label} className={s.items({ className })} value={value} onValueChange={setValue} delayDuration={delayDuration} {...props}>\n <Nav.List ref={ref} className={s.list()} {...handlers}>\n {children}\n </Nav.List>\n <Nav.Viewport ref={viewport} className={s.viewport()} />\n </Nav.Root>\n </ItemsContext.Provider>\n );\n}\n\nexport type NavBarLinkProps = Omit<React.ComponentProps<typeof Nav.Link>, \"active\"> & {\n /** The current page: `aria-current=\"page\"`, and the light rests on it. */\n active?: boolean;\n /** Classes on the list item around the link (to show it from a breakpoint only). */\n itemClassName?: string;\n};\n\n/** A link of the bar. `asChild` renders your router's `<Link>`. */\nexport function NavBarLink({ active, className, itemClassName, onPointerEnter, ...props }: NavBarLinkProps) {\n const { close } = React.useContext(ItemsContext);\n return (\n <Nav.Item className={itemClassName}>\n <Nav.Link\n data-nav-item=\"\"\n data-active={active ? \"\" : undefined}\n active={active}\n aria-current={active ? \"page\" : undefined}\n className={s.item({ className })}\n onPointerEnter={(e) => {\n onPointerEnter?.(e);\n close();\n }}\n {...props}\n />\n </Nav.Item>\n );\n}\n\nexport type NavBarMenuProps = Omit<React.ComponentProps<typeof Nav.Item>, \"children\"> & {\n /** The trigger's words (“Products”) — passed translated. */\n label: string;\n /** The current page is inside this menu: the light rests on its trigger. */\n active?: boolean;\n /** The menu's links (`NavBar.MenuLink`), laid out in a panel; `columns` sets the grid. */\n children: React.ReactNode;\n /**\n * Columns of the panel.\n * @default 1\n */\n columns?: 1 | 2;\n /**\n * A section with this many links or fewer needs no hidden list: they sit in the bar as plain links (the active one\n * marked, no dropdown, `label` unused on the desktop). Above it, a dropdown. `0` always makes a dropdown.\n * @default 3\n */\n inlineUpTo?: number;\n /**\n * From which breakpoint the inline links stand in the bar. Below it (between the phone panel at `md` and this\n * breakpoint) the section is the dropdown, so long labels never overflow a tablet-width bar. `md` inlines as soon as\n * the bar is shown.\n * @default \"lg\"\n */\n inlineFrom?: \"md\" | \"lg\" | \"xl\";\n};\n\n// Static class names (Tailwind reads them at build time).\nconst INLINE_HIDE = { md: \"\", lg: \"max-lg:hidden\", xl: \"max-xl:hidden\" } as const;\nconst DROPDOWN_HIDE = { md: \"\", lg: \"lg:hidden\", xl: \"xl:hidden\" } as const;\n\n/**\n * A menu of the bar: its trigger, and its links in a panel that opens under the bar. A menu of `inlineUpTo` links or\n * fewer (3 by default) is not a menu at all: its links stand in the bar, each with its active state — a hidden list of\n * three is one click more for nothing. The phone's panel groups them as usual (`NavBar.MobileGroup`).\n */\nexport function NavBarMenu({ label, active, columns = 1, inlineUpTo = 3, inlineFrom = \"lg\", children, className, ...props }: NavBarMenuProps) {\n const links = React.Children.toArray(children);\n const dropdown = (hide: string) => (\n <Nav.Item className={cn(hide, className)} {...props}>\n <Nav.Trigger data-nav-item=\"\" data-active={active ? \"\" : undefined} className={cn(s.item(), \"group/trigger\")}>\n {label}\n <svg viewBox=\"0 0 24 24\" className={s.chevron()} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </Nav.Trigger>\n <Nav.Content className={cn(s.panel(), columns === 2 && s.panelWide())}>{children}</Nav.Content>\n </Nav.Item>\n );\n const inline = links.length > 0 && links.length <= inlineUpTo && links.every((c) => React.isValidElement(c) && c.type === NavBarMenuLink);\n if (inline) {\n return (\n <>\n {inlineFrom !== \"md\" && dropdown(DROPDOWN_HIDE[inlineFrom])}\n {links.map((link) => {\n const { title, href, active: here, asChild, children: child, icon: _icon, description: _description, className: linkClass, ...rest } = (link as React.ReactElement<NavBarMenuLinkProps>).props;\n return (\n <NavBarLink key={(link as React.ReactElement).key} asChild={asChild} href={asChild ? undefined : href} active={here} className={linkClass} itemClassName={INLINE_HIDE[inlineFrom]} {...rest}>\n {asChild && React.isValidElement<{ children?: React.ReactNode }>(child) ? React.cloneElement(child, undefined, title) : title}\n </NavBarLink>\n );\n })}\n </>\n );\n }\n return dropdown(\"\");\n}\n\nexport type NavBarMenuLinkProps = Omit<React.ComponentProps<typeof Nav.Link>, \"title\" | \"active\"> & {\n /** The link's name — passed translated. */\n title: string;\n /** One line under it — passed translated. */\n description?: string;\n /** An icon (a signature icon of `@krizaka/icons`: its node lights up on hover). */\n icon?: React.ReactNode;\n /** The current page. */\n active?: boolean;\n};\n\n/** A link inside a menu: an icon, a name and a line of text. */\nexport function NavBarMenuLink({ title, description, icon, active, href, className, asChild, children, ...props }: NavBarMenuLinkProps) {\n const body = (\n <>\n {icon && <span className={s.menuIcon()}>{icon}</span>}\n <span className=\"min-w-0 flex-1\">\n <span className={s.menuTitle()}>{title}</span>\n {description && <span className={s.menuText()}>{description}</span>}\n </span>\n </>\n );\n return (\n <Nav.Link asChild={asChild} href={asChild ? undefined : href} active={active} aria-current={active ? \"page\" : undefined} data-active={active ? \"\" : undefined} className={s.menuLink({ className })} {...props}>\n {asChild && React.isValidElement<{ children?: React.ReactNode }>(children) ? React.cloneElement(children, undefined, body) : body}\n </Nav.Link>\n );\n}\n\n/** The right side: search, theme, language, the call to action. */\nexport function NavBarActions({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.actions({ className })} {...props} />;\n}\n\nexport type NavBarMobileProps = React.ComponentProps<\"nav\"> & {\n /** The toggle's name when closed (“Open the menu”) — passed translated. */\n openLabel: string;\n /** The toggle's name when open (“Close the menu”) — passed translated. */\n closeLabel: string;\n};\n\n/**\n * Below `md`: a toggle, and a panel under the bar with its links (`NavBar.MobileLink`), grouped like the bar's menus\n * (`NavBar.MobileGroup`). A disclosure: Escape, a click on a link or a press outside close it; Escape returns the focus\n * to the toggle.\n */\nexport function NavBarMobile({ openLabel, closeLabel, className, children, ...props }: NavBarMobileProps) {\n const { label, open, setOpen, panelId } = useNavBar();\n const toggle = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== \"Escape\") return;\n setOpen(false);\n toggle.current?.focus();\n };\n // A press outside the panel and its toggle closes it (the page under it stays usable).\n const onPress = (e: PointerEvent) => {\n const target = e.target as Node | null;\n if (!target || toggle.current?.contains(target) || document.getElementById(panelId)?.contains(target)) return;\n setOpen(false);\n };\n document.addEventListener(\"keydown\", onKey);\n document.addEventListener(\"pointerdown\", onPress);\n return () => {\n document.removeEventListener(\"keydown\", onKey);\n document.removeEventListener(\"pointerdown\", onPress);\n };\n }, [open, setOpen, panelId]);\n return (\n <>\n <button ref={toggle} type=\"button\" aria-expanded={open} aria-controls={panelId} aria-label={open ? closeLabel : openLabel} onClick={() => setOpen(!open)} className={s.toggle()}>\n <svg viewBox=\"0 0 24 24\" className=\"h-4.5 w-4.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n {open ? <path d=\"M18 6 6 18M6 6l12 12\" /> : <path d=\"M4 7h16M4 12h16M4 17h10\" />}\n </svg>\n </button>\n {open && (\n <nav\n id={panelId}\n aria-label={label}\n className={s.mobile({ className })}\n {...props}\n >\n {/* Delegated close on link activation; keyboard activation of a link fires a click too. */}\n <div\n role=\"presentation\"\n className=\"contents\"\n onClick={(e) => {\n if ((e.target as Element).closest(\"a\")) setOpen(false);\n }}\n >\n <MobileContext.Provider value>{children}</MobileContext.Provider>\n </div>\n </nav>\n )}\n </>\n );\n}\n\nexport type NavBarMobileGroupProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The group's heading — the same words as the bar's menu (“Product”) — passed translated. */\n label: string;\n};\n\n/** A group of the mobile panel: the links of one of the bar's menus under its name, in the same order. */\nexport function NavBarMobileGroup({ label, className, children, ...props }: NavBarMobileGroupProps) {\n const id = React.useId();\n return (\n <div role=\"group\" aria-labelledby={id} className={s.mobileGroup({ className })} {...props}>\n <p id={id} className={s.mobileGroupTitle()}>\n {label}\n </p>\n {children}\n </div>\n );\n}\n\nexport type NavBarMobileLinkProps = React.ComponentProps<\"a\"> & {\n /** The current page. */\n active?: boolean;\n /** Renders your router's `<Link>`. */\n asChild?: boolean;\n};\n\n/** A link of the mobile panel. */\nexport function NavBarMobileLink({ active, asChild, className, ...props }: NavBarMobileLinkProps) {\n const Comp = asChild ? Slot.Root : \"a\";\n return <Comp aria-current={active ? \"page\" : undefined} className={s.mobileLink({ className })} {...props} />;\n}\n\n\nconst tagTone = {\n upcoming: \"bg-accent-soft text-fg ring-1 ring-inset ring-accent/40\",\n construction: \"bg-warning/15 text-fg ring-1 ring-inset ring-warning/40\",\n development: \"bg-surface-3 text-fg ring-1 ring-inset ring-border-strong\",\n current: \"bg-surface-3 text-fg-secondary\",\n};\n\n/** A site's name and its tags: status when not released, “You are here” on the current one. */\nfunction FamilyName({ site, current, labels }: { site: Site; current: boolean; labels: FamilyLabels }) {\n return (\n <span className={s.familyName()}>\n {site.name}\n {site.status !== \"released\" && <span className={cn(s.familyTag(), tagTone[site.status])}>{labels.status[site.status]}</span>}\n {current && <span className={cn(s.familyTag(), tagTone.current)}>{labels.current}</span>}\n </span>\n );\n}\n\nexport type NavBarFamilyProps = {\n /** The site this bar belongs to (`@krizaka/ui/sites`): marked in the family, `aria-current=\"true\"`. */\n current: SiteId;\n /**\n * The family's words, passed translated: `familyLabels.fr` from `@krizaka/ui/sites`, or your own of the same shape.\n * @default familyLabels.en\n */\n labels?: FamilyLabels;\n /** Opens the panel at first render (a story, a screenshot). */\n defaultOpen?: boolean;\n /** Classes of the switcher (or, inside `NavBar.Mobile`, of the family's group). */\n className?: string;\n};\n\n/**\n * @deprecated No site carries the family switcher any more (2026-10-22): krizaka.com is the only way back between the Krizaka sites, through the footer's « A Krizaka project » line. Removed in the next minor; `krizaka/no-family-switcher` refuses it.\n *\n * The family switcher, attached to the brand (place it right after `NavBar.Brand`): a chevron that opens every site of\n * Krizaka grouped — Krizaka · Products · Open source · GitHub — the current one marked. It opens on click, Enter, Space\n * or ↓ (never on hover); ↑ ↓ walk the sites, Escape closes and returns the focus. Hidden below `md`: place a second\n * `NavBar.Family` as the last child of `NavBar.Mobile`, where it renders as the panel's last group.\n */\nexport function NavBarFamily({ current, labels = familyLabels.en, defaultOpen, className }: NavBarFamilyProps) {\n const inMobile = React.useContext(MobileContext);\n const id = React.useId();\n const groups = sitesByGroup();\n if (inMobile) {\n return (\n <div role=\"group\" aria-labelledby={`${id}-family`} className={s.mobileFamily({ className })}>\n <p id={`${id}-family`} className={s.familyGroupTitle()}>\n {labels.family}\n </p>\n {groups.map(({ group, sites }) => (\n <div key={group}>\n {/* The company's own group is named like the family itself: its heading would repeat the panel's. */}\n {group !== \"krizaka\" && (\n <p id={`${id}-${group}`} className={s.familyGroupTitle()}>\n {labels.groups[group]}\n </p>\n )}\n <ul aria-labelledby={group !== \"krizaka\" ? `${id}-${group}` : `${id}-family`} className=\"grid gap-0.5\">\n {sites.map((site) => (\n <li key={site.id}>\n <a href={site.url} data-current={site.id === current ? \"\" : undefined} aria-current={site.id === current ? \"true\" : undefined} className={s.mobileFamilyLink()}>\n <span className={s.familyMark()}>\n <FamilyMark mark={site.mark} size={24} />\n </span>\n <FamilyName site={site} current={site.id === current} labels={labels} />\n </a>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n }\n // Click only: a pointer passing over the brand never opens the family (Radix opens its menus on hover by default).\n const noHover = (e: React.PointerEvent) => e.preventDefault();\n const columns = [groups.filter((g) => g.group === \"krizaka\" || g.group === \"products\"), groups.filter((g) => g.group === \"open-source\" || g.group === \"github\")];\n return (\n <Nav.Root aria-label={labels.family} defaultValue={defaultOpen ? \"family\" : undefined} className={s.family({ className })}>\n <Nav.List className=\"flex\">\n <Nav.Item value=\"family\">\n <Nav.Trigger aria-label={labels.family} onPointerMove={noHover} onPointerLeave={noHover} className={s.familyTrigger()}>\n <svg viewBox=\"0 0 24 24\" className={s.chevron()} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </Nav.Trigger>\n <Nav.Content onPointerLeave={noHover} className={s.familyPanel()}>\n {columns.map((column, i) => (\n <div key={i} className=\"grid content-start gap-3\">\n {column.map(({ group, sites }) => (\n <div key={group}>\n <p id={`${id}-${group}`} className={s.familyGroupTitle()}>\n {labels.groups[group]}\n </p>\n <ul aria-labelledby={`${id}-${group}`} className=\"grid gap-0.5\">\n {sites.map((site) => (\n <li key={site.id}>\n <Nav.Link href={site.url} data-current={site.id === current ? \"\" : undefined} aria-current={site.id === current ? \"true\" : undefined} className={s.familyLink()}>\n <span className={s.familyMark()}>\n <FamilyMark mark={site.mark} size={28} />\n </span>\n <span className=\"min-w-0\">\n <FamilyName site={site} current={site.id === current} labels={labels} />\n <span className={s.familyText()}>{labels.descriptions[site.id]}</span>\n </span>\n </Nav.Link>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n ))}\n </Nav.Content>\n </Nav.Item>\n </Nav.List>\n <Nav.Viewport onPointerLeave={noHover} className={s.familyViewport()} />\n </Nav.Root>\n );\n}\n\nexport type NavBarBadgeProps = React.ComponentProps<\"span\"> & {\n /** The environment, when it is not production (`DEV`). */\n env?: string;\n /** The version the site runs (`1.2.3`, shown `v1.2.3`). */\n version?: string;\n};\n\n/** A small mono badge beside the brand: the environment and the version (`DEV · v1.2.3`). Hidden below `sm`. */\nexport function NavBarBadge({ env, version, className, children, ...props }: NavBarBadgeProps) {\n const parts = [env, version && `v${version.replace(/^v/, \"\")}`].filter(Boolean);\n return (\n <span className={s.badge({ className })} {...props}>\n {parts.join(\" · \")}\n {children}\n </span>\n );\n}\n\nexport type NavBarLanguageProps = Omit<LanguageSwitchProps, \"variant\">;\n\n/**\n * The language switch, the same on every site: in the bar a globe and the current code (FR) opening a short menu of\n * the languages by their own names; inside `NavBar.Mobile` the same languages as a row in the preferences.\n */\nexport function NavBarLanguage(props: NavBarLanguageProps) {\n const inMobile = React.useContext(MobileContext);\n return <LanguageSwitch variant={inMobile ? \"inline\" : \"menu\"} {...props} />;\n}\n\nexport type NavBarMobilePreferencesProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The group's heading (“Preferences”) — passed translated. */\n label: string;\n};\n\n/** The last group of the mobile panel: the preferences (theme, `NavBar.Language`), in a row under their heading. */\nexport function NavBarMobilePreferences({ label, className, children, ...props }: NavBarMobilePreferencesProps) {\n const id = React.useId();\n return (\n <div role=\"group\" aria-labelledby={id} className={s.mobileGroup({ className })} {...props}>\n <p id={id} className={s.mobileGroupTitle()}>\n {label}\n </p>\n <div className=\"flex flex-wrap items-center gap-2 px-3 py-1\">{children}</div>\n </div>\n );\n}\n\nexport type NavBarRepoProps = Omit<React.ComponentProps<\"a\">, \"children\"> & {\n /** The repository the site is built from. */\n href: string;\n /** The link's accessible name (“Source on GitHub”) — passed translated. */\n label: string;\n};\n\n/** The site's repository on GitHub, an icon link of `NavBar.Actions`. */\nexport function NavBarRepo({ label, className, ...props }: NavBarRepoProps) {\n return (\n <a aria-label={label} className={s.repo({ className })} {...props}>\n <GitHubGlyph size={18} />\n </a>\n );\n}\n\n/**\n * `NavBar.Root/Brand/Family/Badge/Items/Link/Menu/MenuLink/Actions/Repo/Session/Language/Mobile/MobileGroup/MobilePreferences/MobileLink` — the Krizaka navigation bar,\n * the same on every site of the family: floating, tightening on scroll, the family switcher on the brand, one light\n * gliding between its items, accessible menus, a mobile panel.\n */\nexport const NavBar = {\n Root: NavBarRoot,\n Brand: NavBarBrand,\n Family: NavBarFamily,\n Badge: NavBarBadge,\n Items: NavBarItems,\n Link: NavBarLink,\n Menu: NavBarMenu,\n MenuLink: NavBarMenuLink,\n Actions: NavBarActions,\n Repo: NavBarRepo,\n Session: NavBarSession,\n Language: NavBarLanguage,\n Mobile: NavBarMobile,\n MobilePreferences: NavBarMobilePreferences,\n MobileGroup: NavBarMobileGroup,\n MobileLink: NavBarMobileLink,\n};\n","/**\n * Where a menu panel of the bar sits: its left edge under its trigger's, pushed back inside the page when it would run\n * past the right edge, never closer to the left edge than the gutter. All values are pixels of the page (a bounding\n * rect's `left`, a width), the result is the panel's `left` relative to the bar's navigation (`root`). Pure, so a\n * viewport of 360 px and one of 1280 px are tested without a browser.\n */\nexport interface PlacePanel {\n /** The trigger's left edge. */\n trigger: number;\n /** The navigation's left edge (the panel is positioned inside it). */\n root: number;\n /** The panel's width. */\n panel: number;\n /** The window's width. */\n window: number;\n /**\n * The space kept between the panel and the window's edges.\n * @default 16\n */\n gutter?: number;\n}\n\nexport function placePanel({ trigger, root, panel, window, gutter = 16 }: PlacePanel): number {\n const wanted = trigger - root;\n const farthest = window - gutter - panel - root;\n const nearest = gutter - root;\n return Math.round(Math.max(nearest, Math.min(wanted, farthest)));\n}\n","// Client. The bar's « who is here » island, the same for every product: it asks `GET /api/me` (the contract of ./me)\n// through @krizaka/query and shows the product's account menu or its sign-in actions. It needs a QueryClient above it.\nimport { krizakaFetch, useQuery } from \"@krizaka/query\";\nimport * as React from \"react\";\n\nimport { type MeResponse, meSchema } from \"./me\";\n\nexport type NavBarSessionProps<TAccount = unknown> = {\n /**\n * Where the contract is served.\n * @default \"/api/me\"\n */\n endpoint?: string;\n /**\n * The session the server already knows (a dynamic page reading its cookie): the first paint then IS the answer, with no\n * placeholder and no swap. Leave it out on a static page; the bar reserves its place until the answer comes.\n */\n initial?: MeResponse<TAccount>;\n /** Signed out: the product's `ProductBarActions`, told whether sign-up is open. */\n signedOut: (state: { signupOpen: boolean }) => React.ReactNode;\n /** Signed in: the product's `AccountMenu`, given the account. */\n signedIn: (account: TAccount, state: { signupOpen: boolean }) => React.ReactNode;\n /**\n * The server's hint that a session cookie exists (krizaka-ui#827): while the answer is on its way the bar then reserves\n * a signed-in placeholder (account-sized, `data-state=\"signed-in-pending\"`) instead of an empty place, and never the\n * « Sign in » action. A hint, never the proof: `/api/me` still decides. Left out, it is read from the family's readable\n * flag cookie (`kz-session=1`, kept by `sessionHint` of `@krizaka/auth` in the proxy), so a static page needs no prop.\n */\n sessionHint?: boolean;\n /** The hint's words while the answer is on its way (“Checking your session…”) — passed translated. */\n hint: string;\n /** Classes of the loading placeholder. */\n className?: string;\n};\n\n/** The readable flag the proxy keeps next to the HttpOnly session cookie (`@krizaka/auth` `SESSION_HINT_COOKIE`; a test pins the two). */\nexport const SESSION_HINT_COOKIE = \"kz-session\";\n\nconst noop = () => () => {};\nconst readFlag = () => typeof document !== \"undefined\" && document.cookie.split(\";\").some((part) => part.trim() === `${SESSION_HINT_COOKIE}=1`);\n\n/** Whether the readable flag cookie says a session exists. False on the server and on the first hydration pass (no mismatch). */\nexport function useSessionHint(): boolean {\n return React.useSyncExternalStore(noop, readFlag, () => false);\n}\n\nexport const sessionKey = (endpoint: string) => [\"krizaka\", \"session\", endpoint] as const;\n\n/** What the bar knows of the visitor: `pending` is NOT « signed out » — nothing is drawn as either until the answer comes. */\nexport type NavSession<TAccount = unknown> = { status: \"pending\" } | { status: \"in\"; account: TAccount; signupOpen: boolean } | { status: \"out\"; signupOpen: boolean };\n\n/**\n * The one « who is here » reading of the family (the bar, a hero's action, a closing call all read this and so never\n * disagree). Three rules, krizaka-ui#800: (1) `pending` is its own state, never drawn as signed out; (2) only an answer\n * (`GET /api/me` 200) changes the state — a failed or throttled refetch keeps the last known state instead of flipping a\n * signed-in person to « Sign in »; (3) with no answer at all (the first request failed) the visitor can still sign in.\n */\nexport function useNavSession<TAccount = unknown>(endpoint = \"/api/me\", initial?: MeResponse<TAccount>): NavSession<TAccount> {\n const { data, isPending, isError } = useQuery({\n queryKey: sessionKey(endpoint),\n queryFn: ({ signal }) => krizakaFetch(endpoint, { schema: meSchema, signal, cache: \"no-store\" }),\n staleTime: 30_000,\n retry: false,\n throwOnError: false,\n ...(initial ? { initialData: initial as MeResponse } : {}),\n });\n if (data) {\n const me = data as MeResponse<TAccount>;\n return me.signedIn && me.account !== undefined ? { status: \"in\", account: me.account, signupOpen: me.signupOpen } : { status: \"out\", signupOpen: me.signupOpen };\n }\n if (isPending && !isError) return { status: \"pending\" };\n return { status: \"out\", signupOpen: false };\n}\n\n/**\n * The bar's session island: put it in `NavBar.Actions`. While the answer is on its way it reserves the place and says\n * `hint` politely (or, given `initial`, draws the server's answer at once); if the first request fails it shows the\n * signed-out actions (the visitor can still sign in).\n */\nexport function NavBarSession<TAccount = unknown>({ endpoint = \"/api/me\", initial, sessionHint, signedOut, signedIn, hint, className }: NavBarSessionProps<TAccount>) {\n const session = useNavSession<TAccount>(endpoint, initial);\n const flagged = useSessionHint();\n if (session.status === \"pending\") {\n if (sessionHint ?? flagged) {\n return (\n <span role=\"status\" aria-live=\"polite\" data-state=\"signed-in-pending\" className={className}>\n <span aria-hidden=\"true\" className=\"inline-block size-9 rounded-full bg-surface-2\" />\n <span className=\"sr-only\">{hint}</span>\n </span>\n );\n }\n return (\n <span role=\"status\" aria-live=\"polite\" data-state=\"loading\" className={className}>\n <span className=\"sr-only\">{hint}</span>\n </span>\n );\n }\n const state = { signupOpen: session.signupOpen };\n return <>{session.status === \"in\" ? signedIn(session.account, state) : signedOut(state)}</>;\n}\n","// Client (the Button). The right side of a product's bar, decided once for every product (« the objective is to use the app,\n// not to talk to us »): the primary action is using the app — « Sign in » while sign-up is closed, « Try » once it opens —\n// never a duplicate « Sign in » beside it, never « Contact » (that is a plain link in the footer).\nimport type * as React from \"react\";\n\nimport { Button } from \"../button/button\";\n\n/** The two ways into a product. */\nexport const ProductBarAction = { SignIn: \"sign-in\", Try: \"try\" } as const;\nexport type ProductBarAction = (typeof ProductBarAction)[keyof typeof ProductBarAction];\n\nexport interface ProductBarState {\n /** Whether the product accepts new accounts (its `signupOpen` setting). */\n signupOpen: boolean;\n /** Whether the product has a « try it » action (a free first audit, a founder offer). */\n hasTry: boolean;\n}\n\n/** What the bar shows: one primary, and « Sign in » beside it only when it is not the primary. */\nexport function productBarActions({ signupOpen, hasTry }: ProductBarState): { primary: ProductBarAction; secondary: ProductBarAction | null } {\n return signupOpen && hasTry ? { primary: ProductBarAction.Try, secondary: ProductBarAction.SignIn } : { primary: ProductBarAction.SignIn, secondary: null };\n}\n\nexport interface ProductBarLink {\n href: string;\n /** Passed translated. */\n label: string;\n}\n\nexport type ProductBarActionsProps = {\n /** Where « Sign in » leads, and its words. */\n signIn: ProductBarLink;\n /** « Try for free » (the first audit is free), the founder offer: absent when the product has none. */\n tryIt?: ProductBarLink;\n /** Whether the product accepts new accounts (its `signupOpen` setting): « Try » is the primary action only then. */\n signupOpen: boolean;\n /** The app's link component (Next's `Link`); an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /**\n * `bar` (from `md`, the buttons of the bar) or `panel` (the mobile panel: full-width, the primary last).\n * @default \"bar\"\n */\n placement?: \"bar\" | \"panel\";\n};\n\n/** The product bar's actions: use the app. Put it in `NavBar.Actions` (`placement=\"bar\"`) or in `NavBar.Mobile` (`placement=\"panel\"`). */\nexport function ProductBarActions({ signIn, tryIt, signupOpen, linkAs: Link = \"a\", placement = \"bar\" }: ProductBarActionsProps) {\n const { primary, secondary } = productBarActions({ signupOpen, hasTry: Boolean(tryIt) });\n const link = (kind: ProductBarAction) => (kind === ProductBarAction.Try && tryIt ? tryIt : signIn);\n const panel = placement === \"panel\";\n const button = (kind: ProductBarAction, variant: \"primary\" | \"ghost\") => (\n <Button key={kind} asChild variant={variant} size={panel ? \"md\" : \"sm\"} className={panel ? (variant === \"primary\" ? \"mt-2 w-full font-bold\" : \"w-full\") : variant === \"primary\" ? \"ml-1 hidden font-bold md:inline-flex\" : \"hidden md:inline-flex\"}>\n <Link href={link(kind).href}>{link(kind).label}</Link>\n </Button>\n );\n return (\n <>\n {secondary ? button(secondary, \"ghost\") : null}\n {button(primary, \"primary\")}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAM,YAAY,EAAE,iBAAiB,qBAAqB,MAAM,SAAS;AAGzE,SAAS,WAAqB,EAAE,UAAU,YAAY,QAAQ,GAAmC;AACtG,QAAM,OAA6B,YAAY,YAAY,SAAY,EAAE,UAAU,YAAY,QAAQ,IAAI,EAAE,UAAU,OAAO,WAAW;AACzI,SAAO,IAAI,SAAS,KAAK,UAAU,IAAI,GAAG,EAAE,QAAQ,KAAK,SAAS,EAAE,GAAG,WAAW,gBAAgB,mBAAmB,EAAE,CAAC;AAC1H;AAGO,IAAM,WAAW;AAAA,EACtB,aAAa;AAAA,IACX,SAAS;AAAA,IACT,QAAQ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AAAA,EACnB,aAAa;AAAA,EACb,YAAY;AACd;;;AGpnBM,SAIF,YAAAE,WAJE,OAAAC,MAIF,QAAAC,aAJE;AA5CC,IAAM,mBAAmB,EAAE,QAAQ,WAAW,KAAK,MAAM;AAWzD,SAAS,kBAAkB,EAAE,YAAY,OAAO,GAAuF;AAC5I,SAAO,cAAc,SAAS,EAAE,SAAS,iBAAiB,KAAK,WAAW,iBAAiB,OAAO,IAAI,EAAE,SAAS,iBAAiB,QAAQ,WAAW,KAAK;AAC5J;AAyBO,SAAS,kBAAkB,EAAE,QAAQ,OAAO,YAAY,QAAQ,OAAO,KAAK,YAAY,MAAM,GAA2B;AAC9H,QAAM,EAAE,SAAS,UAAU,IAAI,kBAAkB,EAAE,YAAY,QAAQ,QAAQ,KAAK,EAAE,CAAC;AACvF,QAAM,OAAO,CAAC,SAA4B,SAAS,iBAAiB,OAAO,QAAQ,QAAQ;AAC3F,QAAM,QAAQ,cAAc;AAC5B,QAAM,SAAS,CAAC,MAAwB,YACtC,gBAAAD,KAAC,UAAkB,SAAO,MAAC,SAAkB,MAAM,QAAQ,OAAO,MAAM,WAAW,QAAS,YAAY,YAAY,0BAA0B,WAAY,YAAY,YAAY,yCAAyC,yBACzN,0BAAAA,KAAC,QAAK,MAAM,KAAK,IAAI,EAAE,MAAO,eAAK,IAAI,EAAE,OAAM,KADpC,IAEb;AAEF,SACE,gBAAAC,MAAAF,WAAA,EACG;AAAA,gBAAY,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,OAAO,SAAS,SAAS;AAAA,KAC5B;AAEJ;","names":["React","window","Fragment","jsx","jsxs","Fragment","jsx","jsxs"]}
1
+ {"version":3,"sources":["../src/nav-bar/me.ts","../src/nav-bar/nav-bar.tsx","../src/nav-bar/placement.ts","../src/nav-bar/session.tsx","../src/nav-bar/product-actions.tsx"],"sourcesContent":["// The « who is here » contract, the same for every product: `GET /api/me` answers 200 `{ signedIn, signupOpen, account? }`\n// with `Cache-Control: private, no-store` and `Vary: Cookie`. A public page asking who is there is not an error: signed\n// out is a 200 with `signedIn: false`, never a 401.\n\n/** The body of `GET /api/me`. `account` is the product's own shape, present only when `signedIn`. */\nexport interface MeResponse<TAccount = unknown> {\n signedIn: boolean;\n /** Whether the product accepts new accounts (its `signupOpen` setting). */\n signupOpen: boolean;\n account?: TAccount;\n}\n\n/** The headers of the answer: per-visitor, never cached, varying with the session cookie. */\nexport const meHeaders = { \"Cache-Control\": \"private, no-store\", Vary: \"Cookie\" } as const;\n\n/** The 200 answer of `GET /api/me` for a route handler. A signed-out visitor never gets an `account`. */\nexport function meResponse<TAccount>({ signedIn, signupOpen, account }: MeResponse<TAccount>): Response {\n const body: MeResponse<TAccount> = signedIn && account !== undefined ? { signedIn, signupOpen, account } : { signedIn: false, signupOpen };\n return new Response(JSON.stringify(body), { status: 200, headers: { ...meHeaders, \"Content-Type\": \"application/json\" } });\n}\n\n/** A Standard Schema of the body, for `krizakaFetch`: refuses anything that is not the contract. */\nexport const meSchema = {\n \"~standard\": {\n version: 1,\n vendor: \"krizaka\",\n validate(value: unknown) {\n const v = value as Partial<MeResponse> | null;\n if (v && typeof v === \"object\" && typeof v.signedIn === \"boolean\" && typeof v.signupOpen === \"boolean\" && (v.signedIn || !(\"account\" in v))) return { value: v as MeResponse };\n return { issues: [{ message: \"Expected { signedIn: boolean, signupOpen: boolean, account?: … }.\" }] };\n },\n },\n} as const;\n","// Client (scroll, a sliding indicator, menus). Radix NavigationMenu does the menus' semantics and keyboard (Enter, Space\n// and ↓ open; ↑ ↓ Home End walk; Escape closes and returns the focus; Tab out closes); this file draws the Krizaka bar:\n// a floating pill that tightens once the page scrolls, one light that glides to the item under the pointer or the\n// focus and rests on the current page, and a mobile panel that is a plain disclosure (no focus trap, Escape closes).\nimport { NavigationMenu as Nav, Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { FamilyMark, GitHubGlyph } from \"../family-mark\";\nimport { LanguageSwitch, type LanguageSwitchProps } from \"../language-switch/language-switch\";\nimport { type FamilyLabels, familyLabels, type OrgFacts, type Site, siteById, type SiteId, sitesByGroup } from \"../sites/sites\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\nimport { placePanel } from \"./placement\";\nimport { NavBarSession } from \"./session\";\n\nexport const navBar = tv({\n slots: {\n root:\n \"group/nav relative z-40 mx-auto flex h-14 w-full items-center gap-2 border-border-subtle bg-surface-1 \" +\n \"transition-[height,background-color,border-color,box-shadow] duration-300 motion-reduce:transition-none \" +\n \"data-compact:h-12 data-compact:border-border-default data-compact:bg-surface-1 data-compact:shadow-lg\",\n brand:\n \"mr-2 inline-flex shrink-0 items-center gap-2 font-display text-[15px] font-bold tracking-tight text-fg no-underline \" +\n \"rounded-md focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n items: \"relative hidden md:block\",\n list:\n \"group/list relative isolate flex items-center gap-0.5 \" +\n // The ink rule (Cahier, ADR-004): a pen line under the item that is pointed at or focused, resting on the current page.\n \"before:absolute before:left-0 before:top-0 before:-z-10 before:h-0.5 before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-[calc(var(--kz-ind-y)+var(--kz-ind-h)-6px)] \" +\n \"before:scale-x-[0.72] before:bg-fg before:opacity-0 before:transition-[translate,width,opacity] before:duration-300 motion-reduce:before:transition-none \" +\n \"data-[indicator=on]:before:opacity-100\",\n item:\n \"inline-flex h-9 select-none items-center gap-1 rounded-sm px-3.5 text-sm font-medium text-fg-secondary no-underline transition-colors \" +\n \"hover:text-fg data-active:text-fg data-[state=open]:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n // Before the light is ready (server render), the current page carries its own tint.\n \"group-not-data-[indicator=on]/list:data-active:underline group-not-data-[indicator=on]/list:data-active:decoration-2 group-not-data-[indicator=on]/list:data-active:underline-offset-8\",\n chevron: \"h-3.5 w-3.5 transition-transform duration-300 group-data-[state=open]/trigger:rotate-180 motion-reduce:transition-none\",\n viewport:\n // `left` is set by NavBarItems (--kz-menu-left): the panel's edge under its trigger, kept inside the page.\n \"kz-pop absolute left-[var(--kz-menu-left,0px)] top-full mt-2 h-(--radix-navigation-menu-viewport-height) w-(--radix-navigation-menu-viewport-width) origin-top-left overflow-hidden \" +\n \"rounded-2xl border border-border-default bg-surface-1 shadow-lg transition-[left,width,height] duration-300 motion-reduce:transition-none\",\n // Icon · title · a description of two lines at most. 28 rem (40 rem in two columns), never wider than the page\n // between its gutters, and never taller than the screen.\n panel: \"grid w-[min(28rem,calc(100vw-2rem))] max-h-[calc(100dvh-6rem)] gap-0.5 overflow-y-auto p-1.5\",\n panelWide: \"w-[min(40rem,calc(100vw-2rem))] md:grid-cols-2\",\n menuLink:\n \"group/link flex items-start gap-3 rounded-lg px-2.5 py-2 text-left no-underline outline-hidden transition-colors \" +\n \"hover:bg-surface-2 focus-visible:bg-surface-2 focus-visible:ring-2 focus-visible:ring-ring data-active:bg-accent-soft\",\n menuIcon:\n \"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border-default bg-surface-2 text-fg-accent \" +\n \"transition-[transform,border-color] duration-300 group-hover/link:-translate-y-0.5 group-hover/link:border-accent [&>svg]:h-4 [&>svg]:w-4 motion-reduce:transform-none\",\n menuTitle: \"block line-clamp-2 wrap-break-word text-sm font-semibold leading-5 text-fg\",\n // Two lines at most, wrapped at word boundaries — a longer one ends in an ellipsis, never cut mid-sentence.\n menuText: \"mt-0.5 block line-clamp-2 wrap-break-word text-xs leading-4 text-fg-secondary\",\n actions: \"ml-auto flex items-center gap-2\",\n toggle:\n \"inline-flex h-9 w-9 items-center justify-center rounded-sm border border-border-subtle bg-surface-2 text-fg md:hidden \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n mobile: \"kz-pop absolute inset-x-0 top-full mt-2 grid gap-1 rounded-2xl border border-border-default bg-surface-1 p-2 shadow-lg md:hidden\",\n mobileGroup: \"grid gap-0.5 [&+&]:mt-1 [&+&]:border-t [&+&]:border-border-subtle [&+&]:pt-2\",\n mobileGroupTitle: \"px-3 pb-1 pt-1 text-[11px] font-semibold text-fg-secondary\",\n mobileLink:\n \"flex items-center justify-between rounded-xl px-3 py-3 text-[15px] font-medium text-fg no-underline hover:bg-surface-2 \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-fg-accent\",\n // The family switcher: a chevron attached to the brand, its panel aligned on the bar's left edge.\n family: \"hidden md:block\",\n familyTrigger:\n \"group/trigger -ml-2 mr-1 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-sm text-fg-secondary transition-colors \" +\n \"hover:bg-surface-3 hover:text-fg data-[state=open]:bg-surface-3 data-[state=open]:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n familyViewport:\n \"kz-pop absolute left-0 top-full mt-2 h-(--radix-navigation-menu-viewport-height) w-(--radix-navigation-menu-viewport-width) origin-top-left overflow-hidden \" +\n \"rounded-2xl border border-border-default bg-surface-1 shadow-lg transition-[width,height] duration-300 motion-reduce:transition-none\",\n familyPanel: \"grid w-[min(92vw,42rem)] gap-x-2 gap-y-3 p-3 sm:grid-cols-2\",\n familyGroupTitle: \"px-3 pb-1 pt-1 text-[11px] font-semibold text-fg-secondary\",\n familyLink:\n \"group/link flex items-start gap-3 rounded-xl px-3 py-2.5 text-left no-underline outline-hidden transition-colors \" +\n \"hover:bg-surface-2 focus-visible:bg-surface-2 focus-visible:ring-2 focus-visible:ring-ring data-current:bg-accent-soft\",\n familyMark: \"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center text-fg\",\n familyName: \"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-sm font-semibold text-fg\",\n familyText: \"mt-0.5 block text-xs leading-relaxed text-fg-secondary\",\n familyTag: \"rounded-sm px-1.5 py-px text-[10px] font-semibold\",\n mobileFamily: \"mt-1 grid gap-2 border-t border-border-subtle px-1 pb-1 pt-3\",\n mobileFamilyLink:\n \"flex min-h-11 items-center gap-3 rounded-xl px-2 py-2 text-[15px] font-medium text-fg no-underline hover:bg-surface-2 \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-current:bg-accent-soft\",\n badge:\n \"hidden h-6 shrink-0 items-center gap-1 rounded-sm border border-border-subtle bg-surface-2 px-2 font-mono text-[11px] font-medium text-fg-secondary sm:inline-flex\",\n repo:\n \"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-sm text-fg-secondary transition-colors hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n variants: {\n floating: {\n true: { root: \"max-w-5xl rounded-sm border pl-5 pr-2 data-compact:max-w-4xl\" },\n false: { root: \"border-b px-4 md:px-6\" },\n },\n },\n defaultVariants: { floating: true },\n});\nconst s = navBar();\n\ninterface NavBarContext {\n label: string;\n open: boolean;\n setOpen: (open: boolean) => void;\n panelId: string;\n}\nconst Context = React.createContext<NavBarContext | null>(null);\n/** The open menu of `NavBar.Items` (`\"\"`: none), so a plain link can close it when the pointer moves on to it. */\nconst ItemsContext = React.createContext<{ close: () => void }>({ close: () => {} });\n/** True inside `NavBar.Mobile`: the family renders as the panel's last group instead of a switcher. */\nconst MobileContext = React.createContext(false);\nconst useNavBar = () => {\n const ctx = React.useContext(Context);\n if (!ctx) throw new Error(\"NavBar parts must be inside <NavBar.Root>.\");\n return ctx;\n};\n\nexport type NavBarRootProps = React.ComponentProps<\"header\"> & {\n /** The accessible name of the navigation (“Main”) — passed translated. */\n label: string;\n /**\n * Pixels of scroll after which the bar tightens (denser, lower, lifted). `false`: never.\n * @default 24\n */\n compactAfter?: number | false;\n /**\n * A floating pill (the Krizaka bar) or a full-width bar with a hairline under it.\n * @default true\n */\n floating?: boolean;\n};\n\n/** The bar. Place it in a `sticky top-3` (floating) or `sticky top-0` wrapper — or let it scroll. */\nexport function NavBarRoot({ label, compactAfter = 24, floating = true, className, children, ...props }: NavBarRootProps) {\n const [compact, setCompact] = React.useState(false);\n const [open, setOpen] = React.useState(false);\n const panelId = React.useId();\n React.useEffect(() => {\n if (compactAfter === false) return;\n const onScroll = () => setCompact(window.scrollY > compactAfter);\n onScroll();\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n return () => window.removeEventListener(\"scroll\", onScroll);\n }, [compactAfter]);\n const ctx = React.useMemo(() => ({ label, open, setOpen, panelId }), [label, open, panelId]);\n return (\n <Context.Provider value={ctx}>\n <header data-compact={compact ? \"\" : undefined} data-floating={floating} className={navBar({ floating }).root({ className })} {...props}>\n {children}\n </header>\n </Context.Provider>\n );\n}\n\nexport type NavBarBrandProps = React.ComponentProps<\"a\"> & {\n /** Renders your link (a router `<Link>`) with the brand's look. */\n asChild?: boolean;\n /**\n * The organisation's facts (`org` of `@krizaka/org`): without children, the brand is the Krizaka mark and `org.brand.name`,\n * so no site writes the company's name by hand. Children, when given, win (a product's own brand).\n */\n org?: Pick<OrgFacts, \"brand\">;\n};\n\n/** The brand: a mark and a name, linking home. */\nexport function NavBarBrand({ asChild, className, org, children, ...props }: NavBarBrandProps) {\n const Comp = asChild ? Slot.Root : \"a\";\n const fromOrg = org && !asChild && children === undefined;\n return (\n <Comp className={s.brand({ className })} {...props}>\n {fromOrg ? (\n <>\n <FamilyMark mark={siteById(\"krizaka\").mark} size={22} />\n {org.brand.name}\n </>\n ) : (\n children\n )}\n </Comp>\n );\n}\n\nexport type NavBarItemsProps = Omit<React.ComponentProps<typeof Nav.Root>, \"orientation\">;\n\n/**\n * The desktop navigation: links and menus, with the light that glides between them. Hidden below `md` (see\n * `NavBar.Mobile`). A menu opens on click, Enter, Space or ↓ — or when the pointer rests on its trigger (hover intent,\n * `delayDuration`, 200 ms): passing over the bar opens nothing. While a menu is open the light stays on its trigger;\n * moving on to a plain link closes the menu, so the bar never shows two current items. A click outside or Escape closes.\n */\nexport function NavBarItems({ className, children, value: valueProp, defaultValue, onValueChange, delayDuration = 200, ...props }: NavBarItemsProps) {\n const { label } = useNavBar();\n const [inner, setInner] = React.useState(defaultValue ?? \"\");\n const value = valueProp ?? inner;\n const setValue = React.useCallback(\n (next: string) => {\n setInner(next);\n onValueChange?.(next);\n },\n [onValueChange],\n );\n const items = React.useMemo(() => ({ close: () => setValue(\"\") }), [setValue]);\n const { ref, handlers } = useSlidingIndicator<HTMLUListElement>({\n item: \"[data-nav-item]\",\n active: \"[data-nav-item][data-active]\",\n prefer: \"[data-nav-item][data-state=open]\",\n follow: true,\n });\n const root = React.useRef<HTMLElement>(null);\n const viewport = React.useRef<HTMLDivElement>(null);\n // The open panel sits under its trigger and stays inside the page (collision): measured when a menu opens, when\n // the panel changes size (another menu) and when the window does.\n React.useLayoutEffect(() => {\n const panel = viewport.current;\n const nav = root.current;\n if (!panel || !nav || !value) return;\n const place = () => {\n const trigger = nav.querySelector<HTMLElement>(\"[data-nav-item][data-state=open]\");\n const width = Number.parseFloat(panel.style.getPropertyValue(\"--radix-navigation-menu-viewport-width\"));\n if (!trigger || !Number.isFinite(width)) return;\n const left = `${placePanel({ trigger: trigger.getBoundingClientRect().left, root: nav.getBoundingClientRect().left, panel: width, window: document.documentElement.clientWidth })}px`;\n if (panel.style.getPropertyValue(\"--kz-menu-left\") !== left) panel.style.setProperty(\"--kz-menu-left\", left);\n };\n place();\n const watch = new MutationObserver(place);\n watch.observe(panel, { attributes: true, attributeFilter: [\"style\"] });\n window.addEventListener(\"resize\", place);\n return () => {\n watch.disconnect();\n window.removeEventListener(\"resize\", place);\n };\n }, [value]);\n return (\n <ItemsContext.Provider value={items}>\n <Nav.Root ref={root} aria-label={label} className={s.items({ className })} value={value} onValueChange={setValue} delayDuration={delayDuration} {...props}>\n <Nav.List ref={ref} className={s.list()} {...handlers}>\n {children}\n </Nav.List>\n <Nav.Viewport ref={viewport} className={s.viewport()} />\n </Nav.Root>\n </ItemsContext.Provider>\n );\n}\n\nexport type NavBarLinkProps = Omit<React.ComponentProps<typeof Nav.Link>, \"active\"> & {\n /** The current page: `aria-current=\"page\"`, and the light rests on it. */\n active?: boolean;\n /** Classes on the list item around the link (to show it from a breakpoint only). */\n itemClassName?: string;\n};\n\n/** A link of the bar. `asChild` renders your router's `<Link>`. */\nexport function NavBarLink({ active, className, itemClassName, onPointerEnter, ...props }: NavBarLinkProps) {\n const { close } = React.useContext(ItemsContext);\n return (\n <Nav.Item className={itemClassName}>\n <Nav.Link\n data-nav-item=\"\"\n data-active={active ? \"\" : undefined}\n active={active}\n aria-current={active ? \"page\" : undefined}\n className={s.item({ className })}\n onPointerEnter={(e) => {\n onPointerEnter?.(e);\n close();\n }}\n {...props}\n />\n </Nav.Item>\n );\n}\n\nexport type NavBarMenuProps = Omit<React.ComponentProps<typeof Nav.Item>, \"children\"> & {\n /** The trigger's words (“Products”) — passed translated. */\n label: string;\n /** The current page is inside this menu: the light rests on its trigger. */\n active?: boolean;\n /** The menu's links (`NavBar.MenuLink`), laid out in a panel; `columns` sets the grid. */\n children: React.ReactNode;\n /**\n * Columns of the panel.\n * @default 1\n */\n columns?: 1 | 2;\n /**\n * A section with this many links or fewer needs no hidden list: they sit in the bar as plain links (the active one\n * marked, no dropdown, `label` unused on the desktop). Above it, a dropdown. `0` always makes a dropdown.\n * @default 3\n */\n inlineUpTo?: number;\n /**\n * From which breakpoint the inline links stand in the bar. Below it (between the phone panel at `md` and this\n * breakpoint) the section is the dropdown, so long labels never overflow a tablet-width bar. `md` inlines as soon as\n * the bar is shown.\n * @default \"lg\"\n */\n inlineFrom?: \"md\" | \"lg\" | \"xl\";\n};\n\n// Static class names (Tailwind reads them at build time).\nconst INLINE_HIDE = { md: \"\", lg: \"max-lg:hidden\", xl: \"max-xl:hidden\" } as const;\nconst DROPDOWN_HIDE = { md: \"\", lg: \"lg:hidden\", xl: \"xl:hidden\" } as const;\n\n/**\n * A menu of the bar: its trigger, and its links in a panel that opens under the bar. A menu of `inlineUpTo` links or\n * fewer (3 by default) is not a menu at all: its links stand in the bar, each with its active state — a hidden list of\n * three is one click more for nothing. The phone's panel groups them as usual (`NavBar.MobileGroup`).\n */\nexport function NavBarMenu({ label, active, columns = 1, inlineUpTo = 3, inlineFrom = \"lg\", children, className, ...props }: NavBarMenuProps) {\n const links = React.Children.toArray(children);\n const dropdown = (hide: string) => (\n <Nav.Item className={cn(hide, className)} {...props}>\n <Nav.Trigger data-nav-item=\"\" data-active={active ? \"\" : undefined} className={cn(s.item(), \"group/trigger\")}>\n {label}\n <svg viewBox=\"0 0 24 24\" className={s.chevron()} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </Nav.Trigger>\n <Nav.Content className={cn(s.panel(), columns === 2 && s.panelWide())}>{children}</Nav.Content>\n </Nav.Item>\n );\n const inline = links.length > 0 && links.length <= inlineUpTo && links.every((c) => React.isValidElement(c) && c.type === NavBarMenuLink);\n if (inline) {\n return (\n <>\n {inlineFrom !== \"md\" && dropdown(DROPDOWN_HIDE[inlineFrom])}\n {links.map((link) => {\n const { title, href, active: here, asChild, children: child, icon: _icon, description: _description, className: linkClass, ...rest } = (link as React.ReactElement<NavBarMenuLinkProps>).props;\n return (\n <NavBarLink key={(link as React.ReactElement).key} asChild={asChild} href={asChild ? undefined : href} active={here} className={linkClass} itemClassName={INLINE_HIDE[inlineFrom]} {...rest}>\n {asChild && React.isValidElement<{ children?: React.ReactNode }>(child) ? React.cloneElement(child, undefined, title) : title}\n </NavBarLink>\n );\n })}\n </>\n );\n }\n return dropdown(\"\");\n}\n\nexport type NavBarMenuLinkProps = Omit<React.ComponentProps<typeof Nav.Link>, \"title\" | \"active\"> & {\n /** The link's name — passed translated. */\n title: string;\n /** One line under it — passed translated. */\n description?: string;\n /** An icon (a signature icon of `@krizaka/icons`: its node lights up on hover). */\n icon?: React.ReactNode;\n /** The current page. */\n active?: boolean;\n};\n\n/** A link inside a menu: an icon, a name and a line of text. */\nexport function NavBarMenuLink({ title, description, icon, active, href, className, asChild, children, ...props }: NavBarMenuLinkProps) {\n const body = (\n <>\n {icon && <span className={s.menuIcon()}>{icon}</span>}\n <span className=\"min-w-0 flex-1\">\n <span className={s.menuTitle()}>{title}</span>\n {description && <span className={s.menuText()}>{description}</span>}\n </span>\n </>\n );\n return (\n <Nav.Link asChild={asChild} href={asChild ? undefined : href} active={active} aria-current={active ? \"page\" : undefined} data-active={active ? \"\" : undefined} className={s.menuLink({ className })} {...props}>\n {asChild && React.isValidElement<{ children?: React.ReactNode }>(children) ? React.cloneElement(children, undefined, body) : body}\n </Nav.Link>\n );\n}\n\n/** The right side: search, theme, language, the call to action. */\nexport function NavBarActions({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={s.actions({ className })} {...props} />;\n}\n\nexport type NavBarMobileProps = React.ComponentProps<\"nav\"> & {\n /** The toggle's name when closed (“Open the menu”) — passed translated. */\n openLabel: string;\n /** The toggle's name when open (“Close the menu”) — passed translated. */\n closeLabel: string;\n};\n\n/**\n * Below `md`: a toggle, and a panel under the bar with its links (`NavBar.MobileLink`), grouped like the bar's menus\n * (`NavBar.MobileGroup`). A disclosure: Escape, a click on a link or a press outside close it; Escape returns the focus\n * to the toggle.\n */\nexport function NavBarMobile({ openLabel, closeLabel, className, children, ...props }: NavBarMobileProps) {\n const { label, open, setOpen, panelId } = useNavBar();\n const toggle = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== \"Escape\") return;\n setOpen(false);\n toggle.current?.focus();\n };\n // A press outside the panel and its toggle closes it (the page under it stays usable).\n const onPress = (e: PointerEvent) => {\n const target = e.target as Node | null;\n if (!target || toggle.current?.contains(target) || document.getElementById(panelId)?.contains(target)) return;\n setOpen(false);\n };\n document.addEventListener(\"keydown\", onKey);\n document.addEventListener(\"pointerdown\", onPress);\n return () => {\n document.removeEventListener(\"keydown\", onKey);\n document.removeEventListener(\"pointerdown\", onPress);\n };\n }, [open, setOpen, panelId]);\n return (\n <>\n <button ref={toggle} type=\"button\" aria-expanded={open} aria-controls={panelId} aria-label={open ? closeLabel : openLabel} onClick={() => setOpen(!open)} className={s.toggle()}>\n <svg viewBox=\"0 0 24 24\" className=\"h-4.5 w-4.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n {open ? <path d=\"M18 6 6 18M6 6l12 12\" /> : <path d=\"M4 7h16M4 12h16M4 17h10\" />}\n </svg>\n </button>\n {open && (\n <nav\n id={panelId}\n aria-label={label}\n className={s.mobile({ className })}\n {...props}\n >\n {/* Delegated close on link activation; keyboard activation of a link fires a click too. */}\n <div\n role=\"presentation\"\n className=\"contents\"\n onClick={(e) => {\n if ((e.target as Element).closest(\"a\")) setOpen(false);\n }}\n >\n <MobileContext.Provider value>{children}</MobileContext.Provider>\n </div>\n </nav>\n )}\n </>\n );\n}\n\nexport type NavBarMobileGroupProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The group's heading — the same words as the bar's menu (“Product”) — passed translated. */\n label: string;\n};\n\n/** A group of the mobile panel: the links of one of the bar's menus under its name, in the same order. */\nexport function NavBarMobileGroup({ label, className, children, ...props }: NavBarMobileGroupProps) {\n const id = React.useId();\n return (\n <div role=\"group\" aria-labelledby={id} className={s.mobileGroup({ className })} {...props}>\n <p id={id} className={s.mobileGroupTitle()}>\n {label}\n </p>\n {children}\n </div>\n );\n}\n\nexport type NavBarMobileLinkProps = React.ComponentProps<\"a\"> & {\n /** The current page. */\n active?: boolean;\n /** Renders your router's `<Link>`. */\n asChild?: boolean;\n};\n\n/** A link of the mobile panel. */\nexport function NavBarMobileLink({ active, asChild, className, ...props }: NavBarMobileLinkProps) {\n const Comp = asChild ? Slot.Root : \"a\";\n return <Comp aria-current={active ? \"page\" : undefined} className={s.mobileLink({ className })} {...props} />;\n}\n\n\nconst tagTone = {\n upcoming: \"bg-accent-soft text-fg ring-1 ring-inset ring-accent/40\",\n construction: \"bg-warning/15 text-fg ring-1 ring-inset ring-warning/40\",\n development: \"bg-surface-3 text-fg ring-1 ring-inset ring-border-strong\",\n current: \"bg-surface-3 text-fg-secondary\",\n};\n\n/** A site's name and its tags: status when not released, “You are here” on the current one. */\nfunction FamilyName({ site, current, labels }: { site: Site; current: boolean; labels: FamilyLabels }) {\n return (\n <span className={s.familyName()}>\n {site.name}\n {site.status !== \"released\" && <span className={cn(s.familyTag(), tagTone[site.status])}>{labels.status[site.status]}</span>}\n {current && <span className={cn(s.familyTag(), tagTone.current)}>{labels.current}</span>}\n </span>\n );\n}\n\nexport type NavBarFamilyProps = {\n /** The site this bar belongs to (`@krizaka/ui/sites`): marked in the family, `aria-current=\"true\"`. */\n current: SiteId;\n /**\n * The family's words, passed translated: `familyLabels.fr` from `@krizaka/ui/sites`, or your own of the same shape.\n * @default familyLabels.en\n */\n labels?: FamilyLabels;\n /** Opens the panel at first render (a story, a screenshot). */\n defaultOpen?: boolean;\n /** Classes of the switcher (or, inside `NavBar.Mobile`, of the family's group). */\n className?: string;\n};\n\n/**\n * @deprecated No site carries the family switcher any more (2026-10-22): krizaka.com is the only way back between the Krizaka sites, through the footer's « A Krizaka project » line. Removed in the next minor; `krizaka/no-family-switcher` refuses it.\n *\n * The family switcher, attached to the brand (place it right after `NavBar.Brand`): a chevron that opens every site of\n * Krizaka grouped — Krizaka · Products · Open source · GitHub — the current one marked. It opens on click, Enter, Space\n * or ↓ (never on hover); ↑ ↓ walk the sites, Escape closes and returns the focus. Hidden below `md`: place a second\n * `NavBar.Family` as the last child of `NavBar.Mobile`, where it renders as the panel's last group.\n */\nexport function NavBarFamily({ current, labels = familyLabels.en, defaultOpen, className }: NavBarFamilyProps) {\n const inMobile = React.useContext(MobileContext);\n const id = React.useId();\n const groups = sitesByGroup();\n if (inMobile) {\n return (\n <div role=\"group\" aria-labelledby={`${id}-family`} className={s.mobileFamily({ className })}>\n <p id={`${id}-family`} className={s.familyGroupTitle()}>\n {labels.family}\n </p>\n {groups.map(({ group, sites }) => (\n <div key={group}>\n {/* The company's own group is named like the family itself: its heading would repeat the panel's. */}\n {group !== \"krizaka\" && (\n <p id={`${id}-${group}`} className={s.familyGroupTitle()}>\n {labels.groups[group]}\n </p>\n )}\n <ul aria-labelledby={group !== \"krizaka\" ? `${id}-${group}` : `${id}-family`} className=\"grid gap-0.5\">\n {sites.map((site) => (\n <li key={site.id}>\n <a href={site.url} data-current={site.id === current ? \"\" : undefined} aria-current={site.id === current ? \"true\" : undefined} className={s.mobileFamilyLink()}>\n <span className={s.familyMark()}>\n <FamilyMark mark={site.mark} size={24} />\n </span>\n <FamilyName site={site} current={site.id === current} labels={labels} />\n </a>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n }\n // Click only: a pointer passing over the brand never opens the family (Radix opens its menus on hover by default).\n const noHover = (e: React.PointerEvent) => e.preventDefault();\n const columns = [groups.filter((g) => g.group === \"krizaka\" || g.group === \"products\"), groups.filter((g) => g.group === \"open-source\" || g.group === \"github\")];\n return (\n <Nav.Root aria-label={labels.family} defaultValue={defaultOpen ? \"family\" : undefined} className={s.family({ className })}>\n <Nav.List className=\"flex\">\n <Nav.Item value=\"family\">\n <Nav.Trigger aria-label={labels.family} onPointerMove={noHover} onPointerLeave={noHover} className={s.familyTrigger()}>\n <svg viewBox=\"0 0 24 24\" className={s.chevron()} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </Nav.Trigger>\n <Nav.Content onPointerLeave={noHover} className={s.familyPanel()}>\n {columns.map((column, i) => (\n <div key={i} className=\"grid content-start gap-3\">\n {column.map(({ group, sites }) => (\n <div key={group}>\n <p id={`${id}-${group}`} className={s.familyGroupTitle()}>\n {labels.groups[group]}\n </p>\n <ul aria-labelledby={`${id}-${group}`} className=\"grid gap-0.5\">\n {sites.map((site) => (\n <li key={site.id}>\n <Nav.Link href={site.url} data-current={site.id === current ? \"\" : undefined} aria-current={site.id === current ? \"true\" : undefined} className={s.familyLink()}>\n <span className={s.familyMark()}>\n <FamilyMark mark={site.mark} size={28} />\n </span>\n <span className=\"min-w-0\">\n <FamilyName site={site} current={site.id === current} labels={labels} />\n <span className={s.familyText()}>{labels.descriptions[site.id]}</span>\n </span>\n </Nav.Link>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n ))}\n </Nav.Content>\n </Nav.Item>\n </Nav.List>\n <Nav.Viewport onPointerLeave={noHover} className={s.familyViewport()} />\n </Nav.Root>\n );\n}\n\nexport type NavBarBadgeProps = React.ComponentProps<\"span\"> & {\n /** The environment, when it is not production (`DEV`). */\n env?: string;\n /** The version the site runs (`1.2.3`, shown `v1.2.3`). */\n version?: string;\n};\n\n/** A small mono badge beside the brand: the environment and the version (`DEV · v1.2.3`). Hidden below `sm`. */\nexport function NavBarBadge({ env, version, className, children, ...props }: NavBarBadgeProps) {\n const parts = [env, version && `v${version.replace(/^v/, \"\")}`].filter(Boolean);\n return (\n <span className={s.badge({ className })} {...props}>\n {parts.join(\" · \")}\n {children}\n </span>\n );\n}\n\nexport type NavBarLanguageProps = Omit<LanguageSwitchProps, \"variant\">;\n\n/**\n * The language switch, the same on every site: in the bar a globe and the current code (FR) opening a short menu of\n * the languages by their own names; inside `NavBar.Mobile` the same languages as a row in the preferences.\n */\nexport function NavBarLanguage(props: NavBarLanguageProps) {\n const inMobile = React.useContext(MobileContext);\n return <LanguageSwitch variant={inMobile ? \"inline\" : \"menu\"} {...props} />;\n}\n\nexport type NavBarMobilePreferencesProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The group's heading (“Preferences”) — passed translated. */\n label: string;\n};\n\n/** The last group of the mobile panel: the preferences (theme, `NavBar.Language`), in a row under their heading. */\nexport function NavBarMobilePreferences({ label, className, children, ...props }: NavBarMobilePreferencesProps) {\n const id = React.useId();\n return (\n <div role=\"group\" aria-labelledby={id} className={s.mobileGroup({ className })} {...props}>\n <p id={id} className={s.mobileGroupTitle()}>\n {label}\n </p>\n <div className=\"flex flex-wrap items-center gap-2 px-3 py-1\">{children}</div>\n </div>\n );\n}\n\nexport type NavBarRepoProps = Omit<React.ComponentProps<\"a\">, \"children\"> & {\n /** The repository the site is built from. */\n href: string;\n /** The link's accessible name (“Source on GitHub”) — passed translated. */\n label: string;\n};\n\n/** The site's repository on GitHub, an icon link of `NavBar.Actions`. */\nexport function NavBarRepo({ label, className, ...props }: NavBarRepoProps) {\n return (\n <a aria-label={label} className={s.repo({ className })} {...props}>\n <GitHubGlyph size={18} />\n </a>\n );\n}\n\n/**\n * `NavBar.Root/Brand/Family/Badge/Items/Link/Menu/MenuLink/Actions/Repo/Session/Language/Mobile/MobileGroup/MobilePreferences/MobileLink` — the Krizaka navigation bar,\n * the same on every site of the family: floating, tightening on scroll, the family switcher on the brand, one light\n * gliding between its items, accessible menus, a mobile panel.\n */\nexport const NavBar = {\n Root: NavBarRoot,\n Brand: NavBarBrand,\n Family: NavBarFamily,\n Badge: NavBarBadge,\n Items: NavBarItems,\n Link: NavBarLink,\n Menu: NavBarMenu,\n MenuLink: NavBarMenuLink,\n Actions: NavBarActions,\n Repo: NavBarRepo,\n Session: NavBarSession,\n Language: NavBarLanguage,\n Mobile: NavBarMobile,\n MobilePreferences: NavBarMobilePreferences,\n MobileGroup: NavBarMobileGroup,\n MobileLink: NavBarMobileLink,\n};\n","/**\n * Where a menu panel of the bar sits: its left edge under its trigger's, pushed back inside the page when it would run\n * past the right edge, never closer to the left edge than the gutter. All values are pixels of the page (a bounding\n * rect's `left`, a width), the result is the panel's `left` relative to the bar's navigation (`root`). Pure, so a\n * viewport of 360 px and one of 1280 px are tested without a browser.\n */\nexport interface PlacePanel {\n /** The trigger's left edge. */\n trigger: number;\n /** The navigation's left edge (the panel is positioned inside it). */\n root: number;\n /** The panel's width. */\n panel: number;\n /** The window's width. */\n window: number;\n /**\n * The space kept between the panel and the window's edges.\n * @default 16\n */\n gutter?: number;\n}\n\nexport function placePanel({ trigger, root, panel, window, gutter = 16 }: PlacePanel): number {\n const wanted = trigger - root;\n const farthest = window - gutter - panel - root;\n const nearest = gutter - root;\n return Math.round(Math.max(nearest, Math.min(wanted, farthest)));\n}\n","// Client. The bar's « who is here » island, the same for every product: it asks `GET /api/me` (the contract of ./me)\n// through @krizaka/query and shows the product's account menu or its sign-in actions. It needs a QueryClient above it.\nimport { krizakaFetch, useQuery } from \"@krizaka/query\";\nimport * as React from \"react\";\n\nimport { type MeResponse, meSchema } from \"./me\";\n\nexport type NavBarSessionProps<TAccount = unknown> = {\n /**\n * Where the contract is served.\n * @default \"/api/me\"\n */\n endpoint?: string;\n /**\n * The session the server already knows (a dynamic page reading its cookie): the first paint then IS the answer, with no\n * placeholder and no swap. Leave it out on a static page; the bar reserves its place until the answer comes.\n */\n initial?: MeResponse<TAccount>;\n /** Signed out: the product's `ProductBarActions`, told whether sign-up is open. */\n signedOut: (state: { signupOpen: boolean }) => React.ReactNode;\n /** Signed in: the product's `AccountMenu`, given the account. */\n signedIn: (account: TAccount, state: { signupOpen: boolean }) => React.ReactNode;\n /**\n * The server's hint that a session cookie exists (krizaka-ui#827): while the answer is on its way the bar then reserves\n * a signed-in placeholder (account-sized, `data-state=\"signed-in-pending\"`) instead of an empty place, and never the\n * « Sign in » action. A hint, never the proof: `/api/me` still decides. Left out, it is read from the family's readable\n * flag cookie (`kz-session=1`, kept by `sessionHint` of `@krizaka/auth` in the proxy), so a static page needs no prop.\n */\n sessionHint?: boolean;\n /** The hint's words while the answer is on its way (“Checking your session…”) — passed translated. */\n hint: string;\n /** Classes of the loading placeholder. */\n className?: string;\n};\n\n/** The readable flag the proxy keeps next to the HttpOnly session cookie (`@krizaka/auth` `SESSION_HINT_COOKIE`; a test pins the two). */\nexport const SESSION_HINT_COOKIE = \"kz-session\";\n\nconst noop = () => () => {};\nconst readFlag = () => typeof document !== \"undefined\" && document.cookie.split(\";\").some((part) => part.trim() === `${SESSION_HINT_COOKIE}=1`);\n\n/** Whether the readable flag cookie says a session exists. False on the server and on the first hydration pass (no mismatch). */\nexport function useSessionHint(): boolean {\n return React.useSyncExternalStore(noop, readFlag, () => false);\n}\n\nexport const sessionKey = (endpoint: string) => [\"krizaka\", \"session\", endpoint] as const;\n\n/** What the bar knows of the visitor: `pending` is NOT « signed out » — nothing is drawn as either until the answer comes. */\nexport type NavSession<TAccount = unknown> = { status: \"pending\" } | { status: \"in\"; account: TAccount; signupOpen: boolean } | { status: \"out\"; signupOpen: boolean };\n\n/**\n * The one « who is here » reading of the family (the bar, a hero's action, a closing call all read this and so never\n * disagree). Three rules, krizaka-ui#800: (1) `pending` is its own state, never drawn as signed out; (2) only an answer\n * (`GET /api/me` 200) changes the state — a failed or throttled refetch keeps the last known state instead of flipping a\n * signed-in person to « Sign in »; (3) with no answer at all (the first request failed) the visitor can still sign in.\n */\nexport function useNavSession<TAccount = unknown>(endpoint = \"/api/me\", initial?: MeResponse<TAccount>): NavSession<TAccount> {\n const { data, isPending, isError } = useQuery({\n queryKey: sessionKey(endpoint),\n queryFn: ({ signal }) => krizakaFetch(endpoint, { schema: meSchema, signal, cache: \"no-store\" }),\n staleTime: 30_000,\n retry: false,\n throwOnError: false,\n ...(initial ? { initialData: initial as MeResponse } : {}),\n });\n if (data) {\n const me = data as MeResponse<TAccount>;\n return me.signedIn && me.account !== undefined ? { status: \"in\", account: me.account, signupOpen: me.signupOpen } : { status: \"out\", signupOpen: me.signupOpen };\n }\n if (isPending && !isError) return { status: \"pending\" };\n return { status: \"out\", signupOpen: false };\n}\n\n/**\n * The bar's session island: put it in `NavBar.Actions`. While the answer is on its way it reserves the place and says\n * `hint` politely (or, given `initial`, draws the server's answer at once); if the first request fails it shows the\n * signed-out actions (the visitor can still sign in).\n */\nexport function NavBarSession<TAccount = unknown>({ endpoint = \"/api/me\", initial, sessionHint, signedOut, signedIn, hint, className }: NavBarSessionProps<TAccount>) {\n const session = useNavSession<TAccount>(endpoint, initial);\n const flagged = useSessionHint();\n if (session.status === \"pending\") {\n if (sessionHint ?? flagged) {\n return (\n <span role=\"status\" aria-live=\"polite\" data-state=\"signed-in-pending\" className={className}>\n <span aria-hidden=\"true\" className=\"inline-block size-9 rounded-full bg-surface-2\" />\n <span className=\"sr-only\">{hint}</span>\n </span>\n );\n }\n return (\n <span role=\"status\" aria-live=\"polite\" data-state=\"loading\" className={className}>\n <span className=\"sr-only\">{hint}</span>\n </span>\n );\n }\n const state = { signupOpen: session.signupOpen };\n return <>{session.status === \"in\" ? signedIn(session.account, state) : signedOut(state)}</>;\n}\n","// Client (the Button). The right side of a product's bar, decided once for every product (« the objective is to use the app,\n// not to talk to us »): the primary action is using the app — « Sign in » while sign-up is closed, « Try » once it opens —\n// never a duplicate « Sign in » beside it, never « Contact » (that is a plain link in the footer).\nimport type * as React from \"react\";\n\nimport { Button } from \"../button/button\";\n\n/** The two ways into a product. */\nexport const ProductBarAction = { SignIn: \"sign-in\", Try: \"try\" } as const;\nexport type ProductBarAction = (typeof ProductBarAction)[keyof typeof ProductBarAction];\n\nexport interface ProductBarState {\n /** Whether the product accepts new accounts (its `signupOpen` setting). */\n signupOpen: boolean;\n /** Whether the product has a « try it » action (a free first audit, a founder offer). */\n hasTry: boolean;\n}\n\n/** What the bar shows: one primary, and « Sign in » beside it only when it is not the primary. */\nexport function productBarActions({ signupOpen, hasTry }: ProductBarState): { primary: ProductBarAction; secondary: ProductBarAction | null } {\n return signupOpen && hasTry ? { primary: ProductBarAction.Try, secondary: ProductBarAction.SignIn } : { primary: ProductBarAction.SignIn, secondary: null };\n}\n\nexport interface ProductBarLink {\n href: string;\n /** Passed translated. */\n label: string;\n}\n\nexport type ProductBarActionsProps = {\n /** Where « Sign in » leads, and its words. */\n signIn: ProductBarLink;\n /** « Try for free » (the first audit is free), the founder offer: absent when the product has none. */\n tryIt?: ProductBarLink;\n /** Whether the product accepts new accounts (its `signupOpen` setting): « Try » is the primary action only then. */\n signupOpen: boolean;\n /** The app's link component (Next's `Link`); an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /**\n * `bar` (from `md`, the buttons of the bar) or `panel` (the mobile panel: full-width, the primary last).\n * @default \"bar\"\n */\n placement?: \"bar\" | \"panel\";\n};\n\n/** The product bar's actions: use the app. Put it in `NavBar.Actions` (`placement=\"bar\"`) or in `NavBar.Mobile` (`placement=\"panel\"`). */\nexport function ProductBarActions({ signIn, tryIt, signupOpen, linkAs: Link = \"a\", placement = \"bar\" }: ProductBarActionsProps) {\n const { primary, secondary } = productBarActions({ signupOpen, hasTry: Boolean(tryIt) });\n const link = (kind: ProductBarAction) => (kind === ProductBarAction.Try && tryIt ? tryIt : signIn);\n const panel = placement === \"panel\";\n const button = (kind: ProductBarAction, variant: \"primary\" | \"ghost\") => (\n <Button key={kind} asChild data-signed-out-only=\"\" variant={variant} size={panel ? \"md\" : \"sm\"} className={panel ? (variant === \"primary\" ? \"mt-2 w-full font-bold\" : \"w-full\") : variant === \"primary\" ? \"ml-1 hidden font-bold md:inline-flex\" : \"hidden md:inline-flex\"}>\n <Link href={link(kind).href}>{link(kind).label}</Link>\n </Button>\n );\n return (\n <>\n {secondary ? button(secondary, \"ghost\") : null}\n {button(primary, \"primary\")}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAM,YAAY,EAAE,iBAAiB,qBAAqB,MAAM,SAAS;AAGzE,SAAS,WAAqB,EAAE,UAAU,YAAY,QAAQ,GAAmC;AACtG,QAAM,OAA6B,YAAY,YAAY,SAAY,EAAE,UAAU,YAAY,QAAQ,IAAI,EAAE,UAAU,OAAO,WAAW;AACzI,SAAO,IAAI,SAAS,KAAK,UAAU,IAAI,GAAG,EAAE,QAAQ,KAAK,SAAS,EAAE,GAAG,WAAW,gBAAgB,mBAAmB,EAAE,CAAC;AAC1H;AAGO,IAAM,WAAW;AAAA,EACtB,aAAa;AAAA,IACX,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,SAAS,OAAgB;AACvB,YAAM,IAAI;AACV,UAAI,KAAK,OAAO,MAAM,YAAY,OAAO,EAAE,aAAa,aAAa,OAAO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M,mBAAmB,EAAE,QAAQ,WAAW,KAAK,MAAM;AAWzD,SAAS,kBAAkB,EAAE,YAAY,OAAO,GAAuF;AAC5I,SAAO,cAAc,SAAS,EAAE,SAAS,iBAAiB,KAAK,WAAW,iBAAiB,OAAO,IAAI,EAAE,SAAS,iBAAiB,QAAQ,WAAW,KAAK;AAC5J;AAyBO,SAAS,kBAAkB,EAAE,QAAQ,OAAO,YAAY,QAAQ,OAAO,KAAK,YAAY,MAAM,GAA2B;AAC9H,QAAM,EAAE,SAAS,UAAU,IAAI,kBAAkB,EAAE,YAAY,QAAQ,QAAQ,KAAK,EAAE,CAAC;AACvF,QAAM,OAAO,CAAC,SAA4B,SAAS,iBAAiB,OAAO,QAAQ,QAAQ;AAC3F,QAAM,QAAQ,cAAc;AAC5B,QAAM,SAAS,CAAC,MAAwB,YACtC,gBAAAD,KAAC,UAAkB,SAAO,MAAC,wBAAqB,IAAG,SAAkB,MAAM,QAAQ,OAAO,MAAM,WAAW,QAAS,YAAY,YAAY,0BAA0B,WAAY,YAAY,YAAY,yCAAyC,yBACjP,0BAAAA,KAAC,QAAK,MAAM,KAAK,IAAI,EAAE,MAAO,eAAK,IAAI,EAAE,OAAM,KADpC,IAEb;AAEF,SACE,gBAAAC,MAAAF,WAAA,EACG;AAAA,gBAAY,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,OAAO,SAAS,SAAS;AAAA,KAC5B;AAEJ;","names":["React","window","Fragment","jsx","jsxs","Fragment","jsx","jsxs"]}
@@ -1,9 +1,9 @@
1
- import {
2
- cn
3
- } from "./chunk-KH3JOEPY.js";
4
1
  import {
5
2
  warnDeprecated
6
3
  } from "./chunk-KGLRZMCY.js";
4
+ import {
5
+ cn
6
+ } from "./chunk-KH3JOEPY.js";
7
7
 
8
8
  // src/product-page/product-page.tsx
9
9
  import { ArgumentCard } from "@krizaka/ui/argument-card";
@@ -28,7 +28,7 @@ var shopGalleryLabelsFr = {
28
28
  // src/shop-gallery/shop-gallery.tsx
29
29
  import * as React from "react";
30
30
  import { jsx, jsxs } from "react/jsx-runtime";
31
- var Lightbox = React.lazy(() => import("./lightbox-D5NAHFEA.js"));
31
+ var Lightbox = React.lazy(() => import("./lightbox-Q45BZ3HW.js"));
32
32
  var BENTO = 5;
33
33
  var styles = `
34
34
  .kz-sg{position:relative}
@@ -26,6 +26,20 @@ function fieldKey(event, { draft, value, commit, onValueChange, setDraft }) {
26
26
  setDraft("");
27
27
  }
28
28
  }
29
+ var reached = (max, count) => max !== void 0 && count >= max;
30
+ function commitDraft({ typed, exact, canCreate, full, value, marker, onValueChange, onCreate, setDraft }) {
31
+ if (!typed) return;
32
+ if (exact) {
33
+ if (value.includes(exact.value) || full) {
34
+ setDraft("");
35
+ return;
36
+ }
37
+ onValueChange([...value, exact.value]);
38
+ } else if (canCreate) {
39
+ onCreate?.(typed, marker);
40
+ } else return;
41
+ setDraft("");
42
+ }
29
43
  function TagSelector({
30
44
  label,
31
45
  options,
@@ -45,7 +59,7 @@ function TagSelector({
45
59
  maxLength = 80,
46
60
  emptyLabel
47
61
  }) {
48
- const full = max !== void 0 && value.length >= max;
62
+ const full = reached(max, value.length);
49
63
  const [draft, setDraft] = React.useState("");
50
64
  const [marker, setMarker] = React.useState(defaultMarker);
51
65
  const typed = draft.replace(/\s+/g, " ").trim();
@@ -54,15 +68,7 @@ function TagSelector({
54
68
  const shown = creatable && needle ? matching(options, needle, value) : options;
55
69
  const canCreate = Boolean(creatable && onCreate && typed && !exact && !full);
56
70
  const toggle = (option, on) => onValueChange(on ? [...value, option.value] : value.filter((v) => v !== option.value));
57
- const commit = () => {
58
- if (!typed) return;
59
- if (exact) {
60
- if (!value.includes(exact.value) && !full) onValueChange([...value, exact.value]);
61
- } else if (canCreate) {
62
- onCreate?.(typed, marker);
63
- } else return;
64
- setDraft("");
65
- };
71
+ const commit = () => commitDraft({ typed, exact, canCreate, full, value, marker, onValueChange, onCreate, setDraft });
66
72
  const listId = React.useId();
67
73
  return /* @__PURE__ */ jsxs("div", { className: ["flex flex-col gap-2", className].filter(Boolean).join(" "), children: [
68
74
  /* @__PURE__ */ jsxs("div", { role: "group", "aria-label": label, id: listId, className: "flex flex-wrap gap-2", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tag-selector/tag-selector.tsx"],"sourcesContent":["// Client. Interests, languages, a workspace's tags: toggle chips with a limit and a count; once it is reached the others\n// rest (disabled) and the count says so. An option with a `marker` is a tag with a colour beside its name (`TagChip`).\n// `creatable` adds a field: Enter takes the typed word — the tag of that name if it exists, else a new one the host creates\n// (`onCreate`, with the marker chosen from the closed palette) — and the typed word narrows the tags offered.\nimport * as React from \"react\";\n\nimport { Chip, type Marker, MarkerPicker, TagChip } from \"../chip\";\n\nexport type TagOption = {\n value: string;\n label: string;\n /** A tag's colour: a name of the closed palette (`@krizaka/organize` `MARKERS`). Without it, a plain chip. */\n marker?: Marker;\n};\n\ntype CreatableProps = {\n /** Adds a field: Enter chooses the tag typed, or asks the host to create it. */\n creatable?: boolean;\n /** Called with the new name (trimmed, as typed) and the marker chosen; the host creates the tag (it may refuse), adds the option and chooses it. */\n onCreate?: (name: string, marker: Marker) => void;\n /** The field's accessible name (\"Add a tag\"), passed translated. */\n inputLabel?: string;\n /** The field's placeholder, passed translated. */\n placeholder?: string;\n /** The create button: `(name) => \"Create “\" + name + \"”\"`, passed translated. */\n createLabel?: (name: string) => string;\n /** The name of each colour, passed translated: shows the colour choice beside the field. */\n markerNames?: Readonly<Record<Marker, string>>;\n /** The colour choice's accessible name (\"Colour of the new tag\"). */\n markerLabel?: string;\n /** The colour a new tag starts with (default `blue`). */\n defaultMarker?: Marker;\n /** The most characters of a name (default 80, the contract's `NAME_MAX`). */\n maxLength?: number;\n /** What is said when nothing matches and creating is not offered (“No tag of that name”), passed translated. */\n emptyLabel?: string;\n};\n\nexport type TagSelectorProps = CreatableProps & {\n /** The group's name (“Interests”) — passed translated. */\n label: string;\n /** The tags offered. */\n options: readonly TagOption[];\n /** The tags chosen. */\n value: readonly string[];\n /** Called with the tags chosen. */\n onValueChange: (value: string[]) => void;\n /** The most that can be chosen. */\n max?: number;\n /** The count under the tags: `(n, max) => n + \" of \" + max`. */\n countLabel?: (count: number, max: number) => string;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The options whose label holds the typed text, and those already chosen. */\nconst matching = (options: readonly TagOption[], needle: string, value: readonly string[]) =>\n options.filter((o) => o.label.toLocaleLowerCase().includes(needle) || value.includes(o.value));\n\n/** One toggle chip: a marked tag wears its marker; the others rest once the limit is reached. */\nfunction OptionChip({ option, on, full, onToggle }: { option: TagOption; on: boolean; full: boolean; onToggle: (next: boolean) => void }) {\n const props = { selected: on, disabled: !on && full, onSelectedChange: onToggle };\n return option.marker ? (\n <TagChip marker={option.marker} {...props}>\n {option.label}\n </TagChip>\n ) : (\n <Chip {...props}>{option.label}</Chip>\n );\n}\n\ntype FieldKeyContext = {\n draft: string;\n value: readonly string[];\n commit: () => void;\n onValueChange: (next: string[]) => void;\n setDraft: (next: string) => void;\n};\n\n/** The typed field's keys: Enter commits, Backspace on an empty field takes the last tag back, Escape clears the draft. */\nfunction fieldKey(event: React.KeyboardEvent<HTMLInputElement>, { draft, value, commit, onValueChange, setDraft }: FieldKeyContext) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit();\n } else if (event.key === \"Backspace\" && !draft && value.length > 0) {\n onValueChange(value.slice(0, -1));\n } else if (event.key === \"Escape\" && draft) {\n event.stopPropagation();\n setDraft(\"\");\n }\n}\n\n/** Toggle chips with a limit and a count — the others rest once the limit is reached; `creatable` types a new one. */\nexport function TagSelector({\n label,\n options,\n value,\n onValueChange,\n max,\n countLabel,\n className,\n creatable,\n onCreate,\n inputLabel,\n placeholder,\n createLabel = (name) => `Create “${name}”`,\n markerNames,\n markerLabel,\n defaultMarker = \"blue\",\n maxLength = 80,\n emptyLabel,\n}: TagSelectorProps) {\n const full = max !== undefined && value.length >= max;\n const [draft, setDraft] = React.useState(\"\");\n const [marker, setMarker] = React.useState<Marker>(defaultMarker);\n const typed = draft.replace(/\\s+/g, \" \").trim();\n const needle = typed.toLocaleLowerCase();\n const exact = options.find((o) => o.label.toLocaleLowerCase() === needle);\n const shown = creatable && needle ? matching(options, needle, value) : options;\n const canCreate = Boolean(creatable && onCreate && typed && !exact && !full);\n const toggle = (option: TagOption, on: boolean) => onValueChange(on ? [...value, option.value] : value.filter((v) => v !== option.value));\n\n const commit = () => {\n if (!typed) return;\n if (exact) {\n if (!value.includes(exact.value) && !full) onValueChange([...value, exact.value]);\n } else if (canCreate) {\n onCreate?.(typed, marker);\n } else return;\n setDraft(\"\");\n };\n const listId = React.useId();\n\n return (\n <div className={[\"flex flex-col gap-2\", className].filter(Boolean).join(\" \")}>\n <div role=\"group\" aria-label={label} id={listId} className=\"flex flex-wrap gap-2\">\n {shown.map((option) => (\n <OptionChip key={option.value} option={option} on={value.includes(option.value)} full={full} onToggle={(next) => toggle(option, next)} />\n ))}\n {creatable && needle && shown.length === 0 && !canCreate && emptyLabel ? <p className=\"m-0 text-xs text-fg-secondary\">{emptyLabel}</p> : null}\n </div>\n {creatable ? (\n <div className=\"flex flex-wrap items-center gap-2\">\n <input\n type=\"text\"\n value={draft}\n maxLength={maxLength}\n aria-label={inputLabel ?? label}\n aria-controls={listId}\n placeholder={placeholder}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => fieldKey(event, { draft, value, commit, onValueChange, setDraft })}\n className=\"h-9 min-w-40 flex-1 rounded-md border border-border-control bg-surface-1 px-3 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n />\n {canCreate ? (\n <>\n {markerNames ? <MarkerPicker label={markerLabel ?? label} names={markerNames} value={marker} onValueChange={setMarker} /> : null}\n <button\n type=\"button\"\n onClick={commit}\n className=\"inline-flex h-9 items-center rounded-md border border-accent bg-accent-soft px-3 text-xs font-semibold text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {createLabel(typed)}\n </button>\n </>\n ) : null}\n </div>\n ) : null}\n {max !== undefined && countLabel ? (\n <p className={[\"m-0 text-xs\", full ? \"font-semibold text-fg-accent\" : \"text-fg-secondary\"].join(\" \")} aria-live=\"polite\">\n {countLabel(value.length, max)}\n </p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAIA,YAAY,WAAW;AA2DnB,SA4FQ,UA5FR,KAwEE,YAxEF;AAPJ,IAAM,WAAW,CAAC,SAA+B,QAAgB,UAC/D,QAAQ,OAAO,CAAC,MAAM,EAAE,MAAM,kBAAkB,EAAE,SAAS,MAAM,KAAK,MAAM,SAAS,EAAE,KAAK,CAAC;AAG/F,SAAS,WAAW,EAAE,QAAQ,IAAI,MAAM,SAAS,GAAyF;AACxI,QAAM,QAAQ,EAAE,UAAU,IAAI,UAAU,CAAC,MAAM,MAAM,kBAAkB,SAAS;AAChF,SAAO,OAAO,SACZ,oBAAC,WAAQ,QAAQ,OAAO,QAAS,GAAG,OACjC,iBAAO,OACV,IAEA,oBAAC,QAAM,GAAG,OAAQ,iBAAO,OAAM;AAEnC;AAWA,SAAS,SAAS,OAA8C,EAAE,OAAO,OAAO,QAAQ,eAAe,SAAS,GAAoB;AAClI,MAAI,MAAM,QAAQ,SAAS;AACzB,UAAM,eAAe;AACrB,WAAO;AAAA,EACT,WAAW,MAAM,QAAQ,eAAe,CAAC,SAAS,MAAM,SAAS,GAAG;AAClE,kBAAc,MAAM,MAAM,GAAG,EAAE,CAAC;AAAA,EAClC,WAAW,MAAM,QAAQ,YAAY,OAAO;AAC1C,UAAM,gBAAgB;AACtB,aAAS,EAAE;AAAA,EACb;AACF;AAGO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc,CAAC,SAAS,gBAAW,IAAI;AAAA,EACvC;AAAA,EACA;AAAA,E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G,CACxI;AAAA,MACA,aAAa,UAAU,MAAM,WAAW,KAAK,CAAC,aAAa,aAAa,oBAAC,OAAE,WAAU,iCAAiC,sBAAW,IAAO;AAAA,OAC3I;AAAA,IACC,YACC,qBAAC,SAAI,WAAU,qCACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAO;AAAA,UACP;AAAA,UACA,cAAY,cAAc;AAAA,UAC1B,iBAAe;AAAA,UACf;AAAA,UACA,UAAU,CAAC,UAAU,SAAS,MAAM,OAAO,KAAK;AAAA,UAChD,WAAW,CAAC,UAAU,SAAS,OAAO,EAAE,OAAO,OAAO,QAAQ,eAAe,SAAS,CAAC;AAAA,UACvF,WAAU;AAAA;AAAA,MACZ;AAAA,MACC,YACC,iCACG;AAAA,sBAAc,oBAAC,gBAAa,OAAO,eAAe,OAAO,OAAO,aAAa,OAAO,QAAQ,eAAe,WAAW,IAAK;AAAA,QAC5H;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS;AAAA,YACT,WAAU;AAAA,YAET,sBAAY,KAAK;AAAA;AAAA,QACpB;AAAA,SACF,IACE;AAAA,OACN,IACE;AAAA,IACH,QAAQ,UAAa,aACpB,oBAAC,OAAE,WAAW,CAAC,eAAe,OAAO,iCAAiC,mBAAmB,EAAE,KAAK,GAAG,GAAG,aAAU,UAC7G,qBAAW,MAAM,QAAQ,GAAG,GAC/B,IACE;AAAA,KACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/tag-selector/tag-selector.tsx"],"sourcesContent":["// Client. Interests, languages, a workspace's tags: toggle chips with a limit and a count; once it is reached the others\n// rest (disabled) and the count says so. An option with a `marker` is a tag with a colour beside its name (`TagChip`).\n// `creatable` adds a field: Enter takes the typed word — the tag of that name if it exists, else a new one the host creates\n// (`onCreate`, with the marker chosen from the closed palette) — and the typed word narrows the tags offered.\nimport * as React from \"react\";\n\nimport { Chip, type Marker, MarkerPicker, TagChip } from \"../chip\";\n\nexport type TagOption = {\n value: string;\n label: string;\n /** A tag's colour: a name of the closed palette (`@krizaka/organize` `MARKERS`). Without it, a plain chip. */\n marker?: Marker;\n};\n\ntype CreatableProps = {\n /** Adds a field: Enter chooses the tag typed, or asks the host to create it. */\n creatable?: boolean;\n /** Called with the new name (trimmed, as typed) and the marker chosen; the host creates the tag (it may refuse), adds the option and chooses it. */\n onCreate?: (name: string, marker: Marker) => void;\n /** The field's accessible name (\"Add a tag\"), passed translated. */\n inputLabel?: string;\n /** The field's placeholder, passed translated. */\n placeholder?: string;\n /** The create button: `(name) => \"Create “\" + name + \"”\"`, passed translated. */\n createLabel?: (name: string) => string;\n /** The name of each colour, passed translated: shows the colour choice beside the field. */\n markerNames?: Readonly<Record<Marker, string>>;\n /** The colour choice's accessible name (\"Colour of the new tag\"). */\n markerLabel?: string;\n /** The colour a new tag starts with (default `blue`). */\n defaultMarker?: Marker;\n /** The most characters of a name (default 80, the contract's `NAME_MAX`). */\n maxLength?: number;\n /** What is said when nothing matches and creating is not offered (“No tag of that name”), passed translated. */\n emptyLabel?: string;\n};\n\nexport type TagSelectorProps = CreatableProps & {\n /** The group's name (“Interests”) — passed translated. */\n label: string;\n /** The tags offered. */\n options: readonly TagOption[];\n /** The tags chosen. */\n value: readonly string[];\n /** Called with the tags chosen. */\n onValueChange: (value: string[]) => void;\n /** The most that can be chosen. */\n max?: number;\n /** The count under the tags: `(n, max) => n + \" of \" + max`. */\n countLabel?: (count: number, max: number) => string;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The options whose label holds the typed text, and those already chosen. */\nconst matching = (options: readonly TagOption[], needle: string, value: readonly string[]) =>\n options.filter((o) => o.label.toLocaleLowerCase().includes(needle) || value.includes(o.value));\n\n/** One toggle chip: a marked tag wears its marker; the others rest once the limit is reached. */\nfunction OptionChip({ option, on, full, onToggle }: { option: TagOption; on: boolean; full: boolean; onToggle: (next: boolean) => void }) {\n const props = { selected: on, disabled: !on && full, onSelectedChange: onToggle };\n return option.marker ? (\n <TagChip marker={option.marker} {...props}>\n {option.label}\n </TagChip>\n ) : (\n <Chip {...props}>{option.label}</Chip>\n );\n}\n\ntype FieldKeyContext = {\n draft: string;\n value: readonly string[];\n commit: () => void;\n onValueChange: (next: string[]) => void;\n setDraft: (next: string) => void;\n};\n\n/** The typed field's keys: Enter commits, Backspace on an empty field takes the last tag back, Escape clears the draft. */\nfunction fieldKey(event: React.KeyboardEvent<HTMLInputElement>, { draft, value, commit, onValueChange, setDraft }: FieldKeyContext) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit();\n } else if (event.key === \"Backspace\" && !draft && value.length > 0) {\n onValueChange(value.slice(0, -1));\n } else if (event.key === \"Escape\" && draft) {\n event.stopPropagation();\n setDraft(\"\");\n }\n}\n\nconst reached = (max: number | undefined, count: number) => max !== undefined && count >= max;\n\ntype CommitArgs = {\n typed: string;\n exact: TagOption | undefined;\n canCreate: boolean;\n full: boolean;\n value: readonly string[];\n marker: Marker;\n onValueChange: (value: string[]) => void;\n onCreate?: (name: string, marker: Marker) => void;\n setDraft: (draft: string) => void;\n};\n\n/** Enter or the button: pick the option the text names, or create it; nothing happens when neither applies. */\nfunction commitDraft({ typed, exact, canCreate, full, value, marker, onValueChange, onCreate, setDraft }: CommitArgs) {\n if (!typed) return;\n if (exact) {\n if (value.includes(exact.value) || full) {\n setDraft(\"\");\n return;\n }\n onValueChange([...value, exact.value]);\n } else if (canCreate) {\n onCreate?.(typed, marker);\n } else return;\n setDraft(\"\");\n}\n\n/** Toggle chips with a limit and a count — the others rest once the limit is reached; `creatable` types a new one. */\nexport function TagSelector({\n label,\n options,\n value,\n onValueChange,\n max,\n countLabel,\n className,\n creatable,\n onCreate,\n inputLabel,\n placeholder,\n createLabel = (name) => `Create “${name}”`,\n markerNames,\n markerLabel,\n defaultMarker = \"blue\",\n maxLength = 80,\n emptyLabel,\n}: TagSelectorProps) {\n const full = reached(max, value.length);\n const [draft, setDraft] = React.useState(\"\");\n const [marker, setMarker] = React.useState<Marker>(defaultMarker);\n const typed = draft.replace(/\\s+/g, \" \").trim();\n const needle = typed.toLocaleLowerCase();\n const exact = options.find((o) => o.label.toLocaleLowerCase() === needle);\n const shown = creatable && needle ? matching(options, needle, value) : options;\n const canCreate = Boolean(creatable && onCreate && typed && !exact && !full);\n const toggle = (option: TagOption, on: boolean) => onValueChange(on ? [...value, option.value] : value.filter((v) => v !== option.value));\n\n const commit = () => commitDraft({ typed, exact, canCreate, full, value, marker, onValueChange, onCreate, setDraft });\n const listId = React.useId();\n\n return (\n <div className={[\"flex flex-col gap-2\", className].filter(Boolean).join(\" \")}>\n <div role=\"group\" aria-label={label} id={listId} className=\"flex flex-wrap gap-2\">\n {shown.map((option) => (\n <OptionChip key={option.value} option={option} on={value.includes(option.value)} full={full} onToggle={(next) => toggle(option, next)} />\n ))}\n {creatable && needle && shown.length === 0 && !canCreate && emptyLabel ? <p className=\"m-0 text-xs text-fg-secondary\">{emptyLabel}</p> : null}\n </div>\n {creatable ? (\n <div className=\"flex flex-wrap items-center gap-2\">\n <input\n type=\"text\"\n value={draft}\n maxLength={maxLength}\n aria-label={inputLabel ?? label}\n aria-controls={listId}\n placeholder={placeholder}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => fieldKey(event, { draft, value, commit, onValueChange, setDraft })}\n className=\"h-9 min-w-40 flex-1 rounded-md border border-border-control bg-surface-1 px-3 text-sm text-fg placeholder:text-fg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n />\n {canCreate ? (\n <>\n {markerNames ? <MarkerPicker label={markerLabel ?? label} names={markerNames} value={marker} onValueChange={setMarker} /> : null}\n <button\n type=\"button\"\n onClick={commit}\n className=\"inline-flex h-9 items-center rounded-md border border-accent bg-accent-soft px-3 text-xs font-semibold text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {createLabel(typed)}\n </button>\n </>\n ) : null}\n </div>\n ) : null}\n {max !== undefined && countLabel ? (\n <p className={[\"m-0 text-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Q,WAAU,wBACxD;AAAA,YAAM,IAAI,CAAC,WACV,oBAAC,cAA8B,QAAgB,IAAI,MAAM,SAAS,OAAO,KAAK,GAAG,MAAY,UAAU,CAAC,SAAS,OAAO,QAAQ,IAAI,KAAnH,OAAO,KAA+G,CACxI;AAAA,MACA,aAAa,UAAU,MAAM,WAAW,KAAK,CAAC,aAAa,aAAa,oBAAC,OAAE,WAAU,iCAAiC,sBAAW,IAAO;AAAA,OAC3I;AAAA,IACC,YACC,qBAAC,SAAI,WAAU,qCACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAO;AAAA,UACP;AAAA,UACA,cAAY,cAAc;AAAA,UAC1B,iBAAe;AAAA,UACf;AAAA,UACA,UAAU,CAAC,UAAU,SAAS,MAAM,OAAO,KAAK;AAAA,UAChD,WAAW,CAAC,UAAU,SAAS,OAAO,EAAE,OAAO,OAAO,QAAQ,eAAe,SAAS,CAAC;AAAA,UACvF,WAAU;AAAA;AAAA,MACZ;AAAA,MACC,YACC,iCACG;AAAA,sBAAc,oBAAC,gBAAa,OAAO,eAAe,OAAO,OAAO,aAAa,OAAO,QAAQ,eAAe,WAAW,IAAK;AAAA,QAC5H;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS;AAAA,YACT,WAAU;AAAA,YAET,sBAAY,KAAK;AAAA;AAAA,QACpB;AAAA,SACF,IACE;AAAA,OACN,IACE;AAAA,IACH,QAAQ,UAAa,aACpB,oBAAC,OAAE,WAAW,CAAC,eAAe,OAAO,iCAAiC,mBAAmB,EAAE,KAAK,GAAG,GAAG,aAAU,UAC7G,qBAAW,MAAM,QAAQ,GAAG,GAC/B,IACE;AAAA,KACN;AAEJ;","names":[]}
package/dist/theme.d.ts CHANGED
@@ -15,7 +15,9 @@ type ThemeScriptProps = {
15
15
  };
16
16
  /**
17
17
  * In <head>, before anything renders: applies the persisted mode (else `defaultMode`) and named theme, so the page
18
- * never flashes. `nonce` for a strict Content-Security-Policy.
18
+ * never flashes. It also sets `html[data-session]` when the readable `kz-session` hint cookie says a session exists, so
19
+ * `blocks.css` hides the bar's signed-out-only actions from the first paint (krizaka-ui#827). `nonce` for a strict
20
+ * Content-Security-Policy.
19
21
  */
20
22
  declare function ThemeScript({ nonce, defaultMode }: ThemeScriptProps): React.JSX.Element;
21
23
  type ThemeContextValue = {
package/dist/theme.js CHANGED
@@ -52,9 +52,10 @@ function applyName(previous, next) {
52
52
  if (previous) classes.remove(`theme-${previous}`);
53
53
  if (next) classes.add(`theme-${next}`);
54
54
  }
55
+ var SESSION_HINT_COOKIE = "kz-session";
55
56
  function ThemeScript({ nonce, defaultMode = "system" }) {
56
57
  const fallback = isMode(defaultMode) ? defaultMode : "system";
57
- const js = `(function(){try{var m=localStorage.getItem("${MODE_KEY}");if(m!=="dark"&&m!=="light"&&m!=="system")m="${fallback}";var n=localStorage.getItem("${NAME_KEY}");var d=matchMedia("${DARK_QUERY}").matches;var c=document.documentElement.classList;c.toggle("light",m==="light"||(m==="system"&&!d));if(n)c.add("theme-"+n);var a=localStorage.getItem("${ACCENT_KEY}");if(a)document.documentElement.setAttribute("data-accent",a);var y=localStorage.getItem("${DENSITY_KEY}");if(y)document.documentElement.setAttribute("data-density",y)}catch(e){}})()`;
58
+ const js = `(function(){try{if(/(?:^|;\\s*)${SESSION_HINT_COOKIE}=1(?:;|$)/.test(document.cookie))document.documentElement.setAttribute("data-session","")}catch(e){}try{var m=localStorage.getItem("${MODE_KEY}");if(m!=="dark"&&m!=="light"&&m!=="system")m="${fallback}";var n=localStorage.getItem("${NAME_KEY}");var d=matchMedia("${DARK_QUERY}").matches;var c=document.documentElement.classList;c.toggle("light",m==="light"||(m==="system"&&!d));if(n)c.add("theme-"+n);var a=localStorage.getItem("${ACCENT_KEY}");if(a)document.documentElement.setAttribute("data-accent",a);var y=localStorage.getItem("${DENSITY_KEY}");if(y)document.documentElement.setAttribute("data-density",y)}catch(e){}})()`;
58
59
  return /* @__PURE__ */ jsx("script", { nonce, dangerouslySetInnerHTML: { __html: js } });
59
60
  }
60
61
  var ThemeContext = React.createContext(null);
package/dist/theme.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/theme/theme.tsx"],"sourcesContent":["// Client. ONE mechanism for the whole organisation: dark by default, `html.light` for light, `html.theme-<name>` for a\n// named theme, persisted in localStorage (`kz-theme` for the mode, `kz-theme-name` for the named theme).\nimport * as React from \"react\";\n\nimport { type ButtonVariants, buttonVariants } from \"../button/button\";\n\nexport type Mode = \"dark\" | \"light\" | \"system\";\n\nconst MODE_KEY = \"kz-theme\";\nconst NAME_KEY = \"kz-theme-name\";\nconst ACCENT_KEY = \"kz-accent\";\nconst DENSITY_KEY = \"kz-density\";\nconst MODES: readonly Mode[] = [\"dark\", \"light\", \"system\"];\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nconst isMode = (value: unknown): value is Mode => MODES.includes(value as Mode);\n\n// Storage blocked (private mode, sandbox): the choice lives in memory for the page.\nconst memory = new Map<string, string>();\n\nfunction read(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return memory.get(key) ?? null;\n }\n}\n\nfunction write(key: string, value: string | null) {\n if (value === null) memory.delete(key);\n else memory.set(key, value);\n try {\n if (value === null) localStorage.removeItem(key);\n else localStorage.setItem(key, value);\n } catch {\n // storage blocked: memory holds it\n }\n}\n\n// The persisted choice is an external store: every provider and tab reads the same value, the server reads none.\nconst listeners = new Set<() => void>();\nconst notify = () => listeners.forEach((listener) => listener());\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n window.addEventListener(\"storage\", listener);\n return () => {\n listeners.delete(listener);\n window.removeEventListener(\"storage\", listener);\n };\n}\n\nfunction applyMode(mode: Mode) {\n const dark = window.matchMedia(DARK_QUERY).matches;\n document.documentElement.classList.toggle(\"light\", mode === \"light\" || (mode === \"system\" && !dark));\n}\n\nfunction applyName(previous: string | null, next: string | null) {\n const classes = document.documentElement.classList;\n if (previous) classes.remove(`theme-${previous}`);\n if (next) classes.add(`theme-${next}`);\n}\n\nexport type ThemeScriptProps = {\n /** The nonce of a strict Content-Security-Policy (`script-src 'nonce-…'`). */\n nonce?: string;\n /**\n * The mode before the visitor chooses one — pass the same value as `ThemeProvider`'s `defaultMode`. A persisted\n * choice (`kz-theme`) always wins.\n * @default \"system\"\n */\n defaultMode?: Mode;\n};\n\n/**\n * In <head>, before anything renders: applies the persisted mode (else `defaultMode`) and named theme, so the page\n * never flashes. `nonce` for a strict Content-Security-Policy.\n */\nexport function ThemeScript({ nonce, defaultMode = \"system\" }: ThemeScriptProps) {\n const fallback = isMode(defaultMode) ? defaultMode : \"system\";\n const js =\n `(function(){try{var m=localStorage.getItem(\"${MODE_KEY}\");if(m!==\"dark\"&&m!==\"light\"&&m!==\"system\")m=\"${fallback}\";` +\n `var n=localStorage.getItem(\"${NAME_KEY}\");var d=matchMedia(\"${DARK_QUERY}\").matches;var c=document.documentElement.classList;` +\n `c.toggle(\"light\",m===\"light\"||(m===\"system\"&&!d));if(n)c.add(\"theme-\"+n);var a=localStorage.getItem(\"${ACCENT_KEY}\");if(a)document.documentElement.setAttribute(\"data-accent\",a);var y=localStorage.getItem(\"${DENSITY_KEY}\");if(y)document.documentElement.setAttribute(\"data-density\",y)}catch(e){}})()`;\n return <script nonce={nonce} dangerouslySetInnerHTML={{ __html: js }} />;\n}\n\nexport type ThemeContextValue = {\n /** The chosen mode: dark, light or follow the system. */\n mode: Mode;\n setMode: (mode: Mode) => void;\n /** The named theme (`html.theme-<name>`), or null. */\n theme: string | null;\n setTheme: (theme: string | null) => void;\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | null>(null);\n\nexport type ThemeProviderProps = {\n children: React.ReactNode;\n /**\n * The mode before the visitor chooses one (nothing persisted as `kz-theme`) — pass the same value to `ThemeScript`.\n * @default \"system\"\n */\n defaultMode?: Mode;\n};\n\nexport function ThemeProvider({ children, defaultMode = \"system\" }: ThemeProviderProps) {\n // Before hydration the server knows nothing persisted (ThemeScript has already applied it to <html>).\n const stored = React.useSyncExternalStore(subscribe, () => read(MODE_KEY), () => null);\n const mode: Mode = isMode(stored) ? stored : defaultMode;\n const theme = React.useSyncExternalStore(subscribe, () => read(NAME_KEY), () => null);\n\n // The same resolution as ThemeScript (a no-op after it), for an app that renders the provider without the script.\n React.useEffect(() => {\n const persisted = read(MODE_KEY);\n applyMode(isMode(persisted) ? persisted : defaultMode);\n }, [defaultMode]);\n\n // \"system\" follows the operating system while the page is open.\n React.useEffect(() => {\n if (mode !== \"system\") return;\n const query = window.matchMedia(DARK_QUERY);\n const onChange = () => applyMode(\"system\");\n query.addEventListener?.(\"change\", onChange);\n return () => query.removeEventListener?.(\"change\", onChange);\n }, [mode]);\n\n const setMode = React.useCallback((next: Mode) => {\n write(MODE_KEY, next);\n applyMode(next);\n notify();\n }, []);\n\n const setTheme = React.useCallback((next: string | null) => {\n applyName(read(NAME_KEY), next);\n write(NAME_KEY, next);\n notify();\n }, []);\n\n const value = React.useMemo(() => ({ mode, setMode, theme, setTheme }), [mode, setMode, theme, setTheme]);\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/** The theme context, or `null` outside a `ThemeProvider` (a frame that offers the theme only when the app has one). */\nexport function useOptionalTheme(): ThemeContextValue | null {\n return React.useContext(ThemeContext);\n}\n\nexport function useTheme(): ThemeContextValue {\n const context = React.useContext(ThemeContext);\n if (!context) throw new Error(\"useTheme: wrap the app in <ThemeProvider>\");\n return context;\n}\n\nconst ICONS: Record<Mode, React.ReactNode> = {\n dark: <path d=\"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5Z\" />,\n light: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </>\n ),\n system: (\n <>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"12\" rx=\"2\" />\n <path d=\"M8 20h8M12 16v4\" />\n </>\n ),\n};\n\nexport type ThemeToggleProps = Omit<React.ComponentProps<\"button\">, \"onClick\" | \"children\"> &\n Pick<ButtonVariants, \"variant\" | \"shape\"> & {\n /** Any `Button` variant. */\n variant?: ButtonVariants[\"variant\"];\n /**\n * rounded · pill.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** The accessible name — a string, or one per current mode (e.g. `(mode) => t(\"theme.\" + mode)`). */\n label: string | ((mode: Mode) => string);\n };\n\n/**\n * An icon button (styled as `IconButton`, without its Slot) that cycles dark → light → system. Needs a\n * <ThemeProvider> above it. State: `data-mode`.\n */\nexport function ThemeToggle({ label, variant = \"ghost\", shape, className, ...props }: ThemeToggleProps) {\n const { mode, setMode } = useTheme();\n const next = MODES[(MODES.indexOf(mode) + 1) % MODES.length] as Mode;\n const name = typeof label === \"function\" ? label(mode) : label;\n return (\n <button\n type=\"button\"\n aria-label={name}\n title={name}\n data-mode={mode}\n onClick={() => setMode(next)}\n className={buttonVariants({ variant, shape, size: \"icon\", className })}\n {...props}\n >\n <svg viewBox=\"0 0 24 24\" className=\"h-5 w-5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n {ICONS[mode]}\n </svg>\n </button>\n );\n}\n\n/** The choices of the Appearance block (ADR-006 §4): the theme (`system · light · dark`, then a surface set), the accent, the density. */\nexport type AppearanceState = {\n /** `system`, `light`, `dark`, or the surface set (`blueprint`, `carbone`) — which is dark. */\n themeId: string;\n setThemeId: (id: string) => void;\n /** A brand's accent (`data-accent` on `<html>`), or null: the product's own. */\n accent: string | null;\n setAccent: (accent: string | null) => void;\n /** `standard` or `compact` (`data-density` on `<html>`, the token layer: rows and gaps one step down). */\n density: string;\n setDensity: (density: string) => void;\n};\n\nfunction applyAttribute(name: string, value: string | null) {\n if (value === null) document.documentElement.removeAttribute(name);\n else document.documentElement.setAttribute(name, value);\n}\n\n/**\n * The state of the Appearance block, applied at once and kept in the browser (`kz-theme`, `kz-theme-name`, `kz-accent`,\n * `kz-density`; `ThemeScript` restores them before paint). A product with an account also saves what `onChange` of the block\n * reports, so the choice follows the person. Needs a `ThemeProvider`.\n * @param surfaceSets the themes that are a dark surface set (default `blueprint`, `carbone`)\n */\nexport function useAppearance(surfaceSets: readonly string[] = [\"blueprint\", \"carbone\"]): AppearanceState {\n const { mode, setMode, theme, setTheme } = useTheme();\n const accent = React.useSyncExternalStore(subscribe, () => read(ACCENT_KEY), () => null);\n const density = React.useSyncExternalStore(subscribe, () => read(DENSITY_KEY), () => null) ?? \"standard\";\n const themeId = theme && surfaceSets.includes(theme) && mode === \"dark\" ? theme : mode;\n const setThemeId = React.useCallback(\n (id: string) => {\n if (surfaceSets.includes(id)) {\n setMode(\"dark\");\n setTheme(id);\n } else {\n setTheme(null);\n setMode(id as Mode);\n }\n },\n [setMode, setTheme, surfaceSets],\n );\n const setAccent = React.useCallback((next: string | null) => {\n applyAttribute(\"data-accent\", next);\n write(ACCENT_KEY, next);\n notify();\n }, []);\n const setDensity = React.useCallback((next: string) => {\n applyAttribute(\"data-density\", next === \"standard\" ? null : next);\n write(DENSITY_KEY, next === \"standard\" ? null : next);\n notify();\n }, []);\n return { themeId, setThemeId, accent, setAccent, density, setDensity };\n}\n"],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AAiFd,SA0EL,UA1EK,KA0EL,YA1EK;AA3ET,IAAM,WAAW;AACjB,IAAM,WAAW;AACjB,IAAM,aAAa;AACnB,IAAM,cAAc;AACpB,IAAM,QAAyB,CAAC,QAAQ,SAAS,QAAQ;AACzD,IAAM,aAAa;AAEnB,IAAM,SAAS,CAAC,UAAkC,MAAM,SAAS,KAAa;AAG9E,IAAM,SAAS,oBAAI,IAAoB;AAEvC,SAAS,KAAK,KAA4B;AACxC,MAAI;AACF,WAAO,aAAa,QAAQ,GAAG;AAAA,EACjC,QAAQ;AACN,WAA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,IAAI;AACvF,QAAM,UAAgB,2BAAqB,WAAW,MAAM,KAAK,WAAW,GAAG,MAAM,IAAI,KAAK;AAC9F,QAAM,UAAU,SAAS,YAAY,SAAS,KAAK,KAAK,SAAS,SAAS,QAAQ;AAClF,QAAM,aAAmB;AAAA,IACvB,CAAC,OAAe;AACd,UAAI,YAAY,SAAS,EAAE,GAAG;AAC5B,gBAAQ,MAAM;AACd,iBAAS,EAAE;AAAA,MACb,OAAO;AACL,iBAAS,IAAI;AACb,gBAAQ,EAAU;AAAA,MACpB;AAAA,IACF;AAAA,IACA,CAAC,SAAS,UAAU,WAAW;AAAA,EACjC;AACA,QAAM,YAAkB,kBAAY,CAAC,SAAwB;AAC3D,mBAAe,eAAe,IAAI;AAClC,UAAM,YAAY,IAAI;AACtB,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,QAAM,aAAmB,kBAAY,CAAC,SAAiB;AACrD,mBAAe,gBAAgB,SAAS,aAAa,OAAO,IAAI;AAChE,UAAM,aAAa,SAAS,aAAa,OAAO,IAAI;AACpD,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,SAAO,EAAE,SAAS,YAAY,QAAQ,WAAW,SAAS,WAAW;AACvE;","names":[]}
1
+ {"version":3,"sources":["../src/theme/theme.tsx"],"sourcesContent":["// Client. ONE mechanism for the whole organisation: dark by default, `html.light` for light, `html.theme-<name>` for a\n// named theme, persisted in localStorage (`kz-theme` for the mode, `kz-theme-name` for the named theme).\nimport * as React from \"react\";\n\nimport { type ButtonVariants, buttonVariants } from \"../button/button\";\n\nexport type Mode = \"dark\" | \"light\" | \"system\";\n\nconst MODE_KEY = \"kz-theme\";\nconst NAME_KEY = \"kz-theme-name\";\nconst ACCENT_KEY = \"kz-accent\";\nconst DENSITY_KEY = \"kz-density\";\nconst MODES: readonly Mode[] = [\"dark\", \"light\", \"system\"];\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nconst isMode = (value: unknown): value is Mode => MODES.includes(value as Mode);\n\n// Storage blocked (private mode, sandbox): the choice lives in memory for the page.\nconst memory = new Map<string, string>();\n\nfunction read(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return memory.get(key) ?? null;\n }\n}\n\nfunction write(key: string, value: string | null) {\n if (value === null) memory.delete(key);\n else memory.set(key, value);\n try {\n if (value === null) localStorage.removeItem(key);\n else localStorage.setItem(key, value);\n } catch {\n // storage blocked: memory holds it\n }\n}\n\n// The persisted choice is an external store: every provider and tab reads the same value, the server reads none.\nconst listeners = new Set<() => void>();\nconst notify = () => listeners.forEach((listener) => listener());\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n window.addEventListener(\"storage\", listener);\n return () => {\n listeners.delete(listener);\n window.removeEventListener(\"storage\", listener);\n };\n}\n\nfunction applyMode(mode: Mode) {\n const dark = window.matchMedia(DARK_QUERY).matches;\n document.documentElement.classList.toggle(\"light\", mode === \"light\" || (mode === \"system\" && !dark));\n}\n\nfunction applyName(previous: string | null, next: string | null) {\n const classes = document.documentElement.classList;\n if (previous) classes.remove(`theme-${previous}`);\n if (next) classes.add(`theme-${next}`);\n}\n\nexport type ThemeScriptProps = {\n /** The nonce of a strict Content-Security-Policy (`script-src 'nonce-…'`). */\n nonce?: string;\n /**\n * The mode before the visitor chooses one — pass the same value as `ThemeProvider`'s `defaultMode`. A persisted\n * choice (`kz-theme`) always wins.\n * @default \"system\"\n */\n defaultMode?: Mode;\n};\n\n/** The readable flag cookie of a session (`kz-session=1`, kept by `@krizaka/auth`): a hint, never the proof. */\nconst SESSION_HINT_COOKIE = \"kz-session\";\n\n/**\n * In <head>, before anything renders: applies the persisted mode (else `defaultMode`) and named theme, so the page\n * never flashes. It also sets `html[data-session]` when the readable `kz-session` hint cookie says a session exists, so\n * `blocks.css` hides the bar's signed-out-only actions from the first paint (krizaka-ui#827). `nonce` for a strict\n * Content-Security-Policy.\n */\nexport function ThemeScript({ nonce, defaultMode = \"system\" }: ThemeScriptProps) {\n const fallback = isMode(defaultMode) ? defaultMode : \"system\";\n const js =\n `(function(){try{if(/(?:^|;\\\\s*)${SESSION_HINT_COOKIE}=1(?:;|$)/.test(document.cookie))document.documentElement.setAttribute(\"data-session\",\"\")}catch(e){}try{var m=localStorage.getItem(\"${MODE_KEY}\");if(m!==\"dark\"&&m!==\"light\"&&m!==\"system\")m=\"${fallback}\";` +\n `var n=localStorage.getItem(\"${NAME_KEY}\");var d=matchMedia(\"${DARK_QUERY}\").matches;var c=document.documentElement.classList;` +\n `c.toggle(\"light\",m===\"light\"||(m===\"system\"&&!d));if(n)c.add(\"theme-\"+n);var a=localStorage.getItem(\"${ACCENT_KEY}\");if(a)document.documentElement.setAttribute(\"data-accent\",a);var y=localStorage.getItem(\"${DENSITY_KEY}\");if(y)document.documentElement.setAttribute(\"data-density\",y)}catch(e){}})()`;\n return <script nonce={nonce} dangerouslySetInnerHTML={{ __html: js }} />;\n}\n\nexport type ThemeContextValue = {\n /** The chosen mode: dark, light or follow the system. */\n mode: Mode;\n setMode: (mode: Mode) => void;\n /** The named theme (`html.theme-<name>`), or null. */\n theme: string | null;\n setTheme: (theme: string | null) => void;\n};\n\nconst ThemeContext = React.createContext<ThemeContextValue | null>(null);\n\nexport type ThemeProviderProps = {\n children: React.ReactNode;\n /**\n * The mode before the visitor chooses one (nothing persisted as `kz-theme`) — pass the same value to `ThemeScript`.\n * @default \"system\"\n */\n defaultMode?: Mode;\n};\n\nexport function ThemeProvider({ children, defaultMode = \"system\" }: ThemeProviderProps) {\n // Before hydration the server knows nothing persisted (ThemeScript has already applied it to <html>).\n const stored = React.useSyncExternalStore(subscribe, () => read(MODE_KEY), () => null);\n const mode: Mode = isMode(stored) ? stored : defaultMode;\n const theme = React.useSyncExternalStore(subscribe, () => read(NAME_KEY), () => null);\n\n // The same resolution as ThemeScript (a no-op after it), for an app that renders the provider without the script.\n React.useEffect(() => {\n const persisted = read(MODE_KEY);\n applyMode(isMode(persisted) ? persisted : defaultMode);\n }, [defaultMode]);\n\n // \"system\" follows the operating system while the page is open.\n React.useEffect(() => {\n if (mode !== \"system\") return;\n const query = window.matchMedia(DARK_QUERY);\n const onChange = () => applyMode(\"system\");\n query.addEventListener?.(\"change\", onChange);\n return () => query.removeEventListener?.(\"change\", onChange);\n }, [mode]);\n\n const setMode = React.useCallback((next: Mode) => {\n write(MODE_KEY, next);\n applyMode(next);\n notify();\n }, []);\n\n const setTheme = React.useCallback((next: string | null) => {\n applyName(read(NAME_KEY), next);\n write(NAME_KEY, next);\n notify();\n }, []);\n\n const value = React.useMemo(() => ({ mode, setMode, theme, setTheme }), [mode, setMode, theme, setTheme]);\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/** The theme context, or `null` outside a `ThemeProvider` (a frame that offers the theme only when the app has one). */\nexport function useOptionalTheme(): ThemeContextValue | null {\n return React.useContext(ThemeContext);\n}\n\nexport function useTheme(): ThemeContextValue {\n const context = React.useContext(ThemeContext);\n if (!context) throw new Error(\"useTheme: wrap the app in <ThemeProvider>\");\n return context;\n}\n\nconst ICONS: Record<Mode, React.ReactNode> = {\n dark: <path d=\"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5Z\" />,\n light: (\n <>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4\" />\n </>\n ),\n system: (\n <>\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"12\" rx=\"2\" />\n <path d=\"M8 20h8M12 16v4\" />\n </>\n ),\n};\n\nexport type ThemeToggleProps = Omit<React.ComponentProps<\"button\">, \"onClick\" | \"children\"> &\n Pick<ButtonVariants, \"variant\" | \"shape\"> & {\n /** Any `Button` variant. */\n variant?: ButtonVariants[\"variant\"];\n /**\n * rounded · pill.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** The accessible name — a string, or one per current mode (e.g. `(mode) => t(\"theme.\" + mode)`). */\n label: string | ((mode: Mode) => string);\n };\n\n/**\n * An icon button (styled as `IconButton`, without its Slot) that cycles dark → light → system. Needs a\n * <ThemeProvider> above it. State: `data-mode`.\n */\nexport function ThemeToggle({ label, variant = \"ghost\", shape, className, ...props }: ThemeToggleProps) {\n const { mode, setMode } = useTheme();\n const next = MODES[(MODES.indexOf(mode) + 1) % MODES.length] as Mode;\n const name = typeof label === \"function\" ? label(mode) : label;\n return (\n <button\n type=\"button\"\n aria-label={name}\n title={name}\n data-mode={mode}\n onClick={() => setMode(next)}\n className={buttonVariants({ variant, shape, size: \"icon\", className })}\n {...props}\n >\n <svg viewBox=\"0 0 24 24\" className=\"h-5 w-5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n {ICONS[mode]}\n </svg>\n </button>\n );\n}\n\n/** The choices of the Appearance block (ADR-006 §4): the theme (`system · light · dark`, then a surface set), the accent, the density. */\nexport type AppearanceState = {\n /** `system`, `light`, `dark`, or the surface set (`blueprint`, `carbone`) — which is dark. */\n themeId: string;\n setThemeId: (id: string) => void;\n /** A brand's accent (`data-accent` on `<html>`), or null: the product's own. */\n accent: string | null;\n setAccent: (accent: string | null) => void;\n /** `standard` or `compact` (`data-density` on `<html>`, the token layer: rows and gaps one step down). */\n density: string;\n setDensity: (density: string) => void;\n};\n\nfunction applyAttribute(name: string, value: string | null) {\n if (value === null) document.documentElement.removeAttribute(name);\n else document.documentElement.setAttribute(name, value);\n}\n\n/**\n * The state of the Appearance block, applied at once and kept in the browser (`kz-theme`, `kz-theme-name`, `kz-accent`,\n * `kz-density`; `ThemeScript` restores them before paint). A product with an account also saves what `onChange` of the block\n * reports, so the choice follows the person. Needs a `ThemeProvider`.\n * @param surfaceSets the themes that are a dark surface set (default `blueprint`, `carbone`)\n */\nexport function useAppearance(surfaceSets: readonly string[] = [\"blueprint\", \"carbone\"]): AppearanceState {\n const { mode, setMode, theme, setTheme } = useTheme();\n const accent = React.useSyncExternalStore(subscribe, () => read(ACCENT_KEY), () => null);\n const density = React.useSyncExternalStore(subscribe, () => read(DENSITY_KEY), () => null) ?? \"standard\";\n const themeId = theme && surfaceSets.includes(theme) && mode === \"dark\" ? theme : mode;\n const setThemeId = React.useCallback(\n (id: string) => {\n if (surfaceSets.includes(id)) {\n setMode(\"dark\");\n setTheme(id);\n } else {\n setTheme(null);\n setMode(id as Mode);\n }\n },\n [setMode, setTheme, surfaceSets],\n );\n const setAccent = React.useCallback((next: string | null) => {\n applyAttribute(\"data-accent\", next);\n write(ACCENT_KEY, next);\n notify();\n }, []);\n const setDensity = React.useCallback((next: string) => {\n applyAttribute(\"data-density\", next === \"standard\" ? null : next);\n write(DENSITY_KEY, next === \"standard\" ? null : next);\n notify();\n }, []);\n return { themeId, setThemeId, accent, setAccent, density, setDensity };\n}\n"],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AAsFd,SA0EL,UA1EK,KA0EL,YA1EK;AAhFT,IAAM,WAAW;AACjB,IAAM,WAAW;AACjB,IAAM,aAAa;AACnB,IAAM,cAAc;AACpB,IAAM,QAAyB,CAAC,QAAQ,SAAS,QAAQ;AACzD,IAAM,aAAa;AAEnB,IAAM,SAAS,CAAC,UAAkC,MAAM,SAAS,KAAa;AAG9E,IAAM,SAAS,oBAAI,IAAoB;AAEvC,SAAS,KAAK,KAA4B;AACxC,MAAI;AACF,WAAO,aAAa,QAAQ,GAAG;AAAA,EACjC,QAAQ;AACN,WAAO,OAAO,IAAI,GAAG,KAAK;AAAA,EAC5B;AACF;AAEA,SAAS,MAAM,KAAa,OAAsB;AAChD,MAAI,UAAU,KAAM,QAAO,OAAO,GAAG;AAAA,MAChC,QAAO,IAAI,KAAK,KAAK;AAC1B,MAAI;AACF,QAAI,UAAU,KAAM,cAAa,WAAW,GAAG;AAAA,QAC1C,cAAa,QAAQ,KAAK,KAAK;AAAA,EACtC,QAAQ;AAAA,EAER;AACF;AAGA,IA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AACd,iBAAS,EAAE;AAAA,MACb,OAAO;AACL,iBAAS,IAAI;AACb,gBAAQ,EAAU;AAAA,MACpB;AAAA,IACF;AAAA,IACA,CAAC,SAAS,UAAU,WAAW;AAAA,EACjC;AACA,QAAM,YAAkB,kBAAY,CAAC,SAAwB;AAC3D,mBAAe,eAAe,IAAI;AAClC,UAAM,YAAY,IAAI;AACtB,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,QAAM,aAAmB,kBAAY,CAAC,SAAiB;AACrD,mBAAe,gBAAgB,SAAS,aAAa,OAAO,IAAI;AAChE,UAAM,aAAa,SAAS,aAAa,OAAO,IAAI;AACpD,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,SAAO,EAAE,SAAS,YAAY,QAAQ,WAAW,SAAS,WAAW;AACvE;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-E46AEUPH.js";
5
5
  import {
6
6
  IconButton
7
- } from "./chunk-M3GEYLMR.js";
7
+ } from "./chunk-ZPOVOEO3.js";
8
8
  import "./chunk-D3T54RSL.js";
9
9
  import {
10
10
  cn