@krizaka/ui 3.70.0 → 3.72.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 (306) hide show
  1. package/dist/account-menu.d.ts +1 -1
  2. package/dist/account-menu.js +1 -1
  3. package/dist/account-settings.d.ts +1 -1
  4. package/dist/account-settings.js +1 -1
  5. package/dist/avatar/defaults.d.ts +22 -2
  6. package/dist/avatar/defaults.js +20 -7
  7. package/dist/avatar/defaults.js.map +1 -1
  8. package/dist/{avatar-BdZcfkWR.d.ts → avatar-B_na7r1U.d.ts} +16 -0
  9. package/dist/avatar.d.ts +22 -2
  10. package/dist/avatar.js +20 -7
  11. package/dist/avatar.js.map +1 -1
  12. package/dist/blocks.css +37 -0
  13. package/dist/chat.js +1 -1
  14. package/dist/chunk-3PRYL2LS.js +2 -0
  15. package/dist/chunk-3PRYL2LS.js.map +1 -0
  16. package/dist/{chunk-HK525THY.js → chunk-5MPPIGCB.js} +18 -7
  17. package/dist/chunk-5MPPIGCB.js.map +1 -0
  18. package/dist/{chunk-CSRKYZ53.js → chunk-CZHPWLNW.js} +1 -1
  19. package/dist/{chunk-PZ4FJOD5.js → chunk-HLEBSAGC.js} +5 -1
  20. package/dist/{chunk-PZ4FJOD5.js.map → chunk-HLEBSAGC.js.map} +1 -1
  21. package/dist/chunk-M3T5RQYV.js +34 -0
  22. package/dist/chunk-M3T5RQYV.js.map +1 -0
  23. package/dist/{chunk-EUJ7337V.js → chunk-TISDOZH3.js} +18 -7
  24. package/dist/chunk-TISDOZH3.js.map +1 -0
  25. package/dist/chunk-W64RAX4N.js +79 -0
  26. package/dist/chunk-W64RAX4N.js.map +1 -0
  27. package/dist/chunk-ZFR6ZNXD.js +203 -0
  28. package/dist/chunk-ZFR6ZNXD.js.map +1 -0
  29. package/dist/collection-switcher.d.ts +1 -1
  30. package/dist/{default-avatar-D9kiSFNB.d.ts → default-avatar-BL0nJFti.d.ts} +16 -0
  31. package/dist/entity-header.d.ts +1 -1
  32. package/dist/{frame-D6Xv83t8.d.ts → frame-CNZ5VgDD.d.ts} +11 -4
  33. package/dist/index.js +7 -7
  34. package/dist/kind-config-editor.js +3 -2
  35. package/dist/kind-config-editor.js.map +1 -1
  36. package/dist/map.d.ts +6 -6
  37. package/dist/match-dialog.js +1 -1
  38. package/dist/media-grid.d.ts +16 -0
  39. package/dist/media-grid.js +1 -1
  40. package/dist/money-input.js +6 -70
  41. package/dist/money-input.js.map +1 -1
  42. package/dist/native.d.ts +16 -0
  43. package/dist/native.js +17 -6
  44. package/dist/native.js.map +1 -1
  45. package/dist/nav-bar.d.ts +13 -2
  46. package/dist/nav-bar.js +71 -54
  47. package/dist/nav-bar.js.map +1 -1
  48. package/dist/notification-preferences.js +2 -1
  49. package/dist/notification-preferences.js.map +1 -1
  50. package/dist/price-catalogue-editor.d.ts +117 -0
  51. package/dist/price-catalogue-editor.js +194 -0
  52. package/dist/price-catalogue-editor.js.map +1 -0
  53. package/dist/promo-code-field.js +1 -1
  54. package/dist/schema-DgjBz7-8.d.ts +242 -0
  55. package/dist/schema-form.d.ts +106 -0
  56. package/dist/schema-form.js +268 -0
  57. package/dist/schema-form.js.map +1 -0
  58. package/dist/shop/booking.d.ts +2 -2
  59. package/dist/shop/booking.js +1 -1
  60. package/dist/shop/booking.js.map +1 -1
  61. package/dist/shop/bulletin.js +1 -1
  62. package/dist/shop/faq.d.ts +2 -1
  63. package/dist/shop/faq.js +1 -1
  64. package/dist/shop/faq.js.map +1 -1
  65. package/dist/shop/gallery.js +1 -1
  66. package/dist/shop/look.d.ts +43 -0
  67. package/dist/shop/look.js +52 -0
  68. package/dist/shop/look.js.map +1 -0
  69. package/dist/shop/policies.d.ts +2 -1
  70. package/dist/shop/policies.js +1 -1
  71. package/dist/shop/policies.js.map +1 -1
  72. package/dist/shop/reviews.d.ts +2 -1
  73. package/dist/shop/reviews.js +1 -1
  74. package/dist/shop/reviews.js.map +1 -1
  75. package/dist/shop/services.js +1 -1
  76. package/dist/shop/social.js +1 -1
  77. package/dist/shop/story.d.ts +2 -1
  78. package/dist/shop/story.js +1 -1
  79. package/dist/shop/story.js.map +1 -1
  80. package/dist/shop/team.js +1 -1
  81. package/dist/shop/video.js +1 -1
  82. package/dist/shop/visit.js +1 -1
  83. package/dist/shop-composer.d.ts +29 -0
  84. package/dist/shop-composer.js +156 -89
  85. package/dist/shop-composer.js.map +1 -1
  86. package/dist/shop.d.ts +6 -240
  87. package/dist/shop.js +24 -212
  88. package/dist/shop.js.map +1 -1
  89. package/dist/switch.js +2 -1
  90. package/dist/vertical-video.js +1 -1
  91. package/dist/wall.d.ts +7 -1
  92. package/dist/wall.js +5 -4
  93. package/dist/wall.js.map +1 -1
  94. package/package.json +59 -9
  95. package/registry/account-menu.json +1 -1
  96. package/registry/account-settings.json +1 -1
  97. package/registry/achievement.json +1 -1
  98. package/registry/action-bar.json +1 -1
  99. package/registry/activity-feed.json +1 -1
  100. package/registry/agenda.json +1 -1
  101. package/registry/alert.json +1 -1
  102. package/registry/analysis-report.json +1 -1
  103. package/registry/anatomy-plate.json +1 -1
  104. package/registry/app-frame.json +2 -2
  105. package/registry/app-header.json +1 -1
  106. package/registry/app-shell.json +1 -1
  107. package/registry/argument-card.json +1 -1
  108. package/registry/audio-player.json +1 -1
  109. package/registry/auth-layout.json +1 -1
  110. package/registry/avatar.json +4 -4
  111. package/registry/badge.json +1 -1
  112. package/registry/bird-plate.json +1 -1
  113. package/registry/button.json +1 -1
  114. package/registry/captcha.json +1 -1
  115. package/registry/card-grid.json +1 -1
  116. package/registry/card.json +1 -1
  117. package/registry/catalogue-page.json +1 -1
  118. package/registry/changelog-page.json +1 -1
  119. package/registry/chapter.json +1 -1
  120. package/registry/chat.json +1 -1
  121. package/registry/checkbox.json +1 -1
  122. package/registry/chip-link.json +1 -1
  123. package/registry/chip-row.json +1 -1
  124. package/registry/chip.json +1 -1
  125. package/registry/choice-grid.json +1 -1
  126. package/registry/code-block.json +1 -1
  127. package/registry/collection-switcher.json +1 -1
  128. package/registry/combobox.json +1 -1
  129. package/registry/command.json +1 -1
  130. package/registry/comparison-table.json +1 -1
  131. package/registry/component-page.json +1 -1
  132. package/registry/confirm-button.json +1 -1
  133. package/registry/contact-page.json +1 -1
  134. package/registry/continue-prompt.json +1 -1
  135. package/registry/copy-button.json +1 -1
  136. package/registry/countdown.json +1 -1
  137. package/registry/cover-hero.json +1 -1
  138. package/registry/cta-panel.json +1 -1
  139. package/registry/dashboard-layout.json +1 -1
  140. package/registry/data-table.json +1 -1
  141. package/registry/date-picker.json +1 -1
  142. package/registry/decision-list.json +1 -1
  143. package/registry/description-list.json +1 -1
  144. package/registry/desktop-window.json +1 -1
  145. package/registry/detail-layout.json +1 -1
  146. package/registry/dialog.json +1 -1
  147. package/registry/docs-article-page.json +1 -1
  148. package/registry/docs-hub-page.json +1 -1
  149. package/registry/docs-layout.json +1 -1
  150. package/registry/docs-nav.json +1 -1
  151. package/registry/document-viewer.json +1 -1
  152. package/registry/doodle.json +1 -1
  153. package/registry/drop-overlay.json +1 -1
  154. package/registry/dropdown-menu.json +1 -1
  155. package/registry/elephant.json +2 -2
  156. package/registry/embed-facade.json +1 -1
  157. package/registry/empty-state.json +1 -1
  158. package/registry/engine-flow.json +1 -1
  159. package/registry/entity-header.json +1 -1
  160. package/registry/environment-notice.json +1 -1
  161. package/registry/error-page.json +1 -1
  162. package/registry/examples/price-catalogue-editor/default.d.ts +4 -0
  163. package/registry/examples/price-catalogue-editor/default.js +47 -0
  164. package/registry/examples/price-catalogue-editor/default.tsx +25 -0
  165. package/registry/examples/schema-form/default.d.ts +4 -0
  166. package/registry/examples/schema-form/default.js +29 -0
  167. package/registry/examples/schema-form/default.tsx +27 -0
  168. package/registry/examples/wall/pinned-note.js +2 -1
  169. package/registry/examples/wall/pinned-note.tsx +2 -1
  170. package/registry/field.json +1 -1
  171. package/registry/file-upload.json +1 -1
  172. package/registry/filter-bar.json +1 -1
  173. package/registry/flock.json +1 -1
  174. package/registry/footnote.json +1 -1
  175. package/registry/force-update-screen.json +1 -1
  176. package/registry/form.json +1 -1
  177. package/registry/gallery-page.json +1 -1
  178. package/registry/genui.json +1 -1
  179. package/registry/glossary-term.json +1 -1
  180. package/registry/glossary.json +1 -1
  181. package/registry/glow-card.json +1 -1
  182. package/registry/goal-gauge.json +1 -1
  183. package/registry/grade-stamp.json +1 -1
  184. package/registry/how-it-works-page.json +1 -1
  185. package/registry/image-cropper.json +1 -1
  186. package/registry/index.json +81 -8
  187. package/registry/iso.json +1 -1
  188. package/registry/kanban.json +1 -1
  189. package/registry/kbd.json +1 -1
  190. package/registry/kind-config-editor.json +1 -1
  191. package/registry/kpi-explained.json +1 -1
  192. package/registry/landing-page.json +1 -1
  193. package/registry/landscape.json +1 -1
  194. package/registry/language-switch.json +1 -1
  195. package/registry/legal-page.json +1 -1
  196. package/registry/link-card.json +1 -1
  197. package/registry/list.json +1 -1
  198. package/registry/loader.json +1 -1
  199. package/registry/longform-page.json +1 -1
  200. package/registry/maintenance-screen.json +1 -1
  201. package/registry/map.json +2 -2
  202. package/registry/margin-layout.json +1 -1
  203. package/registry/markdown.json +1 -1
  204. package/registry/marketing-layout.json +1 -1
  205. package/registry/marquee.json +1 -1
  206. package/registry/mascot-quote.json +1 -1
  207. package/registry/mascot-state.json +1 -1
  208. package/registry/mascots.json +1 -1
  209. package/registry/match-dialog.json +1 -1
  210. package/registry/media-capture.json +1 -1
  211. package/registry/media-gallery.json +1 -1
  212. package/registry/media-grid.json +1 -1
  213. package/registry/meta-row.json +1 -1
  214. package/registry/meter.json +1 -1
  215. package/registry/money-input.json +1 -1
  216. package/registry/nav-bar.json +30 -6
  217. package/registry/next-actions.json +1 -1
  218. package/registry/notification-preferences.json +1 -1
  219. package/registry/number-ticker.json +1 -1
  220. package/registry/opening-hours.json +1 -1
  221. package/registry/page-header.json +1 -1
  222. package/registry/page-hero.json +1 -1
  223. package/registry/page-index.json +1 -1
  224. package/registry/page.json +1 -1
  225. package/registry/pagination.json +1 -1
  226. package/registry/photo-grid.json +1 -1
  227. package/registry/pointer-light.json +1 -1
  228. package/registry/popover.json +1 -1
  229. package/registry/price-catalogue-editor.json +228 -0
  230. package/registry/pricing-page.json +1 -1
  231. package/registry/product-page.json +1 -1
  232. package/registry/profile-card.json +1 -1
  233. package/registry/progress.json +1 -1
  234. package/registry/promise-card.json +1 -1
  235. package/registry/promo-code-field.json +1 -1
  236. package/registry/proposal.json +1 -1
  237. package/registry/qr-code.json +1 -1
  238. package/registry/quota-meter.json +1 -1
  239. package/registry/radio-group.json +1 -1
  240. package/registry/rail-nav.json +2 -2
  241. package/registry/recipes.json +1 -1
  242. package/registry/retro-tv.json +1 -1
  243. package/registry/reviews.json +1 -1
  244. package/registry/router.json +1 -1
  245. package/registry/schema-form.json +253 -0
  246. package/registry/scroll-stage.json +1 -1
  247. package/registry/search-field.json +1 -1
  248. package/registry/section-backdrop.json +1 -1
  249. package/registry/separator.json +1 -1
  250. package/registry/service-card.json +1 -1
  251. package/registry/settings-layout.json +1 -1
  252. package/registry/shop-composer.json +10 -6
  253. package/registry/shop-gallery.json +1 -1
  254. package/registry/shop.json +51 -10
  255. package/registry/showcase.json +1 -1
  256. package/registry/signature.json +1 -1
  257. package/registry/site-cahier.json +1 -1
  258. package/registry/site-footer.json +2 -2
  259. package/registry/sites.json +1 -1
  260. package/registry/skeleton.json +1 -1
  261. package/registry/skip-link.json +1 -1
  262. package/registry/slider.json +1 -1
  263. package/registry/slot-picker.json +1 -1
  264. package/registry/slot.json +1 -1
  265. package/registry/specimen-tag.json +1 -1
  266. package/registry/speed-lines.json +1 -1
  267. package/registry/spinner.json +1 -1
  268. package/registry/split-view.json +1 -1
  269. package/registry/stage-banner.json +1 -1
  270. package/registry/stat.json +1 -1
  271. package/registry/status-chip.json +1 -1
  272. package/registry/status-page.json +1 -1
  273. package/registry/step-progress.json +1 -1
  274. package/registry/step-showcase.json +1 -1
  275. package/registry/stepper.json +1 -1
  276. package/registry/sticky-action.json +1 -1
  277. package/registry/stuck.json +1 -1
  278. package/registry/swipe-deck.json +1 -1
  279. package/registry/switch.json +1 -1
  280. package/registry/tabs.json +1 -1
  281. package/registry/tag-input.json +1 -1
  282. package/registry/tag-selector.json +1 -1
  283. package/registry/taped-photo.json +1 -1
  284. package/registry/terminal-replay.json +1 -1
  285. package/registry/text-style.json +1 -1
  286. package/registry/theme.json +1 -1
  287. package/registry/toast.json +1 -1
  288. package/registry/toc.json +1 -1
  289. package/registry/tooltip.json +1 -1
  290. package/registry/tree-view.json +1 -1
  291. package/registry/update-prompt.json +1 -1
  292. package/registry/upload-queue.json +1 -1
  293. package/registry/usage.json +1 -1
  294. package/registry/verified-badge.json +1 -1
  295. package/registry/versus-card.json +1 -1
  296. package/registry/vertical-video.json +1 -1
  297. package/registry/video-player.json +1 -1
  298. package/registry/video-trimmer.json +1 -1
  299. package/registry/virtual.json +1 -1
  300. package/registry/wall.json +47 -4
  301. package/registry/waveform.json +1 -1
  302. package/dist/chunk-A7MQPIEG.js +0 -31
  303. package/dist/chunk-A7MQPIEG.js.map +0 -1
  304. package/dist/chunk-EUJ7337V.js.map +0 -1
  305. package/dist/chunk-HK525THY.js.map +0 -1
  306. /package/dist/{chunk-CSRKYZ53.js.map → chunk-CZHPWLNW.js.map} +0 -0
package/dist/nav-bar.d.ts CHANGED
@@ -54,11 +54,22 @@ type NavBarSessionProps<TAccount = unknown> = {
54
54
  signedIn: (account: TAccount, state: {
55
55
  signupOpen: boolean;
56
56
  }) => React.ReactNode;
57
+ /**
58
+ * The server's hint that a session cookie exists (krizaka-ui#827): while the answer is on its way the bar then reserves
59
+ * a signed-in placeholder (account-sized, `data-state="signed-in-pending"`) instead of an empty place, and never the
60
+ * « Sign in » action. A hint, never the proof: `/api/me` still decides. Left out, it is read from the family's readable
61
+ * flag cookie (`kz-session=1`, kept by `sessionHint` of `@krizaka/auth` in the proxy), so a static page needs no prop.
62
+ */
63
+ sessionHint?: boolean;
57
64
  /** The hint's words while the answer is on its way (“Checking your session…”) — passed translated. */
58
65
  hint: string;
59
66
  /** Classes of the loading placeholder. */
60
67
  className?: string;
61
68
  };
69
+ /** The readable flag the proxy keeps next to the HttpOnly session cookie (`@krizaka/auth` `SESSION_HINT_COOKIE`; a test pins the two). */
70
+ declare const SESSION_HINT_COOKIE = "kz-session";
71
+ /** Whether the readable flag cookie says a session exists. False on the server and on the first hydration pass (no mismatch). */
72
+ declare function useSessionHint(): boolean;
62
73
  declare const sessionKey: (endpoint: string) => readonly ["krizaka", "session", string];
63
74
  /** What the bar knows of the visitor: `pending` is NOT « signed out » — nothing is drawn as either until the answer comes. */
64
75
  type NavSession<TAccount = unknown> = {
@@ -83,7 +94,7 @@ declare function useNavSession<TAccount = unknown>(endpoint?: string, initial?:
83
94
  * `hint` politely (or, given `initial`, draws the server's answer at once); if the first request fails it shows the
84
95
  * signed-out actions (the visitor can still sign in).
85
96
  */
86
- declare function NavBarSession<TAccount = unknown>({ endpoint, initial, signedOut, signedIn, hint, className }: NavBarSessionProps<TAccount>): React.JSX.Element;
97
+ declare function NavBarSession<TAccount = unknown>({ endpoint, initial, sessionHint, signedOut, signedIn, hint, className }: NavBarSessionProps<TAccount>): React.JSX.Element;
87
98
 
88
99
  declare const navBar: tailwind_variants.TVReturnType<{
89
100
  floating: {
@@ -467,5 +478,5 @@ type ProductBarActionsProps = {
467
478
  /** The product bar's actions: use the app. Put it in `NavBar.Actions` (`placement="bar"`) or in `NavBar.Mobile` (`placement="panel"`). */
468
479
  declare function ProductBarActions({ signIn, tryIt, signupOpen, linkAs: Link, placement }: ProductBarActionsProps): React.JSX.Element;
469
480
 
470
- export { NavBar, NavBarActions, NavBarBadge, NavBarBrand, NavBarFamily, NavBarItems, NavBarLanguage, NavBarLink, NavBarMenu, NavBarMenuLink, NavBarMobile, NavBarMobileGroup, NavBarMobileLink, NavBarMobilePreferences, NavBarRepo, NavBarRoot, NavBarSession, ProductBarAction, ProductBarActions, meHeaders, meResponse, meSchema, navBar, placePanel, productBarActions, sessionKey, useNavSession };
481
+ export { NavBar, NavBarActions, NavBarBadge, NavBarBrand, NavBarFamily, NavBarItems, NavBarLanguage, NavBarLink, NavBarMenu, NavBarMenuLink, NavBarMobile, NavBarMobileGroup, NavBarMobileLink, NavBarMobilePreferences, NavBarRepo, NavBarRoot, NavBarSession, ProductBarAction, ProductBarActions, SESSION_HINT_COOKIE, meHeaders, meResponse, meSchema, navBar, placePanel, productBarActions, sessionKey, useNavSession, useSessionHint };
471
482
  export type { MeResponse, NavBarBadgeProps, NavBarBrandProps, NavBarFamilyProps, NavBarItemsProps, NavBarLanguageProps, NavBarLinkProps, NavBarMenuLinkProps, NavBarMenuProps, NavBarMobileGroupProps, NavBarMobileLinkProps, NavBarMobilePreferencesProps, NavBarMobileProps, NavBarRepoProps, NavBarRootProps, NavBarSessionProps, NavSession, PlacePanel, ProductBarActionsProps, ProductBarLink, ProductBarState };
package/dist/nav-bar.js CHANGED
@@ -42,7 +42,7 @@ var meSchema = {
42
42
 
43
43
  // src/nav-bar/nav-bar.tsx
44
44
  import { NavigationMenu as Nav, Slot } from "radix-ui";
45
- import * as React from "react";
45
+ import * as React2 from "react";
46
46
  import { tv } from "tailwind-variants";
47
47
 
48
48
  // src/nav-bar/placement.ts
@@ -55,7 +55,15 @@ function placePanel({ trigger, root, panel, window: window2, gutter = 16 }) {
55
55
 
56
56
  // src/nav-bar/session.tsx
57
57
  import { krizakaFetch, useQuery } from "@krizaka/query";
58
- import { Fragment, jsx } from "react/jsx-runtime";
58
+ import * as React from "react";
59
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
60
+ var SESSION_HINT_COOKIE = "kz-session";
61
+ var noop = () => () => {
62
+ };
63
+ var readFlag = () => typeof document !== "undefined" && document.cookie.split(";").some((part) => part.trim() === `${SESSION_HINT_COOKIE}=1`);
64
+ function useSessionHint() {
65
+ return React.useSyncExternalStore(noop, readFlag, () => false);
66
+ }
59
67
  var sessionKey = (endpoint) => ["krizaka", "session", endpoint];
60
68
  function useNavSession(endpoint = "/api/me", initial) {
61
69
  const { data, isPending, isError } = useQuery({
@@ -73,9 +81,16 @@ function useNavSession(endpoint = "/api/me", initial) {
73
81
  if (isPending && !isError) return { status: "pending" };
74
82
  return { status: "out", signupOpen: false };
75
83
  }
76
- function NavBarSession({ endpoint = "/api/me", initial, signedOut, signedIn, hint, className }) {
84
+ function NavBarSession({ endpoint = "/api/me", initial, sessionHint, signedOut, signedIn, hint, className }) {
77
85
  const session = useNavSession(endpoint, initial);
86
+ const flagged = useSessionHint();
78
87
  if (session.status === "pending") {
88
+ if (sessionHint ?? flagged) {
89
+ return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", "data-state": "signed-in-pending", className, children: [
90
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-block size-9 rounded-full bg-surface-2" }),
91
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: hint })
92
+ ] });
93
+ }
79
94
  return /* @__PURE__ */ jsx("span", { role: "status", "aria-live": "polite", "data-state": "loading", className, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: hint }) });
80
95
  }
81
96
  const state = { signupOpen: session.signupOpen };
@@ -83,7 +98,7 @@ function NavBarSession({ endpoint = "/api/me", initial, signedOut, signedIn, hin
83
98
  }
84
99
 
85
100
  // src/nav-bar/nav-bar.tsx
86
- import { Fragment as Fragment2, jsx as jsx2, jsxs } from "react/jsx-runtime";
101
+ import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
87
102
  var navBar = tv({
88
103
  slots: {
89
104
  root: "group/nav relative z-40 mx-auto flex h-14 w-full items-center gap-2 border-border-subtle bg-surface-1 transition-[height,background-color,border-color,box-shadow] duration-300 motion-reduce:transition-none data-compact:h-12 data-compact:border-border-default data-compact:bg-surface-1 data-compact:shadow-lg",
@@ -136,58 +151,58 @@ var navBar = tv({
136
151
  defaultVariants: { floating: true }
137
152
  });
138
153
  var s = navBar();
139
- var Context = React.createContext(null);
140
- var ItemsContext = React.createContext({ close: () => {
154
+ var Context = React2.createContext(null);
155
+ var ItemsContext = React2.createContext({ close: () => {
141
156
  } });
142
- var MobileContext = React.createContext(false);
157
+ var MobileContext = React2.createContext(false);
143
158
  var useNavBar = () => {
144
- const ctx = React.useContext(Context);
159
+ const ctx = React2.useContext(Context);
145
160
  if (!ctx) throw new Error("NavBar parts must be inside <NavBar.Root>.");
146
161
  return ctx;
147
162
  };
148
163
  function NavBarRoot({ label, compactAfter = 24, floating = true, className, children, ...props }) {
149
- const [compact, setCompact] = React.useState(false);
150
- const [open, setOpen] = React.useState(false);
151
- const panelId = React.useId();
152
- React.useEffect(() => {
164
+ const [compact, setCompact] = React2.useState(false);
165
+ const [open, setOpen] = React2.useState(false);
166
+ const panelId = React2.useId();
167
+ React2.useEffect(() => {
153
168
  if (compactAfter === false) return;
154
169
  const onScroll = () => setCompact(window.scrollY > compactAfter);
155
170
  onScroll();
156
171
  window.addEventListener("scroll", onScroll, { passive: true });
157
172
  return () => window.removeEventListener("scroll", onScroll);
158
173
  }, [compactAfter]);
159
- const ctx = React.useMemo(() => ({ label, open, setOpen, panelId }), [label, open, panelId]);
174
+ const ctx = React2.useMemo(() => ({ label, open, setOpen, panelId }), [label, open, panelId]);
160
175
  return /* @__PURE__ */ jsx2(Context.Provider, { value: ctx, children: /* @__PURE__ */ jsx2("header", { "data-compact": compact ? "" : void 0, "data-floating": floating, className: navBar({ floating }).root({ className }), ...props, children }) });
161
176
  }
162
177
  function NavBarBrand({ asChild, className, org, children, ...props }) {
163
178
  const Comp = asChild ? Slot.Root : "a";
164
179
  const fromOrg = org && !asChild && children === void 0;
165
- return /* @__PURE__ */ jsx2(Comp, { className: s.brand({ className }), ...props, children: fromOrg ? /* @__PURE__ */ jsxs(Fragment2, { children: [
180
+ return /* @__PURE__ */ jsx2(Comp, { className: s.brand({ className }), ...props, children: fromOrg ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
166
181
  /* @__PURE__ */ jsx2(FamilyMark, { mark: siteById("krizaka").mark, size: 22 }),
167
182
  org.brand.name
168
183
  ] }) : children });
169
184
  }
170
185
  function NavBarItems({ className, children, value: valueProp, defaultValue, onValueChange, delayDuration = 200, ...props }) {
171
186
  const { label } = useNavBar();
172
- const [inner, setInner] = React.useState(defaultValue ?? "");
187
+ const [inner, setInner] = React2.useState(defaultValue ?? "");
173
188
  const value = valueProp ?? inner;
174
- const setValue = React.useCallback(
189
+ const setValue = React2.useCallback(
175
190
  (next) => {
176
191
  setInner(next);
177
192
  onValueChange?.(next);
178
193
  },
179
194
  [onValueChange]
180
195
  );
181
- const items = React.useMemo(() => ({ close: () => setValue("") }), [setValue]);
196
+ const items = React2.useMemo(() => ({ close: () => setValue("") }), [setValue]);
182
197
  const { ref, handlers } = useSlidingIndicator({
183
198
  item: "[data-nav-item]",
184
199
  active: "[data-nav-item][data-active]",
185
200
  prefer: "[data-nav-item][data-state=open]",
186
201
  follow: true
187
202
  });
188
- const root = React.useRef(null);
189
- const viewport = React.useRef(null);
190
- React.useLayoutEffect(() => {
203
+ const root = React2.useRef(null);
204
+ const viewport = React2.useRef(null);
205
+ React2.useLayoutEffect(() => {
191
206
  const panel = viewport.current;
192
207
  const nav = root.current;
193
208
  if (!panel || !nav || !value) return;
@@ -207,13 +222,13 @@ function NavBarItems({ className, children, value: valueProp, defaultValue, onVa
207
222
  window.removeEventListener("resize", place);
208
223
  };
209
224
  }, [value]);
210
- return /* @__PURE__ */ jsx2(ItemsContext.Provider, { value: items, children: /* @__PURE__ */ jsxs(Nav.Root, { ref: root, "aria-label": label, className: s.items({ className }), value, onValueChange: setValue, delayDuration, ...props, children: [
225
+ return /* @__PURE__ */ jsx2(ItemsContext.Provider, { value: items, children: /* @__PURE__ */ jsxs2(Nav.Root, { ref: root, "aria-label": label, className: s.items({ className }), value, onValueChange: setValue, delayDuration, ...props, children: [
211
226
  /* @__PURE__ */ jsx2(Nav.List, { ref, className: s.list(), ...handlers, children }),
212
227
  /* @__PURE__ */ jsx2(Nav.Viewport, { ref: viewport, className: s.viewport() })
213
228
  ] }) });
214
229
  }
215
230
  function NavBarLink({ active, className, itemClassName, onPointerEnter, ...props }) {
216
- const { close } = React.useContext(ItemsContext);
231
+ const { close } = React2.useContext(ItemsContext);
217
232
  return /* @__PURE__ */ jsx2(Nav.Item, { className: itemClassName, children: /* @__PURE__ */ jsx2(
218
233
  Nav.Link,
219
234
  {
@@ -233,43 +248,43 @@ function NavBarLink({ active, className, itemClassName, onPointerEnter, ...props
233
248
  var INLINE_HIDE = { md: "", lg: "max-lg:hidden", xl: "max-xl:hidden" };
234
249
  var DROPDOWN_HIDE = { md: "", lg: "lg:hidden", xl: "xl:hidden" };
235
250
  function NavBarMenu({ label, active, columns = 1, inlineUpTo = 3, inlineFrom = "lg", children, className, ...props }) {
236
- const links = React.Children.toArray(children);
237
- const dropdown = (hide) => /* @__PURE__ */ jsxs(Nav.Item, { className: cn(hide, className), ...props, children: [
238
- /* @__PURE__ */ jsxs(Nav.Trigger, { "data-nav-item": "", "data-active": active ? "" : void 0, className: cn(s.item(), "group/trigger"), children: [
251
+ const links = React2.Children.toArray(children);
252
+ const dropdown = (hide) => /* @__PURE__ */ jsxs2(Nav.Item, { className: cn(hide, className), ...props, children: [
253
+ /* @__PURE__ */ jsxs2(Nav.Trigger, { "data-nav-item": "", "data-active": active ? "" : void 0, className: cn(s.item(), "group/trigger"), children: [
239
254
  label,
240
255
  /* @__PURE__ */ jsx2("svg", { viewBox: "0 0 24 24", className: s.chevron(), fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "m6 9 6 6 6-6" }) })
241
256
  ] }),
242
257
  /* @__PURE__ */ jsx2(Nav.Content, { className: cn(s.panel(), columns === 2 && s.panelWide()), children })
243
258
  ] });
244
- const inline = links.length > 0 && links.length <= inlineUpTo && links.every((c) => React.isValidElement(c) && c.type === NavBarMenuLink);
259
+ const inline = links.length > 0 && links.length <= inlineUpTo && links.every((c) => React2.isValidElement(c) && c.type === NavBarMenuLink);
245
260
  if (inline) {
246
- return /* @__PURE__ */ jsxs(Fragment2, { children: [
261
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
247
262
  inlineFrom !== "md" && dropdown(DROPDOWN_HIDE[inlineFrom]),
248
263
  links.map((link) => {
249
264
  const { title, href, active: here, asChild, children: child, icon: _icon, description: _description, className: linkClass, ...rest } = link.props;
250
- return /* @__PURE__ */ jsx2(NavBarLink, { asChild, href: asChild ? void 0 : href, active: here, className: linkClass, itemClassName: INLINE_HIDE[inlineFrom], ...rest, children: asChild && React.isValidElement(child) ? React.cloneElement(child, void 0, title) : title }, link.key);
265
+ return /* @__PURE__ */ jsx2(NavBarLink, { asChild, href: asChild ? void 0 : href, active: here, className: linkClass, itemClassName: INLINE_HIDE[inlineFrom], ...rest, children: asChild && React2.isValidElement(child) ? React2.cloneElement(child, void 0, title) : title }, link.key);
251
266
  })
252
267
  ] });
253
268
  }
254
269
  return dropdown("");
255
270
  }
256
271
  function NavBarMenuLink({ title, description, icon, active, href, className, asChild, children, ...props }) {
257
- const body = /* @__PURE__ */ jsxs(Fragment2, { children: [
272
+ const body = /* @__PURE__ */ jsxs2(Fragment2, { children: [
258
273
  icon && /* @__PURE__ */ jsx2("span", { className: s.menuIcon(), children: icon }),
259
- /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
274
+ /* @__PURE__ */ jsxs2("span", { className: "min-w-0 flex-1", children: [
260
275
  /* @__PURE__ */ jsx2("span", { className: s.menuTitle(), children: title }),
261
276
  description && /* @__PURE__ */ jsx2("span", { className: s.menuText(), children: description })
262
277
  ] })
263
278
  ] });
264
- return /* @__PURE__ */ jsx2(Nav.Link, { asChild, href: asChild ? void 0 : href, active, "aria-current": active ? "page" : void 0, "data-active": active ? "" : void 0, className: s.menuLink({ className }), ...props, children: asChild && React.isValidElement(children) ? React.cloneElement(children, void 0, body) : body });
279
+ return /* @__PURE__ */ jsx2(Nav.Link, { asChild, href: asChild ? void 0 : href, active, "aria-current": active ? "page" : void 0, "data-active": active ? "" : void 0, className: s.menuLink({ className }), ...props, children: asChild && React2.isValidElement(children) ? React2.cloneElement(children, void 0, body) : body });
265
280
  }
266
281
  function NavBarActions({ className, ...props }) {
267
282
  return /* @__PURE__ */ jsx2("div", { className: s.actions({ className }), ...props });
268
283
  }
269
284
  function NavBarMobile({ openLabel, closeLabel, className, children, ...props }) {
270
285
  const { label, open, setOpen, panelId } = useNavBar();
271
- const toggle = React.useRef(null);
272
- React.useEffect(() => {
286
+ const toggle = React2.useRef(null);
287
+ React2.useEffect(() => {
273
288
  if (!open) return;
274
289
  const onKey = (e) => {
275
290
  if (e.key !== "Escape") return;
@@ -288,7 +303,7 @@ function NavBarMobile({ openLabel, closeLabel, className, children, ...props })
288
303
  document.removeEventListener("pointerdown", onPress);
289
304
  };
290
305
  }, [open, setOpen, panelId]);
291
- return /* @__PURE__ */ jsxs(Fragment2, { children: [
306
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
292
307
  /* @__PURE__ */ jsx2("button", { ref: toggle, type: "button", "aria-expanded": open, "aria-controls": panelId, "aria-label": open ? closeLabel : openLabel, onClick: () => setOpen(!open), className: s.toggle(), children: /* @__PURE__ */ jsx2("svg", { viewBox: "0 0 24 24", className: "h-4.5 w-4.5", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: open ? /* @__PURE__ */ jsx2("path", { d: "M18 6 6 18M6 6l12 12" }) : /* @__PURE__ */ jsx2("path", { d: "M4 7h16M4 12h16M4 17h10" }) }) }),
293
308
  open && /* @__PURE__ */ jsx2(
294
309
  "nav",
@@ -313,8 +328,8 @@ function NavBarMobile({ openLabel, closeLabel, className, children, ...props })
313
328
  ] });
314
329
  }
315
330
  function NavBarMobileGroup({ label, className, children, ...props }) {
316
- const id = React.useId();
317
- return /* @__PURE__ */ jsxs("div", { role: "group", "aria-labelledby": id, className: s.mobileGroup({ className }), ...props, children: [
331
+ const id = React2.useId();
332
+ return /* @__PURE__ */ jsxs2("div", { role: "group", "aria-labelledby": id, className: s.mobileGroup({ className }), ...props, children: [
318
333
  /* @__PURE__ */ jsx2("p", { id, className: s.mobileGroupTitle(), children: label }),
319
334
  children
320
335
  ] });
@@ -330,22 +345,22 @@ var tagTone = {
330
345
  current: "bg-surface-3 text-fg-secondary"
331
346
  };
332
347
  function FamilyName({ site, current, labels }) {
333
- return /* @__PURE__ */ jsxs("span", { className: s.familyName(), children: [
348
+ return /* @__PURE__ */ jsxs2("span", { className: s.familyName(), children: [
334
349
  site.name,
335
350
  site.status !== "released" && /* @__PURE__ */ jsx2("span", { className: cn(s.familyTag(), tagTone[site.status]), children: labels.status[site.status] }),
336
351
  current && /* @__PURE__ */ jsx2("span", { className: cn(s.familyTag(), tagTone.current), children: labels.current })
337
352
  ] });
338
353
  }
339
354
  function NavBarFamily({ current, labels = familyLabels.en, defaultOpen, className }) {
340
- const inMobile = React.useContext(MobileContext);
341
- const id = React.useId();
355
+ const inMobile = React2.useContext(MobileContext);
356
+ const id = React2.useId();
342
357
  const groups = sitesByGroup();
343
358
  if (inMobile) {
344
- return /* @__PURE__ */ jsxs("div", { role: "group", "aria-labelledby": `${id}-family`, className: s.mobileFamily({ className }), children: [
359
+ return /* @__PURE__ */ jsxs2("div", { role: "group", "aria-labelledby": `${id}-family`, className: s.mobileFamily({ className }), children: [
345
360
  /* @__PURE__ */ jsx2("p", { id: `${id}-family`, className: s.familyGroupTitle(), children: labels.family }),
346
- groups.map(({ group, sites }) => /* @__PURE__ */ jsxs("div", { children: [
361
+ groups.map(({ group, sites }) => /* @__PURE__ */ jsxs2("div", { children: [
347
362
  group !== "krizaka" && /* @__PURE__ */ jsx2("p", { id: `${id}-${group}`, className: s.familyGroupTitle(), children: labels.groups[group] }),
348
- /* @__PURE__ */ jsx2("ul", { "aria-labelledby": group !== "krizaka" ? `${id}-${group}` : `${id}-family`, className: "grid gap-0.5", children: sites.map((site) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs("a", { href: site.url, "data-current": site.id === current ? "" : void 0, "aria-current": site.id === current ? "true" : void 0, className: s.mobileFamilyLink(), children: [
363
+ /* @__PURE__ */ jsx2("ul", { "aria-labelledby": group !== "krizaka" ? `${id}-${group}` : `${id}-family`, className: "grid gap-0.5", children: sites.map((site) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs2("a", { href: site.url, "data-current": site.id === current ? "" : void 0, "aria-current": site.id === current ? "true" : void 0, className: s.mobileFamilyLink(), children: [
349
364
  /* @__PURE__ */ jsx2("span", { className: s.familyMark(), children: /* @__PURE__ */ jsx2(FamilyMark, { mark: site.mark, size: 24 }) }),
350
365
  /* @__PURE__ */ jsx2(FamilyName, { site, current: site.id === current, labels })
351
366
  ] }) }, site.id)) })
@@ -354,14 +369,14 @@ function NavBarFamily({ current, labels = familyLabels.en, defaultOpen, classNam
354
369
  }
355
370
  const noHover = (e) => e.preventDefault();
356
371
  const columns = [groups.filter((g) => g.group === "krizaka" || g.group === "products"), groups.filter((g) => g.group === "open-source" || g.group === "github")];
357
- return /* @__PURE__ */ jsxs(Nav.Root, { "aria-label": labels.family, defaultValue: defaultOpen ? "family" : void 0, className: s.family({ className }), children: [
358
- /* @__PURE__ */ jsx2(Nav.List, { className: "flex", children: /* @__PURE__ */ jsxs(Nav.Item, { value: "family", children: [
372
+ return /* @__PURE__ */ jsxs2(Nav.Root, { "aria-label": labels.family, defaultValue: defaultOpen ? "family" : void 0, className: s.family({ className }), children: [
373
+ /* @__PURE__ */ jsx2(Nav.List, { className: "flex", children: /* @__PURE__ */ jsxs2(Nav.Item, { value: "family", children: [
359
374
  /* @__PURE__ */ jsx2(Nav.Trigger, { "aria-label": labels.family, onPointerMove: noHover, onPointerLeave: noHover, className: s.familyTrigger(), children: /* @__PURE__ */ jsx2("svg", { viewBox: "0 0 24 24", className: s.chevron(), fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx2("path", { d: "m6 9 6 6 6-6" }) }) }),
360
- /* @__PURE__ */ jsx2(Nav.Content, { onPointerLeave: noHover, className: s.familyPanel(), children: columns.map((column, i) => /* @__PURE__ */ jsx2("div", { className: "grid content-start gap-3", children: column.map(({ group, sites }) => /* @__PURE__ */ jsxs("div", { children: [
375
+ /* @__PURE__ */ jsx2(Nav.Content, { onPointerLeave: noHover, className: s.familyPanel(), children: columns.map((column, i) => /* @__PURE__ */ jsx2("div", { className: "grid content-start gap-3", children: column.map(({ group, sites }) => /* @__PURE__ */ jsxs2("div", { children: [
361
376
  /* @__PURE__ */ jsx2("p", { id: `${id}-${group}`, className: s.familyGroupTitle(), children: labels.groups[group] }),
362
- /* @__PURE__ */ jsx2("ul", { "aria-labelledby": `${id}-${group}`, className: "grid gap-0.5", children: sites.map((site) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs(Nav.Link, { href: site.url, "data-current": site.id === current ? "" : void 0, "aria-current": site.id === current ? "true" : void 0, className: s.familyLink(), children: [
377
+ /* @__PURE__ */ jsx2("ul", { "aria-labelledby": `${id}-${group}`, className: "grid gap-0.5", children: sites.map((site) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsxs2(Nav.Link, { href: site.url, "data-current": site.id === current ? "" : void 0, "aria-current": site.id === current ? "true" : void 0, className: s.familyLink(), children: [
363
378
  /* @__PURE__ */ jsx2("span", { className: s.familyMark(), children: /* @__PURE__ */ jsx2(FamilyMark, { mark: site.mark, size: 28 }) }),
364
- /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
379
+ /* @__PURE__ */ jsxs2("span", { className: "min-w-0", children: [
365
380
  /* @__PURE__ */ jsx2(FamilyName, { site, current: site.id === current, labels }),
366
381
  /* @__PURE__ */ jsx2("span", { className: s.familyText(), children: labels.descriptions[site.id] })
367
382
  ] })
@@ -373,18 +388,18 @@ function NavBarFamily({ current, labels = familyLabels.en, defaultOpen, classNam
373
388
  }
374
389
  function NavBarBadge({ env, version, className, children, ...props }) {
375
390
  const parts = [env, version && `v${version.replace(/^v/, "")}`].filter(Boolean);
376
- return /* @__PURE__ */ jsxs("span", { className: s.badge({ className }), ...props, children: [
391
+ return /* @__PURE__ */ jsxs2("span", { className: s.badge({ className }), ...props, children: [
377
392
  parts.join(" \xB7 "),
378
393
  children
379
394
  ] });
380
395
  }
381
396
  function NavBarLanguage(props) {
382
- const inMobile = React.useContext(MobileContext);
397
+ const inMobile = React2.useContext(MobileContext);
383
398
  return /* @__PURE__ */ jsx2(LanguageSwitch, { variant: inMobile ? "inline" : "menu", ...props });
384
399
  }
385
400
  function NavBarMobilePreferences({ label, className, children, ...props }) {
386
- const id = React.useId();
387
- return /* @__PURE__ */ jsxs("div", { role: "group", "aria-labelledby": id, className: s.mobileGroup({ className }), ...props, children: [
401
+ const id = React2.useId();
402
+ return /* @__PURE__ */ jsxs2("div", { role: "group", "aria-labelledby": id, className: s.mobileGroup({ className }), ...props, children: [
388
403
  /* @__PURE__ */ jsx2("p", { id, className: s.mobileGroupTitle(), children: label }),
389
404
  /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap items-center gap-2 px-3 py-1", children })
390
405
  ] });
@@ -412,7 +427,7 @@ var NavBar = {
412
427
  };
413
428
 
414
429
  // src/nav-bar/product-actions.tsx
415
- import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
430
+ import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
416
431
  var ProductBarAction = { SignIn: "sign-in", Try: "try" };
417
432
  function productBarActions({ signupOpen, hasTry }) {
418
433
  return signupOpen && hasTry ? { primary: ProductBarAction.Try, secondary: ProductBarAction.SignIn } : { primary: ProductBarAction.SignIn, secondary: null };
@@ -422,7 +437,7 @@ function ProductBarActions({ signIn, tryIt, signupOpen, linkAs: Link = "a", plac
422
437
  const link = (kind) => kind === ProductBarAction.Try && tryIt ? tryIt : signIn;
423
438
  const panel = placement === "panel";
424
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);
425
- return /* @__PURE__ */ jsxs2(Fragment3, { children: [
440
+ return /* @__PURE__ */ jsxs3(Fragment3, { children: [
426
441
  secondary ? button(secondary, "ghost") : null,
427
442
  button(primary, "primary")
428
443
  ] });
@@ -447,6 +462,7 @@ export {
447
462
  NavBarSession,
448
463
  ProductBarAction,
449
464
  ProductBarActions,
465
+ SESSION_HINT_COOKIE,
450
466
  meHeaders,
451
467
  meResponse,
452
468
  meSchema,
@@ -454,6 +470,7 @@ export {
454
470
  placePanel,
455
471
  productBarActions,
456
472
  sessionKey,
457
- useNavSession
473
+ useNavSession,
474
+ useSessionHint
458
475
  };
459
476
  //# sourceMappingURL=nav-bar.js.map