@krizaka/ui 4.0.0 → 4.2.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 (53) hide show
  1. package/dist/analysis-report.d.ts +44 -2
  2. package/dist/analysis-report.js +34 -13
  3. package/dist/analysis-report.js.map +1 -1
  4. package/dist/{chunk-54WTUZWE.js → chunk-6GTZVF77.js} +1 -1
  5. package/dist/chunk-6GTZVF77.js.map +1 -0
  6. package/dist/filter-bar.d.ts +3 -3
  7. package/dist/media-gallery.d.ts +3 -3
  8. package/dist/media-player.d.ts +3 -3
  9. package/dist/native.d.ts +8 -0
  10. package/dist/native.js +8 -0
  11. package/dist/native.js.map +1 -1
  12. package/dist/nav-bar.d.ts +1 -1
  13. package/dist/nav-bar.js +1 -1
  14. package/dist/{schema-DgjBz7-8.d.ts → schema-CL7t7xqb.d.ts} +1 -1
  15. package/dist/shop.d.ts +2 -2
  16. package/dist/site-cahier.d.ts +52 -39
  17. package/dist/site-cahier.js +18 -2
  18. package/dist/site-cahier.js.map +1 -1
  19. package/dist/site-footer.d.ts +10 -92
  20. package/dist/site-footer.js +19 -3
  21. package/dist/site-footer.js.map +1 -1
  22. package/dist/sites-iJkCPeiH.d.ts +170 -0
  23. package/dist/sites.d.ts +14 -0
  24. package/dist/sites.js.map +1 -1
  25. package/package.json +6 -5
  26. package/registry/account-settings.json +1 -1
  27. package/registry/analysis-report.json +51 -5
  28. package/registry/app-frame.json +1 -1
  29. package/registry/examples/account-settings/patterns.js +1 -1
  30. package/registry/examples/account-settings/patterns.tsx +1 -1
  31. package/registry/examples/analysis-report/authenticity.d.ts +4 -0
  32. package/registry/examples/analysis-report/authenticity.js +50 -0
  33. package/registry/examples/analysis-report/authenticity.tsx +33 -0
  34. package/registry/examples/analysis-report/lease-review.d.ts +4 -0
  35. package/registry/examples/analysis-report/lease-review.js +51 -0
  36. package/registry/examples/analysis-report/lease-review.tsx +33 -0
  37. package/registry/examples/markdown/wide-table.js +1 -1
  38. package/registry/examples/markdown/wide-table.tsx +1 -1
  39. package/registry/examples/site-footer/configured.js +2 -2
  40. package/registry/examples/site-footer/configured.tsx +2 -2
  41. package/registry/examples/site-footer/socials.d.ts +4 -0
  42. package/registry/examples/site-footer/socials.js +25 -0
  43. package/registry/examples/site-footer/socials.tsx +22 -0
  44. package/registry/index.json +13 -10
  45. package/registry/map.json +1 -1
  46. package/registry/markdown.json +1 -1
  47. package/registry/nav-bar.json +1 -1
  48. package/registry/rail-nav.json +1 -1
  49. package/registry/shop.json +1 -1
  50. package/registry/site-footer.json +15 -4
  51. package/registry/sites.json +4 -2
  52. package/dist/chunk-54WTUZWE.js.map +0 -1
  53. package/dist/sites-A5cNWG2Z.d.ts +0 -73
package/dist/sites.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sites/sites.ts","../src/sites/family-groups.ts"],"sourcesContent":["// Server-safe: plain data. The Krizaka family — every site Krizaka runs, once. The family switcher of the bar\n// (`NavBar.Family`) and the common footer (`SiteFooter`) both read it, so adding a site is one release of this package:\n// every bar and every footer of the family follow.\n//\n// The words of the family (a site's one line, the groups, the statuses, the footer's signature) are brand data, written\n// here in English and French (`familyLabels`) — a site passes the set of its locale, or its own translation.\n\n/** A site of the family. */\nexport type SiteId = \"krizaka\" | \"sovkora\" | \"verikora\" | \"folioviv\" | \"ui\" | \"java\" | \"ts\" | \"motion\" | \"github\";\n\n/** What a site is: the company, a product, or an open-source project. It chooses the footer's signature line. */\nexport type SiteKind = \"company\" | \"product\" | \"open-source\";\n\n/**\n * `released`: open to visit. `upcoming`: announced, not released yet (said \"Coming soon\"). `construction`: under\n * construction — nothing offered (a QA-only app may run; the public page says so). `development`: being built in the\n * open, with a dev site (said \"In development\"). A site with none yet would use its repository as its address.\n */\nexport type SiteStatus = \"released\" | \"upcoming\" | \"construction\" | \"development\";\n\n/** The groups of the family, in reading order: Krizaka · Products · Open source · GitHub. */\nexport type SiteGroup = \"krizaka\" | \"products\" | \"open-source\" | \"github\";\n\n/** The mark a site wears: a brand of `ProductLogo` (Krizaka UI and Krizaka Java wear Krizaka's), or GitHub's. */\nexport type SiteMark = \"krizaka\" | \"sovkora\" | \"verikora\" | \"folioviv\" | \"github\";\n\nexport interface Site {\n readonly id: SiteId;\n /** The name, never translated. */\n readonly name: string;\n /** The address of the site (its home). */\n readonly url: string;\n /** The address without the scheme, as people say it (`ui.krizaka.com`). */\n readonly host: string;\n readonly kind: SiteKind;\n readonly group: SiteGroup;\n readonly status: SiteStatus;\n readonly mark: SiteMark;\n /** The repository the site is built from. */\n readonly repo: string;\n}\n\n/** The address as a person reads it: the host, and the path when there is one (`github.com/krizaka`). */\nconst hostOf = (url: string): string => {\n const { host, pathname } = new URL(url);\n return pathname === \"/\" ? host : host + pathname;\n};\nconst site = (s: Omit<Site, \"host\">): Site => ({ ...s, host: hostOf(s.url) });\n\n/** Every site of the family, in reading order (the group order, then the order inside each group). */\nexport const sites: readonly Site[] = [\n site({ id: \"krizaka\", name: \"Krizaka\", url: \"https://www.krizaka.com\", kind: \"company\", group: \"krizaka\", status: \"released\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-com\" }),\n site({ id: \"sovkora\", name: \"Sovkora\", url: \"https://www.sovkora.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"sovkora\", repo: \"https://github.com/krizaka/sovkora\" }),\n site({ id: \"verikora\", name: \"Verikora\", url: \"https://www.verikora.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"verikora\", repo: \"https://github.com/krizaka/verikora\" }),\n site({ id: \"folioviv\", name: \"Folioviv\", url: \"https://www.folioviv.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"folioviv\", repo: \"https://github.com/krizaka/folioviv\" }),\n site({ id: \"ui\", name: \"Krizaka UI\", url: \"https://ui.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-ui\" }),\n site({ id: \"java\", name: \"Krizaka Java\", url: \"https://java.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-java\" }),\n site({ id: \"ts\", name: \"Krizaka TypeScript\", url: \"https://ts.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-ts\" }),\n // The family lab: built in the open, served at lab.krizaka.com; what proves itself there moves into Krizaka UI.\n site({ id: \"motion\", name: \"Krizaka Lab\", url: \"https://lab.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-lab\" }),\n site({ id: \"github\", name: \"GitHub\", url: \"https://github.com/krizaka\", kind: \"open-source\", group: \"github\", status: \"released\", mark: \"github\", repo: \"https://github.com/krizaka\" }),\n];\n\n/** The groups, in reading order. */\nexport const siteGroups: readonly SiteGroup[] = [\"krizaka\", \"products\", \"open-source\", \"github\"];\n\n/** A site by id. */\nexport function siteById(id: SiteId): Site {\n const found = sites.find((s) => s.id === id);\n if (!found) throw new Error(`Unknown Krizaka site \"${id}\".`);\n return found;\n}\n\n/** The family grouped, in reading order: `[{ group, sites }]`, empty groups left out. */\nexport function sitesByGroup(): { group: SiteGroup; sites: Site[] }[] {\n return siteGroups.map((group) => ({ group, sites: sites.filter((s) => s.group === group) })).filter((g) => g.sites.length > 0);\n}\n\n/** The languages the family's words are written in. */\nexport type SiteLocale = \"en\" | \"fr\";\n\n/** The company's own pages, the footer's « Krizaka » column (the brand's home is the signature line's link). */\nexport type CompanyLinkId = \"story\" | \"blog\" | \"contact\";\nexport const companyLinks: readonly { id: CompanyLinkId; url: Record<SiteLocale, string> }[] = [\n { id: \"story\", url: { en: \"https://www.krizaka.com/story\", fr: \"https://www.krizaka.com/fr/story\" } },\n { id: \"blog\", url: { en: \"https://blog.krizaka.com\", fr: \"https://blog.krizaka.com\" } },\n { id: \"contact\", url: { en: \"https://www.krizaka.com/contact\", fr: \"https://www.krizaka.com/fr/contact\" } },\n];\n\n/** The words of the family: the switcher, the footer, each site's one line. */\nexport interface FamilyLabels {\n /** The family's name: the switcher's navigation and its button, the footer's navigation (“Krizaka family”). */\n family: string;\n /** The heading of each group. */\n groups: Record<SiteGroup, string>;\n /** The badge of a site that is not released. */\n status: Record<Exclude<SiteStatus, \"released\">, string>;\n /** Says which site is the current one (“You are here”). */\n current: string;\n /** One line per site: what it is. */\n descriptions: Record<SiteId, string>;\n /** The footer's signature, by the kind of the current site (“A Krizaka product”). */\n signature: Record<SiteKind, string>;\n /** The footer's place line (“Made in Montréal”). */\n place: string;\n /** The accessible name of the version (“Version”). */\n version: string;\n /** The language of these words: the company links open in it. @default \"en\" */\n lang?: SiteLocale;\n /** The company's pages in the footer's « Krizaka » column. @default the English words */\n company?: Record<CompanyLinkId, string>;\n}\n\n/** The family's words in English and French. Pass `familyLabels[locale]`, or your own translation of the same shape. */\nexport const familyLabels: Record<SiteLocale, FamilyLabels> = {\n en: {\n family: \"Krizaka family\",\n groups: { krizaka: \"Krizaka\", products: \"Products\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Coming soon\", construction: \"Under construction\", development: \"In development\" },\n current: \"You are here\",\n descriptions: {\n krizaka: \"The company: our products, our open source, our story.\",\n sovkora: \"Sovereign AI on your own servers: chat, documents, images and video — and the engine under the other products.\",\n verikora: \"Verikora reads your leases, contracts and invoices.\",\n folioviv: \"Running a shop in Québec, for less — Loi 25 by design.\",\n ui: \"Components, tokens, icons and charts — web and React Native.\",\n java: \"Spring Boot building blocks on Maven Central.\",\n ts: \"TypeScript backend building blocks on npm.\",\n motion: \"The family lab: the kit's motion, played live with its knobs.\",\n github: \"Every repository, in the open.\",\n },\n signature: { company: \"A Krizaka company\", product: \"A Krizaka product\", \"open-source\": \"A Krizaka open-source project\" },\n place: \"Made in Montréal\",\n version: \"Version\",\n lang: \"en\",\n company: { story: \"Our story\", blog: \"Blog\", contact: \"Contact us\" },\n },\n fr: {\n family: \"Famille Krizaka\",\n groups: { krizaka: \"Krizaka\", products: \"Produits\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Bientôt\", construction: \"En construction\", development: \"En développement\" },\n current: \"Vous êtes ici\",\n descriptions: {\n krizaka: \"La compagnie : nos produits, notre open source, notre histoire.\",\n sovkora: \"L’IA souveraine sur vos propres serveurs : conversation, documents, images et vidéo — et le moteur des autres produits.\",\n verikora: \"Verikora lit vos baux, contrats et factures.\",\n folioviv: \"Tenir une boutique au Québec, pour moins cher — Loi 25 dès la conception.\",\n ui: \"Composants, jetons, icônes et graphiques — web et React Native.\",\n java: \"Des briques Spring Boot sur Maven Central.\",\n ts: \"Des briques backend TypeScript sur npm.\",\n motion: \"Le labo du mouvement : le mouvement du kit, joué en direct, avec ses réglages.\",\n github: \"Tous les dépôts, au grand jour.\",\n },\n signature: { company: \"Une compagnie Krizaka\", product: \"Un produit Krizaka\", \"open-source\": \"Un projet open source de Krizaka\" },\n place: \"Fait à Montréal\",\n version: \"Version\",\n lang: \"fr\",\n company: { story: \"Notre histoire\", blog: \"Blogue\", contact: \"Nous écrire\" },\n },\n};\n\n/**\n * What the footer and the bar read from `@krizaka/org` (the organisation's public facts, one validated JSON): the brand's\n * name, the footer line and the legal links, each in both languages. Structural: the whole `Org` of `@krizaka/org` fits.\n */\nexport interface OrgFacts {\n brand: { name: string };\n /**\n * Every name of the family (`org.family` of `@krizaka/org`, krizaka/krizaka-internal#754): when given, the footer reads\n * the names and addresses here, never from this package's registry — the company « Krizaka », products by their own\n * name, libraries « Krizaka <X> ».\n */\n family?: readonly OrgFamilyEntry[];\n footer: {\n /** « Une entreprise de Technologies Krizaka · Fait à Montréal ». */\n line: Record<SiteLocale, string>;\n legal: readonly { id: string; label: Record<SiteLocale, string>; url: Record<SiteLocale, string> }[];\n };\n}\n\n/** One entry of `org.family` (`@krizaka/org`), the part the footer reads. */\nexport interface OrgFamilyEntry {\n id: string;\n name: string;\n group: SiteGroup;\n status: SiteStatus;\n url: string;\n}\n\n/** The family's words with the organisation's facts in them: the place line is the org's, not a copy. */\nexport function orgFamilyLabels(org: OrgFacts, locale: SiteLocale): FamilyLabels {\n return { ...familyLabels[locale], place: org.footer.line[locale] };\n}\n","import { type OrgFacts, type SiteGroup, siteGroups, type SiteId, sites,type SiteStatus } from \"./sites\";\n\n/** The registry's id of Krizaka Lab was `motion`; `@krizaka/org` says `lab`. */\nconst ORG_ID: Partial<Record<SiteId, string>> = { motion: \"lab\" };\n\n/** The family to show, grouped in reading order: `org.family` when the host passes it, this package's registry otherwise. */\nexport function familyGroups(org?: Pick<OrgFacts, \"family\">): { group: SiteGroup; entries: FamilyItem[] }[] {\n const entries = org?.family\n ? org.family.map((e) => ({ id: e.id, name: e.name, url: e.url, group: e.group, status: e.status }))\n : sites.map((s) => ({ id: ORG_ID[s.id] ?? s.id, name: s.name, url: s.url, group: s.group, status: s.status }));\n return siteGroups.map((group) => ({ group, entries: entries.filter((e) => e.group === group) })).filter((g) => g.entries.length > 0);\n}\n\n/** The id `@krizaka/org` gives a site of this registry. */\nexport const orgIdOf = (id: SiteId): string => ORG_ID[id] ?? id;\n\ntype Pending = Exclude<SiteStatus, \"released\">;\ntype FamilyItem = { id: string; name: string; url: string; status: SiteStatus };\n\n/**\n * What a column says about its status, from data: when every entry shares one status other than `released`, it is said once\n * for the column (`shared`); when they differ, the most common one is the column's and only the exceptions wear a badge.\n */\nexport function columnStatus(entries: readonly { id: string; status: SiteStatus }[]): { shared: Pending | null; exceptions: Map<string, Pending> } {\n const counts = new Map<SiteStatus, number>();\n for (const e of entries) counts.set(e.status, (counts.get(e.status) ?? 0) + 1);\n const common = [...counts.entries()].sort((a, b) => b[1] - a[1])[0]?.[0] ?? null;\n const exceptions = new Map<string, Pending>();\n for (const e of entries) if (e.status !== common && e.status !== \"released\") exceptions.set(e.id, e.status);\n return { shared: common === null || common === \"released\" ? null : common, exceptions };\n}\n"],"mappings":";AA2CA,IAAM,SAAS,CAAC,QAAwB;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,EAAE,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,OAAO,EAAE;AAC/G,SAAO,WAAW,IAAI,CAAC,WAAW,EAAE,OAAO,SAAS,QAAQ,OAAO,CAAC,MAAM,EAAE,UAAU,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,SAAS,CAAC;AACrI;AAGO,IAAM,UAAU,CAAC,OAAuB,OAAO,EAAE,KAAK;","names":[]}
1
+ {"version":3,"sources":["../src/sites/sites.ts","../src/sites/family-groups.ts"],"sourcesContent":["// Server-safe: plain data. The Krizaka family — every site Krizaka runs, once. The family switcher of the bar\n// (`NavBar.Family`) and the common footer (`SiteFooter`) both read it, so adding a site is one release of this package:\n// every bar and every footer of the family follow.\n//\n// The words of the family (a site's one line, the groups, the statuses, the footer's signature) are brand data, written\n// here in English and French (`familyLabels`) — a site passes the set of its locale, or its own translation.\n\nimport type { OrgSocialLink } from \"../site-footer/footer-config\";\n\n/** A site of the family. */\nexport type SiteId = \"krizaka\" | \"sovkora\" | \"verikora\" | \"folioviv\" | \"ui\" | \"java\" | \"ts\" | \"motion\" | \"github\";\n\n/** What a site is: the company, a product, or an open-source project. It chooses the footer's signature line. */\nexport type SiteKind = \"company\" | \"product\" | \"open-source\";\n\n/**\n * `released`: open to visit. `upcoming`: announced, not released yet (said \"Coming soon\"). `construction`: under\n * construction — nothing offered (a QA-only app may run; the public page says so). `development`: being built in the\n * open, with a dev site (said \"In development\"). A site with none yet would use its repository as its address.\n */\nexport type SiteStatus = \"released\" | \"upcoming\" | \"construction\" | \"development\";\n\n/** The groups of the family, in reading order: Krizaka · Products · Open source · GitHub. */\nexport type SiteGroup = \"krizaka\" | \"products\" | \"open-source\" | \"github\";\n\n/** The mark a site wears: a brand of `ProductLogo` (Krizaka UI and Krizaka Java wear Krizaka's), or GitHub's. */\nexport type SiteMark = \"krizaka\" | \"sovkora\" | \"verikora\" | \"folioviv\" | \"github\";\n\nexport interface Site {\n readonly id: SiteId;\n /** The name, never translated. */\n readonly name: string;\n /** The address of the site (its home). */\n readonly url: string;\n /** The address without the scheme, as people say it (`ui.krizaka.com`). */\n readonly host: string;\n readonly kind: SiteKind;\n readonly group: SiteGroup;\n readonly status: SiteStatus;\n readonly mark: SiteMark;\n /** The repository the site is built from. */\n readonly repo: string;\n}\n\n/** The address as a person reads it: the host, and the path when there is one (`github.com/krizaka`). */\nconst hostOf = (url: string): string => {\n const { host, pathname } = new URL(url);\n return pathname === \"/\" ? host : host + pathname;\n};\nconst site = (s: Omit<Site, \"host\">): Site => ({ ...s, host: hostOf(s.url) });\n\n/** Every site of the family, in reading order (the group order, then the order inside each group). */\nexport const sites: readonly Site[] = [\n site({ id: \"krizaka\", name: \"Krizaka\", url: \"https://www.krizaka.com\", kind: \"company\", group: \"krizaka\", status: \"released\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-com\" }),\n site({ id: \"sovkora\", name: \"Sovkora\", url: \"https://www.sovkora.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"sovkora\", repo: \"https://github.com/krizaka/sovkora\" }),\n site({ id: \"verikora\", name: \"Verikora\", url: \"https://www.verikora.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"verikora\", repo: \"https://github.com/krizaka/verikora\" }),\n site({ id: \"folioviv\", name: \"Folioviv\", url: \"https://www.folioviv.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"folioviv\", repo: \"https://github.com/krizaka/folioviv\" }),\n site({ id: \"ui\", name: \"Krizaka UI\", url: \"https://ui.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-ui\" }),\n site({ id: \"java\", name: \"Krizaka Java\", url: \"https://java.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-java\" }),\n site({ id: \"ts\", name: \"Krizaka TypeScript\", url: \"https://ts.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-ts\" }),\n // The family lab: built in the open, served at lab.krizaka.com; what proves itself there moves into Krizaka UI.\n site({ id: \"motion\", name: \"Krizaka Lab\", url: \"https://lab.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"development\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-lab\" }),\n site({ id: \"github\", name: \"GitHub\", url: \"https://github.com/krizaka\", kind: \"open-source\", group: \"github\", status: \"released\", mark: \"github\", repo: \"https://github.com/krizaka\" }),\n];\n\n/** The groups, in reading order. */\nexport const siteGroups: readonly SiteGroup[] = [\"krizaka\", \"products\", \"open-source\", \"github\"];\n\n/** A site by id. */\nexport function siteById(id: SiteId): Site {\n const found = sites.find((s) => s.id === id);\n if (!found) throw new Error(`Unknown Krizaka site \"${id}\".`);\n return found;\n}\n\n/** The family grouped, in reading order: `[{ group, sites }]`, empty groups left out. */\nexport function sitesByGroup(): { group: SiteGroup; sites: Site[] }[] {\n return siteGroups.map((group) => ({ group, sites: sites.filter((s) => s.group === group) })).filter((g) => g.sites.length > 0);\n}\n\n/** The languages the family's words are written in. */\nexport type SiteLocale = \"en\" | \"fr\";\n\n/** The company's own pages, the footer's « Krizaka » column (the brand's home is the signature line's link). */\nexport type CompanyLinkId = \"story\" | \"blog\" | \"contact\";\nexport const companyLinks: readonly { id: CompanyLinkId; url: Record<SiteLocale, string> }[] = [\n { id: \"story\", url: { en: \"https://www.krizaka.com/story\", fr: \"https://www.krizaka.com/fr/story\" } },\n { id: \"blog\", url: { en: \"https://blog.krizaka.com\", fr: \"https://blog.krizaka.com\" } },\n { id: \"contact\", url: { en: \"https://www.krizaka.com/contact\", fr: \"https://www.krizaka.com/fr/contact\" } },\n];\n\n/** The words of the family: the switcher, the footer, each site's one line. */\nexport interface FamilyLabels {\n /** The family's name: the switcher's navigation and its button, the footer's navigation (“Krizaka family”). */\n family: string;\n /** The heading of each group. */\n groups: Record<SiteGroup, string>;\n /** The badge of a site that is not released. */\n status: Record<Exclude<SiteStatus, \"released\">, string>;\n /** Says which site is the current one (“You are here”). */\n current: string;\n /** One line per site: what it is. */\n descriptions: Record<SiteId, string>;\n /** The footer's signature, by the kind of the current site (“A Krizaka product”). */\n signature: Record<SiteKind, string>;\n /** The footer's place line (“Made in Montréal”). */\n place: string;\n /** The accessible name of the version (“Version”). */\n version: string;\n /** The language of these words: the company links open in it. @default \"en\" */\n lang?: SiteLocale;\n /** The company's pages in the footer's « Krizaka » column. @default the English words */\n company?: Record<CompanyLinkId, string>;\n}\n\n/** The family's words in English and French. Pass `familyLabels[locale]`, or your own translation of the same shape. */\nexport const familyLabels: Record<SiteLocale, FamilyLabels> = {\n en: {\n family: \"Krizaka family\",\n groups: { krizaka: \"Krizaka\", products: \"Products\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Coming soon\", construction: \"Under construction\", development: \"In development\" },\n current: \"You are here\",\n descriptions: {\n krizaka: \"The company: our products, our open source, our story.\",\n sovkora: \"Sovereign AI on your own servers: chat, documents, images and video — and the engine under the other products.\",\n verikora: \"Verikora reads your leases, contracts and invoices.\",\n folioviv: \"Running a shop in Québec, for less — Loi 25 by design.\",\n ui: \"Components, tokens, icons and charts — web and React Native.\",\n java: \"Spring Boot building blocks on Maven Central.\",\n ts: \"TypeScript backend building blocks on npm.\",\n motion: \"The family lab: the kit's motion, played live with its knobs.\",\n github: \"Every repository, in the open.\",\n },\n signature: { company: \"A Krizaka company\", product: \"A Krizaka product\", \"open-source\": \"A Krizaka open-source project\" },\n place: \"Made in Montréal\",\n version: \"Version\",\n lang: \"en\",\n company: { story: \"Our story\", blog: \"Blog\", contact: \"Contact us\" },\n },\n fr: {\n family: \"Famille Krizaka\",\n groups: { krizaka: \"Krizaka\", products: \"Produits\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Bientôt\", construction: \"En construction\", development: \"En développement\" },\n current: \"Vous êtes ici\",\n descriptions: {\n krizaka: \"La compagnie : nos produits, notre open source, notre histoire.\",\n sovkora: \"L’IA souveraine sur vos propres serveurs : conversation, documents, images et vidéo — et le moteur des autres produits.\",\n verikora: \"Verikora lit vos baux, contrats et factures.\",\n folioviv: \"Tenir une boutique au Québec, pour moins cher — Loi 25 dès la conception.\",\n ui: \"Composants, jetons, icônes et graphiques — web et React Native.\",\n java: \"Des briques Spring Boot sur Maven Central.\",\n ts: \"Des briques backend TypeScript sur npm.\",\n motion: \"Le labo du mouvement : le mouvement du kit, joué en direct, avec ses réglages.\",\n github: \"Tous les dépôts, au grand jour.\",\n },\n signature: { company: \"Une compagnie Krizaka\", product: \"Un produit Krizaka\", \"open-source\": \"Un projet open source de Krizaka\" },\n place: \"Fait à Montréal\",\n version: \"Version\",\n lang: \"fr\",\n company: { story: \"Notre histoire\", blog: \"Blogue\", contact: \"Nous écrire\" },\n },\n};\n\n/**\n * What the footer and the bar read from `@krizaka/org` (the organisation's public facts, one validated JSON): the brand's\n * name, the footer line and the legal links, each in both languages. Structural: the whole `Org` of `@krizaka/org` fits.\n */\nexport interface OrgFacts {\n brand: { name: string };\n /**\n * The company's own accounts elsewhere (`org.links.social` of `@krizaka/org` ≥ 1.1.0): the footer draws each one as its\n * icon, linked to the address given here — never typed in a site. Optional so an older `org` still fits.\n */\n links?: { social: readonly OrgSocialLink[] };\n /**\n * Every name of the family (`org.family` of `@krizaka/org`, krizaka/krizaka-internal#754): when given, the footer reads\n * the names and addresses here, never from this package's registry — the company « Krizaka », products by their own\n * name, libraries « Krizaka <X> ».\n */\n family?: readonly OrgFamilyEntry[];\n footer: {\n /** « Une entreprise de Technologies Krizaka · Fait à Montréal ». */\n line: Record<SiteLocale, string>;\n legal: readonly { id: string; label: Record<SiteLocale, string>; url: Record<SiteLocale, string> }[];\n };\n}\n\n/** One entry of `org.family` (`@krizaka/org`), the part the footer reads. */\nexport interface OrgFamilyEntry {\n id: string;\n name: string;\n group: SiteGroup;\n status: SiteStatus;\n url: string;\n}\n\n/** The family's words with the organisation's facts in them: the place line is the org's, not a copy. */\nexport function orgFamilyLabels(org: OrgFacts, locale: SiteLocale): FamilyLabels {\n return { ...familyLabels[locale], place: org.footer.line[locale] };\n}\n","import { type OrgFacts, type SiteGroup, siteGroups, type SiteId, sites,type SiteStatus } from \"./sites\";\n\n/** The registry's id of Krizaka Lab was `motion`; `@krizaka/org` says `lab`. */\nconst ORG_ID: Partial<Record<SiteId, string>> = { motion: \"lab\" };\n\n/** The family to show, grouped in reading order: `org.family` when the host passes it, this package's registry otherwise. */\nexport function familyGroups(org?: Pick<OrgFacts, \"family\">): { group: SiteGroup; entries: FamilyItem[] }[] {\n const entries = org?.family\n ? org.family.map((e) => ({ id: e.id, name: e.name, url: e.url, group: e.group, status: e.status }))\n : sites.map((s) => ({ id: ORG_ID[s.id] ?? s.id, name: s.name, url: s.url, group: s.group, status: s.status }));\n return siteGroups.map((group) => ({ group, entries: entries.filter((e) => e.group === group) })).filter((g) => g.entries.length > 0);\n}\n\n/** The id `@krizaka/org` gives a site of this registry. */\nexport const orgIdOf = (id: SiteId): string => ORG_ID[id] ?? id;\n\ntype Pending = Exclude<SiteStatus, \"released\">;\ntype FamilyItem = { id: string; name: string; url: string; status: SiteStatus };\n\n/**\n * What a column says about its status, from data: when every entry shares one status other than `released`, it is said once\n * for the column (`shared`); when they differ, the most common one is the column's and only the exceptions wear a badge.\n */\nexport function columnStatus(entries: readonly { id: string; status: SiteStatus }[]): { shared: Pending | null; exceptions: Map<string, Pending> } {\n const counts = new Map<SiteStatus, number>();\n for (const e of entries) counts.set(e.status, (counts.get(e.status) ?? 0) + 1);\n const common = [...counts.entries()].sort((a, b) => b[1] - a[1])[0]?.[0] ?? null;\n const exceptions = new Map<string, Pending>();\n for (const e of entries) if (e.status !== common && e.status !== \"released\") exceptions.set(e.id, e.status);\n return { shared: common === null || common === \"released\" ? null : common, exceptions };\n}\n"],"mappings":";AA6CA,IAAM,SAAS,CAAC,QAAwB;AACtC,QAAM,EAAE,MAAM,SAAS,IAAI,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,EAAE,OAAO,EAAE;AAC/G,SAAO,WAAW,IAAI,CAAC,WAAW,EAAE,OAAO,SAAS,QAAQ,OAAO,CAAC,MAAM,EAAE,UAAU,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,SAAS,CAAC;AACrI;AAGO,IAAM,UAAU,CAAC,OAAuB,OAAO,EAAE,KAAK;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krizaka/ui",
3
- "version": "4.0.0",
3
+ "version": "4.2.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, Sovkora, Verikora, Folioviv) and the motion signature — web and /native.",
5
5
  "keywords": [
6
6
  "krizaka",
@@ -1012,7 +1012,7 @@
1012
1012
  ],
1013
1013
  "peerDependencies": {
1014
1014
  "@krizaka/query": ">=0.3.0",
1015
- "@krizaka/tailwind": ">=4.0.0",
1015
+ "@krizaka/tailwind": ">=4.2.0",
1016
1016
  "@maplibre/maplibre-react-native": ">=11",
1017
1017
  "@shopify/flash-list": ">=2",
1018
1018
  "expo-camera": ">=16",
@@ -1032,7 +1032,7 @@
1032
1032
  "@babel/core": "^7.29.7",
1033
1033
  "@jest/globals": "30.5.2",
1034
1034
  "@krizaka/config": "^0.9.1",
1035
- "@krizaka/org": "^1.0.0",
1035
+ "@krizaka/org": "^1.1.0",
1036
1036
  "@maplibre/maplibre-react-native": "11.5.0",
1037
1037
  "@react-native/babel-preset": "0.86.3",
1038
1038
  "@react-native/jest-preset": "0.86.3",
@@ -3480,9 +3480,10 @@
3480
3480
  "sonner": "^2.0.8",
3481
3481
  "tailwind-variants": "^3.3.1",
3482
3482
  "zod": "^4.6.7",
3483
- "@krizaka/pacer": "^0.2.0",
3483
+ "@krizaka/icons": "^0.10.0",
3484
3484
  "@krizaka/intl": "^0.4.1",
3485
- "@krizaka/tokens": "^4.0.0"
3485
+ "@krizaka/tokens": "^4.2.0",
3486
+ "@krizaka/pacer": "^0.2.0"
3486
3487
  },
3487
3488
  "scripts": {
3488
3489
  "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",
@@ -554,7 +554,7 @@
554
554
  "description": "Security, subscription, storage and my data as flat sections of rows.",
555
555
  "path": "examples/account-settings/patterns.tsx",
556
556
  "module": "@krizaka/ui/registry/examples/account-settings/patterns",
557
- "code": "import { Button } from \"@krizaka/ui/button\";\nimport { ConfirmButton } from \"@krizaka/ui/confirm-button\";\nimport { Meter } from \"@krizaka/ui/meter\";\nimport { SettingsRow, SettingsSection } from \"@krizaka/ui/settings-layout\";\n\n// The four other sections of an account page, each a flat SettingsSection of rows: security, subscription (the billing\n// portal is one link), storage (a Meter), « my data » (export, and a delete that asks twice).\nexport default function AccountSectionPatterns() {\n return (\n <div className=\"flex w-full max-w-2xl flex-col gap-10\">\n <SettingsSection variant=\"flat\" title=\"Sécurité\" description=\"Comment vous vous connectez.\">\n <SettingsRow label=\"Courriel\" description=\"Un lien de confirmation est envoyé à la nouvelle adresse.\">\n eric@example.com <Button variant=\"secondary\" size=\"sm\">Changer</Button>\n </SettingsRow>\n <SettingsRow label=\"Mot de passe\" description=\"Modifié il y a 3 mois.\">\n <Button variant=\"secondary\" size=\"sm\">Changer</Button>\n </SettingsRow>\n </SettingsSection>\n <SettingsSection variant=\"flat\" title=\"Abonnement\" description=\"Votre forfait et vos factures.\">\n <SettingsRow label=\"Forfait Solo\" description=\"Renouvelé le 1er novembre.\">\n <Button variant=\"secondary\" size=\"sm\" asChild><a href=\"https://billing.example.com/portal\">Ouvrir le portail de facturation</a></Button>\n </SettingsRow>\n </SettingsSection>\n <SettingsSection variant=\"flat\" title=\"Stockage\" description=\"L'espace utilisé par vos documents.\">\n <SettingsRow label=\"Documents\">\n <Meter className=\"w-56\" label=\"Stockage\" value={18} max={50} valueText=\"18 Go sur 50 Go\" showLabel />\n </SettingsRow>\n </SettingsSection>\n <SettingsSection variant=\"flat\" title=\"Mes données\" description=\"Ce que vous pouvez emporter ou effacer.\">\n <SettingsRow label=\"Exporter\" description=\"Une archive de tout ce que vous avez téléversé.\">\n <Button variant=\"secondary\" size=\"sm\">Demander l'export</Button>\n </SettingsRow>\n <SettingsRow label=\"Supprimer mon compte\" description=\"Vos documents et votre compte disparaissent, sans retour.\">\n <ConfirmButton variant=\"danger\" size=\"sm\" confirmLabel=\"Supprimer pour de bon ?\" onConfirm={() => {}}>Supprimer</ConfirmButton>\n </SettingsRow>\n </SettingsSection>\n </div>\n );\n}\n"
557
+ "code": "import { Button } from \"@krizaka/ui/button\";\nimport { ConfirmButton } from \"@krizaka/ui/confirm-button\";\nimport { Meter } from \"@krizaka/ui/meter\";\nimport { SettingsRow, SettingsSection } from \"@krizaka/ui/settings-layout\";\n\n// The four other sections of an account page, each a flat SettingsSection of rows: security, subscription (the billing\n// portal is one link), storage (a Meter), « my data » (export, and a delete that asks twice).\nexport default function AccountSectionPatterns() {\n return (\n <div className=\"flex w-full max-w-2xl flex-col gap-10\">\n <SettingsSection variant=\"flat\" title=\"Sécurité\" description=\"Comment vous vous connectez.\">\n <SettingsRow label=\"Courriel\" description=\"Un lien de confirmation est envoyé à la nouvelle adresse.\">\n eric@example.com <Button variant=\"secondary\" size=\"sm\">Changer</Button>\n </SettingsRow>\n <SettingsRow label=\"Mot de passe\" description=\"Modifié il y a 3 mois.\">\n <Button variant=\"secondary\" size=\"sm\">Changer</Button>\n </SettingsRow>\n </SettingsSection>\n <SettingsSection variant=\"flat\" title=\"Abonnement\" description=\"Votre forfait et vos factures.\">\n <SettingsRow label=\"Forfait Solo\" description=\"Renouvelé le 1er novembre.\">\n <Button variant=\"secondary\" size=\"sm\" asChild><a href=\"https://example.com\">Ouvrir le portail de facturation</a></Button>\n </SettingsRow>\n </SettingsSection>\n <SettingsSection variant=\"flat\" title=\"Stockage\" description=\"L'espace utilisé par vos documents.\">\n <SettingsRow label=\"Documents\">\n <Meter className=\"w-56\" label=\"Stockage\" value={18} max={50} valueText=\"18 Go sur 50 Go\" showLabel />\n </SettingsRow>\n </SettingsSection>\n <SettingsSection variant=\"flat\" title=\"Mes données\" description=\"Ce que vous pouvez emporter ou effacer.\">\n <SettingsRow label=\"Exporter\" description=\"Une archive de tout ce que vous avez téléversé.\">\n <Button variant=\"secondary\" size=\"sm\">Demander l'export</Button>\n </SettingsRow>\n <SettingsRow label=\"Supprimer mon compte\" description=\"Vos documents et votre compte disparaissent, sans retour.\">\n <ConfirmButton variant=\"danger\" size=\"sm\" confirmLabel=\"Supprimer pour de bon ?\" onConfirm={() => {}}>Supprimer</ConfirmButton>\n </SettingsRow>\n </SettingsSection>\n </div>\n );\n}\n"
558
558
  }
559
559
  ]
560
560
  },
@@ -46,13 +46,15 @@
46
46
  "Pass every word through `labels` from your messages (`@krizaka/i18n`); the package ships none.",
47
47
  "While the run is open, set `streaming`: findings are announced politely as they arrive.",
48
48
  "Give `onLocate` to scroll a document viewer to a finding's place; without it the location is plain text.",
49
+ "Quote the passage the finding rests on (`quote`) and cite the rule (`reference`, with an `href` when it is public): the reader checks the source without opening the document.",
50
+ "Fold the calm groups (`folded`) and the provenance (`provenanceFolded`): the serious findings stay in view, the rest is one tap away.",
49
51
  "Examples and tests use demo data only."
50
52
  ],
51
53
  "accessibility": {
52
54
  "keyboard": [
53
55
  {
54
56
  "keys": "Tab / Enter",
55
- "action": "Reaches the copy buttons, the locations and the folded evidence."
57
+ "action": "Reaches the copy buttons, the locations, the references and the folds; Enter or Space opens a fold."
56
58
  }
57
59
  ],
58
60
  "notes": [
@@ -111,6 +113,13 @@
111
113
  "description": "The studio's name (« Document validation »).",
112
114
  "required": true
113
115
  },
116
+ {
117
+ "name": "folded",
118
+ "type": "readonly (\"inconsistent\" | \"attention\" | \"unverified\" | \"consistent\")[]",
119
+ "default": null,
120
+ "description": "Status groups closed by default (a native `details`, the count in its summary): « respected », « not applicable ».",
121
+ "required": false
122
+ },
114
123
  {
115
124
  "name": "hideActions",
116
125
  "type": "boolean",
@@ -153,6 +162,13 @@
153
162
  "description": "Where the result comes from: model, run id, duration, version.",
154
163
  "required": false
155
164
  },
165
+ {
166
+ "name": "provenanceFolded",
167
+ "type": "boolean",
168
+ "default": null,
169
+ "description": "The provenance (run id, ruleset, version) in one closed fold, titled `labels.provenance`.",
170
+ "required": false
171
+ },
156
172
  {
157
173
  "name": "streaming",
158
174
  "type": "boolean",
@@ -177,6 +193,22 @@
177
193
  "module": "@krizaka/ui/registry/examples/analysis-report/document-validation",
178
194
  "code": "import { AnalysisReport, type AnalysisReportLabels } from \"@krizaka/ui/analysis-report\";\n\n// The words come from the app's messages (demo wording here).\nconst labels: AnalysisReportLabels = {\n status: { inconsistent: \"Inconsistent\", attention: \"Needs attention\", unverified: \"Not verified\", consistent: \"Consistent\" },\n findings: \"Findings\", mayIndicate: \"May indicate\", location: \"Where:\", evidence: \"Evidence\", details: \"Details\",\n limits: \"What this report did not examine\", nextSteps: \"Next steps\", provenance: \"Provenance\",\n model: \"Model\", runId: \"Run\", duration: \"Duration\", version: \"Version\",\n copyJson: \"Copy JSON\", copyMarkdown: \"Copy Markdown\", copied: \"Copied\", streaming: \"Findings are arriving\", noFindings: \"No finding.\",\n};\n\nexport default function AnalysisReportDocumentValidation() {\n return (\n <AnalysisReport\n labels={labels}\n title=\"Document validation\"\n summary=\"Two signals disagree with the document's own dates.\"\n status=\"inconsistent\"\n findings={[\n { id: \"1\", status: \"inconsistent\", code: \"PDF-META-002\", title: \"Modified after it was signed\", observation: \"The file was saved 12 days after the signature date.\", mayIndicate: \"An edit after signing, or a re-export. Not proof of tampering.\", location: \"metadata\", evidence: \"CreationDate: 2026-03-02\\nModDate: 2026-03-14\" },\n { id: \"2\", status: \"attention\", code: \"PDF-FONT-001\", title: \"Two fonts on one line\", observation: \"A single line mixes two typefaces.\", location: \"page 2\" },\n { id: \"3\", status: \"consistent\", code: \"PDF-PAGE-001\", title: \"Page count matches\", observation: \"4 pages, as the footer says.\" },\n ]}\n limits={[\"Handwritten signatures were not compared.\", \"The sender's identity was not checked.\"]}\n nextSteps={[\"Ask the sender for the original file.\", \"Compare with the copy on record.\"]}\n provenance={{ model: \"demo-model-1\", runId: \"run_8f3a21\", duration: \"4.2 s\", version: \"1.3.0\" }}\n />\n );\n}\n"
179
195
  },
196
+ {
197
+ "name": "lease-review",
198
+ "title": "A lease review",
199
+ "description": "Each finding quotes the passage and cites its article of law; the respected and unverified groups and the provenance are folded.",
200
+ "path": "examples/analysis-report/lease-review.tsx",
201
+ "module": "@krizaka/ui/registry/examples/analysis-report/lease-review",
202
+ "code": "import { AnalysisReport, type AnalysisReportLabels } from \"@krizaka/ui/analysis-report\";\n\n// The words come from the app's messages (demo wording here).\nconst labels: AnalysisReportLabels = {\n status: { inconsistent: \"Not compliant\", attention: \"To check\", unverified: \"Not applicable\", consistent: \"Respected\" },\n findings: \"Findings\", mayIndicate: \"May indicate\", location: \"Where:\", evidence: \"Evidence\", details: \"Details\",\n limits: \"What this report did not examine\", nextSteps: \"Next steps\", provenance: \"Provenance\",\n model: \"Ruleset\", runId: \"Run\", duration: \"Duration\", version: \"Version\",\n copyJson: \"Copy JSON\", copyMarkdown: \"Copy Markdown\", copied: \"Copied\", streaming: \"Findings are arriving\", noFindings: \"No finding.\",\n};\n\nexport default function AnalysisReportLeaseReview() {\n return (\n <AnalysisReport\n labels={labels}\n title=\"Lease review\"\n summary=\"One clause goes against the Civil Code; two others are worth a second look.\"\n status=\"inconsistent\"\n folded={[\"consistent\", \"unverified\"]}\n provenanceFolded\n hideActions\n findings={[\n { id: \"1\", status: \"inconsistent\", title: \"Deposit requested\", quote: \"The tenant pays a deposit of one month's rent on signing.\", reference: { label: \"C.c.Q., art. 1904, al. 1\", href: \"https://www.legisquebec.gouv.qc.ca/en/document/cs/CCQ-1991\" }, location: \"clause 6\" },\n { id: \"2\", status: \"attention\", title: \"Notice to change the rent\", quote: \"The landlord may revise the rent with a notice of 30 days.\", reference: { label: \"C.c.Q., art. 1942\" }, location: \"clause 9\" },\n { id: \"3\", status: \"consistent\", title: \"Term of the lease\", quote: \"The lease runs for twelve months from July 1.\", reference: { label: \"C.c.Q., art. 1851\" } },\n { id: \"4\", status: \"unverified\", title: \"Parking space\", observation: \"The lease does not mention a parking space.\" },\n ]}\n limits={[\"The building's by-laws were not provided.\"]}\n nextSteps={[\"Ask the landlord to remove the deposit clause.\"]}\n provenance={{ model: \"lease-rules\", runId: \"run_5c20be\", version: \"2026.11\" }}\n />\n );\n}\n"
203
+ },
204
+ {
205
+ "name": "authenticity",
206
+ "title": "An authenticity check",
207
+ "description": "Three levels (authentic, doubtful, altered) mapped to the existing statuses, quoted passages, the calm group folded.",
208
+ "path": "examples/analysis-report/authenticity.tsx",
209
+ "module": "@krizaka/ui/registry/examples/analysis-report/authenticity",
210
+ "code": "import { AnalysisReport, type AnalysisReportLabels } from \"@krizaka/ui/analysis-report\";\n\n// The words come from the app's messages (demo wording here).\nconst labels: AnalysisReportLabels = {\n status: { inconsistent: \"Altered\", attention: \"Doubtful\", unverified: \"Not checked\", consistent: \"Authentic\" },\n findings: \"Signs found\", mayIndicate: \"Could mean\", location: \"Seen at:\", evidence: \"Raw data\", details: \"More\",\n limits: \"Outside this check\", nextSteps: \"What to do\", provenance: \"Where this comes from\",\n model: \"Rules\", runId: \"Run id\", duration: \"Took\", version: \"Rules version\",\n copyJson: \"Copy as JSON\", copyMarkdown: \"Copy as Markdown\", copied: \"Copied\", streaming: \"Signs are arriving\", noFindings: \"No sign found.\",\n};\n\n// Three levels of authenticity map to the existing statuses: authentic → consistent, doubtful → attention, altered → inconsistent.\nexport default function AnalysisReportAuthenticity() {\n return (\n <AnalysisReport\n labels={labels}\n title=\"Authenticity check\"\n summary=\"The pay stub shows one sign of alteration and one doubtful detail.\"\n status=\"inconsistent\"\n folded={[\"consistent\"]}\n provenanceFolded\n hideActions\n findings={[\n { id: \"1\", status: \"inconsistent\", title: \"Amount edited\", quote: \"Net pay: 2 480,00 $\", observation: \"The digits sit on a different background than the line around them.\", mayIndicate: \"A retouched figure. Not proof of fraud.\", location: \"page 1\" },\n { id: \"2\", status: \"attention\", title: \"Employer name spacing\", quote: \"Atelier Dumont inc.\", location: \"header\" },\n { id: \"3\", status: \"consistent\", title: \"File history\", observation: \"One save, by the issuing software.\" },\n ]}\n limits={[\"The employer was not contacted.\"]}\n nextSteps={[\"Ask for the original from the employer.\"]}\n provenance={{ model: \"authenticity-rules\", runId: \"run_77d1a0\", version: \"1.0.0\" }}\n />\n );\n}\n"
211
+ },
180
212
  {
181
213
  "name": "streaming",
182
214
  "title": "While the run is open",
@@ -317,19 +349,19 @@
317
349
  "files": [
318
350
  {
319
351
  "path": "analysis-report/analysis-report.tsx",
320
- "content": "// Client (the copy buttons, the folds). The result of an AI analysis, read in five seconds then deeper on demand: a header\n// (studio, one sentence, overall status, counts), findings grouped by status (the most serious first), the limits and the\n// next steps as a calm two-column section, a provenance footer, and copy as JSON / Markdown. Words arrive as props.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Badge } from \"../badge/badge\";\nimport { Button } from \"../button/button\";\nimport {\n type AnalysisExport,\n type AnalysisFinding,\n type AnalysisReportData,\n type AnalysisReportLabels,\n type AnalysisStatus,\n countByStatus,\n exportReport,\n groupFindings,\n} from \"./model\";\n\nexport const analysisReportStyles = tv({\n slots: {\n root: \"flex w-full flex-col gap-6 text-fg\",\n header: \"flex items-start gap-4\",\n headText: \"flex min-w-0 flex-1 flex-col gap-2\",\n title: \"font-display text-xl font-bold tracking-tight text-fg\",\n summary: \"text-base text-fg-secondary\",\n counts: \"flex flex-wrap items-center gap-2\",\n actions: \"flex flex-wrap gap-2\",\n group: \"flex flex-col gap-3\",\n groupTitle: \"text-sm font-semibold text-fg-secondary\",\n list: \"flex flex-col gap-3\",\n finding: \"flex min-w-0 flex-col gap-2 rounded-lg border border-border-default bg-surface-1 p-4\",\n findingHead: \"flex flex-wrap items-center gap-2\",\n code: \"font-mono text-xs text-fg-secondary\",\n findingTitle: \"text-base font-semibold text-fg\",\n muted: \"text-sm text-fg-secondary\",\n locate: \"w-fit\",\n fold: \"text-sm text-fg-secondary\",\n evidence: \"mt-2 overflow-x-auto rounded-md border border-border-default bg-surface-2 p-3 font-mono text-xs text-fg focus-visible:focus-ring\",\n foldSummary: \"w-fit cursor-pointer rounded-sm font-semibold text-fg-accent focus-visible:focus-ring\",\n columns: \"grid gap-6 border-t border-border-default pt-6 @lg:grid-cols-2\",\n column: \"flex flex-col gap-2\",\n columnTitle: \"text-sm font-semibold text-fg\",\n items: \"flex list-disc flex-col gap-1 pl-5 text-sm text-fg-secondary\",\n provenance: \"flex flex-wrap gap-x-6 gap-y-1 border-t border-border-default pt-4 text-xs text-fg-secondary\",\n term: \"font-semibold text-fg\",\n live: \"text-sm text-fg-secondary\",\n },\n});\n\nconst TONE = { inconsistent: \"danger\", attention: \"warning\", unverified: \"neutral\", consistent: \"success\" } as const satisfies Record<AnalysisStatus, string>;\n\nexport type AnalysisReportProps = Omit<React.ComponentProps<\"section\">, \"title\" | \"children\"> &\n AnalysisReportData & {\n /** Every word the report prints, passed translated (statuses, section titles, buttons). */\n labels: AnalysisReportLabels;\n /** The pack's bird (a mark of `@krizaka/ui/mascots`), shown beside the studio's name. */\n mark?: React.ReactNode;\n /** Findings are still arriving: the list is announced politely and marked busy. */\n streaming?: boolean;\n /** Makes a finding's location a button (scroll a document viewer to it). */\n onLocate?: (finding: AnalysisFinding) => void;\n /** Called after the report is copied (`json` or `markdown`), with the copied text. Without a clipboard, the app can copy it here. */\n onCopy?: (kind: AnalysisExport, text: string) => void;\n /** Hides the copy buttons (a read-only embed). */\n hideActions?: boolean;\n };\n\nfunction FindingCard({ finding, labels, onLocate }: { finding: AnalysisFinding; labels: AnalysisReportLabels; onLocate?: AnalysisReportProps[\"onLocate\"] }) {\n const s = analysisReportStyles();\n return (\n <li className={s.finding()}>\n <div className={s.findingHead()}>\n <Badge tone={TONE[finding.status]} dot>\n {labels.status[finding.status]}\n </Badge>\n {finding.code ? <span className={s.code()}>{finding.code}</span> : null}\n </div>\n <h4 className={s.findingTitle()}>{finding.title}</h4>\n {finding.observation ? <p className={s.muted()}>{finding.observation}</p> : null}\n {finding.mayIndicate ? (\n <p className={s.muted()}>\n <span className={s.term()}>{labels.mayIndicate}</span> {finding.mayIndicate}\n </p>\n ) : null}\n {finding.location ? (\n onLocate ? (\n <Button variant=\"ghost\" size=\"sm\" className={s.locate()} onClick={() => onLocate(finding)}>\n {labels.location} {finding.location}\n </Button>\n ) : (\n <p className={s.muted()}>\n <span className={s.term()}>{labels.location}</span> {finding.location}\n </p>\n )\n ) : null}\n {finding.evidence ? (\n <details className={s.fold()}>\n <summary className={s.foldSummary()}>{labels.evidence}</summary>\n <pre tabIndex={0} className={s.evidence()}>\n <code>{finding.evidence}</code>\n </pre>\n </details>\n ) : null}\n </li>\n );\n}\n\nfunction TextColumn({ title, items }: { title: string; items: readonly string[] | undefined }) {\n const s = analysisReportStyles();\n if (!items?.length) return null;\n return (\n <section className={s.column()}>\n <h3 className={s.columnTitle()}>{title}</h3>\n <ul className={s.items()}>\n {items.map((i) => (\n <li key={i}>{i}</li>\n ))}\n </ul>\n </section>\n );\n}\n\nfunction Provenance({ data, labels }: { data: NonNullable<AnalysisReportData[\"provenance\"]>; labels: AnalysisReportLabels }) {\n const s = analysisReportStyles();\n const rows = [\n [labels.model, data.model],\n [labels.runId, data.runId],\n [labels.duration, data.duration],\n [labels.version, data.version],\n ].filter((r): r is [string, string] => Boolean(r[1]));\n if (!rows.length) return null;\n return (\n <dl aria-label={labels.provenance} className={s.provenance()}>\n {rows.map(([k, v]) => (\n <div key={k} className=\"flex gap-1.5\">\n <dt className={s.term()}>{k}</dt>\n <dd className=\"font-mono\">{v}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\n/** The result of an AI analysis: summary, findings by status, limits, next steps, provenance, copy as JSON or Markdown. */\nexport function AnalysisReport({ title, summary, status, findings, limits, nextSteps, provenance, labels, mark, streaming, onLocate, onCopy, hideActions, className, ...props }: AnalysisReportProps) {\n const s = analysisReportStyles();\n const [copied, setCopied] = React.useState<AnalysisExport | null>(null);\n const report: AnalysisReportData = { title, summary, status, findings, limits, nextSteps, provenance };\n const counts = countByStatus(findings);\n const heading = React.useId();\n const copy = (kind: AnalysisExport) => {\n const text = exportReport(kind, report, labels);\n void navigator.clipboard?.writeText(text).then(() => setCopied(kind));\n onCopy?.(kind, text);\n };\n return (\n <section aria-labelledby={heading} aria-busy={streaming || undefined} className={s.root({ className })} {...props}>\n <header className={s.header()}>\n {mark}\n <div className={s.headText()}>\n <h2 id={heading} className={s.title()}>\n {title}\n </h2>\n <p className={s.summary()}>{summary}</p>\n <div className={s.counts()}>\n <Badge tone={TONE[status]} size=\"md\" dot>\n {labels.status[status]}\n </Badge>\n {(Object.keys(counts) as AnalysisStatus[])\n .filter((k) => counts[k] > 0)\n .map((k) => (\n <Badge key={k} tone={TONE[k]}>\n {counts[k]} {labels.status[k]}\n </Badge>\n ))}\n </div>\n </div>\n {hideActions ? null : (\n <div className={s.actions()}>\n <Button variant=\"outline\" size=\"sm\" onClick={() => copy(\"json\")}>\n {labels.copyJson}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => copy(\"markdown\")}>\n {labels.copyMarkdown}\n </Button>\n </div>\n )}\n </header>\n <p role=\"status\" className=\"sr-only\">\n {copied ? labels.copied : streaming ? labels.streaming : \"\"}\n </p>\n <div aria-live={streaming ? \"polite\" : undefined} className=\"flex flex-col gap-6\">\n {findings.length === 0 && !streaming ? <p className={s.live()}>{labels.noFindings}</p> : null}\n {groupFindings(findings).map((g) => (\n <section key={g.status} className={s.group()} aria-label={`${labels.findings}: ${labels.status[g.status]}`}>\n <h3 className={s.groupTitle()}>\n {labels.status[g.status]} · {g.findings.length}\n </h3>\n <ul className={s.list()}>\n {g.findings.map((f) => (\n <FindingCard key={f.id} finding={f} labels={labels} onLocate={onLocate} />\n ))}\n </ul>\n </section>\n ))}\n </div>\n {limits?.length || nextSteps?.length ? (\n <div className=\"@container\">\n <div className={s.columns()}>\n <TextColumn title={labels.limits} items={limits} />\n <TextColumn title={labels.nextSteps} items={nextSteps} />\n </div>\n </div>\n ) : null}\n {provenance ? <Provenance data={provenance} labels={labels} /> : null}\n </section>\n );\n}\n"
352
+ "content": "// Client (the copy buttons, the folds). The result of an AI analysis, read in five seconds then deeper on demand: a header\n// (studio, one sentence, overall status, counts), findings grouped by status (the most serious first), the limits and the\n// next steps as a calm two-column section, a provenance footer, and copy as JSON / Markdown. Words arrive as props.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Badge } from \"../badge/badge\";\nimport { Button } from \"../button/button\";\nimport {\n type AnalysisExport,\n type AnalysisFinding,\n type AnalysisReportData,\n type AnalysisReportLabels,\n type AnalysisStatus,\n countByStatus,\n exportReport,\n groupFindings,\n} from \"./model\";\n\nexport const analysisReportStyles = tv({\n slots: {\n root: \"flex w-full flex-col gap-6 text-fg\",\n header: \"flex items-start gap-4\",\n headText: \"flex min-w-0 flex-1 flex-col gap-2\",\n title: \"font-display text-xl font-bold tracking-tight text-fg\",\n summary: \"text-base text-fg-secondary\",\n counts: \"flex flex-wrap items-center gap-2\",\n actions: \"flex flex-wrap gap-2\",\n group: \"flex flex-col gap-3\",\n groupTitle: \"text-sm font-semibold text-fg-secondary\",\n list: \"flex flex-col gap-3\",\n finding: \"flex min-w-0 flex-col gap-2 rounded-lg border border-border-default bg-surface-1 p-4\",\n findingHead: \"flex flex-wrap items-center gap-2\",\n code: \"font-mono text-xs text-fg-secondary\",\n findingTitle: \"text-base font-semibold text-fg\",\n muted: \"text-sm text-fg-secondary\",\n locate: \"w-fit\",\n fold: \"text-sm text-fg-secondary\",\n quote: \"m-0 break-words text-sm text-fg-secondary\",\n reference: \"w-fit max-w-full break-words text-sm font-semibold text-fg-accent\",\n referenceLink: \"rounded-sm underline underline-offset-2 focus-visible:focus-ring\",\n evidence: \"mt-2 overflow-x-auto rounded-md border border-border-default bg-surface-2 p-3 font-mono text-xs text-fg focus-visible:focus-ring\",\n foldSummary: \"w-fit cursor-pointer rounded-sm font-semibold text-fg-accent focus-visible:focus-ring\",\n columns: \"grid gap-6 border-t border-border-default pt-6 @lg:grid-cols-2\",\n column: \"flex flex-col gap-2\",\n columnTitle: \"text-sm font-semibold text-fg\",\n items: \"flex list-disc flex-col gap-1 pl-5 text-sm text-fg-secondary\",\n provenance: \"flex flex-wrap gap-x-6 gap-y-1 border-t border-border-default pt-4 text-xs text-fg-secondary\",\n provenanceFold: \"border-t border-border-default pt-4 text-xs text-fg-secondary\",\n provenanceList: \"mt-2 flex flex-wrap gap-x-6 gap-y-1\",\n term: \"font-semibold text-fg\",\n live: \"text-sm text-fg-secondary\",\n },\n});\n\nconst TONE = { inconsistent: \"danger\", attention: \"warning\", unverified: \"neutral\", consistent: \"success\" } as const satisfies Record<AnalysisStatus, string>;\n\nexport type AnalysisReportProps = Omit<React.ComponentProps<\"section\">, \"title\" | \"children\"> &\n AnalysisReportData & {\n /** Every word the report prints, passed translated (statuses, section titles, buttons). */\n labels: AnalysisReportLabels;\n /** The pack's bird (a mark of `@krizaka/ui/mascots`), shown beside the studio's name. */\n mark?: React.ReactNode;\n /** Findings are still arriving: the list is announced politely and marked busy. */\n streaming?: boolean;\n /** Makes a finding's location a button (scroll a document viewer to it). */\n onLocate?: (finding: AnalysisFinding) => void;\n /** Called after the report is copied (`json` or `markdown`), with the copied text. Without a clipboard, the app can copy it here. */\n onCopy?: (kind: AnalysisExport, text: string) => void;\n /** Hides the copy buttons (a read-only embed). */\n hideActions?: boolean;\n /** Status groups closed by default (a native `details`, the count in its summary): « respected », « not applicable ». */\n folded?: readonly AnalysisStatus[];\n /** The provenance (run id, ruleset, version) in one closed fold, titled `labels.provenance`. */\n provenanceFolded?: boolean;\n };\n\nfunction FindingCard({ finding, labels, onLocate }: { finding: AnalysisFinding; labels: AnalysisReportLabels; onLocate?: AnalysisReportProps[\"onLocate\"] }) {\n const s = analysisReportStyles();\n return (\n <li className={s.finding()}>\n <div className={s.findingHead()}>\n <Badge tone={TONE[finding.status]} dot>\n {labels.status[finding.status]}\n </Badge>\n {finding.code ? <span className={s.code()}>{finding.code}</span> : null}\n </div>\n <h4 className={s.findingTitle()}>{finding.title}</h4>\n {finding.observation ? <p className={s.muted()}>{finding.observation}</p> : null}\n {finding.mayIndicate ? (\n <p className={s.muted()}>\n <span className={s.term()}>{labels.mayIndicate}</span> {finding.mayIndicate}\n </p>\n ) : null}\n {finding.quote ? <p className={s.quote()}>« {finding.quote} »</p> : null}\n {finding.reference ? (\n <p className={s.reference()}>\n {finding.reference.href ? (\n <a href={finding.reference.href} className={s.referenceLink()}>\n {finding.reference.label}\n </a>\n ) : (\n finding.reference.label\n )}\n </p>\n ) : null}\n {finding.location ? (\n onLocate ? (\n <Button variant=\"ghost\" size=\"sm\" className={s.locate()} onClick={() => onLocate(finding)}>\n {labels.location} {finding.location}\n </Button>\n ) : (\n <p className={s.muted()}>\n <span className={s.term()}>{labels.location}</span> {finding.location}\n </p>\n )\n ) : null}\n {finding.evidence ? (\n <details className={s.fold()}>\n <summary className={s.foldSummary()}>{labels.evidence}</summary>\n <pre tabIndex={0} className={s.evidence()}>\n <code>{finding.evidence}</code>\n </pre>\n </details>\n ) : null}\n </li>\n );\n}\n\nfunction TextColumn({ title, items }: { title: string; items: readonly string[] | undefined }) {\n const s = analysisReportStyles();\n if (!items?.length) return null;\n return (\n <section className={s.column()}>\n <h3 className={s.columnTitle()}>{title}</h3>\n <ul className={s.items()}>\n {items.map((i) => (\n <li key={i}>{i}</li>\n ))}\n </ul>\n </section>\n );\n}\n\nfunction Provenance({ data, labels, folded }: { data: NonNullable<AnalysisReportData[\"provenance\"]>; labels: AnalysisReportLabels; folded?: boolean }) {\n const s = analysisReportStyles();\n const rows = [\n [labels.model, data.model],\n [labels.runId, data.runId],\n [labels.duration, data.duration],\n [labels.version, data.version],\n ].filter((r): r is [string, string] => Boolean(r[1]));\n if (!rows.length) return null;\n const list = (\n <dl aria-label={folded ? undefined : labels.provenance} className={folded ? s.provenanceList() : s.provenance()}>\n {rows.map(([k, v]) => (\n <div key={k} className=\"flex min-w-0 gap-1.5\">\n <dt className={s.term()}>{k}</dt>\n <dd className=\"min-w-0 break-all font-mono\">{v}</dd>\n </div>\n ))}\n </dl>\n );\n if (!folded) return list;\n return (\n <details className={s.provenanceFold()}>\n <summary className={s.foldSummary()}>{labels.provenance}</summary>\n {list}\n </details>\n );\n}\n\n/** The result of an AI analysis: summary, findings by status, limits, next steps, provenance, copy as JSON or Markdown. */\nexport function AnalysisReport({ title, summary, status, findings, limits, nextSteps, provenance, labels, mark, streaming, onLocate, onCopy, hideActions, folded, provenanceFolded, className, ...props }: AnalysisReportProps) {\n const s = analysisReportStyles();\n const [copied, setCopied] = React.useState<AnalysisExport | null>(null);\n const report: AnalysisReportData = { title, summary, status, findings, limits, nextSteps, provenance };\n const counts = countByStatus(findings);\n const heading = React.useId();\n const copy = (kind: AnalysisExport) => {\n const text = exportReport(kind, report, labels);\n void navigator.clipboard?.writeText(text).then(() => setCopied(kind));\n onCopy?.(kind, text);\n };\n return (\n <section aria-labelledby={heading} aria-busy={streaming || undefined} className={s.root({ className })} {...props}>\n <header className={s.header()}>\n {mark}\n <div className={s.headText()}>\n <h2 id={heading} className={s.title()}>\n {title}\n </h2>\n <p className={s.summary()}>{summary}</p>\n <div className={s.counts()}>\n <Badge tone={TONE[status]} size=\"md\" dot>\n {labels.status[status]}\n </Badge>\n {(Object.keys(counts) as AnalysisStatus[])\n .filter((k) => counts[k] > 0)\n .map((k) => (\n <Badge key={k} tone={TONE[k]}>\n {counts[k]} {labels.status[k]}\n </Badge>\n ))}\n </div>\n </div>\n {hideActions ? null : (\n <div className={s.actions()}>\n <Button variant=\"outline\" size=\"sm\" onClick={() => copy(\"json\")}>\n {labels.copyJson}\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={() => copy(\"markdown\")}>\n {labels.copyMarkdown}\n </Button>\n </div>\n )}\n </header>\n <p role=\"status\" className=\"sr-only\">\n {copied ? labels.copied : streaming ? labels.streaming : \"\"}\n </p>\n <div aria-live={streaming ? \"polite\" : undefined} className=\"flex flex-col gap-6\">\n {findings.length === 0 && !streaming ? <p className={s.live()}>{labels.noFindings}</p> : null}\n {groupFindings(findings).map((g) => {\n const title = `${labels.status[g.status]} · ${g.findings.length}`;\n const list = (\n <ul className={s.list()}>\n {g.findings.map((f) => (\n <FindingCard key={f.id} finding={f} labels={labels} onLocate={onLocate} />\n ))}\n </ul>\n );\n return folded?.includes(g.status) ? (\n <details key={g.status} className={s.group()} aria-label={`${labels.findings}: ${labels.status[g.status]}`}>\n <summary className={s.foldSummary()}>{title}</summary>\n <div className=\"mt-3\">{list}</div>\n </details>\n ) : (\n <section key={g.status} className={s.group()} aria-label={`${labels.findings}: ${labels.status[g.status]}`}>\n <h3 className={s.groupTitle()}>{title}</h3>\n {list}\n </section>\n );\n })}\n </div>\n {limits?.length || nextSteps?.length ? (\n <div className=\"@container\">\n <div className={s.columns()}>\n <TextColumn title={labels.limits} items={limits} />\n <TextColumn title={labels.nextSteps} items={nextSteps} />\n </div>\n </div>\n ) : null}\n {provenance ? <Provenance data={provenance} labels={labels} folded={provenanceFolded} /> : null}\n </section>\n );\n}\n"
321
353
  },
322
354
  {
323
355
  "path": "analysis-report/index.ts",
324
- "content": "/** @krizaka/ui/analysis-report — `AnalysisReport`, the result of an AI analysis (summary, findings, limits, next steps, provenance, copy as JSON / Markdown), and its rules. Client. */\nexport { AnalysisReport, type AnalysisReportProps, analysisReportStyles } from \"./analysis-report\";\nexport {\n ANALYSIS_STATUSES,\n type AnalysisExport,\n type AnalysisFinding,\n type AnalysisProvenance,\n type AnalysisReportData,\n type AnalysisReportLabels,\n type AnalysisStatus,\n countByStatus,\n exportReport,\n groupFindings,\n reportToJson,\n reportToMarkdown,\n} from \"./model\";\n"
356
+ "content": "/** @krizaka/ui/analysis-report — `AnalysisReport`, the result of an AI analysis (summary, findings, limits, next steps, provenance, copy as JSON / Markdown), and its rules. Client. */\nexport { AnalysisReport, type AnalysisReportProps, analysisReportStyles } from \"./analysis-report\";\nexport {\n ANALYSIS_STATUSES,\n type AnalysisExport,\n type AnalysisFinding,\n type AnalysisProvenance,\n type AnalysisReference,\n type AnalysisReportData,\n type AnalysisReportLabels,\n type AnalysisStatus,\n countByStatus,\n exportReport,\n groupFindings,\n reportToJson,\n reportToMarkdown,\n} from \"./model\";\n"
325
357
  },
326
358
  {
327
359
  "path": "analysis-report/meta.ts",
328
- "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Analysis report\",\n summary:\n \"The result of an AI analysis, honest and calm: one sentence and an overall status, findings grouped by status with what was observed and what it may indicate, what the report did not examine, the next steps and where the result comes from.\",\n status: \"beta\",\n category: \"blocks\",\n domain: \"conversation\",\n platforms: \"both\",\n parity: { desktop: \"web\" },\n whenToUse: [\n \"Showing what an Sovkora analysis found in a document, a lease, an identity check or a moderated item, in any product.\",\n \"Any result that has findings of different gravity, a list of limits and a provenance the reader may need to cite.\",\n ],\n whenNotToUse: [\n { when: \"A single yes / no outcome with no findings.\", use: \"alert\" },\n { when: \"A chat answer that streams as prose.\", use: \"chat\" },\n { when: \"A log of what happened in order.\", use: \"activity-feed\" },\n ],\n bestPractices: [\n \"Order is the point: the most serious group comes first, then the calmer ones; never sort by code.\",\n \"Keep « may indicate » honest: it carries the caveat (« not proof of tampering »), never a verdict.\",\n \"Say what the report did not examine, in the same weight as the findings; the limits are part of the result.\",\n \"Pass every word through `labels` from your messages (`@krizaka/i18n`); the package ships none.\",\n \"While the run is open, set `streaming`: findings are announced politely as they arrive.\",\n \"Give `onLocate` to scroll a document viewer to a finding's place; without it the location is plain text.\",\n \"Examples and tests use demo data only.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Tab / Enter\", action: \"Reaches the copy buttons, the locations and the folded evidence.\" }],\n notes: [\n \"A section named by the studio's title; each status group is a labelled section with a heading, each finding a list item.\",\n \"A status is always a word with its dot, never a colour alone.\",\n \"The copy result and the streaming state are said in a polite status region; the list is `aria-busy` while streaming.\",\n \"The evidence is a native `details`: it works without script and keeps the focus on its summary.\",\n ],\n },\n related: [\"badge\", \"decision-list\", \"mascot-quote\", \"alert\"],\n web: {\n imports: [\"AnalysisReport\", \"groupFindings\", \"countByStatus\", \"reportToMarkdown\", \"reportToJson\"],\n examples: [\n { name: \"document-validation\", title: \"A document validation\", description: \"Header, findings grouped by status, limits and next steps in two columns, provenance, copy as JSON or Markdown.\" },\n { name: \"streaming\", title: \"While the run is open\", description: \"`streaming` marks the report busy and announces each finding as it arrives; the copy actions are hidden.\" },\n ],\n },\n native: {\n imports: [\"AnalysisReport\"],\n differences: [\n \"There is no clipboard in the package: `onCopy` receives the text and the app copies it.\",\n \"The evidence unfolds in place (a pressable summary) instead of a native `details`.\",\n ],\n examples: [{ name: \"document-validation\", title: \"A document validation\", description: \"The same report on the phone: findings by status, limits, next steps.\" }],\n },\n} satisfies ComponentMeta;\n"
360
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Analysis report\",\n summary:\n \"The result of an AI analysis, honest and calm: one sentence and an overall status, findings grouped by status with what was observed and what it may indicate, what the report did not examine, the next steps and where the result comes from.\",\n status: \"beta\",\n category: \"blocks\",\n domain: \"conversation\",\n platforms: \"both\",\n parity: { desktop: \"web\" },\n whenToUse: [\n \"Showing what an Sovkora analysis found in a document, a lease, an identity check or a moderated item, in any product.\",\n \"Any result that has findings of different gravity, a list of limits and a provenance the reader may need to cite.\",\n ],\n whenNotToUse: [\n { when: \"A single yes / no outcome with no findings.\", use: \"alert\" },\n { when: \"A chat answer that streams as prose.\", use: \"chat\" },\n { when: \"A log of what happened in order.\", use: \"activity-feed\" },\n ],\n bestPractices: [\n \"Order is the point: the most serious group comes first, then the calmer ones; never sort by code.\",\n \"Keep « may indicate » honest: it carries the caveat (« not proof of tampering »), never a verdict.\",\n \"Say what the report did not examine, in the same weight as the findings; the limits are part of the result.\",\n \"Pass every word through `labels` from your messages (`@krizaka/i18n`); the package ships none.\",\n \"While the run is open, set `streaming`: findings are announced politely as they arrive.\",\n \"Give `onLocate` to scroll a document viewer to a finding's place; without it the location is plain text.\",\n \"Quote the passage the finding rests on (`quote`) and cite the rule (`reference`, with an `href` when it is public): the reader checks the source without opening the document.\",\n \"Fold the calm groups (`folded`) and the provenance (`provenanceFolded`): the serious findings stay in view, the rest is one tap away.\",\n \"Examples and tests use demo data only.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Tab / Enter\", action: \"Reaches the copy buttons, the locations, the references and the folds; Enter or Space opens a fold.\" }],\n notes: [\n \"A section named by the studio's title; each status group is a labelled section with a heading, each finding a list item.\",\n \"A status is always a word with its dot, never a colour alone.\",\n \"The copy result and the streaming state are said in a polite status region; the list is `aria-busy` while streaming.\",\n \"The evidence is a native `details`: it works without script and keeps the focus on its summary.\",\n ],\n },\n related: [\"badge\", \"decision-list\", \"mascot-quote\", \"alert\"],\n web: {\n imports: [\"AnalysisReport\", \"groupFindings\", \"countByStatus\", \"reportToMarkdown\", \"reportToJson\"],\n examples: [\n { name: \"document-validation\", title: \"A document validation\", description: \"Header, findings grouped by status, limits and next steps in two columns, provenance, copy as JSON or Markdown.\" },\n { name: \"lease-review\", title: \"A lease review\", description: \"Each finding quotes the passage and cites its article of law; the respected and unverified groups and the provenance are folded.\" },\n { name: \"authenticity\", title: \"An authenticity check\", description: \"Three levels (authentic, doubtful, altered) mapped to the existing statuses, quoted passages, the calm group folded.\" },\n { name: \"streaming\", title: \"While the run is open\", description: \"`streaming` marks the report busy and announces each finding as it arrives; the copy actions are hidden.\" },\n ],\n },\n native: {\n imports: [\"AnalysisReport\"],\n differences: [\n \"There is no clipboard in the package: `onCopy` receives the text and the app copies it.\",\n \"The evidence unfolds in place (a pressable summary) instead of a native `details`.\",\n ],\n examples: [{ name: \"document-validation\", title: \"A document validation\", description: \"The same report on the phone: findings by status, limits, next steps.\" }],\n },\n} satisfies ComponentMeta;\n"
329
361
  },
330
362
  {
331
363
  "path": "analysis-report/model.ts",
332
- "content": "// The rules of an analysis report, shared by the web entry and tested alone: the order of the statuses, the grouping of the\n// findings (the most serious first), the counts, and the two exports (JSON, Markdown). No words of its own: the labels arrive.\n\n/** How a finding or a whole report reads, from the most serious to the calmest. */\nexport const ANALYSIS_STATUSES = [\"inconsistent\", \"attention\", \"unverified\", \"consistent\"] as const;\nexport type AnalysisStatus = (typeof ANALYSIS_STATUSES)[number];\n\nexport type AnalysisFinding = {\n id: string;\n status: AnalysisStatus;\n /** The rule's identifier, in mono (`PDF-META-002`). */\n code?: string;\n title: string;\n /** What was observed. */\n observation?: string;\n /** What it may indicate, with its honest caveat. */\n mayIndicate?: string;\n /** Where in the document: « metadata », « page 3 ». `onLocate` receives the finding. */\n location?: string;\n /** The raw evidence, shown in a code block. */\n evidence?: string;\n};\n\nexport type AnalysisProvenance = { model?: string; runId?: string; duration?: string; version?: string };\n\nexport type AnalysisReportData = {\n /** The studio's name (« Document validation »). */\n title: string;\n /** One sentence: the answer. */\n summary: string;\n /** The overall status of the report. */\n status: AnalysisStatus;\n /** The findings, in any order: the report groups them by status, the most serious first. */\n findings: readonly AnalysisFinding[];\n /** « What this report did not examine ». */\n limits?: readonly string[];\n /** What to do next, one step per item. */\n nextSteps?: readonly string[];\n /** Where the result comes from: model, run id, duration, version. */\n provenance?: AnalysisProvenance;\n};\n\n/** Every word the report prints, passed translated (the package ships none). */\nexport type AnalysisReportLabels = {\n status: Record<AnalysisStatus, string>;\n findings: string;\n mayIndicate: string;\n location: string;\n evidence: string;\n details: string;\n limits: string;\n nextSteps: string;\n provenance: string;\n model: string;\n runId: string;\n duration: string;\n version: string;\n copyJson: string;\n copyMarkdown: string;\n copied: string;\n /** Said while findings are still arriving. */\n streaming: string;\n /** Said when the report has no finding. */\n noFindings: string;\n};\n\nexport type AnalysisExport = \"json\" | \"markdown\";\n\n/** The findings grouped by status, the most serious group first; empty groups are left out. */\nexport function groupFindings(findings: readonly AnalysisFinding[]): { status: AnalysisStatus; findings: AnalysisFinding[] }[] {\n return ANALYSIS_STATUSES.map((status) => ({ status, findings: findings.filter((f) => f.status === status) })).filter((g) => g.findings.length > 0);\n}\n\n/** How many findings wear each status (zero included, so a count row is stable). */\nexport function countByStatus(findings: readonly AnalysisFinding[]): Record<AnalysisStatus, number> {\n const counts = { inconsistent: 0, attention: 0, unverified: 0, consistent: 0 } satisfies Record<AnalysisStatus, number>;\n for (const f of findings) counts[f.status] += 1;\n return counts;\n}\n\nexport function reportToJson(report: AnalysisReportData): string {\n return JSON.stringify(report, null, 2);\n}\n\nconst bullets = (items: readonly string[]) => items.map((i) => `- ${i}`);\n\nfunction findingLines(f: AnalysisFinding, labels: AnalysisReportLabels): string[] {\n const head = `### ${f.code ? `\\`${f.code}\\` · ` : \"\"}${f.title}`;\n return [\n head,\n ...(f.observation ? [\"\", f.observation] : []),\n ...(f.mayIndicate ? [\"\", `**${labels.mayIndicate}** ${f.mayIndicate}`] : []),\n ...(f.location ? [\"\", `**${labels.location}** ${f.location}`] : []),\n ...(f.evidence ? [\"\", \"```\", f.evidence, \"```\"] : []),\n \"\",\n ];\n}\n\nfunction provenanceLines(p: AnalysisProvenance | undefined, labels: AnalysisReportLabels): string[] {\n const rows: [string, string | undefined][] = [\n [labels.model, p?.model],\n [labels.runId, p?.runId],\n [labels.duration, p?.duration],\n [labels.version, p?.version],\n ];\n return rows.filter((r): r is [string, string] => Boolean(r[1])).map(([k, v]) => `- ${k}: ${v}`);\n}\n\n/** The report as Markdown, in the same order as the page. */\nexport function reportToMarkdown(report: AnalysisReportData, labels: AnalysisReportLabels): string {\n const sections: string[][] = [\n [`# ${report.title}`, \"\", `**${labels.status[report.status]}** — ${report.summary}`],\n ...groupFindings(report.findings).map((g) => [`## ${labels.status[g.status]}`, \"\", ...g.findings.flatMap((f) => findingLines(f, labels))]),\n ...(report.limits?.length ? [[`## ${labels.limits}`, \"\", ...bullets(report.limits)]] : []),\n ...(report.nextSteps?.length ? [[`## ${labels.nextSteps}`, \"\", ...bullets(report.nextSteps)]] : []),\n ...(provenanceLines(report.provenance, labels).length ? [[`## ${labels.provenance}`, \"\", ...provenanceLines(report.provenance, labels)]] : []),\n ];\n return sections.map((s) => s.join(\"\\n\").trimEnd()).join(\"\\n\\n\") + \"\\n\";\n}\n\n/** The text of an export. */\nexport function exportReport(kind: AnalysisExport, report: AnalysisReportData, labels: AnalysisReportLabels): string {\n return kind === \"json\" ? reportToJson(report) : reportToMarkdown(report, labels);\n}\n"
364
+ "content": "// The rules of an analysis report, shared by the web entry and tested alone: the order of the statuses, the grouping of the\n// findings (the most serious first), the counts, and the two exports (JSON, Markdown). No words of its own: the labels arrive.\n\n/** How a finding or a whole report reads, from the most serious to the calmest. */\nexport const ANALYSIS_STATUSES = [\"inconsistent\", \"attention\", \"unverified\", \"consistent\"] as const;\nexport type AnalysisStatus = (typeof ANALYSIS_STATUSES)[number];\n\nexport type AnalysisFinding = {\n id: string;\n status: AnalysisStatus;\n /** The rule's identifier, in mono (`PDF-META-002`). */\n code?: string;\n title: string;\n /** What was observed. */\n observation?: string;\n /** What it may indicate, with its honest caveat. */\n mayIndicate?: string;\n /** Where in the document: « metadata », « page 3 ». `onLocate` receives the finding. */\n location?: string;\n /** The raw evidence, shown in a code block. */\n evidence?: string;\n /** The passage of the document the finding rests on, shown as a « » line (prose, not code: `evidence` stays for code). */\n quote?: string;\n /** The article of law or rule the finding cites (« C.c.Q., art. 1904, al. 1 »); `href` makes it a link. */\n reference?: AnalysisReference;\n};\n\nexport type AnalysisReference = { label: string; href?: string };\n\nexport type AnalysisProvenance = { model?: string; runId?: string; duration?: string; version?: string };\n\nexport type AnalysisReportData = {\n /** The studio's name (« Document validation »). */\n title: string;\n /** One sentence: the answer. */\n summary: string;\n /** The overall status of the report. */\n status: AnalysisStatus;\n /** The findings, in any order: the report groups them by status, the most serious first. */\n findings: readonly AnalysisFinding[];\n /** « What this report did not examine ». */\n limits?: readonly string[];\n /** What to do next, one step per item. */\n nextSteps?: readonly string[];\n /** Where the result comes from: model, run id, duration, version. */\n provenance?: AnalysisProvenance;\n};\n\n/** Every word the report prints, passed translated (the package ships none). */\nexport type AnalysisReportLabels = {\n status: Record<AnalysisStatus, string>;\n findings: string;\n mayIndicate: string;\n location: string;\n evidence: string;\n details: string;\n limits: string;\n nextSteps: string;\n provenance: string;\n model: string;\n runId: string;\n duration: string;\n version: string;\n copyJson: string;\n copyMarkdown: string;\n copied: string;\n /** Said while findings are still arriving. */\n streaming: string;\n /** Said when the report has no finding. */\n noFindings: string;\n};\n\nexport type AnalysisExport = \"json\" | \"markdown\";\n\n/** The findings grouped by status, the most serious group first; empty groups are left out. */\nexport function groupFindings(findings: readonly AnalysisFinding[]): { status: AnalysisStatus; findings: AnalysisFinding[] }[] {\n return ANALYSIS_STATUSES.map((status) => ({ status, findings: findings.filter((f) => f.status === status) })).filter((g) => g.findings.length > 0);\n}\n\n/** How many findings wear each status (zero included, so a count row is stable). */\nexport function countByStatus(findings: readonly AnalysisFinding[]): Record<AnalysisStatus, number> {\n const counts = { inconsistent: 0, attention: 0, unverified: 0, consistent: 0 } satisfies Record<AnalysisStatus, number>;\n for (const f of findings) counts[f.status] += 1;\n return counts;\n}\n\nexport function reportToJson(report: AnalysisReportData): string {\n return JSON.stringify(report, null, 2);\n}\n\nconst bullets = (items: readonly string[]) => items.map((i) => `- ${i}`);\n\nfunction findingLines(f: AnalysisFinding, labels: AnalysisReportLabels): string[] {\n const head = `### ${f.code ? `\\`${f.code}\\` · ` : \"\"}${f.title}`;\n return [\n head,\n ...(f.observation ? [\"\", f.observation] : []),\n ...(f.mayIndicate ? [\"\", `**${labels.mayIndicate}** ${f.mayIndicate}`] : []),\n ...(f.quote ? [\"\", `> « ${f.quote} »`] : []),\n ...(f.reference ? [\"\", f.reference.href ? `[${f.reference.label}](${f.reference.href})` : f.reference.label] : []),\n ...(f.location ? [\"\", `**${labels.location}** ${f.location}`] : []),\n ...(f.evidence ? [\"\", \"```\", f.evidence, \"```\"] : []),\n \"\",\n ];\n}\n\nfunction provenanceLines(p: AnalysisProvenance | undefined, labels: AnalysisReportLabels): string[] {\n const rows: [string, string | undefined][] = [\n [labels.model, p?.model],\n [labels.runId, p?.runId],\n [labels.duration, p?.duration],\n [labels.version, p?.version],\n ];\n return rows.filter((r): r is [string, string] => Boolean(r[1])).map(([k, v]) => `- ${k}: ${v}`);\n}\n\n/** The report as Markdown, in the same order as the page. */\nexport function reportToMarkdown(report: AnalysisReportData, labels: AnalysisReportLabels): string {\n const sections: string[][] = [\n [`# ${report.title}`, \"\", `**${labels.status[report.status]}** — ${report.summary}`],\n ...groupFindings(report.findings).map((g) => [`## ${labels.status[g.status]}`, \"\", ...g.findings.flatMap((f) => findingLines(f, labels))]),\n ...(report.limits?.length ? [[`## ${labels.limits}`, \"\", ...bullets(report.limits)]] : []),\n ...(report.nextSteps?.length ? [[`## ${labels.nextSteps}`, \"\", ...bullets(report.nextSteps)]] : []),\n ...(provenanceLines(report.provenance, labels).length ? [[`## ${labels.provenance}`, \"\", ...provenanceLines(report.provenance, labels)]] : []),\n ];\n return sections.map((s) => s.join(\"\\n\").trimEnd()).join(\"\\n\\n\") + \"\\n\";\n}\n\n/** The text of an export. */\nexport function exportReport(kind: AnalysisExport, report: AnalysisReportData, labels: AnalysisReportLabels): string {\n return kind === \"json\" ? reportToJson(report) : reportToMarkdown(report, labels);\n}\n"
333
365
  },
334
366
  {
335
367
  "path": "meta.ts",
@@ -387,6 +419,13 @@
387
419
  "description": "The studio's name (« Document validation »).",
388
420
  "required": true
389
421
  },
422
+ {
423
+ "name": "folded",
424
+ "type": "readonly (\"inconsistent\" | \"attention\" | \"unverified\" | \"consistent\")[]",
425
+ "default": null,
426
+ "description": "Status groups closed by default (a native `details`, the count in its summary): « respected », « not applicable ».",
427
+ "required": false
428
+ },
390
429
  {
391
430
  "name": "hideActions",
392
431
  "type": "boolean",
@@ -429,6 +468,13 @@
429
468
  "description": "Where the result comes from: model, run id, duration, version.",
430
469
  "required": false
431
470
  },
471
+ {
472
+ "name": "provenanceFolded",
473
+ "type": "boolean",
474
+ "default": null,
475
+ "description": "The provenance (run id, ruleset, version) in one closed fold, titled `labels.provenance`.",
476
+ "required": false
477
+ },
432
478
  {
433
479
  "name": "streaming",
434
480
  "type": "boolean",
@@ -374,7 +374,7 @@
374
374
  }
375
375
  ],
376
376
  "dependencies": [
377
- "@krizaka/tokens@^4.0.0"
377
+ "@krizaka/tokens@^4.2.0"
378
378
  ],
379
379
  "registryDependencies": [
380
380
  "account-menu",
@@ -15,7 +15,7 @@ function AccountSectionPatterns() {
15
15
  ] }),
16
16
  /* @__PURE__ */ jsx(SettingsRow, { label: "Mot de passe", description: "Modifi\xE9 il y a 3 mois.", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", children: "Changer" }) })
17
17
  ] }),
18
- /* @__PURE__ */ jsx(SettingsSection, { variant: "flat", title: "Abonnement", description: "Votre forfait et vos factures.", children: /* @__PURE__ */ jsx(SettingsRow, { label: "Forfait Solo", description: "Renouvel\xE9 le 1er novembre.", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", asChild: true, children: /* @__PURE__ */ jsx("a", { href: "https://billing.example.com/portal", children: "Ouvrir le portail de facturation" }) }) }) }),
18
+ /* @__PURE__ */ jsx(SettingsSection, { variant: "flat", title: "Abonnement", description: "Votre forfait et vos factures.", children: /* @__PURE__ */ jsx(SettingsRow, { label: "Forfait Solo", description: "Renouvel\xE9 le 1er novembre.", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", asChild: true, children: /* @__PURE__ */ jsx("a", { href: "https://example.com", children: "Ouvrir le portail de facturation" }) }) }) }),
19
19
  /* @__PURE__ */ jsx(SettingsSection, { variant: "flat", title: "Stockage", description: "L'espace utilis\xE9 par vos documents.", children: /* @__PURE__ */ jsx(SettingsRow, { label: "Documents", children: /* @__PURE__ */ jsx(Meter, { className: "w-56", label: "Stockage", value: 18, max: 50, valueText: "18 Go sur 50 Go", showLabel: true }) }) }),
20
20
  /* @__PURE__ */ jsxs(SettingsSection, { variant: "flat", title: "Mes donn\xE9es", description: "Ce que vous pouvez emporter ou effacer.", children: [
21
21
  /* @__PURE__ */ jsx(SettingsRow, { label: "Exporter", description: "Une archive de tout ce que vous avez t\xE9l\xE9vers\xE9.", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", children: "Demander l'export" }) }),
@@ -18,7 +18,7 @@ export default function AccountSectionPatterns() {
18
18
  </SettingsSection>
19
19
  <SettingsSection variant="flat" title="Abonnement" description="Votre forfait et vos factures.">
20
20
  <SettingsRow label="Forfait Solo" description="Renouvelé le 1er novembre.">
21
- <Button variant="secondary" size="sm" asChild><a href="https://billing.example.com/portal">Ouvrir le portail de facturation</a></Button>
21
+ <Button variant="secondary" size="sm" asChild><a href="https://example.com">Ouvrir le portail de facturation</a></Button>
22
22
  </SettingsRow>
23
23
  </SettingsSection>
24
24
  <SettingsSection variant="flat" title="Stockage" description="L'espace utilisé par vos documents.">
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,50 @@
1
+ "use client";
2
+
3
+ // registry/examples/analysis-report/authenticity.tsx
4
+ import { AnalysisReport } from "@krizaka/ui/analysis-report";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var labels = {
7
+ status: { inconsistent: "Altered", attention: "Doubtful", unverified: "Not checked", consistent: "Authentic" },
8
+ findings: "Signs found",
9
+ mayIndicate: "Could mean",
10
+ location: "Seen at:",
11
+ evidence: "Raw data",
12
+ details: "More",
13
+ limits: "Outside this check",
14
+ nextSteps: "What to do",
15
+ provenance: "Where this comes from",
16
+ model: "Rules",
17
+ runId: "Run id",
18
+ duration: "Took",
19
+ version: "Rules version",
20
+ copyJson: "Copy as JSON",
21
+ copyMarkdown: "Copy as Markdown",
22
+ copied: "Copied",
23
+ streaming: "Signs are arriving",
24
+ noFindings: "No sign found."
25
+ };
26
+ function AnalysisReportAuthenticity() {
27
+ return /* @__PURE__ */ jsx(
28
+ AnalysisReport,
29
+ {
30
+ labels,
31
+ title: "Authenticity check",
32
+ summary: "The pay stub shows one sign of alteration and one doubtful detail.",
33
+ status: "inconsistent",
34
+ folded: ["consistent"],
35
+ provenanceFolded: true,
36
+ hideActions: true,
37
+ findings: [
38
+ { id: "1", status: "inconsistent", title: "Amount edited", quote: "Net pay: 2 480,00 $", observation: "The digits sit on a different background than the line around them.", mayIndicate: "A retouched figure. Not proof of fraud.", location: "page 1" },
39
+ { id: "2", status: "attention", title: "Employer name spacing", quote: "Atelier Dumont inc.", location: "header" },
40
+ { id: "3", status: "consistent", title: "File history", observation: "One save, by the issuing software." }
41
+ ],
42
+ limits: ["The employer was not contacted."],
43
+ nextSteps: ["Ask for the original from the employer."],
44
+ provenance: { model: "authenticity-rules", runId: "run_77d1a0", version: "1.0.0" }
45
+ }
46
+ );
47
+ }
48
+ export {
49
+ AnalysisReportAuthenticity as default
50
+ };
@@ -0,0 +1,33 @@
1
+ import { AnalysisReport, type AnalysisReportLabels } from "@krizaka/ui/analysis-report";
2
+
3
+ // The words come from the app's messages (demo wording here).
4
+ const labels: AnalysisReportLabels = {
5
+ status: { inconsistent: "Altered", attention: "Doubtful", unverified: "Not checked", consistent: "Authentic" },
6
+ findings: "Signs found", mayIndicate: "Could mean", location: "Seen at:", evidence: "Raw data", details: "More",
7
+ limits: "Outside this check", nextSteps: "What to do", provenance: "Where this comes from",
8
+ model: "Rules", runId: "Run id", duration: "Took", version: "Rules version",
9
+ copyJson: "Copy as JSON", copyMarkdown: "Copy as Markdown", copied: "Copied", streaming: "Signs are arriving", noFindings: "No sign found.",
10
+ };
11
+
12
+ // Three levels of authenticity map to the existing statuses: authentic → consistent, doubtful → attention, altered → inconsistent.
13
+ export default function AnalysisReportAuthenticity() {
14
+ return (
15
+ <AnalysisReport
16
+ labels={labels}
17
+ title="Authenticity check"
18
+ summary="The pay stub shows one sign of alteration and one doubtful detail."
19
+ status="inconsistent"
20
+ folded={["consistent"]}
21
+ provenanceFolded
22
+ hideActions
23
+ findings={[
24
+ { id: "1", status: "inconsistent", title: "Amount edited", quote: "Net pay: 2 480,00 $", observation: "The digits sit on a different background than the line around them.", mayIndicate: "A retouched figure. Not proof of fraud.", location: "page 1" },
25
+ { id: "2", status: "attention", title: "Employer name spacing", quote: "Atelier Dumont inc.", location: "header" },
26
+ { id: "3", status: "consistent", title: "File history", observation: "One save, by the issuing software." },
27
+ ]}
28
+ limits={["The employer was not contacted."]}
29
+ nextSteps={["Ask for the original from the employer."]}
30
+ provenance={{ model: "authenticity-rules", runId: "run_77d1a0", version: "1.0.0" }}
31
+ />
32
+ );
33
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/ui registry; `defaultOpen` opens what it opens (a dialog, a menu, toasts) at load. */
3
+ declare const Example: ComponentType<{ defaultOpen?: boolean }>;
4
+ export default Example;
@@ -0,0 +1,51 @@
1
+ "use client";
2
+
3
+ // registry/examples/analysis-report/lease-review.tsx
4
+ import { AnalysisReport } from "@krizaka/ui/analysis-report";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var labels = {
7
+ status: { inconsistent: "Not compliant", attention: "To check", unverified: "Not applicable", consistent: "Respected" },
8
+ findings: "Findings",
9
+ mayIndicate: "May indicate",
10
+ location: "Where:",
11
+ evidence: "Evidence",
12
+ details: "Details",
13
+ limits: "What this report did not examine",
14
+ nextSteps: "Next steps",
15
+ provenance: "Provenance",
16
+ model: "Ruleset",
17
+ runId: "Run",
18
+ duration: "Duration",
19
+ version: "Version",
20
+ copyJson: "Copy JSON",
21
+ copyMarkdown: "Copy Markdown",
22
+ copied: "Copied",
23
+ streaming: "Findings are arriving",
24
+ noFindings: "No finding."
25
+ };
26
+ function AnalysisReportLeaseReview() {
27
+ return /* @__PURE__ */ jsx(
28
+ AnalysisReport,
29
+ {
30
+ labels,
31
+ title: "Lease review",
32
+ summary: "One clause goes against the Civil Code; two others are worth a second look.",
33
+ status: "inconsistent",
34
+ folded: ["consistent", "unverified"],
35
+ provenanceFolded: true,
36
+ hideActions: true,
37
+ findings: [
38
+ { id: "1", status: "inconsistent", title: "Deposit requested", quote: "The tenant pays a deposit of one month's rent on signing.", reference: { label: "C.c.Q., art. 1904, al. 1", href: "https://www.legisquebec.gouv.qc.ca/en/document/cs/CCQ-1991" }, location: "clause 6" },
39
+ { id: "2", status: "attention", title: "Notice to change the rent", quote: "The landlord may revise the rent with a notice of 30 days.", reference: { label: "C.c.Q., art. 1942" }, location: "clause 9" },
40
+ { id: "3", status: "consistent", title: "Term of the lease", quote: "The lease runs for twelve months from July 1.", reference: { label: "C.c.Q., art. 1851" } },
41
+ { id: "4", status: "unverified", title: "Parking space", observation: "The lease does not mention a parking space." }
42
+ ],
43
+ limits: ["The building's by-laws were not provided."],
44
+ nextSteps: ["Ask the landlord to remove the deposit clause."],
45
+ provenance: { model: "lease-rules", runId: "run_5c20be", version: "2026.11" }
46
+ }
47
+ );
48
+ }
49
+ export {
50
+ AnalysisReportLeaseReview as default
51
+ };