@krizaka/ui 3.82.0 → 3.83.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 (205) hide show
  1. package/dist/app-frame.d.ts +8 -1
  2. package/dist/app-frame.js +16 -4
  3. package/dist/app-frame.js.map +1 -1
  4. package/dist/app-header.d.ts +6 -4
  5. package/dist/app-header.js +2 -2
  6. package/dist/app-header.js.map +1 -1
  7. package/dist/date-picker.d.ts +15 -15
  8. package/dist/filter-bar.d.ts +3 -3
  9. package/package.json +3 -3
  10. package/registry/account-menu.json +1 -1
  11. package/registry/account-settings.json +1 -1
  12. package/registry/achievement.json +1 -1
  13. package/registry/action-bar.json +1 -1
  14. package/registry/activity-feed.json +1 -1
  15. package/registry/agenda.json +1 -1
  16. package/registry/alert.json +1 -1
  17. package/registry/analysis-report.json +1 -1
  18. package/registry/anatomy-plate.json +1 -1
  19. package/registry/app-frame.json +27 -4
  20. package/registry/app-header.json +18 -4
  21. package/registry/app-shell.json +1 -1
  22. package/registry/argument-card.json +1 -1
  23. package/registry/auth-layout.json +1 -1
  24. package/registry/avatar.json +1 -1
  25. package/registry/badge.json +1 -1
  26. package/registry/bird-plate.json +1 -1
  27. package/registry/button.json +1 -1
  28. package/registry/captcha.json +3 -3
  29. package/registry/card-grid.json +1 -1
  30. package/registry/card.json +1 -1
  31. package/registry/catalogue-page.json +1 -1
  32. package/registry/changelog-page.json +1 -1
  33. package/registry/chapter.json +1 -1
  34. package/registry/chat.json +1 -1
  35. package/registry/checkbox.json +1 -1
  36. package/registry/chip-link.json +1 -1
  37. package/registry/chip-row.json +1 -1
  38. package/registry/chip.json +1 -1
  39. package/registry/choice-grid.json +1 -1
  40. package/registry/code-block.json +1 -1
  41. package/registry/collection-switcher.json +1 -1
  42. package/registry/combobox.json +1 -1
  43. package/registry/command.json +1 -1
  44. package/registry/comparison-table.json +1 -1
  45. package/registry/component-page.json +1 -1
  46. package/registry/confirm-button.json +1 -1
  47. package/registry/contact-page.json +1 -1
  48. package/registry/continue-prompt.json +1 -1
  49. package/registry/copy-button.json +1 -1
  50. package/registry/countdown.json +1 -1
  51. package/registry/cover-hero.json +1 -1
  52. package/registry/cta-panel.json +1 -1
  53. package/registry/dashboard-layout.json +1 -1
  54. package/registry/data-table.json +1 -1
  55. package/registry/date-picker.json +1 -1
  56. package/registry/decision-list.json +1 -1
  57. package/registry/description-list.json +1 -1
  58. package/registry/desktop-window.json +1 -1
  59. package/registry/detail-layout.json +1 -1
  60. package/registry/dialog.json +1 -1
  61. package/registry/docs-article-page.json +1 -1
  62. package/registry/docs-hub-page.json +1 -1
  63. package/registry/docs-layout.json +1 -1
  64. package/registry/docs-nav.json +1 -1
  65. package/registry/document-viewer.json +1 -1
  66. package/registry/doodle.json +1 -1
  67. package/registry/drop-overlay.json +1 -1
  68. package/registry/dropdown-menu.json +1 -1
  69. package/registry/elephant.json +1 -1
  70. package/registry/embed-facade.json +1 -1
  71. package/registry/empty-state.json +1 -1
  72. package/registry/engine-flow.json +1 -1
  73. package/registry/entity-header.json +1 -1
  74. package/registry/environment-notice.json +1 -1
  75. package/registry/error-page.json +1 -1
  76. package/registry/examples/app-frame/touch.d.ts +4 -0
  77. package/registry/examples/app-frame/touch.js +38 -0
  78. package/registry/examples/app-frame/touch.tsx +38 -0
  79. package/registry/field.json +1 -1
  80. package/registry/file-upload.json +1 -1
  81. package/registry/filter-bar.json +1 -1
  82. package/registry/flock.json +1 -1
  83. package/registry/footnote.json +1 -1
  84. package/registry/force-update-screen.json +1 -1
  85. package/registry/form.json +1 -1
  86. package/registry/gallery-page.json +1 -1
  87. package/registry/genui.json +1 -1
  88. package/registry/glossary-term.json +1 -1
  89. package/registry/glossary.json +1 -1
  90. package/registry/glow-card.json +1 -1
  91. package/registry/goal-gauge.json +1 -1
  92. package/registry/grade-stamp.json +1 -1
  93. package/registry/identity-card.json +1 -1
  94. package/registry/image-cropper.json +1 -1
  95. package/registry/index.json +8 -8
  96. package/registry/kanban.json +1 -1
  97. package/registry/kbd.json +1 -1
  98. package/registry/kind-config-editor.json +1 -1
  99. package/registry/kpi-explained.json +1 -1
  100. package/registry/landing-page.json +1 -1
  101. package/registry/landscape.json +1 -1
  102. package/registry/language-switch.json +1 -1
  103. package/registry/legal-page.json +1 -1
  104. package/registry/link-card.json +1 -1
  105. package/registry/list.json +1 -1
  106. package/registry/loader.json +1 -1
  107. package/registry/longform-page.json +1 -1
  108. package/registry/maintenance-screen.json +1 -1
  109. package/registry/map.json +2 -2
  110. package/registry/margin-layout.json +1 -1
  111. package/registry/markdown.json +1 -1
  112. package/registry/marketing-layout.json +1 -1
  113. package/registry/mascot-quote.json +1 -1
  114. package/registry/mascot-state.json +1 -1
  115. package/registry/mascots.json +1 -1
  116. package/registry/match-dialog.json +1 -1
  117. package/registry/media-capture.json +1 -1
  118. package/registry/media-gallery.json +1 -1
  119. package/registry/meter.json +1 -1
  120. package/registry/money-input.json +1 -1
  121. package/registry/nav-bar.json +2 -2
  122. package/registry/next-actions.json +1 -1
  123. package/registry/notification-preferences.json +1 -1
  124. package/registry/number-ticker.json +1 -1
  125. package/registry/opening-hours.json +1 -1
  126. package/registry/page-header.json +1 -1
  127. package/registry/page-hero.json +1 -1
  128. package/registry/page-index.json +1 -1
  129. package/registry/page.json +1 -1
  130. package/registry/pagination.json +1 -1
  131. package/registry/pointer-light.json +1 -1
  132. package/registry/popover.json +1 -1
  133. package/registry/price-catalogue-editor.json +1 -1
  134. package/registry/pricing-page.json +1 -1
  135. package/registry/product-page.json +1 -1
  136. package/registry/profile-card.json +1 -1
  137. package/registry/progress.json +1 -1
  138. package/registry/promise-card.json +1 -1
  139. package/registry/promo-code-field.json +1 -1
  140. package/registry/proposal.json +1 -1
  141. package/registry/qr-code.json +1 -1
  142. package/registry/quota-meter.json +1 -1
  143. package/registry/radio-group.json +1 -1
  144. package/registry/rail-nav.json +2 -2
  145. package/registry/recipes.json +1 -1
  146. package/registry/retro-tv.json +1 -1
  147. package/registry/reviews.json +1 -1
  148. package/registry/router.json +1 -1
  149. package/registry/schema-form.json +1 -1
  150. package/registry/scroll-stage.json +1 -1
  151. package/registry/search-field.json +1 -1
  152. package/registry/section-backdrop.json +1 -1
  153. package/registry/separator.json +1 -1
  154. package/registry/service-card.json +1 -1
  155. package/registry/settings-layout.json +1 -1
  156. package/registry/shop-composer.json +1 -1
  157. package/registry/shop-gallery.json +1 -1
  158. package/registry/shop.json +2 -2
  159. package/registry/showcase.json +1 -1
  160. package/registry/signature.json +1 -1
  161. package/registry/site-cahier.json +1 -1
  162. package/registry/site-footer.json +2 -2
  163. package/registry/sites.json +1 -1
  164. package/registry/skeleton.json +1 -1
  165. package/registry/skip-link.json +1 -1
  166. package/registry/slider.json +1 -1
  167. package/registry/slot-picker.json +1 -1
  168. package/registry/slot.json +1 -1
  169. package/registry/specimen-tag.json +1 -1
  170. package/registry/speed-lines.json +1 -1
  171. package/registry/spinner.json +1 -1
  172. package/registry/split-view.json +1 -1
  173. package/registry/stage-banner.json +1 -1
  174. package/registry/stat.json +1 -1
  175. package/registry/status-chip.json +1 -1
  176. package/registry/status-page.json +1 -1
  177. package/registry/step-progress.json +1 -1
  178. package/registry/step-showcase.json +1 -1
  179. package/registry/stepper.json +1 -1
  180. package/registry/sticky-action.json +1 -1
  181. package/registry/stuck.json +1 -1
  182. package/registry/swipe-deck.json +1 -1
  183. package/registry/switch.json +1 -1
  184. package/registry/tabs.json +1 -1
  185. package/registry/tag-input.json +1 -1
  186. package/registry/tag-selector.json +1 -1
  187. package/registry/taped-photo.json +1 -1
  188. package/registry/terminal-replay.json +1 -1
  189. package/registry/text-style.json +1 -1
  190. package/registry/theme.json +1 -1
  191. package/registry/toast.json +1 -1
  192. package/registry/toc.json +1 -1
  193. package/registry/tooltip.json +1 -1
  194. package/registry/tree-view.json +1 -1
  195. package/registry/update-prompt.json +1 -1
  196. package/registry/upload-queue.json +1 -1
  197. package/registry/usage.json +1 -1
  198. package/registry/verified-badge.json +1 -1
  199. package/registry/versus-card.json +1 -1
  200. package/registry/vertical-video.json +1 -1
  201. package/registry/video-player.json +1 -1
  202. package/registry/video-trimmer.json +1 -1
  203. package/registry/virtual.json +1 -1
  204. package/registry/wall.json +1 -1
  205. package/registry/waveform.json +1 -1
@@ -202,9 +202,16 @@ interface AppFrameProps {
202
202
  children: React.ReactNode;
203
203
  /** The rail's accessible name. Defaults to the product's name. */
204
204
  label?: string;
205
+ /**
206
+ * `true`: every control of the frame (the rail's places and mark, the home link, the search, the account) is at least
207
+ * 44 x 44 px, the touch-target floor of WCAG 2.5.5 and of the page audit's `smallTargets`. Off by default so a product
208
+ * adopts it with its own visual baselines; the rail's places grow from 40 to 44 px on a desktop.
209
+ * @default false
210
+ */
211
+ touchTargets?: boolean;
205
212
  }
206
213
  /** The signed-in frame: sections, account and the primary action in; the rail, the top bar and the account menu out. */
207
- declare function AppFrame({ name, mark, headerMark, homeHref, accent, sections, currentId, account, primary, search, notifications, chips, variant, language, theme, locale, words, linkAs: Link, children, label, }: AppFrameProps): React.JSX.Element;
214
+ declare function AppFrame({ name, mark, headerMark, homeHref, accent, sections, currentId, account, primary, search, notifications, chips, variant, language, theme, locale, words, linkAs: Link, children, label, touchTargets, }: AppFrameProps): React.JSX.Element;
208
215
 
209
216
  export { ACCOUNT_LINK_IDS, ACCOUNT_MENU_ORDER, AppFrame, MAIN_SECTIONS_MAX, PUBLIC_BAR_MAX, frameIssues, framePlaces, navVocabulary, navWord, navWords, orderAccountLinks, publicBarLinks };
210
217
  export type { AccountLinkId, AppFrameAccount, AppFrameAccountLink, AppFrameLanguage, AppFrameProps, AppFrameTheme, FramePlaces, FrameSection, NavLocale, NavWordKey, NavWords, PublicBarLink, PublicBarSlot };
package/dist/app-frame.js CHANGED
@@ -106,6 +106,13 @@ function publicBarLinks(hrefs, locale) {
106
106
 
107
107
  // src/app-frame/app-frame.tsx
108
108
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
109
+ var TOUCH = {
110
+ item: "md:h-11",
111
+ mark: "flex min-h-11 min-w-11 items-center justify-center",
112
+ home: "min-h-11",
113
+ search: "h-11 w-11",
114
+ account: "min-h-11 min-w-11"
115
+ };
109
116
  var MODES = ["light", "dark", "system"];
110
117
  function useFrameTheme(theme) {
111
118
  const provided = useOptionalTheme();
@@ -133,13 +140,15 @@ function AppFrame({
133
140
  words,
134
141
  linkAs: Link,
135
142
  children,
136
- label
143
+ label,
144
+ touchTargets = false
137
145
  }) {
138
146
  const w = { ...navVocabulary(locale), ...words };
139
147
  const admin = variant === "admin";
140
148
  const links = orderAccountLinks(account.links, admin);
141
149
  const places = framePlaces(sections, links.map((l) => l.id));
142
150
  const frameTheme = useFrameTheme(theme);
151
+ const touch = (key) => touchTargets ? TOUCH[key] : void 0;
143
152
  const item = (section) => /* @__PURE__ */ jsx(
144
153
  RailNav.Item,
145
154
  {
@@ -150,6 +159,7 @@ function AppFrame({
150
159
  current: section.id === currentId,
151
160
  badge: section.badge,
152
161
  badgeLabel: section.badgeLabel,
162
+ className: touch("item"),
153
163
  children: Link ? /* @__PURE__ */ jsx(Link, { href: section.href }) : void 0
154
164
  },
155
165
  section.id
@@ -162,7 +172,7 @@ function AppFrame({
162
172
  {
163
173
  label: label ?? name,
164
174
  accent,
165
- mark: Link ? /* @__PURE__ */ jsx(Link, { href: homeHref, "aria-label": name, children: mark }) : /* @__PURE__ */ jsx("a", { href: homeHref, "aria-label": name, children: mark }),
175
+ mark: Link ? /* @__PURE__ */ jsx(Link, { href: homeHref, "aria-label": name, className: touch("mark"), children: mark }) : /* @__PURE__ */ jsx("a", { href: homeHref, "aria-label": name, className: touch("mark"), children: mark }),
166
176
  footer: places.foot.length > 0 ? places.foot.map(item) : void 0,
167
177
  children: places.main.map(item)
168
178
  }
@@ -174,12 +184,13 @@ function AppFrame({
174
184
  name,
175
185
  mark: headerMark ?? mark,
176
186
  href: Link ? void 0 : homeHref,
177
- homeLink: Link ? /* @__PURE__ */ jsx(Link, { href: homeHref }) : void 0,
187
+ homeLink: Link && /* @__PURE__ */ jsx(Link, { href: homeHref }),
188
+ homeClassName: touch("home"),
178
189
  chips: /* @__PURE__ */ jsxs(Fragment, { children: [
179
190
  admin && /* @__PURE__ */ jsx(Badge, { tone: "accent", children: w.administration }),
180
191
  chips
181
192
  ] }),
182
- search: search && /* @__PURE__ */ jsx(AppHeaderSearch, { label: search.label, onOpen: search.onOpen }),
193
+ search: search && /* @__PURE__ */ jsx(AppHeaderSearch, { label: search.label, onOpen: search.onOpen, className: touch("search") }),
183
194
  notifications,
184
195
  primary,
185
196
  account: /* @__PURE__ */ jsx(
@@ -192,6 +203,7 @@ function AppFrame({
192
203
  showName: "lg",
193
204
  links: menuLinks,
194
205
  linkAs: Link,
206
+ className: touch("account"),
195
207
  language: language && { label: w.language, value: language.value, options: language.options, onChange: language.onChange },
196
208
  theme: frameTheme ? { label: w.theme, value: frameTheme.value, options: MODES.map((value) => ({ value, label: modeLabels[value] })), onChange: (value) => frameTheme.onChange(value) } : void 0,
197
209
  signOut: { label: w.signOut, onSelect: account.onSignOut }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/app-frame/app-frame.tsx","../src/app-frame/contract.ts","../src/app-frame/vocabulary.ts"],"sourcesContent":["// Client (the rail's state, the account menu, the theme). THE signed-in frame of every Krizaka web product (audit F1, F2,\n// F6): the rail (a bottom tab bar on a phone) and the family's top bar, composed once from data. The product keeps its\n// list of sections; the frame owns the rest — the account menu's content and order, where the preferences live (always in\n// the menu: a header has no room for them on a phone), which place is on the rail and which is under the avatar.\nimport { AccountMenu, type AccountMenuLink } from \"@krizaka/ui/account-menu\";\nimport { AppHeader } from \"@krizaka/ui/app-header\";\nimport { AppHeaderSearch } from \"@krizaka/ui/app-header/search\";\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { RailNav } from \"@krizaka/ui/rail-nav\";\nimport { type Mode, useOptionalTheme } from \"@krizaka/ui/theme\";\nimport * as React from \"react\";\n\nimport type { BrandId } from \"../marks/ProductLogo\";\nimport { type AccountLinkId, framePlaces, type FrameSection, orderAccountLinks } from \"./contract\";\nimport { navVocabulary, type NavWords } from \"./vocabulary\";\n\nexport interface AppFrameAccountLink {\n href: string;\n /** Overrides the shared word (`Credits and usage` for billing where credits exist). */\n label?: string;\n icon?: React.ReactNode;\n}\n\nexport interface AppFrameAccount {\n name?: string;\n email?: string;\n /** `src`, or `defaultAvatar` (`{ brand, seed }`). */\n avatar?: React.ComponentProps<typeof AccountMenu>[\"avatar\"];\n /**\n * The places under the avatar. Pass the ones the product has: Billing only when it sells, Administration only for an\n * admin. The frame draws them in its order (Profile, Settings, Billing, Administration), Settings landing on the settings home.\n */\n links?: Partial<Record<AccountLinkId, AppFrameAccountLink>>;\n /** Called by Sign out. */\n onSignOut: () => void;\n}\n\nexport interface AppFrameLanguage {\n value: string;\n options: readonly { value: string; label: string }[];\n onChange: (value: string) => void;\n}\n\nexport interface AppFrameTheme {\n value: Mode;\n onChange: (mode: Mode) => void;\n}\n\nexport interface AppFrameProps {\n /** The product's name, as text in the top bar. */\n name: string;\n /** The product's mark (`<ProductLogo id=\"yomizaka\" size={26} />`): on the rail on a desktop, in the top bar on a phone. */\n mark: React.ReactNode;\n /** The mark in the top bar below `md` (smaller). Defaults to `mark`. */\n headerMark?: React.ReactNode;\n /** Where the mark and the name lead (`/app`). */\n homeHref: string;\n /** The product's brand: scopes its colours over the rail. */\n accent?: BrandId;\n /** The destinations. `place: \"foot\"` puts one at the rail's foot; `gated` leaves one out for this person. */\n sections: readonly FrameSection[];\n /** The id of the section the person is in. */\n currentId?: string;\n /** Who is signed in, the places under their avatar and Sign out. */\n account: AppFrameAccount;\n /** The one primary action of the app (« Check a document »). */\n primary?: React.ReactNode;\n /** The search (⌘K): opens the app's command palette. */\n search?: { label: string; onOpen: () => void };\n /** Notifications: an `AppHeaderCount`, or the trigger of the host's popover. */\n notifications?: React.ReactNode;\n /** Chips beside the name (`Dev`, `Local · Sovereign`). */\n chips?: React.ReactNode;\n /** `admin`: the administration's frame — a chip says so, and the way into it is not offered again. */\n variant?: \"app\" | \"admin\";\n /** The language row of the account menu; absent for a product with one language. */\n language?: AppFrameLanguage;\n /** The theme row. By default the `ThemeProvider`'s; pass `false` for a product that has none. */\n theme?: AppFrameTheme | false;\n /** `en` or `fr`: the words of the shared vocabulary. @default \"en\" */\n locale?: string;\n /** Overrides of the shared words, for a product that needs one different (use sparingly). */\n words?: Partial<NavWords>;\n /** The router's link component (Next's `Link`) for the rail and the menu. */\n linkAs?: React.ElementType;\n /** The page, inside `RailNav.Body` under the top bar. */\n children: React.ReactNode;\n /** The rail's accessible name. Defaults to the product's name. */\n label?: string;\n}\n\nconst MODES: readonly Mode[] = [\"light\", \"dark\", \"system\"];\n\nfunction useFrameTheme(theme: AppFrameProps[\"theme\"]): AppFrameTheme | null {\n const provided = useOptionalTheme();\n if (theme === false) return null;\n if (theme) return theme;\n return provided ? { value: provided.mode, onChange: provided.setMode } : null;\n}\n\n/** The signed-in frame: sections, account and the primary action in; the rail, the top bar and the account menu out. */\nexport function AppFrame({\n name, mark, headerMark, homeHref, accent, sections, currentId, account, primary, search, notifications, chips, variant = \"app\", language, theme, locale = \"en\", words, linkAs: Link, children, label,\n}: AppFrameProps) {\n const w = { ...navVocabulary(locale), ...words };\n const admin = variant === \"admin\";\n const links = orderAccountLinks(account.links, admin);\n const places = framePlaces(sections, links.map((l) => l.id));\n const frameTheme = useFrameTheme(theme);\n const item = (section: FrameSection) => (\n <RailNav.Item\n key={section.id}\n asChild={Boolean(Link)}\n href={Link ? undefined : section.href}\n icon={section.icon}\n label={section.label}\n current={section.id === currentId}\n badge={section.badge}\n badgeLabel={section.badgeLabel}\n >\n {Link ? <Link href={section.href} /> : undefined}\n </RailNav.Item>\n );\n const menuLinks: AccountMenuLink[] = links.map(({ id, link }) => ({ id, label: link.label ?? w[id], href: link.href, icon: link.icon }));\n const modeLabels: Record<Mode, string> = { light: w.themeLight, dark: w.themeDark, system: w.themeSystem };\n return (\n <RailNav.Shell data-variant={variant}>\n <RailNav.Root\n label={label ?? name}\n accent={accent}\n mark={Link ? <Link href={homeHref} aria-label={name}>{mark}</Link> : <a href={homeHref} aria-label={name}>{mark}</a>}\n footer={places.foot.length > 0 ? places.foot.map(item) : undefined}\n >\n {places.main.map(item)}\n </RailNav.Root>\n <RailNav.Body>\n <AppHeader\n name={name}\n mark={headerMark ?? mark}\n href={Link ? undefined : homeHref}\n homeLink={Link ? <Link href={homeHref} /> : undefined}\n chips={\n <>\n {admin && <Badge tone=\"accent\">{w.administration}</Badge>}\n {chips}\n </>\n }\n search={search && <AppHeaderSearch label={search.label} onOpen={search.onOpen} />}\n notifications={notifications}\n primary={primary}\n account={\n <AccountMenu\n label={w.account}\n name={account.name}\n email={account.email}\n avatar={account.avatar}\n showName=\"lg\"\n links={menuLinks}\n linkAs={Link}\n language={language && { label: w.language, value: language.value, options: language.options, onChange: language.onChange }}\n theme={frameTheme ? { label: w.theme, value: frameTheme.value, options: MODES.map((value) => ({ value, label: modeLabels[value] })), onChange: (value) => frameTheme.onChange(value as Mode) } : undefined}\n signOut={{ label: w.signOut, onSelect: account.onSignOut }}\n />\n }\n />\n {children}\n </RailNav.Body>\n </RailNav.Shell>\n );\n}\n","// Server-safe, pure. The rules of the signed-in frame, written once and tested (the audit's F1 and F2): what the account\n// menu holds and in which order, where a place lives (the rail or the avatar, never both), what a phone's tab bar can carry.\nimport type * as React from \"react\";\n\n/** The places the account menu can hold, in the order the frame draws them. */\nexport const ACCOUNT_LINK_IDS = [\"profile\", \"settings\", \"billing\", \"administration\"] as const;\nexport type AccountLinkId = (typeof ACCOUNT_LINK_IDS)[number];\n\n/** The account menu from top to bottom: who you are, the places, the preferences, Sign out. Fixed by the frame, not by the product. */\nexport const ACCOUNT_MENU_ORDER = [\"identity\", \"profile\", \"settings\", \"billing\", \"administration\", \"language\", \"theme\", \"signOut\"] as const;\n\n/** The most destinations a phone's tab bar carries (the rail's main items; the foot follows them in the same bar). */\nexport const MAIN_SECTIONS_MAX = 5;\n\nexport interface FrameSection {\n /** Stable id; `settings`, `billing`, `profile`, `administration` are the account menu's places. */\n id: string;\n label: string;\n href: string;\n icon: React.ReactNode;\n /** Not offered to this person (a permission, a feature not open): left out of the rail and the tab bar. */\n gated?: boolean;\n /** A count on the icon. */\n badge?: string | number;\n /** The count in words (« 3 to decide »). */\n badgeLabel?: string;\n /** `main`: what the person works in (the tab bar on a phone). `foot`: the rail's foot. @default \"main\" */\n place?: \"main\" | \"foot\";\n}\n\nexport interface FramePlaces {\n main: FrameSection[];\n foot: FrameSection[];\n /** Sections left out of the rail because the account menu already holds that place (or because they are gated). */\n dropped: { id: string; reason: \"account\" | \"gated\" }[];\n}\n\n/**\n * Splits the sections into the rail's main and foot, in the order given. A place is on the rail or under the avatar,\n * never both: a section whose id is one of the account links the frame was given leaves the rail (the avatar owns it).\n * A gated section leaves too.\n */\nexport function framePlaces(sections: readonly FrameSection[], accountLinks: readonly string[] = []): FramePlaces {\n const result: FramePlaces = { main: [], foot: [], dropped: [] };\n for (const section of sections) {\n if (section.gated) result.dropped.push({ id: section.id, reason: \"gated\" });\n else if (accountLinks.includes(section.id)) result.dropped.push({ id: section.id, reason: \"account\" });\n else result[section.place === \"foot\" ? \"foot\" : \"main\"].push(section);\n }\n return result;\n}\n\n/** The account links the frame draws, in the frame's order, whatever the order they were written in. Only what was passed. */\nexport function orderAccountLinks<T>(links: Partial<Record<AccountLinkId, T>> | undefined, admin = false): { id: AccountLinkId; link: T }[] {\n if (!links) return [];\n return ACCOUNT_LINK_IDS.flatMap((id) => {\n const link = links[id];\n // Inside the administration, the way into it is not offered again.\n return link && !(admin && id === \"administration\") ? [{ id, link }] : [];\n });\n}\n\n/** What is wrong with a frame's data, in words for the developer (empty: it is right). Used by the tests and by the dev warning. */\nexport function frameIssues(sections: readonly FrameSection[], accountLinks: readonly string[] = []): string[] {\n const issues: string[] = [];\n const ids = sections.map((s) => s.id);\n for (const id of new Set(ids)) if (ids.filter((x) => x === id).length > 1) issues.push(`The section \"${id}\" is declared twice.`);\n const places = framePlaces(sections, accountLinks);\n for (const { id, reason } of places.dropped) if (reason === \"account\") issues.push(`\"${id}\" is on the rail and under the avatar: a place is in one of them, so the rail drops it.`);\n if (places.main.length > MAIN_SECTIONS_MAX) issues.push(`${places.main.length} main sections: a phone's tab bar carries ${MAIN_SECTIONS_MAX} at most.`);\n return issues;\n}\n","// Server-safe: data and pure functions, no React. The words every Krizaka product says the same way (the audit's F4): the\n// frame's menus, the public bar's links and the footers read them, so « Docs », « Terms » and « Settings » never differ\n// between two products. English is the reference; a French key is required by the type.\nexport const navWords = {\n en: {\n docs: \"Docs\",\n terms: \"Terms\",\n privacy: \"Privacy\",\n settings: \"Settings\",\n billing: \"Billing\",\n profile: \"Profile\",\n administration: \"Administration\",\n account: \"Account\",\n language: \"Language\",\n theme: \"Theme\",\n themeLight: \"Light\",\n themeDark: \"Dark\",\n themeSystem: \"System\",\n signOut: \"Sign out\",\n howItWorks: \"How it works\",\n pricing: \"Pricing\",\n download: \"Download\",\n contact: \"Contact\",\n search: \"Search\",\n notifications: \"Notifications\",\n expand: \"Show the words\",\n collapse: \"Hide the words\",\n },\n fr: {\n docs: \"Docs\",\n terms: \"Conditions d'utilisation\",\n privacy: \"Confidentialité\",\n settings: \"Réglages\",\n billing: \"Facturation\",\n profile: \"Profil\",\n administration: \"Administration\",\n account: \"Compte\",\n language: \"Langue\",\n theme: \"Thème\",\n themeLight: \"Clair\",\n themeDark: \"Sombre\",\n themeSystem: \"Système\",\n signOut: \"Se déconnecter\",\n howItWorks: \"Comment ça marche\",\n pricing: \"Tarifs\",\n download: \"Télécharger\",\n contact: \"Contact\",\n search: \"Rechercher\",\n notifications: \"Notifications\",\n expand: \"Afficher les mots\",\n collapse: \"Masquer les mots\",\n },\n} as const satisfies Record<\"en\" | \"fr\", Record<string, string>>;\n\nexport type NavLocale = keyof typeof navWords;\nexport type NavWords = { [K in keyof (typeof navWords)[\"en\"]]: string };\nexport type NavWordKey = keyof NavWords;\n\n/** The words of a locale (`fr`, `fr-CA`…); any other falls back to English. */\nexport function navVocabulary(locale: string = \"en\"): NavWords {\n return navWords[locale.toLowerCase().startsWith(\"fr\") ? \"fr\" : \"en\"];\n}\n\n/** One word of the shared vocabulary. */\nexport function navWord(locale: string | undefined, key: NavWordKey): string {\n return navVocabulary(locale)[key];\n}\n\n/** The most links a product's public bar holds: past four, the bar is a menu in disguise (audit F3). */\nexport const PUBLIC_BAR_MAX = 4;\n\nexport type PublicBarSlot = \"howItWorks\" | \"pricing\" | \"docs\" | \"download\";\nexport interface PublicBarLink {\n id: PublicBarSlot;\n label: string;\n href: string;\n}\n\n/**\n * The one shape of a product's public bar: flat links, in this order, four at most — How it works · Pricing (when the\n * product has a price) · Docs · Download (when an app exists). Privacy and Terms are the footer's, « Overview » is the mark.\n * Pass the address of each slot the product has; the words come from the shared vocabulary.\n */\nexport function publicBarLinks(hrefs: Partial<Record<PublicBarSlot, string>>, locale?: string): PublicBarLink[] {\n const order: PublicBarSlot[] = [\"howItWorks\", \"pricing\", \"docs\", \"download\"];\n return order.flatMap((id) => {\n const href = hrefs[id];\n return href ? [{ id, label: navWord(locale, id), href }] : [];\n });\n}\n"],"mappings":";;;AAIA,SAAS,mBAAyC;AAClD,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAoB,wBAAwB;;;ACJrC,IAAM,mBAAmB,CAAC,WAAW,YAAY,WAAW,gBAAgB;AAI5E,IAAM,qBAAqB,CAAC,YAAY,WAAW,YAAY,WAAW,kBAAkB,YAAY,SAAS,SAAS;AAG1H,IAAM,oBAAoB;AA8B1B,SAAS,YAAY,UAAmC,eAAkC,CAAC,GAAgB;AAChH,QAAM,SAAsB,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE;AAC9D,aAAW,WAAW,UAAU;AAC9B,QAAI,QAAQ,MAAO,QAAO,QAAQ,KAAK,EAAE,IAAI,QAAQ,IAAI,QAAQ,QAAQ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,cACjM,SAAS,EAAE,OAAO,EAAE,SAAS,UAAU,QAAQ,UAAU;AAAA;AAAA,UAC3D;AAAA;AAAA,MAEJ;AAAA,MACC;AAAA,OACH;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/app-frame/app-frame.tsx","../src/app-frame/contract.ts","../src/app-frame/vocabulary.ts"],"sourcesContent":["// Client (the rail's state, the account menu, the theme). THE signed-in frame of every Krizaka web product (audit F1, F2,\n// F6): the rail (a bottom tab bar on a phone) and the family's top bar, composed once from data. The product keeps its\n// list of sections; the frame owns the rest — the account menu's content and order, where the preferences live (always in\n// the menu: a header has no room for them on a phone), which place is on the rail and which is under the avatar.\nimport { AccountMenu, type AccountMenuLink } from \"@krizaka/ui/account-menu\";\nimport { AppHeader } from \"@krizaka/ui/app-header\";\nimport { AppHeaderSearch } from \"@krizaka/ui/app-header/search\";\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { RailNav } from \"@krizaka/ui/rail-nav\";\nimport { type Mode, useOptionalTheme } from \"@krizaka/ui/theme\";\nimport * as React from \"react\";\n\nimport type { BrandId } from \"../marks/ProductLogo\";\nimport { type AccountLinkId, framePlaces, type FrameSection, orderAccountLinks } from \"./contract\";\nimport { navVocabulary, type NavWords } from \"./vocabulary\";\n\nexport interface AppFrameAccountLink {\n href: string;\n /** Overrides the shared word (`Credits and usage` for billing where credits exist). */\n label?: string;\n icon?: React.ReactNode;\n}\n\nexport interface AppFrameAccount {\n name?: string;\n email?: string;\n /** `src`, or `defaultAvatar` (`{ brand, seed }`). */\n avatar?: React.ComponentProps<typeof AccountMenu>[\"avatar\"];\n /**\n * The places under the avatar. Pass the ones the product has: Billing only when it sells, Administration only for an\n * admin. The frame draws them in its order (Profile, Settings, Billing, Administration), Settings landing on the settings home.\n */\n links?: Partial<Record<AccountLinkId, AppFrameAccountLink>>;\n /** Called by Sign out. */\n onSignOut: () => void;\n}\n\nexport interface AppFrameLanguage {\n value: string;\n options: readonly { value: string; label: string }[];\n onChange: (value: string) => void;\n}\n\nexport interface AppFrameTheme {\n value: Mode;\n onChange: (mode: Mode) => void;\n}\n\nexport interface AppFrameProps {\n /** The product's name, as text in the top bar. */\n name: string;\n /** The product's mark (`<ProductLogo id=\"yomizaka\" size={26} />`): on the rail on a desktop, in the top bar on a phone. */\n mark: React.ReactNode;\n /** The mark in the top bar below `md` (smaller). Defaults to `mark`. */\n headerMark?: React.ReactNode;\n /** Where the mark and the name lead (`/app`). */\n homeHref: string;\n /** The product's brand: scopes its colours over the rail. */\n accent?: BrandId;\n /** The destinations. `place: \"foot\"` puts one at the rail's foot; `gated` leaves one out for this person. */\n sections: readonly FrameSection[];\n /** The id of the section the person is in. */\n currentId?: string;\n /** Who is signed in, the places under their avatar and Sign out. */\n account: AppFrameAccount;\n /** The one primary action of the app (« Check a document »). */\n primary?: React.ReactNode;\n /** The search (⌘K): opens the app's command palette. */\n search?: { label: string; onOpen: () => void };\n /** Notifications: an `AppHeaderCount`, or the trigger of the host's popover. */\n notifications?: React.ReactNode;\n /** Chips beside the name (`Dev`, `Local · Sovereign`). */\n chips?: React.ReactNode;\n /** `admin`: the administration's frame — a chip says so, and the way into it is not offered again. */\n variant?: \"app\" | \"admin\";\n /** The language row of the account menu; absent for a product with one language. */\n language?: AppFrameLanguage;\n /** The theme row. By default the `ThemeProvider`'s; pass `false` for a product that has none. */\n theme?: AppFrameTheme | false;\n /** `en` or `fr`: the words of the shared vocabulary. @default \"en\" */\n locale?: string;\n /** Overrides of the shared words, for a product that needs one different (use sparingly). */\n words?: Partial<NavWords>;\n /** The router's link component (Next's `Link`) for the rail and the menu. */\n linkAs?: React.ElementType;\n /** The page, inside `RailNav.Body` under the top bar. */\n children: React.ReactNode;\n /** The rail's accessible name. Defaults to the product's name. */\n label?: string;\n /**\n * `true`: every control of the frame (the rail's places and mark, the home link, the search, the account) is at least\n * 44 x 44 px, the touch-target floor of WCAG 2.5.5 and of the page audit's `smallTargets`. Off by default so a product\n * adopts it with its own visual baselines; the rail's places grow from 40 to 44 px on a desktop.\n * @default false\n */\n touchTargets?: boolean;\n}\n\n// The classes the frame adds to its own controls when `touchTargets` is on (tailwind-variants merges them over the defaults).\nconst TOUCH = {\n item: \"md:h-11\",\n mark: \"flex min-h-11 min-w-11 items-center justify-center\",\n home: \"min-h-11\",\n search: \"h-11 w-11\",\n account: \"min-h-11 min-w-11\",\n} as const;\n\nconst MODES: readonly Mode[] = [\"light\", \"dark\", \"system\"];\n\nfunction useFrameTheme(theme: AppFrameProps[\"theme\"]): AppFrameTheme | null {\n const provided = useOptionalTheme();\n if (theme === false) return null;\n if (theme) return theme;\n return provided ? { value: provided.mode, onChange: provided.setMode } : null;\n}\n\n/** The signed-in frame: sections, account and the primary action in; the rail, the top bar and the account menu out. */\nexport function AppFrame({\n name, mark, headerMark, homeHref, accent, sections, currentId, account, primary, search, notifications, chips, variant = \"app\", language, theme, locale = \"en\", words, linkAs: Link, children, label, touchTargets = false,\n}: AppFrameProps) {\n const w = { ...navVocabulary(locale), ...words };\n const admin = variant === \"admin\";\n const links = orderAccountLinks(account.links, admin);\n const places = framePlaces(sections, links.map((l) => l.id));\n const frameTheme = useFrameTheme(theme);\n const touch = (key: keyof typeof TOUCH) => (touchTargets ? TOUCH[key] : undefined);\n const item = (section: FrameSection) => (\n <RailNav.Item\n key={section.id}\n asChild={Boolean(Link)}\n href={Link ? undefined : section.href}\n icon={section.icon}\n label={section.label}\n current={section.id === currentId}\n badge={section.badge}\n badgeLabel={section.badgeLabel}\n className={touch(\"item\")}\n >\n {Link ? <Link href={section.href} /> : undefined}\n </RailNav.Item>\n );\n const menuLinks: AccountMenuLink[] = links.map(({ id, link }) => ({ id, label: link.label ?? w[id], href: link.href, icon: link.icon }));\n const modeLabels: Record<Mode, string> = { light: w.themeLight, dark: w.themeDark, system: w.themeSystem };\n return (\n <RailNav.Shell data-variant={variant}>\n <RailNav.Root\n label={label ?? name}\n accent={accent}\n mark={Link ? <Link href={homeHref} aria-label={name} className={touch(\"mark\")}>{mark}</Link> : <a href={homeHref} aria-label={name} className={touch(\"mark\")}>{mark}</a>}\n footer={places.foot.length > 0 ? places.foot.map(item) : undefined}\n >\n {places.main.map(item)}\n </RailNav.Root>\n <RailNav.Body>\n <AppHeader\n name={name}\n mark={headerMark ?? mark}\n href={Link ? undefined : homeHref}\n homeLink={Link && <Link href={homeHref} />}\n homeClassName={touch(\"home\")}\n chips={\n <>\n {admin && <Badge tone=\"accent\">{w.administration}</Badge>}\n {chips}\n </>\n }\n search={search && <AppHeaderSearch label={search.label} onOpen={search.onOpen} className={touch(\"search\")} />}\n notifications={notifications}\n primary={primary}\n account={\n <AccountMenu\n label={w.account}\n name={account.name}\n email={account.email}\n avatar={account.avatar}\n showName=\"lg\"\n links={menuLinks}\n linkAs={Link}\n className={touch(\"account\")}\n language={language && { label: w.language, value: language.value, options: language.options, onChange: language.onChange }}\n theme={frameTheme ? { label: w.theme, value: frameTheme.value, options: MODES.map((value) => ({ value, label: modeLabels[value] })), onChange: (value) => frameTheme.onChange(value as Mode) } : undefined}\n signOut={{ label: w.signOut, onSelect: account.onSignOut }}\n />\n }\n />\n {children}\n </RailNav.Body>\n </RailNav.Shell>\n );\n}\n","// Server-safe, pure. The rules of the signed-in frame, written once and tested (the audit's F1 and F2): what the account\n// menu holds and in which order, where a place lives (the rail or the avatar, never both), what a phone's tab bar can carry.\nimport type * as React from \"react\";\n\n/** The places the account menu can hold, in the order the frame draws them. */\nexport const ACCOUNT_LINK_IDS = [\"profile\", \"settings\", \"billing\", \"administration\"] as const;\nexport type AccountLinkId = (typeof ACCOUNT_LINK_IDS)[number];\n\n/** The account menu from top to bottom: who you are, the places, the preferences, Sign out. Fixed by the frame, not by the product. */\nexport const ACCOUNT_MENU_ORDER = [\"identity\", \"profile\", \"settings\", \"billing\", \"administration\", \"language\", \"theme\", \"signOut\"] as const;\n\n/** The most destinations a phone's tab bar carries (the rail's main items; the foot follows them in the same bar). */\nexport const MAIN_SECTIONS_MAX = 5;\n\nexport interface FrameSection {\n /** Stable id; `settings`, `billing`, `profile`, `administration` are the account menu's places. */\n id: string;\n label: string;\n href: string;\n icon: React.ReactNode;\n /** Not offered to this person (a permission, a feature not open): left out of the rail and the tab bar. */\n gated?: boolean;\n /** A count on the icon. */\n badge?: string | number;\n /** The count in words (« 3 to decide »). */\n badgeLabel?: string;\n /** `main`: what the person works in (the tab bar on a phone). `foot`: the rail's foot. @default \"main\" */\n place?: \"main\" | \"foot\";\n}\n\nexport interface FramePlaces {\n main: FrameSection[];\n foot: FrameSection[];\n /** Sections left out of the rail because the account menu already holds that place (or because they are gated). */\n dropped: { id: string; reason: \"account\" | \"gated\" }[];\n}\n\n/**\n * Splits the sections into the rail's main and foot, in the order given. A place is on the rail or under the avatar,\n * never both: a section whose id is one of the account links the frame was given leaves the rail (the avatar owns it).\n * A gated section leaves too.\n */\nexport function framePlaces(sections: readonly FrameSection[], accountLinks: readonly string[] = []): FramePlaces {\n const result: FramePlaces = { main: [], foot: [], dropped: [] };\n for (const section of sections) {\n if (section.gated) result.dropped.push({ id: section.id, reason: \"gated\" });\n else if (accountLinks.includes(section.id)) result.dropped.push({ id: section.id, reason: \"account\" });\n else result[section.place === \"foot\" ? \"foot\" : \"main\"].push(section);\n }\n return result;\n}\n\n/** The account links the frame draws, in the frame's order, whatever the order they were written in. Only what was passed. */\nexport function orderAccountLinks<T>(links: Partial<Record<AccountLinkId, T>> | undefined, admin = false): { id: AccountLinkId; link: T }[] {\n if (!links) return [];\n return ACCOUNT_LINK_IDS.flatMap((id) => {\n const link = links[id];\n // Inside the administration, the way into it is not offered again.\n return link && !(admin && id === \"administration\") ? [{ id, link }] : [];\n });\n}\n\n/** What is wrong with a frame's data, in words for the developer (empty: it is right). Used by the tests and by the dev warning. */\nexport function frameIssues(sections: readonly FrameSection[], accountLinks: readonly string[] = []): string[] {\n const issues: string[] = [];\n const ids = sections.map((s) => s.id);\n for (const id of new Set(ids)) if (ids.filter((x) => x === id).length > 1) issues.push(`The section \"${id}\" is declared twice.`);\n const places = framePlaces(sections, accountLinks);\n for (const { id, reason } of places.dropped) if (reason === \"account\") issues.push(`\"${id}\" is on the rail and under the avatar: a place is in one of them, so the rail drops it.`);\n if (places.main.length > MAIN_SECTIONS_MAX) issues.push(`${places.main.length} main sections: a phone's tab bar carries ${MAIN_SECTIONS_MAX} at most.`);\n return issues;\n}\n","// Server-safe: data and pure functions, no React. The words every Krizaka product says the same way (the audit's F4): the\n// frame's menus, the public bar's links and the footers read them, so « Docs », « Terms » and « Settings » never differ\n// between two products. English is the reference; a French key is required by the type.\nexport const navWords = {\n en: {\n docs: \"Docs\",\n terms: \"Terms\",\n privacy: \"Privacy\",\n settings: \"Settings\",\n billing: \"Billing\",\n profile: \"Profile\",\n administration: \"Administration\",\n account: \"Account\",\n language: \"Language\",\n theme: \"Theme\",\n themeLight: \"Light\",\n themeDark: \"Dark\",\n themeSystem: \"System\",\n signOut: \"Sign out\",\n howItWorks: \"How it works\",\n pricing: \"Pricing\",\n download: \"Download\",\n contact: \"Contact\",\n search: \"Search\",\n notifications: \"Notifications\",\n expand: \"Show the words\",\n collapse: \"Hide the words\",\n },\n fr: {\n docs: \"Docs\",\n terms: \"Conditions d'utilisation\",\n privacy: \"Confidentialité\",\n settings: \"Réglages\",\n billing: \"Facturation\",\n profile: \"Profil\",\n administration: \"Administration\",\n account: \"Compte\",\n language: \"Langue\",\n theme: \"Thème\",\n themeLight: \"Clair\",\n themeDark: \"Sombre\",\n themeSystem: \"Système\",\n signOut: \"Se déconnecter\",\n howItWorks: \"Comment ça marche\",\n pricing: \"Tarifs\",\n download: \"Télécharger\",\n contact: \"Contact\",\n search: \"Rechercher\",\n notifications: \"Notifications\",\n expand: \"Afficher les mots\",\n collapse: \"Masquer les mots\",\n },\n} as const satisfies Record<\"en\" | \"fr\", Record<string, string>>;\n\nexport type NavLocale = keyof typeof navWords;\nexport type NavWords = { [K in keyof (typeof navWords)[\"en\"]]: string };\nexport type NavWordKey = keyof NavWords;\n\n/** The words of a locale (`fr`, `fr-CA`…); any other falls back to English. */\nexport function navVocabulary(locale: string = \"en\"): NavWords {\n return navWords[locale.toLowerCase().startsWith(\"fr\") ? \"fr\" : \"en\"];\n}\n\n/** One word of the shared vocabulary. */\nexport function navWord(locale: string | undefined, key: NavWordKey): string {\n return navVocabulary(locale)[key];\n}\n\n/** The most links a product's public bar holds: past four, the bar is a menu in disguise (audit F3). */\nexport const PUBLIC_BAR_MAX = 4;\n\nexport type PublicBarSlot = \"howItWorks\" | \"pricing\" | \"docs\" | \"download\";\nexport interface PublicBarLink {\n id: PublicBarSlot;\n label: string;\n href: string;\n}\n\n/**\n * The one shape of a product's public bar: flat links, in this order, four at most — How it works · Pricing (when the\n * product has a price) · Docs · Download (when an app exists). Privacy and Terms are the footer's, « Overview » is the mark.\n * Pass the address of each slot the product has; the words come from the shared vocabulary.\n */\nexport function publicBarLinks(hrefs: Partial<Record<PublicBarSlot, string>>, locale?: string): PublicBarLink[] {\n const order: PublicBarSlot[] = [\"howItWorks\", \"pricing\", \"docs\", \"download\"];\n return order.flatMap((id) => {\n const href = hrefs[id];\n return href ? [{ id, label: navWord(locale, id), href }] : [];\n });\n}\n"],"mappings":";;;AAIA,SAAS,mBAAyC;AAClD,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAoB,wBAAwB;;;ACJrC,IAAM,mBAAmB,CAAC,WAAW,YAAY,WAAW,gBAAgB;AAI5E,IAAM,qBAAqB,CAAC,YAAY,WAAW,YAAY,WAAW,kBAAkB,YAAY,SAAS,SAAS;AAG1H,IAAM,oBAAoB;AA8B1B,SAAS,YAAY,UAAmC,eAAkC,CAAC,GAAgB;AAChH,QAAM,SAAsB,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC,EAAE;AAC9D,aAAW,WAAW,UAAU;AAC9B,QAAI,QAAQ,MAAO,QAAO,QAAQ,KAAK,EAAE,IAAI,QAAQ,IAAI,QAAQ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O;AAAA,cACP,QAAQ;AAAA,cACR,WAAW,MAAM,SAAS;AAAA,cAC1B,UAAU,YAAY,EAAE,OAAO,EAAE,UAAU,OAAO,SAAS,OAAO,SAAS,SAAS,SAAS,UAAU,SAAS,SAAS;AAAA,cACzH,OAAO,aAAa,EAAE,OAAO,EAAE,OAAO,OAAO,WAAW,OAAO,SAAS,MAAM,IAAI,CAAC,WAAW,EAAE,OAAO,OAAO,WAAW,KAAK,EAAE,EAAE,GAAG,UAAU,CAAC,UAAU,WAAW,SAAS,KAAa,EAAE,IAAI;AAAA,cACjM,SAAS,EAAE,OAAO,EAAE,SAAS,UAAU,QAAQ,UAAU;AAAA;AAAA,UAC3D;AAAA;AAAA,MAEJ;AAAA,MACC;AAAA,OACH;AAAA,KACF;AAEJ;","names":[]}
@@ -74,6 +74,8 @@ type AppHeaderProps = Omit<React.ComponentProps<"header">, "children"> & {
74
74
  className?: string;
75
75
  children?: React.ReactNode;
76
76
  }>;
77
+ /** Classes added to the home link (from `href` or `homeLink`), e.g. a 44 px floor; the header fills the link itself. */
78
+ homeClassName?: string;
77
79
  /** Status chips beside the name (`Badge`): « Local · Sovereign », « Dev », a version. */
78
80
  chips?: React.ReactNode;
79
81
  /** The search trigger, first of the controls: `AppHeaderSearch` (`@krizaka/ui/app-header/search`) — a field from `md`, an icon below, ⌘K. */
@@ -92,21 +94,21 @@ type AppHeaderProps = Omit<React.ComponentProps<"header">, "children"> & {
92
94
  account?: React.ReactNode;
93
95
  };
94
96
  /** The app's top bar: the name next to the rail, the mark on a phone, chips, then search · language · actions · messages · notifications · primary · account. */
95
- declare function AppHeader({ name, mark, href, homeLink, chips, search, language, actions, messages, notifications, primary, account, className, ...props }: AppHeaderProps): React.JSX.Element;
97
+ declare function AppHeader({ name, mark, href, homeLink, homeClassName, chips, search, language, actions, messages, notifications, primary, account, className, ...props }: AppHeaderProps): React.JSX.Element;
96
98
 
97
99
  declare const appHeaderCount: tailwind_variants.TVReturnType<{
98
100
  [key: string]: {
99
101
  [key: string]: tailwind_variants.ClassValue | {
100
- icon?: tailwind_variants.ClassValue;
101
102
  root?: tailwind_variants.ClassValue;
103
+ icon?: tailwind_variants.ClassValue;
102
104
  count?: tailwind_variants.ClassValue;
103
105
  };
104
106
  };
105
107
  } | {
106
108
  [x: string]: {
107
109
  [x: string]: tailwind_variants.ClassValue | {
108
- icon?: tailwind_variants.ClassValue;
109
110
  root?: tailwind_variants.ClassValue;
111
+ icon?: tailwind_variants.ClassValue;
110
112
  count?: tailwind_variants.ClassValue;
111
113
  };
112
114
  };
@@ -117,8 +119,8 @@ declare const appHeaderCount: tailwind_variants.TVReturnType<{
117
119
  }, undefined, {
118
120
  [key: string]: {
119
121
  [key: string]: tailwind_variants.ClassValue | {
120
- icon?: tailwind_variants.ClassValue;
121
122
  root?: tailwind_variants.ClassValue;
123
+ icon?: tailwind_variants.ClassValue;
122
124
  count?: tailwind_variants.ClassValue;
123
125
  };
124
126
  };
@@ -16,14 +16,14 @@ var appHeader = tv({
16
16
  }
17
17
  });
18
18
  var s = appHeader();
19
- function AppHeader({ name, mark, href, homeLink, chips, search, language, actions, messages, notifications, primary, account, className, ...props }) {
19
+ function AppHeader({ name, mark, href, homeLink, homeClassName, chips, search, language, actions, messages, notifications, primary, account, className, ...props }) {
20
20
  const brand = /* @__PURE__ */ jsxs(Fragment, { children: [
21
21
  mark && /* @__PURE__ */ jsx("span", { "data-brand-mark": true, className: s.mark(), children: mark }),
22
22
  /* @__PURE__ */ jsx("span", { className: s.name(), children: name })
23
23
  ] });
24
24
  const hasControls = [search, language, actions, messages, notifications, primary, account].some(Boolean);
25
25
  return /* @__PURE__ */ jsxs("header", { className: s.root({ className }), ...props, children: [
26
- homeLink ? React.cloneElement(homeLink, { className: s.brand() }, brand) : href ? /* @__PURE__ */ jsx("a", { href, className: s.brand(), children: brand }) : /* @__PURE__ */ jsx("div", { className: s.brand(), children: brand }),
26
+ homeLink ? React.cloneElement(homeLink, { className: s.brand({ className: [homeLink.props.className, homeClassName] }) }, brand) : href ? /* @__PURE__ */ jsx("a", { href, className: s.brand({ className: homeClassName }), children: brand }) : /* @__PURE__ */ jsx("div", { className: s.brand(), children: brand }),
27
27
  chips && /* @__PURE__ */ jsx("div", { className: s.chips(), children: chips }),
28
28
  hasControls && /* @__PURE__ */ jsxs("div", { className: s.actions(), children: [
29
29
  search && /* @__PURE__ */ jsx("div", { "data-slot": "search", className: s.search(), children: search }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/app-header/app-header.tsx","../src/app-header/count.tsx","../src/app-header/count-text.ts"],"sourcesContent":["// Server-safe: no hook, no context. The family's top bar (#640): the product's NAME as text (the mark is the rail's), optional\n// chips, then the session's controls in a fixed order — search, language, the host's actions (a theme toggle), messages,\n// notifications, the primary action, the account. Every slot is the host's; a slot left empty draws nothing. Where the\n// rail is a bottom tab bar (a phone) it has no room for the mark, so the header shows it there and only there: exactly\n// one brand mark is visible at every width. At 360 px the name truncates first; the controls never clip.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const appHeader = tv({\n slots: {\n root: \"sticky top-0 z-30 flex h-14 w-full min-w-0 shrink-0 items-center gap-3 border-b border-border-subtle bg-surface-1 px-4 md:bg-surface-1 md:pl-3 md:pr-5\",\n // The rail's mark is 56 px tall and so is this bar: the word shares the mark's line, right after the rail.\n brand: \"flex min-w-0 items-center gap-2 font-display text-sm font-bold tracking-tight text-fg no-underline\",\n mark: \"inline-flex shrink-0 md:hidden\",\n name: \"truncate\",\n chips: \"flex shrink-0 items-center gap-2\",\n // The controls: one row at the right, in the order of the slots. They keep their size; the name gives way.\n actions: \"ml-auto flex shrink-0 items-center gap-1 sm:gap-2\",\n search: \"flex min-w-0 shrink-0\",\n },\n});\nconst s = appHeader();\n\nexport type AppHeaderProps = Omit<React.ComponentProps<\"header\">, \"children\"> & {\n /** The product's name, as text (`Orazaka`): the only brand element on a desktop. */\n name: string;\n /** The product's mark (`<ProductLogo id=\"orazaka\" size={22} />`): shown below `md` only, where the rail (which carries it) is a bottom bar. */\n mark?: React.ReactNode;\n /** Makes the name (and the mark) a link home: pass your router's link as `homeLink` or give a `href`. */\n href?: string;\n /** Your router's link element for the home link; it receives the name and the mark as children. */\n homeLink?: React.ReactElement<{ className?: string; children?: React.ReactNode }>;\n /** Status chips beside the name (`Badge`): « Local · Sovereign », « Dev », a version. */\n chips?: React.ReactNode;\n /** The search trigger, first of the controls: `AppHeaderSearch` (`@krizaka/ui/app-header/search`) — a field from `md`, an icon below, ⌘K. */\n search?: React.ReactNode;\n /** The language: `LanguageSwitch` (`@krizaka/ui/language-switch`) — a globe and « FR », labelled. */\n language?: React.ReactNode;\n /** The host's own controls, after the language (a theme toggle). Alone, it is the whole right side, as before. */\n actions?: React.ReactNode;\n /** Messages: an `AppHeaderCount` (an icon button or link with its unread count). Empty: hidden. */\n messages?: React.ReactNode;\n /** Notifications: an `AppHeaderCount` (or the trigger of the host's popover). Empty: hidden. */\n notifications?: React.ReactNode;\n /** The one primary action of the app (« New check », #588), before the account. */\n primary?: React.ReactNode;\n /** The account, last: `AccountMenu` with `showName` (the name from `sm`), or the visitor's Sign in. */\n account?: React.ReactNode;\n};\n\n/** The app's top bar: the name next to the rail, the mark on a phone, chips, then search · language · actions · messages · notifications · primary · account. */\nexport function AppHeader({ name, mark, href, homeLink, chips, search, language, actions, messages, notifications, primary, account, className, ...props }: AppHeaderProps) {\n const brand = (\n <>\n {mark && <span data-brand-mark className={s.mark()}>{mark}</span>}\n <span className={s.name()}>{name}</span>\n </>\n );\n const hasControls = [search, language, actions, messages, notifications, primary, account].some(Boolean);\n return (\n <header className={s.root({ className })} {...props}>\n {homeLink ? (\n React.cloneElement(homeLink, { className: s.brand() }, brand)\n ) : href ? (\n <a href={href} className={s.brand()}>{brand}</a>\n ) : (\n <div className={s.brand()}>{brand}</div>\n )}\n {chips && <div className={s.chips()}>{chips}</div>}\n {/* The order is the family's, not the host's: the same bar in every product. */}\n {hasControls && (\n <div className={s.actions()}>\n {search && <div data-slot=\"search\" className={s.search()}>{search}</div>}\n {language}\n {actions}\n {messages}\n {notifications}\n {primary}\n {account}\n </div>\n )}\n </header>\n );\n}\n","// Server-safe: no hook. An icon control of the top bar with an unread count — messages, notifications. A link (`href`, your\n// router's `linkAs`) or a button (the trigger of the host's popover, through `asChild` of Radix: its props and ref are\n// spread here). The count is drawn as a small badge and said in the name: « Notifications, 3 new ».\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { countName, countText } from \"./count-text\";\n\nexport const appHeaderCount = tv({\n slots: {\n root:\n \"relative inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-fg-secondary no-underline transition-colors \" +\n \"hover:bg-surface-2 hover:text-fg aria-expanded:bg-surface-2 aria-expanded:text-fg aria-[current=page]:bg-surface-2 aria-[current=page]:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none\",\n icon: \"inline-flex h-5 w-5 items-center justify-center [&>svg]:h-5 [&>svg]:w-5\",\n count:\n \"pointer-events-none absolute -right-0.5 -top-0.5 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-accent px-1 \" +\n \"font-mono text-[10px] font-bold leading-none tabular-nums text-on-accent ring-2 ring-surface-1\",\n },\n});\nconst s = appHeaderCount();\n\nexport type AppHeaderCountProps = Omit<React.ComponentProps<\"button\">, \"children\"> & {\n /** What it is (« Notifications », « Messages ») — passed translated; its accessible name, with the count. */\n label: string;\n /** The icon (`<NotificationIcon />` of @krizaka/icons): decorative, the name is `label`. */\n icon: React.ReactNode;\n /** The unread count; 0 or absent draws no badge. */\n count?: number;\n /** The count in words, said after the label (« 3 new », « 3 nouvelles ») — passed translated, with its plural. Default: the number. */\n countLabel?: string;\n /**\n * Above it the badge shows `max+`.\n * @default 99\n */\n max?: number;\n /** A link to the page (`/notifications`) instead of a button. */\n href?: string;\n /** Your router's link (Next's `Link`) for `href`; an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /** The page is the one it leads to (`aria-current=\"page\"`). */\n current?: boolean;\n};\n\n/** An icon button or link of the top bar with an unread count, the count announced in its name. */\nexport function AppHeaderCount({ label, icon, count, countLabel, max = 99, href, linkAs, current, className, type, ...props }: AppHeaderCountProps) {\n const text = countText(count, max);\n const shared = {\n ...props,\n \"aria-label\": countName(label, count, countLabel),\n \"aria-current\": current ? (\"page\" as const) : undefined,\n \"data-unread\": text ? \"\" : undefined,\n className: s.root({ className }),\n };\n const children = (\n <>\n <span aria-hidden className={s.icon()}>{icon}</span>\n {text && <span aria-hidden data-count className={s.count()}>{text}</span>}\n </>\n );\n if (href) {\n const Link = linkAs ?? \"a\";\n return <Link href={href} {...shared}>{children}</Link>;\n }\n return <button type={type ?? \"button\"} {...shared}>{children}</button>;\n}\n","// Pure, no import: shared by the web's AppHeaderCount and the native one (src/native/app-header.tsx).\n\n/** What the badge shows: the count, or `max+` above `max`; nothing at 0. */\nexport function countText(count: number | undefined, max = 99): string | null {\n if (!count || count <= 0 || !Number.isFinite(count)) return null;\n return count > max ? `${max}+` : String(Math.floor(count));\n}\n\n/** The control's accessible name: the label alone, or the label and the count's words (« Notifications, 3 new »). */\nexport function countName(label: string, count: number | undefined, countLabel?: string): string {\n if (!countText(count, Number.POSITIVE_INFINITY)) return label;\n return `${label}, ${countLabel ?? String(Math.floor(count!))}`;\n}\n"],"mappings":";AAKA,YAAY,WAAW;AACvB,SAAS,UAAU;AA+Cf,mBACW,KADX;AA7CG,IAAM,YAAY,GAAG;AAAA,EAC1B,OAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA;AAAA,IAEP,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AACF,CAAC;AACD,IAAM,IAAI,UAAU;AA8Bb,SAAS,UAAU,EAAE,MAAM,MAAM,MAAM,UAAU,OAAO,QAAQ,UAAU,SAAS,UAAU,eAAe,SAAS,SAAS,WAAW,GAAG,MAAM,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AAAC,MADF,QAAAC,aAAA;AA/CG,IAAM,iBAAiBC,IAAG;AAAA,EAC/B,OAAO;AAAA,IACL,MACE;AAAA,IAGF,MAAM;AAAA,IACN,OACE;AAAA,EAEJ;AACF,CAAC;AACD,IAAMC,KAAI,eAAe;AAyBlB,SAAS,eAAe,EAAE,OAAO,MAAM,OAAO,YAAY,MAAM,IAAI,MAAM,QAAQ,SAAS,WAAW,MAAM,GAAG,MAAM,GAAwB;AAClJ,QAAM,OAAO,UAAU,OAAO,GAAG;AACjC,QAAM,SAAS;AAAA,IACb,GAAG;AAAA,IACH,cAAc,UAAU,OAAO,OAAO,UAAU;AAAA,IAChD,gBAAgB,UAAW,SAAmB;AAAA,IAC9C,eAAe,OAAO,KAAK;AAAA,IAC3B,WAAWA,GAAE,KAAK,EAAE,UAAU,CAAC;AAAA,EACjC;AACA,QAAM,WACJ,gBAAAF,MAAAF,WAAA,EACE;AAAA,oBAAAC,KAAC,UAAK,eAAW,MAAC,WAAWG,GAAE,KAAK,GAAI,gBAAK;AAAA,IAC5C,QAAQ,gBAAAH,KAAC,UAAK,eAAW,MAAC,cAAU,MAAC,WAAWG,GAAE,MAAM,GAAI,gBAAK;AAAA,KACpE;AAEF,MAAI,MAAM;AACR,UAAM,OAAO,UAAU;AACvB,WAAO,gBAAAH,KAAC,QAAK,MAAa,GAAG,QAAS,UAAS;AAAA,EACjD;AACA,SAAO,gBAAAA,KAAC,YAAO,MAAM,QAAQ,UAAW,GAAG,QAAS,UAAS;AAC/D;","names":["tv","Fragment","jsx","jsxs","tv","s"]}
1
+ {"version":3,"sources":["../src/app-header/app-header.tsx","../src/app-header/count.tsx","../src/app-header/count-text.ts"],"sourcesContent":["// Server-safe: no hook, no context. The family's top bar (#640): the product's NAME as text (the mark is the rail's), optional\n// chips, then the session's controls in a fixed order — search, language, the host's actions (a theme toggle), messages,\n// notifications, the primary action, the account. Every slot is the host's; a slot left empty draws nothing. Where the\n// rail is a bottom tab bar (a phone) it has no room for the mark, so the header shows it there and only there: exactly\n// one brand mark is visible at every width. At 360 px the name truncates first; the controls never clip.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const appHeader = tv({\n slots: {\n root: \"sticky top-0 z-30 flex h-14 w-full min-w-0 shrink-0 items-center gap-3 border-b border-border-subtle bg-surface-1 px-4 md:bg-surface-1 md:pl-3 md:pr-5\",\n // The rail's mark is 56 px tall and so is this bar: the word shares the mark's line, right after the rail.\n brand: \"flex min-w-0 items-center gap-2 font-display text-sm font-bold tracking-tight text-fg no-underline\",\n mark: \"inline-flex shrink-0 md:hidden\",\n name: \"truncate\",\n chips: \"flex shrink-0 items-center gap-2\",\n // The controls: one row at the right, in the order of the slots. They keep their size; the name gives way.\n actions: \"ml-auto flex shrink-0 items-center gap-1 sm:gap-2\",\n search: \"flex min-w-0 shrink-0\",\n },\n});\nconst s = appHeader();\n\nexport type AppHeaderProps = Omit<React.ComponentProps<\"header\">, \"children\"> & {\n /** The product's name, as text (`Orazaka`): the only brand element on a desktop. */\n name: string;\n /** The product's mark (`<ProductLogo id=\"orazaka\" size={22} />`): shown below `md` only, where the rail (which carries it) is a bottom bar. */\n mark?: React.ReactNode;\n /** Makes the name (and the mark) a link home: pass your router's link as `homeLink` or give a `href`. */\n href?: string;\n /** Your router's link element for the home link; it receives the name and the mark as children. */\n homeLink?: React.ReactElement<{ className?: string; children?: React.ReactNode }>;\n /** Classes added to the home link (from `href` or `homeLink`), e.g. a 44 px floor; the header fills the link itself. */\n homeClassName?: string;\n /** Status chips beside the name (`Badge`): « Local · Sovereign », « Dev », a version. */\n chips?: React.ReactNode;\n /** The search trigger, first of the controls: `AppHeaderSearch` (`@krizaka/ui/app-header/search`) — a field from `md`, an icon below, ⌘K. */\n search?: React.ReactNode;\n /** The language: `LanguageSwitch` (`@krizaka/ui/language-switch`) — a globe and « FR », labelled. */\n language?: React.ReactNode;\n /** The host's own controls, after the language (a theme toggle). Alone, it is the whole right side, as before. */\n actions?: React.ReactNode;\n /** Messages: an `AppHeaderCount` (an icon button or link with its unread count). Empty: hidden. */\n messages?: React.ReactNode;\n /** Notifications: an `AppHeaderCount` (or the trigger of the host's popover). Empty: hidden. */\n notifications?: React.ReactNode;\n /** The one primary action of the app (« New check », #588), before the account. */\n primary?: React.ReactNode;\n /** The account, last: `AccountMenu` with `showName` (the name from `sm`), or the visitor's Sign in. */\n account?: React.ReactNode;\n};\n\n/** The app's top bar: the name next to the rail, the mark on a phone, chips, then search · language · actions · messages · notifications · primary · account. */\nexport function AppHeader({ name, mark, href, homeLink, homeClassName, chips, search, language, actions, messages, notifications, primary, account, className, ...props }: AppHeaderProps) {\n const brand = (\n <>\n {mark && <span data-brand-mark className={s.mark()}>{mark}</span>}\n <span className={s.name()}>{name}</span>\n </>\n );\n const hasControls = [search, language, actions, messages, notifications, primary, account].some(Boolean);\n return (\n <header className={s.root({ className })} {...props}>\n {homeLink ? (\n React.cloneElement(homeLink, { className: s.brand({ className: [homeLink.props.className, homeClassName] }) }, brand)\n ) : href ? (\n <a href={href} className={s.brand({ className: homeClassName })}>{brand}</a>\n ) : (\n <div className={s.brand()}>{brand}</div>\n )}\n {chips && <div className={s.chips()}>{chips}</div>}\n {/* The order is the family's, not the host's: the same bar in every product. */}\n {hasControls && (\n <div className={s.actions()}>\n {search && <div data-slot=\"search\" className={s.search()}>{search}</div>}\n {language}\n {actions}\n {messages}\n {notifications}\n {primary}\n {account}\n </div>\n )}\n </header>\n );\n}\n","// Server-safe: no hook. An icon control of the top bar with an unread count — messages, notifications. A link (`href`, your\n// router's `linkAs`) or a button (the trigger of the host's popover, through `asChild` of Radix: its props and ref are\n// spread here). The count is drawn as a small badge and said in the name: « Notifications, 3 new ».\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { countName, countText } from \"./count-text\";\n\nexport const appHeaderCount = tv({\n slots: {\n root:\n \"relative inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-fg-secondary no-underline transition-colors \" +\n \"hover:bg-surface-2 hover:text-fg aria-expanded:bg-surface-2 aria-expanded:text-fg aria-[current=page]:bg-surface-2 aria-[current=page]:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none\",\n icon: \"inline-flex h-5 w-5 items-center justify-center [&>svg]:h-5 [&>svg]:w-5\",\n count:\n \"pointer-events-none absolute -right-0.5 -top-0.5 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-accent px-1 \" +\n \"font-mono text-[10px] font-bold leading-none tabular-nums text-on-accent ring-2 ring-surface-1\",\n },\n});\nconst s = appHeaderCount();\n\nexport type AppHeaderCountProps = Omit<React.ComponentProps<\"button\">, \"children\"> & {\n /** What it is (« Notifications », « Messages ») — passed translated; its accessible name, with the count. */\n label: string;\n /** The icon (`<NotificationIcon />` of @krizaka/icons): decorative, the name is `label`. */\n icon: React.ReactNode;\n /** The unread count; 0 or absent draws no badge. */\n count?: number;\n /** The count in words, said after the label (« 3 new », « 3 nouvelles ») — passed translated, with its plural. Default: the number. */\n countLabel?: string;\n /**\n * Above it the badge shows `max+`.\n * @default 99\n */\n max?: number;\n /** A link to the page (`/notifications`) instead of a button. */\n href?: string;\n /** Your router's link (Next's `Link`) for `href`; an `<a>` otherwise. */\n linkAs?: React.ElementType;\n /** The page is the one it leads to (`aria-current=\"page\"`). */\n current?: boolean;\n};\n\n/** An icon button or link of the top bar with an unread count, the count announced in its name. */\nexport function AppHeaderCount({ label, icon, count, countLabel, max = 99, href, linkAs, current, className, type, ...props }: AppHeaderCountProps) {\n const text = countText(count, max);\n const shared = {\n ...props,\n \"aria-label\": countName(label, count, countLabel),\n \"aria-current\": current ? (\"page\" as const) : undefined,\n \"data-unread\": text ? \"\" : undefined,\n className: s.root({ className }),\n };\n const children = (\n <>\n <span aria-hidden className={s.icon()}>{icon}</span>\n {text && <span aria-hidden data-count className={s.count()}>{text}</span>}\n </>\n );\n if (href) {\n const Link = linkAs ?? \"a\";\n return <Link href={href} {...shared}>{children}</Link>;\n }\n return <button type={type ?? \"button\"} {...shared}>{children}</button>;\n}\n","// Pure, no import: shared by the web's AppHeaderCount and the native one (src/native/app-header.tsx).\n\n/** What the badge shows: the count, or `max+` above `max`; nothing at 0. */\nexport function countText(count: number | undefined, max = 99): string | null {\n if (!count || count <= 0 || !Number.isFinite(count)) return null;\n return count > max ? `${max}+` : String(Math.floor(count));\n}\n\n/** The control's accessible name: the label alone, or the label and the count's words (« Notifications, 3 new »). */\nexport function countName(label: string, count: number | undefined, countLabel?: string): string {\n if (!countText(count, Number.POSITIVE_INFINITY)) return label;\n return `${label}, ${countLabel ?? String(Math.floor(count!))}`;\n}\n"],"mappings":";AAKA,YAAY,WAAW;AACvB,SAAS,UAAU;AAiDf,mBACW,KADX;AA/CG,IAAM,YAAY,GAAG;AAAA,EAC1B,OAAO;AAAA,IACL,MAAM;AAAA;AAAA,IAEN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA;AAAA,IAEP,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AACF,CAAC;AACD,IAAM,IAAI,UAAU;AAgCb,SAAS,UAAU,EAAE,MAAM,MAAM,MAAM,UAAU,eAAe,OAAO,QAAQ,UAAU,SAAS,UAAU,eAAe,SAAS,SAAS,WAAW,GAAG,MAAM,GAAmB;AACzL,QAAM,QACJ,iCACG;AAAA,YAAQ,oBAAC,UAAK,mBAAe,MAAC,WAAW,EAAE,KAAK,GAAI,gBAAK;AAAA,IAC1D,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,gBAAK;AAAA,KACnC;AAEF,QAAM,cAAc,CAAC,QAAQ,UAAU,SAAS,UAAU,eAAe,SAAS,OAAO,EAAE,KAAK,OAAO;AACvG,SACE,qBAAC,YAAO,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAC3C;AAAA,eACO,mBAAa,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,SAAS,MAAM,WAAW,aAAa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AG;AAAA,IACH,cAAc,UAAU,OAAO,OAAO,UAAU;AAAA,IAChD,gBAAgB,UAAW,SAAmB;AAAA,IAC9C,eAAe,OAAO,KAAK;AAAA,IAC3B,WAAWA,GAAE,KAAK,EAAE,UAAU,CAAC;AAAA,EACjC;AACA,QAAM,WACJ,gBAAAF,MAAAF,WAAA,EACE;AAAA,oBAAAC,KAAC,UAAK,eAAW,MAAC,WAAWG,GAAE,KAAK,GAAI,gBAAK;AAAA,IAC5C,QAAQ,gBAAAH,KAAC,UAAK,eAAW,MAAC,cAAU,MAAC,WAAWG,GAAE,MAAM,GAAI,gBAAK;AAAA,KACpE;AAEF,MAAI,MAAM;AACR,UAAM,OAAO,UAAU;AACvB,WAAO,gBAAAH,KAAC,QAAK,MAAa,GAAG,QAAS,UAAS;AAAA,EACjD;AACA,SAAO,gBAAAA,KAAC,YAAO,MAAM,QAAQ,UAAW,GAAG,QAAS,UAAS;AAC/D;","names":["tv","Fragment","jsx","jsxs","tv","s"]}
@@ -175,11 +175,11 @@ declare const dateField: tailwind_variants.TVReturnType<{
175
175
  [key: string]: {
176
176
  [key: string]: tailwind_variants.ClassValue | {
177
177
  root?: tailwind_variants.ClassValue;
178
+ legend?: tailwind_variants.ClassValue;
178
179
  row?: tailwind_variants.ClassValue;
180
+ part?: tailwind_variants.ClassValue;
179
181
  hint?: tailwind_variants.ClassValue;
180
182
  error?: tailwind_variants.ClassValue;
181
- legend?: tailwind_variants.ClassValue;
182
- part?: tailwind_variants.ClassValue;
183
183
  input?: tailwind_variants.ClassValue;
184
184
  };
185
185
  };
@@ -187,11 +187,11 @@ declare const dateField: tailwind_variants.TVReturnType<{
187
187
  [x: string]: {
188
188
  [x: string]: tailwind_variants.ClassValue | {
189
189
  root?: tailwind_variants.ClassValue;
190
+ legend?: tailwind_variants.ClassValue;
190
191
  row?: tailwind_variants.ClassValue;
192
+ part?: tailwind_variants.ClassValue;
191
193
  hint?: tailwind_variants.ClassValue;
192
194
  error?: tailwind_variants.ClassValue;
193
- legend?: tailwind_variants.ClassValue;
194
- part?: tailwind_variants.ClassValue;
195
195
  input?: tailwind_variants.ClassValue;
196
196
  };
197
197
  };
@@ -207,11 +207,11 @@ declare const dateField: tailwind_variants.TVReturnType<{
207
207
  [key: string]: {
208
208
  [key: string]: tailwind_variants.ClassValue | {
209
209
  root?: tailwind_variants.ClassValue;
210
+ legend?: tailwind_variants.ClassValue;
210
211
  row?: tailwind_variants.ClassValue;
212
+ part?: tailwind_variants.ClassValue;
211
213
  hint?: tailwind_variants.ClassValue;
212
214
  error?: tailwind_variants.ClassValue;
213
- legend?: tailwind_variants.ClassValue;
214
- part?: tailwind_variants.ClassValue;
215
215
  input?: tailwind_variants.ClassValue;
216
216
  };
217
217
  };
@@ -294,15 +294,15 @@ declare const datePicker: tailwind_variants.TVReturnType<{
294
294
  [key: string]: {
295
295
  [key: string]: tailwind_variants.ClassValue | {
296
296
  root?: tailwind_variants.ClassValue;
297
- label?: tailwind_variants.ClassValue;
298
297
  row?: tailwind_variants.ClassValue;
298
+ hint?: tailwind_variants.ClassValue;
299
+ error?: tailwind_variants.ClassValue;
300
+ label?: tailwind_variants.ClassValue;
299
301
  icon?: tailwind_variants.ClassValue;
300
302
  content?: tailwind_variants.ClassValue;
301
303
  layout?: tailwind_variants.ClassValue;
302
304
  presets?: tailwind_variants.ClassValue;
303
305
  presetNode?: tailwind_variants.ClassValue;
304
- hint?: tailwind_variants.ClassValue;
305
- error?: tailwind_variants.ClassValue;
306
306
  trigger?: tailwind_variants.ClassValue;
307
307
  clear?: tailwind_variants.ClassValue;
308
308
  preset?: tailwind_variants.ClassValue;
@@ -312,15 +312,15 @@ declare const datePicker: tailwind_variants.TVReturnType<{
312
312
  [x: string]: {
313
313
  [x: string]: tailwind_variants.ClassValue | {
314
314
  root?: tailwind_variants.ClassValue;
315
- label?: tailwind_variants.ClassValue;
316
315
  row?: tailwind_variants.ClassValue;
316
+ hint?: tailwind_variants.ClassValue;
317
+ error?: tailwind_variants.ClassValue;
318
+ label?: tailwind_variants.ClassValue;
317
319
  icon?: tailwind_variants.ClassValue;
318
320
  content?: tailwind_variants.ClassValue;
319
321
  layout?: tailwind_variants.ClassValue;
320
322
  presets?: tailwind_variants.ClassValue;
321
323
  presetNode?: tailwind_variants.ClassValue;
322
- hint?: tailwind_variants.ClassValue;
323
- error?: tailwind_variants.ClassValue;
324
324
  trigger?: tailwind_variants.ClassValue;
325
325
  clear?: tailwind_variants.ClassValue;
326
326
  preset?: tailwind_variants.ClassValue;
@@ -344,15 +344,15 @@ declare const datePicker: tailwind_variants.TVReturnType<{
344
344
  [key: string]: {
345
345
  [key: string]: tailwind_variants.ClassValue | {
346
346
  root?: tailwind_variants.ClassValue;
347
- label?: tailwind_variants.ClassValue;
348
347
  row?: tailwind_variants.ClassValue;
348
+ hint?: tailwind_variants.ClassValue;
349
+ error?: tailwind_variants.ClassValue;
350
+ label?: tailwind_variants.ClassValue;
349
351
  icon?: tailwind_variants.ClassValue;
350
352
  content?: tailwind_variants.ClassValue;
351
353
  layout?: tailwind_variants.ClassValue;
352
354
  presets?: tailwind_variants.ClassValue;
353
355
  presetNode?: tailwind_variants.ClassValue;
354
- hint?: tailwind_variants.ClassValue;
355
- error?: tailwind_variants.ClassValue;
356
356
  trigger?: tailwind_variants.ClassValue;
357
357
  clear?: tailwind_variants.ClassValue;
358
358
  preset?: tailwind_variants.ClassValue;
@@ -83,11 +83,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
83
83
  [key: string]: {
84
84
  [key: string]: tailwind_variants.ClassValue | {
85
85
  root?: tailwind_variants.ClassValue;
86
+ count?: tailwind_variants.ClassValue;
86
87
  controls?: tailwind_variants.ClassValue;
87
88
  active?: tailwind_variants.ClassValue;
88
89
  clear?: tailwind_variants.ClassValue;
89
90
  results?: tailwind_variants.ClassValue;
90
- count?: tailwind_variants.ClassValue;
91
91
  optionCount?: tailwind_variants.ClassValue;
92
92
  trigger?: tailwind_variants.ClassValue;
93
93
  };
@@ -96,11 +96,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
96
96
  [x: string]: {
97
97
  [x: string]: tailwind_variants.ClassValue | {
98
98
  root?: tailwind_variants.ClassValue;
99
+ count?: tailwind_variants.ClassValue;
99
100
  controls?: tailwind_variants.ClassValue;
100
101
  active?: tailwind_variants.ClassValue;
101
102
  clear?: tailwind_variants.ClassValue;
102
103
  results?: tailwind_variants.ClassValue;
103
- count?: tailwind_variants.ClassValue;
104
104
  optionCount?: tailwind_variants.ClassValue;
105
105
  trigger?: tailwind_variants.ClassValue;
106
106
  };
@@ -118,11 +118,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
118
118
  [key: string]: {
119
119
  [key: string]: tailwind_variants.ClassValue | {
120
120
  root?: tailwind_variants.ClassValue;
121
+ count?: tailwind_variants.ClassValue;
121
122
  controls?: tailwind_variants.ClassValue;
122
123
  active?: tailwind_variants.ClassValue;
123
124
  clear?: tailwind_variants.ClassValue;
124
125
  results?: tailwind_variants.ClassValue;
125
- count?: tailwind_variants.ClassValue;
126
126
  optionCount?: tailwind_variants.ClassValue;
127
127
  trigger?: tailwind_variants.ClassValue;
128
128
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krizaka/ui",
3
- "version": "3.82.0",
3
+ "version": "3.83.0",
4
4
  "description": "The Krizaka front-end platform's components: the primitives (button, card, dialog, toast, menu, field, tabs, chip, switch, slider, command palette, theme, countdown…) on the semantic --kz-* tokens, the animated marks (Krizaka, Orazaka, Yomizaka, Akinaza) and the motion signature — web and /native.",
5
5
  "keywords": [
6
6
  "krizaka",
@@ -993,7 +993,7 @@
993
993
  ],
994
994
  "peerDependencies": {
995
995
  "@krizaka/query": ">=0.3.0",
996
- "@krizaka/tailwind": ">=3.82.0",
996
+ "@krizaka/tailwind": ">=3.83.0",
997
997
  "@maplibre/maplibre-react-native": ">=11",
998
998
  "@shopify/flash-list": ">=2",
999
999
  "expo-camera": ">=16",
@@ -3427,7 +3427,7 @@
3427
3427
  "zod": "^4.6.7",
3428
3428
  "@krizaka/intl": "^0.4.1",
3429
3429
  "@krizaka/pacer": "^0.2.0",
3430
- "@krizaka/tokens": "^3.82.0"
3430
+ "@krizaka/tokens": "^3.83.0"
3431
3431
  },
3432
3432
  "scripts": {
3433
3433
  "build": "node -e \"const fs=require('node:fs');fs.rmSync('dist',{recursive:true,force:true});for(const f of fs.readdirSync('registry/examples',{recursive:true}))if(/\\.(js|d\\.ts)$/.test(f))fs.rmSync('registry/examples/'+f)\" && tsup && node -e \"require('node:fs').copyFileSync('src/motion.css','dist/motion.css');require('node:fs').copyFileSync('src/blocks.css','dist/blocks.css');require('node:fs').copyFileSync('src/story.css','dist/story.css')\" && node scripts/build-registry.mjs",
@@ -189,7 +189,7 @@
189
189
  },
190
190
  {
191
191
  "path": "meta.ts",
192
- "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Orazaka Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the twelve domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
192
+ "content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"copy-button\"\n | \"money-input\"\n | \"price-catalogue-editor\"\n | \"promo-code-field\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"waveform\"\n | \"proposal\"\n | \"qr-code\"\n | \"identity-card\"\n | \"entity-header\"\n | \"collection-switcher\"\n | \"marketing-layout\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"shop-gallery\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"schema-form\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Orazaka Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `experimental`: created for a filed need (ADR-008 §4), it may change or go in any minor until its first consumer imports it; `adoption`\n * names that consumer's issue. `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"experimental\" | \"stable\" | \"beta\" | \"deprecated\";\n\n/**\n * What a component is for (ADR-008 §3): the thirteen domains the documentation, the size budgets and the guards are\n * organised by. The domain is metadata: the entries stay flat (`@krizaka/ui/<name>`). `cahier` is the sites' register\n * (ADR-004): a product never imports it.\n */\nexport type Domain =\n | \"foundations\"\n | \"forms\"\n | \"data-display\"\n | \"navigation-shell\"\n | \"feedback\"\n | \"maps\"\n | \"media\"\n | \"commerce\"\n | \"identity\"\n | \"abuse\"\n | \"conversation\"\n | \"page-blocks\"\n | \"cahier\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** What it is for: one of the twelve domains (ADR-008 §3). */\n readonly domain: Domain;\n /** The `<repo>#<n>` issue of its first consumer: required for, and only for, an `experimental` component. */\n readonly adoption?: string;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
193
193
  }
194
194
  ],
195
195
  "dependencies": [],