@krizaka/ui 4.3.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-menu.d.ts +1 -1
- package/dist/account-menu.js +1 -1
- package/dist/account-menu.js.map +1 -1
- package/dist/account-settings.d.ts +1 -1
- package/dist/account-settings.js +13 -6
- package/dist/account-settings.js.map +1 -1
- package/dist/agenda.d.ts +1 -1
- package/dist/agenda.js +2 -1
- package/dist/agenda.js.map +1 -1
- package/dist/analysis-report.js +19 -11
- package/dist/analysis-report.js.map +1 -1
- package/dist/app-frame.d.ts +1 -1
- package/dist/app-frame.js.map +1 -1
- package/dist/app-header/search.js +2 -2
- package/dist/app-header/search.js.map +1 -1
- package/dist/avatar/defaults.js +3 -1
- package/dist/avatar/defaults.js.map +1 -1
- package/dist/avatar.js +3 -1
- package/dist/avatar.js.map +1 -1
- package/dist/bird-plate.js +8 -2
- package/dist/bird-plate.js.map +1 -1
- package/dist/blocks.css +4 -0
- package/dist/chapter.js +7 -4
- package/dist/chapter.js.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.js +1 -1
- package/dist/{chunk-SNSQLGGS.js → chunk-5VZ37TY3.js} +1 -1
- package/dist/{chunk-XWJDBQU7.js.map → chunk-5VZ37TY3.js.map} +1 -1
- package/dist/{chunk-MTVX4RRF.js → chunk-HP7BDMVK.js} +11 -3
- package/dist/chunk-HP7BDMVK.js.map +1 -0
- package/dist/{chunk-PK3L6WQT.js → chunk-LNAAWT4Y.js} +4 -2
- package/dist/{chunk-PK3L6WQT.js.map → chunk-LNAAWT4Y.js.map} +1 -1
- package/dist/{chunk-UIP3WX5O.js → chunk-MDSP7DJR.js} +2 -2
- package/dist/chunk-MDSP7DJR.js.map +1 -0
- package/dist/{chunk-IEGTRCDI.js → chunk-NQENOT6L.js} +2 -2
- package/dist/{chunk-IEGTRCDI.js.map → chunk-NQENOT6L.js.map} +1 -1
- package/dist/{chunk-FM42KOAU.js → chunk-P7AFIKWG.js} +5 -3
- package/dist/chunk-P7AFIKWG.js.map +1 -0
- package/dist/{chunk-BCD2CRFG.js → chunk-PJNR4NTS.js} +2 -2
- package/dist/chunk-PJNR4NTS.js.map +1 -0
- package/dist/{chunk-ZFR6ZNXD.js → chunk-PVQ2KKPZ.js} +1 -1
- package/dist/chunk-PVQ2KKPZ.js.map +1 -0
- package/dist/{chunk-U4XTZMB7.js → chunk-QA3WETWT.js} +1 -1
- package/dist/{chunk-U4XTZMB7.js.map → chunk-QA3WETWT.js.map} +1 -1
- package/dist/{chunk-YXETEQQJ.js → chunk-SG2RKUVJ.js} +2 -2
- package/dist/{chunk-EOWV6BNQ.js → chunk-TXFX4PMN.js} +4 -2
- package/dist/{chunk-EOWV6BNQ.js.map → chunk-TXFX4PMN.js.map} +1 -1
- package/dist/{chunk-XWJDBQU7.js → chunk-V5RO6JYI.js} +1 -1
- package/dist/{chunk-SNSQLGGS.js.map → chunk-V5RO6JYI.js.map} +1 -1
- package/dist/chunk-VZ6ZALIJ.js +13 -0
- package/dist/chunk-VZ6ZALIJ.js.map +1 -0
- package/dist/{chunk-2DHL7NJW.js → chunk-XVRKKYWU.js} +5 -3
- package/dist/{chunk-2DHL7NJW.js.map → chunk-XVRKKYWU.js.map} +1 -1
- package/dist/{chunk-CDNOT2KR.js → chunk-YTYNKMNS.js} +1 -1
- package/dist/chunk-YTYNKMNS.js.map +1 -0
- package/dist/code-block.js.map +1 -1
- package/dist/combobox.js +2 -2
- package/dist/copy-button.js +2 -2
- package/dist/copy-button.js.map +1 -1
- package/dist/data-table.js +3 -3
- package/dist/desktop-window.d.ts +1 -1
- package/dist/desktop-window.js +3 -1
- package/dist/desktop-window.js.map +1 -1
- package/dist/drop-overlay.js +8 -8
- package/dist/drop-overlay.js.map +1 -1
- package/dist/elephant.d.ts +1 -1
- package/dist/elephant.js.map +1 -1
- package/dist/embed-facade.d.ts +1 -1
- package/dist/embed-facade.js +3 -1
- package/dist/embed-facade.js.map +1 -1
- package/dist/engine-flow.js +7 -2
- package/dist/engine-flow.js.map +1 -1
- package/dist/entity-header.js +9 -3
- package/dist/entity-header.js.map +1 -1
- package/dist/file-upload.d.ts +1 -1
- package/dist/file-upload.js.map +1 -1
- package/dist/filter-bar.d.ts +4 -4
- package/dist/filter-bar.js +2 -2
- package/dist/flock.js +9 -6
- package/dist/flock.js.map +1 -1
- package/dist/form.d.ts +3 -3
- package/dist/form.js.map +1 -1
- package/dist/genui.js +3 -3
- package/dist/glossary-term.d.ts +1 -1
- package/dist/glossary-term.js.map +1 -1
- package/dist/glossary.d.ts +1 -1
- package/dist/glossary.js.map +1 -1
- package/dist/identity-card.js +1 -1
- package/dist/index.js +1 -1
- package/dist/kind-config-editor.d.ts +2 -2
- package/dist/kind-config-editor.js +1 -1
- package/dist/kind-config-editor.js.map +1 -1
- package/dist/kpi-explained.d.ts +1 -1
- package/dist/kpi-explained.js +4 -4
- package/dist/kpi-explained.js.map +1 -1
- package/dist/landing-page.d.ts +10 -3
- package/dist/landing-page.js +8 -6
- package/dist/landing-page.js.map +1 -1
- package/dist/{lightbox-Q45BZ3HW.js → lightbox-MRB2YZEP.js} +1 -1
- package/dist/lightbox-MRB2YZEP.js.map +1 -0
- package/dist/map/cards.js +4 -2
- package/dist/map/cards.js.map +1 -1
- package/dist/map/pin.js +2 -1
- package/dist/map/pin.js.map +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js.map +1 -1
- package/dist/mascot-quote.js +1 -1
- package/dist/mascot-state.js +1 -1
- package/dist/mascots.js +1 -1
- package/dist/match-dialog.js +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js.map +1 -1
- package/dist/native/form.d.ts +3 -3
- package/dist/native/form.js.map +1 -1
- package/dist/native/markdown.d.ts +1 -1
- package/dist/native/markdown.js.map +1 -1
- package/dist/native/vertical-video.js.map +1 -1
- package/dist/native.d.ts +12 -12
- package/dist/native.js +12 -7
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.d.ts +2 -2
- package/dist/nav-bar.js +1 -1
- package/dist/nav-bar.js.map +1 -1
- package/dist/next-actions.d.ts +1 -1
- package/dist/next-actions.js.map +1 -1
- package/dist/notification-preferences.d.ts +1 -1
- package/dist/notification-preferences.js +5 -2
- package/dist/notification-preferences.js.map +1 -1
- package/dist/page-index.js +2 -2
- package/dist/page-index.js.map +1 -1
- package/dist/product-page.js +4 -4
- package/dist/product-page.js.map +1 -1
- package/dist/promo-code-field.d.ts +1 -1
- package/dist/promo-code-field.js.map +1 -1
- package/dist/qr-code.d.ts +1 -1
- package/dist/qr-code.js +1 -1
- package/dist/rail-nav.js +3 -3
- package/dist/rail-nav.js.map +1 -1
- package/dist/retro-tv.d.ts +1 -1
- package/dist/retro-tv.js.map +1 -1
- package/dist/reviews.d.ts +2 -2
- package/dist/reviews.js.map +1 -1
- package/dist/router.d.ts +1 -1
- package/dist/router.js +8 -8
- package/dist/router.js.map +1 -1
- package/dist/{schema-DgjBz7-8.d.ts → schema-Dd05m48Q.d.ts} +8 -8
- package/dist/service-card.js +22 -13
- package/dist/service-card.js.map +1 -1
- package/dist/settings-layout.js +1 -1
- package/dist/shop/booking.js.map +1 -1
- package/dist/shop/gallery.js +7 -6
- package/dist/shop/gallery.js.map +1 -1
- package/dist/shop/hero.js.map +1 -1
- package/dist/shop/look.d.ts +2 -2
- package/dist/shop/look.js +1 -1
- package/dist/shop/look.js.map +1 -1
- package/dist/shop/map-gate.d.ts +1 -1
- package/dist/shop/map-gate.js +2 -2
- package/dist/shop/map-gate.js.map +1 -1
- package/dist/shop/services.js.map +1 -1
- package/dist/shop-composer.d.ts +10 -10
- package/dist/shop-composer.js +27 -14
- package/dist/shop-composer.js.map +1 -1
- package/dist/shop-gallery.js +1 -1
- package/dist/shop.d.ts +2 -2
- package/dist/shop.js +2 -2
- package/dist/shop.js.map +1 -1
- package/dist/signature.js +2 -1
- package/dist/signature.js.map +1 -1
- package/dist/site-cahier.js +7 -3
- package/dist/site-cahier.js.map +1 -1
- package/dist/site-footer.js +6 -2
- package/dist/site-footer.js.map +1 -1
- package/dist/slot-picker.js +5 -2
- package/dist/slot-picker.js.map +1 -1
- package/dist/stat.js +1 -1
- package/dist/status-chip.d.ts +1 -1
- package/dist/status-chip.js.map +1 -1
- package/dist/tabs.js.map +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/tag-selector.js +1 -1
- package/dist/text-style.js +4 -3
- package/dist/text-style.js.map +1 -1
- package/dist/usage.js +8 -3
- package/dist/usage.js.map +1 -1
- package/dist/versus-card.js +1 -1
- package/dist/versus-card.js.map +1 -1
- package/dist/vertical-video.js +1 -1
- package/dist/vertical-video.js.map +1 -1
- package/dist/wall.d.ts +4 -4
- package/dist/wall.js +1 -1
- package/dist/wall.js.map +1 -1
- package/package.json +6 -6
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +2 -2
- package/registry/agenda.json +1 -1
- package/registry/analysis-report.json +2 -2
- package/registry/app-frame.json +3 -3
- package/registry/app-header.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +2 -2
- package/registry/bird-plate.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/copy-button.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/desktop-window.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/elephant.json +1 -1
- package/registry/embed-facade.json +2 -2
- package/registry/engine-flow.json +2 -2
- package/registry/entity-header.json +1 -1
- package/registry/examples/landing-page/showcase.d.ts +4 -0
- package/registry/examples/landing-page/showcase.js +45 -0
- package/registry/examples/landing-page/showcase.tsx +42 -0
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +2 -2
- package/registry/form.json +7 -7
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/index.json +19 -10
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +61 -21
- package/registry/map.json +4 -4
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +2 -2
- package/registry/nav-bar.json +4 -4
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +4 -0
- package/registry/product-page.json +1 -1
- package/registry/promo-code-field.json +1 -1
- package/registry/qr-code.json +2 -2
- package/registry/rail-nav.json +3 -3
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +7 -7
- package/registry/shop-gallery.json +1 -1
- package/registry/shop.json +11 -11
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +3 -3
- package/registry/slot-picker.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/usage.json +2 -2
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/wall.json +5 -5
- package/registry/waveform.json +2 -2
- package/dist/chunk-BCD2CRFG.js.map +0 -1
- package/dist/chunk-CDNOT2KR.js.map +0 -1
- package/dist/chunk-FM42KOAU.js.map +0 -1
- package/dist/chunk-MTVX4RRF.js.map +0 -1
- package/dist/chunk-UIP3WX5O.js.map +0 -1
- package/dist/chunk-ZFR6ZNXD.js.map +0 -1
- package/dist/lightbox-Q45BZ3HW.js.map +0 -1
- /package/dist/{chunk-YXETEQQJ.js.map → chunk-SG2RKUVJ.js.map} +0 -0
package/dist/site-footer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/site-footer/footer-config.ts","../src/site-footer/site-footer.tsx","../src/sites/family-groups.ts"],"sourcesContent":["// The footer as the admin configures it (krizaka-internal#591): the settings an app stores (`@krizaka/settings`, audited)\n// — words as message keys, so FR and EN come from the app's catalogues — and the resolved config `SiteFooter` draws.\n// Pure: no React, no fetch. The structure is the design rule (founder, 2026-11-01): a few short columns, then one legal\n// line that names the company once.\nimport type { SiteStatus } from \"../sites/sites\";\n\n/** At most four columns of at most six links: past that a footer is a sitemap, and nobody reads it. */\nexport const FOOTER_LIMITS = { columns: 4, links: 6, legalLinks: 4 } as const;\n\n/** A status said once, on a column's heading (never on each link). */\nexport type FooterStatus = Exclude<SiteStatus, \"released\">;\n\n/** A link, its words resolved. `external`: it leaves this site (a plain `<a>`, never the router). */\nexport type FooterLink = { label: string; href: string; external?: boolean };\n\n/** A column, its words resolved. */\nexport type FooterColumn = { id: string; title: string; status?: FooterStatus; links: readonly FooterLink[] };\n\n/** The legal line: who publishes the site, once — `legalName · NEQ … · city`, then the version and the legal links. */\nexport type FooterLegal = {\n legalName: string;\n /** The Québec enterprise number, shown as the publisher's legal identity (`NEQ 1182652231`). */\n neq?: string;\n city: string;\n showVersion: boolean;\n /** Where the version leads (the release's page), when it is a link. */\n versionHref?: string;\n links: readonly FooterLink[];\n};\n\n/** What `SiteFooter` draws from `config`: the columns, then the legal line and the socials. */\nexport type SiteFooterConfig = {\n /** The name of the columns' navigation (« Pied de page » / « Footer »). */\n label: string;\n columns: readonly FooterColumn[];\n legal: FooterLegal;\n social?: readonly { id: string; label: string; href: string }[];\n};\n\n/** A stored link: a message key (`labelKey`) or a proper noun the same in every language (`label`: « Verikora », « GitHub »). */\nexport type FooterLinkSetting = ({ labelKey: string; label?: never } | { label: string; labelKey?: never }) & {\n href: string;\n external?: boolean;\n};\n\n/** The footer as an app stores it in its settings. */\nexport type FooterSettings = {\n labelKey: string;\n columns: readonly { id: string; titleKey: string; status?: FooterStatus; links: readonly FooterLinkSetting[] }[];\n legal: { legalName: string; neq?: string; city: string; showVersion: boolean; versionHref?: string; links: readonly FooterLinkSetting[] };\n /** The ids of the org's social links (`@krizaka/org`) to show; their addresses are the org's, never typed here. */\n social?: readonly string[];\n};\n\n/** A social link of the org (`@krizaka/org` `links.social`). */\nexport type OrgSocialLink = { id: string; label: string; url: string };\n\nconst link = (l: FooterLinkSetting, t: (key: string) => string): FooterLink => ({\n label: l.labelKey === undefined ? l.label! : t(l.labelKey),\n href: l.href,\n ...(l.external ? { external: true } : {}),\n});\n\n/** The settings, their words read from the app's messages (`t`) and the socials from the org's list. */\nexport function resolveFooterSettings(\n settings: FooterSettings,\n t: (key: string) => string,\n social: readonly OrgSocialLink[] = [],\n): SiteFooterConfig {\n const shown = (settings.social ?? []).flatMap((id) => social.filter((s) => s.id === id));\n return {\n label: t(settings.labelKey),\n columns: settings.columns.map((c) => ({\n id: c.id,\n title: t(c.titleKey),\n ...(c.status ? { status: c.status } : {}),\n links: c.links.map((l) => link(l, t)),\n })),\n legal: { ...settings.legal, links: settings.legal.links.map((l) => link(l, t)) },\n ...(shown.length > 0 ? { social: shown.map((s) => ({ id: s.id, label: s.label, href: s.url })) } : {}),\n };\n}\n\n/**\n * What is wrong with a footer's settings — the admin's form refuses to save while the list is not empty: too many\n * columns or links, a link twice, an empty column, an `http:` or a development address, a malformed NEQ.\n */\nexport function footerSettingsProblems(settings: FooterSettings): string[] {\n return [...limitProblems(settings), ...linkProblems(settings), ...legalProblems(settings)];\n}\n\nfunction limitProblems(settings: FooterSettings): string[] {\n const problems: string[] = [];\n if (settings.columns.length > FOOTER_LIMITS.columns) problems.push(`at most ${FOOTER_LIMITS.columns} columns`);\n if (settings.legal.links.length > FOOTER_LIMITS.legalLinks) problems.push(`at most ${FOOTER_LIMITS.legalLinks} legal links`);\n for (const c of settings.columns) {\n if (c.links.length === 0) problems.push(`column ${c.id}: no link`);\n if (c.links.length > FOOTER_LIMITS.links) problems.push(`column ${c.id}: at most ${FOOTER_LIMITS.links} links`);\n }\n return problems;\n}\n\nfunction hrefProblems(where: string, l: { href: string; external?: boolean }): string[] {\n const problems: string[] = [];\n if (/^http:/i.test(l.href)) problems.push(`${where}: ${l.href} is not https`);\n if (/^https?:\\/\\/dev\\./i.test(l.href)) problems.push(`${where}: ${l.href} is a development host`);\n if (l.external && !/^[a-z][a-z0-9+.-]*:/i.test(l.href)) problems.push(`${where}: ${l.href} is external but relative`);\n return problems;\n}\n\nfunction linkProblems(settings: FooterSettings): string[] {\n const problems: string[] = [];\n const seen = new Set<string>();\n const all = [...settings.columns.flatMap((c) => c.links.map((l) => ({ where: c.id, l }))), ...settings.legal.links.map((l) => ({ where: \"legal\", l }))];\n for (const { where, l } of all) {\n if (seen.has(l.href)) problems.push(`${where}: ${l.href} is already in the footer`);\n seen.add(l.href);\n problems.push(...hrefProblems(where, l));\n }\n return problems;\n}\n\nfunction legalProblems(settings: FooterSettings): string[] {\n const problems: string[] = [];\n if (settings.legal.neq !== undefined && !/^\\d{10}$/.test(settings.legal.neq)) problems.push(\"legal: the NEQ has ten digits\");\n if (settings.legal.legalName.trim() === \"\") problems.push(\"legal: the legal name is required\");\n return problems;\n}\n","// Client (the mark holds an id). The footer shared by every site and app of the Krizaka family — compact (founder,\n// 2026-10-30, krizaka/krizaka-internal#754: « des footers de 10 lignes »): at most three lines on a desktop —\n// 1. the site's own links, each group inline (`Docs Get started · Components`);\n// 2. the family, grouped inline (Products · Open source · Krizaka), names read from `org.family` of `@krizaka/org`;\n// 3. one line: the mark and the org's signature, the version, the legal links, the host's controls (language, theme).\n// On a phone the family's groups fold (`<details>`), the rest wraps. `variant=\"app\"` keeps line 3 only. Same structure on\n// the Cahier sites and the products (`tone`). No link twice, no site block, no names typed here when `org` is given.\nimport { InstagramIcon, YoutubeIcon } from \"@krizaka/icons\";\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\n// ProductLogo, not KrizakaLogo: one import path keeps every mark in one shared chunk (KrizakaLogo alone split it: +871 B gzip on the typical page).\nimport type { LinkComponent } from \"../block-link\";\nimport { ProductLogo } from \"../marks/ProductLogo\";\nimport { columnStatus, familyGroups, orgIdOf } from \"../sites/family-groups\";\nimport { companyLinks, type FamilyLabels, familyLabels, type OrgFacts, siteById, type SiteId, type SiteStatus } from \"../sites/sites\";\nimport type { FooterLink, SiteFooterConfig } from \"./footer-config\";\n\nexport const siteFooter = tv({\n slots: {\n root: \"w-full border-t border-border-subtle bg-surface-0 text-fg\",\n inner:\n \"mx-auto grid w-full max-w-[calc(var(--kz-page-max,72rem)_+_2*var(--kz-page-gutter,clamp(16px,3.2vw,32px)))] grid-cols-[minmax(0,1fr)] gap-3 px-[var(--kz-page-gutter,clamp(16px,3.2vw,32px))] py-6\",\n row: \"flex min-w-0 flex-wrap items-baseline gap-x-6 gap-y-2\",\n family: \"grid min-w-0 grid-cols-[minmax(0,1fr)] gap-1 lg:flex lg:flex-wrap lg:items-baseline lg:gap-x-6 lg:gap-y-2\",\n group:\n \"group/fold min-w-0 lg:[&::details-content]:[content-visibility:visible] lg:[&::details-content]:contents lg:[&>summary]:pointer-events-none lg:inline-flex lg:items-baseline lg:gap-2\",\n summary:\n \"flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md text-xs font-semibold text-fg-secondary [&::-webkit-details-marker]:hidden \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring lg:inline lg:min-h-0 lg:cursor-default\",\n chevron: \"size-4 shrink-0 transition-transform group-open/fold:rotate-180 motion-reduce:transition-none lg:hidden\",\n column: \"inline-flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1\",\n title: \"text-xs font-semibold text-fg-secondary\",\n note: \"font-normal\",\n list: \"flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1 pb-2 lg:pb-0\",\n link:\n \"inline-flex min-h-6 min-w-0 items-center rounded-md text-sm [overflow-wrap:anywhere] text-fg-secondary no-underline transition-colors hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-fg aria-[current=page]:font-semibold aria-[current=true]:text-fg aria-[current=true]:font-semibold\",\n bottom: \"flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-secondary\",\n signature:\n \"inline-flex items-center gap-2 rounded-md font-medium text-fg no-underline hover:text-fg-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n version:\n \"rounded-sm border border-border-subtle bg-surface-2 px-2 py-0.5 font-mono text-[11px] text-fg-secondary\",\n legal: \"flex flex-wrap items-center gap-x-4 gap-y-2\",\n controls: \"flex flex-wrap items-center gap-2 sm:ml-auto\",\n // `config`: real columns — two on a phone, side by side from `sm`, each a heading over a stacked list.\n columns: \"grid min-w-0 grid-cols-2 gap-x-6 gap-y-6 pb-2 sm:grid-flow-col sm:grid-cols-none sm:auto-cols-[minmax(0,13rem)] sm:gap-x-10\",\n stack: \"flex min-w-0 flex-col gap-2\",\n stackList: \"flex min-w-0 flex-col gap-1\",\n identity: \"text-fg-secondary\",\n // The accounts drawn as their icon (the name stays for screen readers): colour change only on hover, never movement.\n socials: \"flex flex-wrap items-center gap-x-3 gap-y-2\",\n social:\n \"inline-flex min-h-6 min-w-6 items-center justify-center rounded-md text-fg-secondary no-underline transition-colors hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n variants: {\n // `site`: the three lines. `docs`: the same on the documentation's width. `app`: line 3 only, inside a signed-in product.\n variant: {\n site: {},\n docs: {\n inner: \"max-w-[calc(var(--kz-page-max-docs,88rem)_+_2*var(--kz-page-gutter,clamp(16px,3.2vw,32px)))]\",\n },\n app: {\n root: \"bg-transparent\",\n inner: \"py-3\",\n },\n },\n // `product`: the products' plain Krizaka UI. `cahier`: the Cahier sites (www, blog, ui., java., ts., lab.) — the\n // headings in the Cahier's hand; the structure is the same.\n tone: {\n product: {},\n cahier: {\n title: \"font-[family-name:var(--kz-font-display,inherit)] italic\",\n summary: \"font-[family-name:var(--kz-font-display,inherit)] italic\",\n },\n },\n },\n defaultVariants: { variant: \"site\", tone: \"product\" },\n});\n\nconst bare = (p: string) => p.replace(/^\\/(en|fr)(?=\\/|$)/, \"\").replace(/\\/+$/, \"\") || \"/\";\n\n/** Is `href` (an absolute family address) the page `path` of the site at `siteUrl`? Locale prefix and trailing slash do not count. */\nfunction isThisPage(href: string, siteUrl: string, path: string): boolean {\n try {\n const target = new URL(href);\n return target.host === new URL(siteUrl).host && bare(target.pathname) === bare(path.split(/[?#]/)[0]!);\n } catch {\n return false;\n }\n}\n\n/** The link to the page you are on: no reload, back to the top (the browser would otherwise keep or restore the scroll). */\nfunction backToTop(event: React.MouseEvent<HTMLAnchorElement>) {\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0) return;\n event.preventDefault();\n window.scrollTo({ top: 0, behavior: \"auto\" });\n}\n\ntype Tone = \"product\" | \"cahier\";\nconst ToneContext = React.createContext<Tone>(\"product\");\n\nexport type SiteFooterProps = Omit<React.ComponentProps<\"footer\">, \"children\"> & {\n /** The site this footer belongs to (`@krizaka/ui/sites`): marked in the family, its address for `path`. */\n current: SiteId;\n /**\n * The family's words, passed translated: `familyLabels.fr` from `@krizaka/ui/sites`, or your own of the same shape.\n * @default familyLabels.en\n */\n labels?: FamilyLabels;\n /** The site's own link groups (`SiteFooter.Column`), on the first line. */\n children?: React.ReactNode;\n /** The version the site runs (`1.2.3`, shown `v1.2.3`). */\n version?: string;\n /** The environment, when it is not production (`DEV`). */\n env?: string;\n /**\n * The path of the page being read on this site (`/en/story`, `/blog/…`): the company link that points to this very\n * page says so (`aria-current=\"page\"`) and a click on it scrolls to the top instead of reloading.\n */\n path?: string;\n /**\n * Shows the family on the second line, folded on a phone. The links to the other sites live on krizaka.com only\n * (founder rule, 2026-10-30): every other site and its documentation opts in on purpose, none by default.\n * @default current === \"krizaka\" (and never in `variant=\"app\"`)\n */\n family?: boolean;\n /** Only these products in the Products group (the current site always kept). Omit it to list every product. */\n products?: readonly SiteId[];\n /**\n * The organisation's public facts (`org` of `@krizaka/org`) — pass them on every site. The names and addresses of the\n * family are then `org.family`, the signature is `org.footer.line` (« Une entreprise de Technologies Krizaka · Fait à\n * Montréal », the same everywhere) and, without `legal`, the legal links are `org.footer.legal`.\n */\n org?: OrgFacts;\n /** The legal links, when not the org's (`SiteFooter.Link`s). */\n legal?: React.ReactNode;\n /** The host's controls at the end of the last line: the language switch, the theme toggle. */\n controls?: React.ReactNode;\n /**\n * `site` — every public site. `docs` — the same under documentation, on its width. `app` — inside a signed-in product:\n * the last line only; render it once, in the layout.\n * @default \"site\"\n */\n variant?: \"site\" | \"docs\" | \"app\";\n /** `cahier` on the Cahier sites (www, blog, ui., java., ts., lab.), `product` in the products. @default \"product\" */\n tone?: Tone;\n /**\n * The footer as the admin configured it (`resolveFooterSettings` of the app's settings): its columns, then one legal\n * line — `legalName · NEQ … · city`, the version when `showVersion`, the legal links, the socials. With it the family\n * is not drawn (the columns hold what the site wants) and the org's signature gives way to the legal identity.\n */\n config?: SiteFooterConfig;\n /** The app's router link for the config's internal links (Next's `Link`). @default \"a\" */\n linkAs?: LinkComponent;\n};\n\nconst NO_STATUS = { shared: null, exceptions: new Map<string, Exclude<SiteStatus, \"released\">>() } as const;\n\n/** The footer of a Krizaka site or app: at most three lines — its links, the family, then signature · version · legal. */\nexport function SiteFooter({\n current,\n labels = familyLabels.en,\n children,\n version,\n env,\n path,\n legal: legalProp,\n controls,\n org,\n family: familyProp,\n products,\n variant = \"site\",\n tone = \"product\",\n config,\n linkAs,\n className,\n ...props\n}: SiteFooterProps) {\n const id = React.useId();\n const s = siteFooter({ variant, tone });\n const slim = variant === \"app\";\n const family = !slim && (familyProp ?? (current === \"krizaka\" && !config));\n const site = siteById(current);\n const krizaka = siteById(\"krizaka\");\n const currentId = orgIdOf(current);\n const tag = [env, version && `v${version.replace(/^v/, \"\")}`].filter(Boolean).join(\" · \");\n const own = !slim && React.Children.toArray(children).length > 0;\n const lang = labels.lang ?? \"en\";\n const company = labels.company ?? familyLabels.en.company!;\n const legal =\n legalProp ??\n (org && (\n <>\n {org.footer.legal.map((l) => (\n <SiteFooterLink key={l.id} href={l.url[lang]}>\n {l.label[lang]}\n </SiteFooterLink>\n ))}\n </>\n ));\n const here = (href: string) => path !== undefined && isThisPage(href, site.url, path);\n const productIds = products?.map(orgIdOf);\n // Products · Open source (GitHub closes it) · Krizaka (the company's pages; its home is the signature's link).\n const groups = familyGroups(org);\n const columns = [\n ...groups\n .filter((g) => g.group === \"products\")\n .map((g) => ({ ...g, entries: productIds ? g.entries.filter((e) => productIds.includes(e.id) || e.id === currentId) : g.entries })),\n { group: \"open-source\" as const, entries: groups.filter((g) => g.group === \"open-source\" || g.group === \"github\").flatMap((g) => g.entries) },\n ];\n const companyEntries = companyLinks.map((l) => ({ id: l.id, name: company[l.id], url: l.url[lang] }));\n return (\n <ToneContext.Provider value={tone}>\n <footer className={s.root({ className })} {...props}>\n <div className={s.inner()}>\n {own && <div className={s.row()}>{children}</div>}\n {config && !slim && <ConfigColumns s={s} config={config} id={id} labels={labels} linkAs={linkAs} path={path} />}\n {family && (\n <nav aria-label={labels.family} className={s.family()}>\n {[\n ...columns.map((c) => ({ key: c.group, title: labels.groups[c.group], entries: c.entries, ...columnStatus(c.entries) })),\n { key: \"krizaka\" as const, title: labels.groups.krizaka, entries: companyEntries, ...NO_STATUS },\n ]\n .filter((c) => c.entries.length > 0)\n .map((c) => (\n <details key={c.key} className={s.group()}>\n <summary className={s.summary()}>\n <span>\n <span id={`${id}-${c.key}`}>{c.title}</span>\n {c.shared && (\n <span className={s.note()}>\n <span aria-hidden=\"true\"> · </span>\n {labels.status[c.shared]}\n </span>\n )}\n </span>\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" className={s.chevron()}>\n <path d=\"M4 6l4 4 4-4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </summary>\n <ul aria-labelledby={`${id}-${c.key}`} className={s.list()}>\n {c.entries.map((e) => {\n const isCompany = c.key === \"krizaka\";\n const atHome = isCompany && here(e.url);\n const exception = c.exceptions.get(e.id);\n const isCurrent = !isCompany && e.id === currentId;\n return (\n <li key={e.id}>\n <a\n href={e.url}\n aria-current={atHome ? \"page\" : isCurrent ? \"true\" : undefined}\n onClick={atHome ? backToTop : undefined}\n className={s.link()}\n >\n {e.name}\n {exception && <span className={s.note()}> ({labels.status[exception]})</span>}\n {isCurrent && <span className=\"sr-only\"> ({labels.current})</span>}\n </a>\n </li>\n );\n })}\n </ul>\n </details>\n ))}\n </nav>\n )}\n {config ? (\n <ConfigBottom s={s} config={config} krizaka={krizaka.url} brand={org?.brand.name ?? \"Krizaka\"} tag={tag} env={env} versionLabel={labels.version} linkAs={linkAs} path={path} controls={controls} />\n ) : (\n <div className={s.bottom()}>\n <a href={krizaka.url} className={s.signature()}>\n <ProductLogo id=\"krizaka\" size={18} animated={false} />\n {org ? org.footer.line[lang] : `${labels.signature[site.kind]} · ${labels.place}`}\n </a>\n {tag && (\n <span className={s.version()}>\n <span className=\"sr-only\">{labels.version} </span>\n {tag}\n </span>\n )}\n {legal && <div className={s.legal()}>{legal}</div>}\n <FooterSocials s={s} links={(org?.links?.social ?? []).map((x) => ({ id: x.id, label: x.label, href: x.url }))} />\n {controls && <div className={s.controls()}>{controls}</div>}\n </div>\n )}\n </div>\n </footer>\n </ToneContext.Provider>\n );\n}\n\nconst isCurrent = (l: FooterLink, path?: string) => path !== undefined && !l.external && bare(l.href.split(/[?#]/)[0]!) === bare(path.split(/[?#]/)[0]!);\n\n/** The configured bottom line: the mark beside the legal identity, the version, the legal links and the socials. */\nfunction ConfigBottom({\n s,\n config,\n krizaka,\n brand,\n tag,\n env,\n versionLabel,\n linkAs,\n path,\n controls,\n}: Readonly<{\n s: ReturnType<typeof siteFooter>;\n config: SiteFooterConfig;\n krizaka: string;\n brand: string;\n tag: string;\n env?: string;\n versionLabel: string;\n linkAs?: LinkComponent;\n path?: string;\n controls?: React.ReactNode;\n}>) {\n const { legal, social } = config;\n const configured = (l: FooterLink) => <ConfigLink key={l.href} link={l} linkAs={linkAs} current={isCurrent(l, path)} />;\n const shown = legal.showVersion ? tag : env;\n const identity = [legal.legalName, legal.neq && `NEQ ${legal.neq}`, legal.city].filter(Boolean).join(\" · \");\n const versionText = (\n <>\n <span className=\"sr-only\">{versionLabel} </span>\n {shown}\n </>\n );\n return (\n <div className={s.bottom()}>\n {/* The company named once: its mark (home) beside its legal identity — never a second « by Technologies Krizaka ». */}\n <a href={krizaka} className={s.signature()} aria-label={brand}>\n <ProductLogo id=\"krizaka\" size={18} animated={false} />\n </a>\n <span className={s.identity()}>{identity}</span>\n {shown &&\n (legal.showVersion && legal.versionHref ? (\n <a href={legal.versionHref} className={s.version({ className: \"no-underline hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\" })}>\n {versionText}\n </a>\n ) : (\n <span className={s.version()}>{versionText}</span>\n ))}\n {legal.links.length > 0 && <div className={s.legal()}>{legal.links.map(configured)}</div>}\n <FooterSocials s={s} links={social ?? []} />\n {controls && <div className={s.controls()}>{controls}</div>}\n </div>\n );\n}\n\n/** Icons of the accounts a glyph exists for; any other account stays a text link. */\nconst SOCIAL_ICONS: Readonly<Partial<Record<string, typeof InstagramIcon>>> = { instagram: InstagramIcon, youtube: YoutubeIcon };\n\n/** The company's accounts: each is its icon (decorative) in a link named by the account, opening in a new tab. */\nfunction FooterSocials({ s, links }: Readonly<{ s: ReturnType<typeof siteFooter>; links: readonly { id: string; label: string; href: string }[] }>) {\n if (links.length === 0) return null;\n return (\n <div className={s.socials()}>\n {links.map((x) => {\n const Icon = SOCIAL_ICONS[x.id];\n return (\n <a key={x.id} href={x.href} target=\"_blank\" rel=\"noopener noreferrer\" className={Icon ? s.social() : s.link()}>\n {Icon && <Icon size={20} />}\n {Icon ? <span className=\"sr-only\">{x.label}</span> : x.label}\n </a>\n );\n })}\n </div>\n );\n}\n\n/** The admin-configured columns: a title (and status) over a list of links. */\nfunction ConfigColumns({\n s,\n config,\n id,\n labels,\n linkAs,\n path,\n}: Readonly<{ s: ReturnType<typeof siteFooter>; config: SiteFooterConfig; id: string; labels: FamilyLabels; linkAs?: LinkComponent; path?: string }>) {\n if (config.columns.length === 0) return null;\n return (\n <nav aria-label={config.label} className={s.columns()}>\n {config.columns.map((c) => (\n <div key={c.id} className={s.stack()}>\n <p id={`${id}-c-${c.id}`} className={s.title()}>\n {c.title}\n {c.status && (\n <span className={s.note()}>\n <span aria-hidden=\"true\"> · </span>\n {labels.status[c.status]}\n </span>\n )}\n </p>\n <ul aria-labelledby={`${id}-c-${c.id}`} className={s.stackList()}>\n {c.links.map((l) => (\n <li key={l.href}>\n <ConfigLink link={l} linkAs={linkAs} current={isCurrent(l, path)} />\n </li>\n ))}\n </ul>\n </div>\n ))}\n </nav>\n );\n}\n\n/** A configured link: the router's link inside the site, a plain `<a>` when it leaves it. */\nfunction ConfigLink({ link, linkAs, current }: Readonly<{ link: FooterLink; linkAs?: LinkComponent; current: boolean }>) {\n const s = siteFooter();\n const Comp = (link.external || !linkAs ? \"a\" : linkAs) as React.ElementType;\n return (\n <Comp href={link.href} className={s.link()} aria-current={current ? \"page\" : undefined}>\n {link.label}\n </Comp>\n );\n}\n\nexport type SiteFooterColumnProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The group's heading (“Docs”) — passed translated. */\n title: string;\n /** Its links (`SiteFooter.Link`). */\n children: React.ReactNode;\n};\n\n/** One of the site's own link groups, inline on the first line: its heading, then its links. */\nexport function SiteFooterColumn({ title, children, className, ...props }: SiteFooterColumnProps) {\n const id = React.useId();\n const tone = React.useContext(ToneContext);\n // A group with no link is not a group: only a heading over nothing.\n if (React.Children.toArray(children).length === 0) return null;\n const s = siteFooter({ tone });\n return (\n <div className={s.column({ className })} {...props}>\n <p id={id} className={s.title()}>\n {title}\n </p>\n <ul aria-labelledby={id} className={s.list({ className: \"pb-0\" })}>\n {React.Children.toArray(children).map((child, i) => <li key={i}>{child}</li>)}\n </ul>\n </div>\n );\n}\n\nexport type SiteFooterLinkProps = React.ComponentProps<\"a\"> & {\n /** The current page: `aria-current=\"page\"`. */\n active?: boolean;\n /** Renders your router's `<Link>`. */\n asChild?: boolean;\n};\n\n/** A link of the footer. */\nexport function SiteFooterLink({ active, asChild, className, ...props }: SiteFooterLinkProps) {\n const s = siteFooter();\n const Comp = asChild ? Slot.Root : \"a\";\n return <Comp aria-current={active ? \"page\" : undefined} className={s.link({ className })} {...props} />;\n}\n\nSiteFooter.Column = SiteFooterColumn;\nSiteFooter.Link = SiteFooterLink;\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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AE,QAAQ,SAAS,WAAW,GAAG,MAAM,GAAwB;AAC5F,QAAM,IAAI,WAAW;AACrB,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SAAO,oBAAC,QAAK,gBAAc,SAAS,SAAS,QAAW,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AACvG;AAEA,WAAW,SAAS;AACpB,WAAW,OAAO;","names":["isCurrent","link"]}
|
|
1
|
+
{"version":3,"sources":["../src/site-footer/footer-config.ts","../src/site-footer/site-footer.tsx","../src/sites/family-groups.ts"],"sourcesContent":["// The footer as the admin configures it (krizaka-internal#591): the settings an app stores (`@krizaka/settings`, audited)\n// — words as message keys, so FR and EN come from the app's catalogues — and the resolved config `SiteFooter` draws.\n// Pure: no React, no fetch. The structure is the design rule (founder, 2026-11-01): a few short columns, then one legal\n// line that names the company once.\nimport type { SiteStatus } from \"../sites/sites\";\n\n/** At most four columns of at most six links: past that a footer is a sitemap, and nobody reads it. */\nexport const FOOTER_LIMITS = { columns: 4, links: 6, legalLinks: 4 } as const;\n\n/** A status said once, on a column's heading (never on each link). */\nexport type FooterStatus = Exclude<SiteStatus, \"released\">;\n\n/** A link, its words resolved. `external`: it leaves this site (a plain `<a>`, never the router). */\nexport type FooterLink = { label: string; href: string; external?: boolean };\n\n/** A column, its words resolved. */\nexport type FooterColumn = { id: string; title: string; status?: FooterStatus; links: readonly FooterLink[] };\n\n/** The legal line: who publishes the site, once — `legalName · NEQ … · city`, then the version and the legal links. */\nexport type FooterLegal = {\n legalName: string;\n /** The Québec enterprise number, shown as the publisher's legal identity (`NEQ 1182652231`). */\n neq?: string;\n city: string;\n showVersion: boolean;\n /** Where the version leads (the release's page), when it is a link. */\n versionHref?: string;\n links: readonly FooterLink[];\n};\n\n/** What `SiteFooter` draws from `config`: the columns, then the legal line and the socials. */\nexport type SiteFooterConfig = {\n /** The name of the columns' navigation (« Pied de page » / « Footer »). */\n label: string;\n columns: readonly FooterColumn[];\n legal: FooterLegal;\n social?: readonly { id: string; label: string; href: string }[];\n};\n\n/** A stored link: a message key (`labelKey`) or a proper noun the same in every language (`label`: « Verikora », « GitHub »). */\nexport type FooterLinkSetting = ({ labelKey: string; label?: never } | { label: string; labelKey?: never }) & {\n href: string;\n external?: boolean;\n};\n\n/** The footer as an app stores it in its settings. */\nexport type FooterSettings = {\n labelKey: string;\n columns: readonly { id: string; titleKey: string; status?: FooterStatus; links: readonly FooterLinkSetting[] }[];\n legal: { legalName: string; neq?: string; city: string; showVersion: boolean; versionHref?: string; links: readonly FooterLinkSetting[] };\n /** The ids of the org's social links (`@krizaka/org`) to show; their addresses are the org's, never typed here. */\n social?: readonly string[];\n};\n\n/** A social link of the org (`@krizaka/org` `links.social`). */\nexport type OrgSocialLink = { id: string; label: string; url: string };\n\nconst link = (l: FooterLinkSetting, t: (key: string) => string): FooterLink => ({\n label: l.labelKey === undefined ? l.label! : t(l.labelKey),\n href: l.href,\n ...(l.external ? { external: true } : {}),\n});\n\n/** The settings, their words read from the app's messages (`t`) and the socials from the org's list. */\nexport function resolveFooterSettings(\n settings: FooterSettings,\n t: (key: string) => string,\n social: readonly OrgSocialLink[] = [],\n): SiteFooterConfig {\n const shown = (settings.social ?? []).flatMap((id) => social.filter((s) => s.id === id));\n return {\n label: t(settings.labelKey),\n columns: settings.columns.map((c) => ({\n id: c.id,\n title: t(c.titleKey),\n ...(c.status ? { status: c.status } : {}),\n links: c.links.map((l) => link(l, t)),\n })),\n legal: { ...settings.legal, links: settings.legal.links.map((l) => link(l, t)) },\n ...(shown.length > 0 ? { social: shown.map((s) => ({ id: s.id, label: s.label, href: s.url })) } : {}),\n };\n}\n\n/**\n * What is wrong with a footer's settings — the admin's form refuses to save while the list is not empty: too many\n * columns or links, a link twice, an empty column, an `http:` or a development address, a malformed NEQ.\n */\nexport function footerSettingsProblems(settings: FooterSettings): string[] {\n return [...limitProblems(settings), ...linkProblems(settings), ...legalProblems(settings)];\n}\n\nfunction limitProblems(settings: FooterSettings): string[] {\n const problems: string[] = [];\n if (settings.columns.length > FOOTER_LIMITS.columns) problems.push(`at most ${FOOTER_LIMITS.columns} columns`);\n if (settings.legal.links.length > FOOTER_LIMITS.legalLinks) problems.push(`at most ${FOOTER_LIMITS.legalLinks} legal links`);\n for (const c of settings.columns) {\n if (c.links.length === 0) problems.push(`column ${c.id}: no link`);\n if (c.links.length > FOOTER_LIMITS.links) problems.push(`column ${c.id}: at most ${FOOTER_LIMITS.links} links`);\n }\n return problems;\n}\n\nfunction hrefProblems(where: string, l: { href: string; external?: boolean }): string[] {\n const problems: string[] = [];\n if (/^http:/i.test(l.href)) problems.push(`${where}: ${l.href} is not https`);\n if (/^https?:\\/\\/dev\\./i.test(l.href)) problems.push(`${where}: ${l.href} is a development host`);\n if (l.external && !/^[a-z][a-z0-9+.-]*:/i.test(l.href)) problems.push(`${where}: ${l.href} is external but relative`);\n return problems;\n}\n\nfunction linkProblems(settings: FooterSettings): string[] {\n const problems: string[] = [];\n const seen = new Set<string>();\n const all = [...settings.columns.flatMap((c) => c.links.map((l) => ({ where: c.id, l }))), ...settings.legal.links.map((l) => ({ where: \"legal\", l }))];\n for (const { where, l } of all) {\n if (seen.has(l.href)) problems.push(`${where}: ${l.href} is already in the footer`);\n seen.add(l.href);\n problems.push(...hrefProblems(where, l));\n }\n return problems;\n}\n\nfunction legalProblems(settings: FooterSettings): string[] {\n const problems: string[] = [];\n if (settings.legal.neq !== undefined && !/^\\d{10}$/.test(settings.legal.neq)) problems.push(\"legal: the NEQ has ten digits\");\n if (settings.legal.legalName.trim() === \"\") problems.push(\"legal: the legal name is required\");\n return problems;\n}\n","// Client (the mark holds an id). The footer shared by every site and app of the Krizaka family — compact (founder,\n// 2026-10-30, krizaka/krizaka-internal#754: « des footers de 10 lignes »): at most three lines on a desktop —\n// 1. the site's own links, each group inline (`Docs Get started · Components`);\n// 2. the family, grouped inline (Products · Open source · Krizaka), names read from `org.family` of `@krizaka/org`;\n// 3. one line: the mark and the org's signature, the version, the legal links, the host's controls (language, theme).\n// On a phone the family's groups fold (`<details>`), the rest wraps. `variant=\"app\"` keeps line 3 only. Same structure on\n// the Cahier sites and the products (`tone`). No link twice, no site block, no names typed here when `org` is given.\nimport { InstagramIcon, YoutubeIcon } from \"@krizaka/icons\";\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\n// ProductLogo, not KrizakaLogo: one import path keeps every mark in one shared chunk (KrizakaLogo alone split it: +871 B gzip on the typical page).\nimport type { LinkComponent } from \"../block-link\";\nimport { ProductLogo } from \"../marks/ProductLogo\";\nimport { columnStatus, familyGroups, orgIdOf } from \"../sites/family-groups\";\nimport { companyLinks, type FamilyLabels, familyLabels, type OrgFacts, siteById, type SiteId, type SiteStatus } from \"../sites/sites\";\nimport type { FooterLink, SiteFooterConfig } from \"./footer-config\";\n\nexport const siteFooter = tv({\n slots: {\n root: \"w-full border-t border-border-subtle bg-surface-0 text-fg\",\n inner:\n \"mx-auto grid w-full max-w-[calc(var(--kz-page-max,72rem)_+_2*var(--kz-page-gutter,clamp(16px,3.2vw,32px)))] grid-cols-[minmax(0,1fr)] gap-3 px-[var(--kz-page-gutter,clamp(16px,3.2vw,32px))] py-6\",\n row: \"flex min-w-0 flex-wrap items-baseline gap-x-6 gap-y-2\",\n family: \"grid min-w-0 grid-cols-[minmax(0,1fr)] gap-1 lg:flex lg:flex-wrap lg:items-baseline lg:gap-x-6 lg:gap-y-2\",\n group:\n \"group/fold min-w-0 lg:[&::details-content]:[content-visibility:visible] lg:[&::details-content]:contents lg:[&>summary]:pointer-events-none lg:inline-flex lg:items-baseline lg:gap-2\",\n summary:\n \"flex min-h-11 cursor-pointer list-none items-center justify-between rounded-md text-xs font-semibold text-fg-secondary [&::-webkit-details-marker]:hidden \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring lg:inline lg:min-h-0 lg:cursor-default\",\n chevron: \"size-4 shrink-0 transition-transform group-open/fold:rotate-180 motion-reduce:transition-none lg:hidden\",\n column: \"inline-flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1\",\n title: \"text-xs font-semibold text-fg-secondary\",\n note: \"font-normal\",\n list: \"flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1 pb-2 lg:pb-0\",\n link:\n \"inline-flex min-h-6 min-w-0 items-center rounded-md text-sm [overflow-wrap:anywhere] text-fg-secondary no-underline transition-colors hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-[current=page]:text-fg aria-[current=page]:font-semibold aria-[current=true]:text-fg aria-[current=true]:font-semibold\",\n bottom: \"flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-secondary\",\n signature:\n \"inline-flex items-center gap-2 rounded-md font-medium text-fg no-underline hover:text-fg-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n version:\n \"rounded-sm border border-border-subtle bg-surface-2 px-2 py-0.5 font-mono text-[11px] text-fg-secondary\",\n legal: \"flex flex-wrap items-center gap-x-4 gap-y-2\",\n controls: \"flex flex-wrap items-center gap-2 sm:ml-auto\",\n // `config`: real columns — two on a phone, side by side from `sm`, each a heading over a stacked list.\n columns: \"grid min-w-0 grid-cols-2 gap-x-6 gap-y-6 pb-2 sm:grid-flow-col sm:grid-cols-none sm:auto-cols-[minmax(0,13rem)] sm:gap-x-10\",\n stack: \"flex min-w-0 flex-col gap-2\",\n stackList: \"flex min-w-0 flex-col gap-1\",\n identity: \"text-fg-secondary\",\n // The accounts drawn as their icon (the name stays for screen readers): colour change only on hover, never movement.\n socials: \"flex flex-wrap items-center gap-x-3 gap-y-2\",\n social:\n \"inline-flex min-h-6 min-w-6 items-center justify-center rounded-md text-fg-secondary no-underline transition-colors hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n variants: {\n // `site`: the three lines. `docs`: the same on the documentation's width. `app`: line 3 only, inside a signed-in product.\n variant: {\n site: {},\n docs: {\n inner: \"max-w-[calc(var(--kz-page-max-docs,88rem)_+_2*var(--kz-page-gutter,clamp(16px,3.2vw,32px)))]\",\n },\n app: {\n root: \"bg-transparent\",\n inner: \"py-3\",\n },\n },\n // `product`: the products' plain Krizaka UI. `cahier`: the Cahier sites (www, blog, ui., java., ts., lab.) — the\n // headings in the Cahier's hand; the structure is the same.\n tone: {\n product: {},\n cahier: {\n title: \"font-[family-name:var(--kz-font-display,inherit)] italic\",\n summary: \"font-[family-name:var(--kz-font-display,inherit)] italic\",\n },\n },\n },\n defaultVariants: { variant: \"site\", tone: \"product\" },\n});\n\nconst bare = (p: string) => p.replace(/^\\/(en|fr)(?=\\/|$)/, \"\").replace(/\\/+$/, \"\") || \"/\";\n\n/** Is `href` (an absolute family address) the page `path` of the site at `siteUrl`? Locale prefix and trailing slash do not count. */\nfunction isThisPage(href: string, siteUrl: string, path: string): boolean {\n try {\n const target = new URL(href);\n return target.host === new URL(siteUrl).host && bare(target.pathname) === bare(path.split(/[?#]/)[0]!);\n } catch {\n return false;\n }\n}\n\n/** The link to the page you are on: no reload, back to the top (the browser would otherwise keep or restore the scroll). */\nfunction backToTop(event: React.MouseEvent<HTMLAnchorElement>) {\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0) return;\n event.preventDefault();\n window.scrollTo({ top: 0, behavior: \"auto\" });\n}\n\ntype Tone = \"product\" | \"cahier\";\nconst ToneContext = React.createContext<Tone>(\"product\");\n\nexport type SiteFooterProps = Omit<React.ComponentProps<\"footer\">, \"children\"> & {\n /** The site this footer belongs to (`@krizaka/ui/sites`): marked in the family, its address for `path`. */\n current: SiteId;\n /**\n * The family's words, passed translated: `familyLabels.fr` from `@krizaka/ui/sites`, or your own of the same shape.\n * @default familyLabels.en\n */\n labels?: FamilyLabels;\n /** The site's own link groups (`SiteFooter.Column`), on the first line. */\n children?: React.ReactNode;\n /** The version the site runs (`1.2.3`, shown `v1.2.3`). */\n version?: string;\n /** The environment, when it is not production (`DEV`). */\n env?: string;\n /**\n * The path of the page being read on this site (`/en/story`, `/blog/…`): the company link that points to this very\n * page says so (`aria-current=\"page\"`) and a click on it scrolls to the top instead of reloading.\n */\n path?: string;\n /**\n * Shows the family on the second line, folded on a phone. The links to the other sites live on krizaka.com only\n * (founder rule, 2026-10-30): every other site and its documentation opts in on purpose, none by default.\n * @default current === \"krizaka\" (and never in `variant=\"app\"`)\n */\n family?: boolean;\n /** Only these products in the Products group (the current site always kept). Omit it to list every product. */\n products?: readonly SiteId[];\n /**\n * The organisation's public facts (`org` of `@krizaka/org`) — pass them on every site. The names and addresses of the\n * family are then `org.family`, the signature is `org.footer.line` (« Une entreprise de Technologies Krizaka · Fait à\n * Montréal », the same everywhere) and, without `legal`, the legal links are `org.footer.legal`.\n */\n org?: OrgFacts;\n /** The legal links, when not the org's (`SiteFooter.Link`s). */\n legal?: React.ReactNode;\n /** The host's controls at the end of the last line: the language switch, the theme toggle. */\n controls?: React.ReactNode;\n /**\n * `site` — every public site. `docs` — the same under documentation, on its width. `app` — inside a signed-in product:\n * the last line only; render it once, in the layout.\n * @default \"site\"\n */\n variant?: \"site\" | \"docs\" | \"app\";\n /** `cahier` on the Cahier sites (www, blog, ui., java., ts., lab.), `product` in the products. @default \"product\" */\n tone?: Tone;\n /**\n * The footer as the admin configured it (`resolveFooterSettings` of the app's settings): its columns, then one legal\n * line — `legalName · NEQ … · city`, the version when `showVersion`, the legal links, the socials. With it the family\n * is not drawn (the columns hold what the site wants) and the org's signature gives way to the legal identity.\n */\n config?: SiteFooterConfig;\n /** The app's router link for the config's internal links (Next's `Link`). @default \"a\" */\n linkAs?: LinkComponent;\n};\n\nfunction currentMark(atHome: boolean, isCurrent: boolean): \"page\" | \"true\" | undefined {\n if (atHome) return \"page\";\n return isCurrent ? \"true\" : undefined;\n}\n\nconst NO_STATUS = { shared: null, exceptions: new Map<string, Exclude<SiteStatus, \"released\">>() } as const;\n\n/** The footer of a Krizaka site or app: at most three lines — its links, the family, then signature · version · legal. */\nexport function SiteFooter({\n current,\n labels = familyLabels.en,\n children,\n version,\n env,\n path,\n legal: legalProp,\n controls,\n org,\n family: familyProp,\n products,\n variant = \"site\",\n tone = \"product\",\n config,\n linkAs,\n className,\n ...props\n}: SiteFooterProps) {\n const id = React.useId();\n const s = siteFooter({ variant, tone });\n const slim = variant === \"app\";\n const family = !slim && (familyProp ?? (current === \"krizaka\" && !config));\n const site = siteById(current);\n const krizaka = siteById(\"krizaka\");\n const currentId = orgIdOf(current);\n const tag = [env, version && `v${version.replace(/^v/, \"\")}`].filter(Boolean).join(\" · \");\n const own = !slim && React.Children.toArray(children).length > 0;\n const lang = labels.lang ?? \"en\";\n const company = labels.company ?? familyLabels.en.company!;\n const legal =\n legalProp ??\n (org && (\n <>\n {org.footer.legal.map((l) => (\n <SiteFooterLink key={l.id} href={l.url[lang]}>\n {l.label[lang]}\n </SiteFooterLink>\n ))}\n </>\n ));\n const here = (href: string) => path !== undefined && isThisPage(href, site.url, path);\n const productIds = products?.map(orgIdOf);\n // Products · Open source (GitHub closes it) · Krizaka (the company's pages; its home is the signature's link).\n const groups = familyGroups(org);\n const columns = [\n ...groups\n .filter((g) => g.group === \"products\")\n .map((g) => ({ ...g, entries: productIds ? g.entries.filter((e) => productIds.includes(e.id) || e.id === currentId) : g.entries })),\n { group: \"open-source\" as const, entries: groups.filter((g) => g.group === \"open-source\" || g.group === \"github\").flatMap((g) => g.entries) },\n ];\n const companyEntries = companyLinks.map((l) => ({ id: l.id, name: company[l.id], url: l.url[lang] }));\n return (\n <ToneContext.Provider value={tone}>\n <footer className={s.root({ className })} {...props}>\n <div className={s.inner()}>\n {own && <div className={s.row()}>{children}</div>}\n {config && !slim && <ConfigColumns s={s} config={config} id={id} labels={labels} linkAs={linkAs} path={path} />}\n {family && (\n <nav aria-label={labels.family} className={s.family()}>\n {[\n ...columns.map((c) => ({ key: c.group, title: labels.groups[c.group], entries: c.entries, ...columnStatus(c.entries) })),\n { key: \"krizaka\" as const, title: labels.groups.krizaka, entries: companyEntries, ...NO_STATUS },\n ]\n .filter((c) => c.entries.length > 0)\n .map((c) => (\n <details key={c.key} className={s.group()}>\n <summary className={s.summary()}>\n <span>\n <span id={`${id}-${c.key}`}>{c.title}</span>\n {c.shared && (\n <span className={s.note()}>\n <span aria-hidden=\"true\"> · </span>\n {labels.status[c.shared]}\n </span>\n )}\n </span>\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" className={s.chevron()}>\n <path d=\"M4 6l4 4 4-4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </summary>\n <ul aria-labelledby={`${id}-${c.key}`} className={s.list()}>\n {c.entries.map((e) => {\n const isCompany = c.key === \"krizaka\";\n const atHome = isCompany && here(e.url);\n const exception = c.exceptions.get(e.id);\n const isCurrent = !isCompany && e.id === currentId;\n return (\n <li key={e.id}>\n <a\n href={e.url}\n aria-current={currentMark(atHome, isCurrent)}\n onClick={atHome ? backToTop : undefined}\n className={s.link()}\n >\n {e.name}\n {exception && <span className={s.note()}> ({labels.status[exception]})</span>}\n {isCurrent && <span className=\"sr-only\"> ({labels.current})</span>}\n </a>\n </li>\n );\n })}\n </ul>\n </details>\n ))}\n </nav>\n )}\n {config ? (\n <ConfigBottom s={s} config={config} krizaka={krizaka.url} brand={org?.brand.name ?? \"Krizaka\"} tag={tag} env={env} versionLabel={labels.version} linkAs={linkAs} path={path} controls={controls} />\n ) : (\n <div className={s.bottom()}>\n <a href={krizaka.url} className={s.signature()}>\n <ProductLogo id=\"krizaka\" size={18} animated={false} />\n {org ? org.footer.line[lang] : `${labels.signature[site.kind]} · ${labels.place}`}\n </a>\n {tag && (\n <span className={s.version()}>\n <span className=\"sr-only\">{labels.version} </span>\n {tag}\n </span>\n )}\n {legal && <div className={s.legal()}>{legal}</div>}\n <FooterSocials s={s} links={(org?.links?.social ?? []).map((x) => ({ id: x.id, label: x.label, href: x.url }))} />\n {controls && <div className={s.controls()}>{controls}</div>}\n </div>\n )}\n </div>\n </footer>\n </ToneContext.Provider>\n );\n}\n\nconst isCurrent = (l: FooterLink, path?: string) => path !== undefined && !l.external && bare(l.href.split(/[?#]/)[0]!) === bare(path.split(/[?#]/)[0]!);\n\n/** The configured bottom line: the mark beside the legal identity, the version, the legal links and the socials. */\nfunction ConfigBottom({\n s,\n config,\n krizaka,\n brand,\n tag,\n env,\n versionLabel,\n linkAs,\n path,\n controls,\n}: Readonly<{\n s: ReturnType<typeof siteFooter>;\n config: SiteFooterConfig;\n krizaka: string;\n brand: string;\n tag: string;\n env?: string;\n versionLabel: string;\n linkAs?: LinkComponent;\n path?: string;\n controls?: React.ReactNode;\n}>) {\n const { legal, social } = config;\n const configured = (l: FooterLink) => <ConfigLink key={l.href} link={l} linkAs={linkAs} current={isCurrent(l, path)} />;\n const shown = legal.showVersion ? tag : env;\n const identity = [legal.legalName, legal.neq && `NEQ ${legal.neq}`, legal.city].filter(Boolean).join(\" · \");\n const versionText = (\n <>\n <span className=\"sr-only\">{versionLabel} </span>\n {shown}\n </>\n );\n return (\n <div className={s.bottom()}>\n {/* The company named once: its mark (home) beside its legal identity — never a second « by Technologies Krizaka ». */}\n <a href={krizaka} className={s.signature()} aria-label={brand}>\n <ProductLogo id=\"krizaka\" size={18} animated={false} />\n </a>\n <span className={s.identity()}>{identity}</span>\n {shown &&\n (legal.showVersion && legal.versionHref ? (\n <a href={legal.versionHref} className={s.version({ className: \"no-underline hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\" })}>\n {versionText}\n </a>\n ) : (\n <span className={s.version()}>{versionText}</span>\n ))}\n {legal.links.length > 0 && <div className={s.legal()}>{legal.links.map(configured)}</div>}\n <FooterSocials s={s} links={social ?? []} />\n {controls && <div className={s.controls()}>{controls}</div>}\n </div>\n );\n}\n\n/** Icons of the accounts a glyph exists for; any other account stays a text link. */\nconst SOCIAL_ICONS: Readonly<Partial<Record<string, typeof InstagramIcon>>> = { instagram: InstagramIcon, youtube: YoutubeIcon };\n\n/** The company's accounts: each is its icon (decorative) in a link named by the account, opening in a new tab. */\nfunction FooterSocials({ s, links }: Readonly<{ s: ReturnType<typeof siteFooter>; links: readonly { id: string; label: string; href: string }[] }>) {\n if (links.length === 0) return null;\n return (\n <div className={s.socials()}>\n {links.map((x) => {\n const Icon = SOCIAL_ICONS[x.id];\n return (\n <a key={x.id} href={x.href} target=\"_blank\" rel=\"noopener noreferrer\" className={Icon ? s.social() : s.link()}>\n {Icon && <Icon size={20} />}\n {Icon ? <span className=\"sr-only\">{x.label}</span> : x.label}\n </a>\n );\n })}\n </div>\n );\n}\n\n/** The admin-configured columns: a title (and status) over a list of links. */\nfunction ConfigColumns({\n s,\n config,\n id,\n labels,\n linkAs,\n path,\n}: Readonly<{ s: ReturnType<typeof siteFooter>; config: SiteFooterConfig; id: string; labels: FamilyLabels; linkAs?: LinkComponent; path?: string }>) {\n if (config.columns.length === 0) return null;\n return (\n <nav aria-label={config.label} className={s.columns()}>\n {config.columns.map((c) => (\n <div key={c.id} className={s.stack()}>\n <p id={`${id}-c-${c.id}`} className={s.title()}>\n {c.title}\n {c.status && (\n <span className={s.note()}>\n <span aria-hidden=\"true\"> · </span>\n {labels.status[c.status]}\n </span>\n )}\n </p>\n <ul aria-labelledby={`${id}-c-${c.id}`} className={s.stackList()}>\n {c.links.map((l) => (\n <li key={l.href}>\n <ConfigLink link={l} linkAs={linkAs} current={isCurrent(l, path)} />\n </li>\n ))}\n </ul>\n </div>\n ))}\n </nav>\n );\n}\n\n/** A configured link: the router's link inside the site, a plain `<a>` when it leaves it. */\nfunction ConfigLink({ link, linkAs, current }: Readonly<{ link: FooterLink; linkAs?: LinkComponent; current: boolean }>) {\n const s = siteFooter();\n const Comp = (link.external || !linkAs ? \"a\" : linkAs) as React.ElementType;\n return (\n <Comp href={link.href} className={s.link()} aria-current={current ? \"page\" : undefined}>\n {link.label}\n </Comp>\n );\n}\n\nexport type SiteFooterColumnProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The group's heading (“Docs”) — passed translated. */\n title: string;\n /** Its links (`SiteFooter.Link`). */\n children: React.ReactNode;\n};\n\n/** One of the site's own link groups, inline on the first line: its heading, then its links. */\nexport function SiteFooterColumn({ title, children, className, ...props }: SiteFooterColumnProps) {\n const id = React.useId();\n const tone = React.useContext(ToneContext);\n // A group with no link is not a group: only a heading over nothing.\n if (React.Children.toArray(children).length === 0) return null;\n const s = siteFooter({ tone });\n return (\n <div className={s.column({ className })} {...props}>\n <p id={id} className={s.title()}>\n {title}\n </p>\n <ul aria-labelledby={id} className={s.list({ className: \"pb-0\" })}>\n {React.Children.toArray(children).map((child, i) => <li key={i}>{child}</li>)}\n </ul>\n </div>\n );\n}\n\nexport type SiteFooterLinkProps = React.ComponentProps<\"a\"> & {\n /** The current page: `aria-current=\"page\"`. */\n active?: boolean;\n /** Renders your router's `<Link>`. */\n asChild?: boolean;\n};\n\n/** A link of the footer. */\nexport function SiteFooterLink({ active, asChild, className, ...props }: SiteFooterLinkProps) {\n const s = siteFooter();\n const Comp = asChild ? Slot.Root : \"a\";\n return <Comp aria-current={active ? \"page\" : undefined} className={s.link({ className })} {...props} />;\n}\n\nSiteFooter.Column = SiteFooterColumn;\nSiteFooter.Link = SiteFooterLink;\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":";;;;;;;;;;;;;AAOO,IAAM,gBAAgB,EAAE,SAAS,GAAG,OAAO,GAAG,YAAY,EAAE;AAkDnE,IAAM,OAAO,CAAC,GAAsB,OAA4C;AAAA,EAC9E,OAAO,EAAE,aAAa,SAAY,EAAE,QAAS,EAAE,EAAE,QAAQ;AAAA,EACzD,MAAM,EAAE;AAAA,EACR,GAAI,EAAE,WAAW,EAAE,UAAU,KAAK,IAAI,CAAC;AACzC;AAGO,SAAS,sBACd,UACA,GACA,SAAmC,CAAC,GAClB;AAClB,QAAM,SAAS,SAAS,UAAU,CAAC,GAAG,QAAQ,CAAC,OAAO,OAAO,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;AACvF,SAAO;AAAA,IACL,OAAO,EAAE,SAAS,QAAQ;AAAA,IAC1B,SAAS,SAAS,QAAQ,IAAI,CAAC,OAAO;AAAA,MACpC,IAAI,EAAE;AAAA,MACN,OAAO,EAAE,EAAE,QAAQ;AAAA,MACnB,GAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,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AG,gBAAc,UAAU,SAAS,QAC1E,UAAAA,MAAK,OACR;AAEJ;AAUO,SAAS,iBAAiB,EAAE,OAAO,UAAU,WAAW,GAAG,MAAM,GAA0B;AAChG,QAAM,KAAW,YAAM;AACvB,QAAM,OAAa,iBAAW,WAAW;AAEzC,MAAU,eAAS,QAAQ,QAAQ,EAAE,WAAW,EAAG,QAAO;AAC1D,QAAM,IAAI,WAAW,EAAE,KAAK,CAAC;AAC7B,SACE,qBAAC,SAAI,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,GAAI,GAAG,OAC3C;AAAA,wBAAC,OAAE,IAAQ,WAAW,EAAE,MAAM,GAC3B,iBACH;AAAA,IACA,oBAAC,QAAG,mBAAiB,IAAI,WAAW,EAAE,KAAK,EAAE,WAAW,OAAO,CAAC,GAC7D,UAAM,eAAS,QAAQ,QAAQ,EAAE,IAAI,CAAC,OAAO,MAAM,oBAAC,QAAY,mBAAJ,CAAU,CAAK,GAC9E;AAAA,KACF;AAEJ;AAUO,SAAS,eAAe,EAAE,QAAQ,SAAS,WAAW,GAAG,MAAM,GAAwB;AAC5F,QAAM,IAAI,WAAW;AACrB,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SAAO,oBAAC,QAAK,gBAAc,SAAS,SAAS,QAAW,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AACvG;AAEA,WAAW,SAAS;AACpB,WAAW,OAAO;","names":["isCurrent","link"]}
|
package/dist/slot-picker.js
CHANGED
|
@@ -35,7 +35,9 @@ var addDays = (iso, days) => {
|
|
|
35
35
|
};
|
|
36
36
|
var focusables = (root) => [...root?.querySelectorAll("button:not(:disabled), a[href]") ?? []];
|
|
37
37
|
function moveFocus(e, keys) {
|
|
38
|
-
|
|
38
|
+
let dir = 0;
|
|
39
|
+
if (keys.prev.includes(e.key)) dir = -1;
|
|
40
|
+
else if (keys.next.includes(e.key)) dir = 1;
|
|
39
41
|
if (!dir) return;
|
|
40
42
|
const items = focusables(e.currentTarget);
|
|
41
43
|
const at = items.indexOf(document.activeElement);
|
|
@@ -98,7 +100,8 @@ function SlotPicker({
|
|
|
98
100
|
slot.label,
|
|
99
101
|
slot.note && /* @__PURE__ */ jsx("span", { className: s.note(), children: slot.note })
|
|
100
102
|
] }) }, slot.id)) });
|
|
101
|
-
const
|
|
103
|
+
const subText = active?.sub ? ` ${active.sub}` : "";
|
|
104
|
+
const dayName = active ? `${active.label}${subText}` : "";
|
|
102
105
|
return /* @__PURE__ */ jsxs("div", { ref: rootRef, className: s.root({ className }), onKeyDown, ...props, children: [
|
|
103
106
|
weeks && weekButtons && /* @__PURE__ */ jsxs("div", { className: s.weekBar(), children: [
|
|
104
107
|
weekLabel && /* @__PURE__ */ jsx("p", { className: s.weekLabel(), role: "status", "aria-live": "polite", children: weekLabel }),
|
package/dist/slot-picker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/slot-picker/slot-picker.tsx"],"sourcesContent":["// Client (the chosen day). The next free times of a service as tappable chips: a strip of days, then the day's times.\n// A time is a link (`href`: the booking page with the time chosen) or a toggle the reader presses (`value`,\n// `onValueChange`). The app computes the slots (its availability is the truth) and formats the labels. With `week` the\n// picker moves through the weeks (← Today →): the host loads the days of the week it is asked for, the picker never computes.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\n\nexport const slotPicker = tv({\n slots: {\n root: \"flex min-w-0 flex-col gap-3\",\n days: \"flex gap-2 overflow-x-auto p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n day:\n \"flex min-h-12 min-w-[4.5rem] shrink-0 cursor-pointer flex-col items-center justify-center rounded-xl border border-border-default bg-surface-1 px-3 py-1.5 text-center leading-tight text-fg-secondary \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent-soft aria-pressed:text-fg\",\n dayName: \"text-xs font-bold\",\n daySub: \"text-[11px] tabular-nums text-fg-muted\",\n times: \"m-0 flex list-none flex-wrap gap-2 p-0\",\n time:\n \"inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline \" +\n \"transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:text-fg-muted disabled:line-through disabled:hover:border-border-default disabled:hover:bg-transparent\",\n note: \"text-[11px] font-medium text-fg-secondary group-aria-pressed:text-on-accent\",\n weekBar: \"flex flex-wrap items-center justify-between gap-2\",\n weekLabel: \"m-0 min-w-0 text-sm font-semibold tabular-nums text-fg\",\n weekNav: \"flex items-center gap-1.5\",\n weekBtn:\n \"inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-sm border border-border-default bg-surface-1 px-3 text-sm font-semibold text-fg no-underline \" +\n \"transition-colors hover:border-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-disabled:cursor-not-allowed aria-disabled:opacity-50\",\n groups: \"m-0 flex list-none flex-col gap-3 p-0\",\n groupLabel: \"m-0 mb-1.5 text-xs font-bold text-fg-secondary\",\n footer: \"m-0 text-xs text-fg-secondary\",\n empty: \"m-0 rounded-xl border border-dashed border-border-default px-4 py-6 text-center text-sm text-fg-secondary\",\n },\n});\nconst s = slotPicker();\n\nexport type PickerSlot = {\n /** A stable id (the slot's start as an ISO string). */\n id: string;\n /** The time in words, formatted by the app (`9 h 30`). */\n label: string;\n /** What to know about it (`2 places left`), shown beside the time and read with it. */\n note?: string;\n /** Not offered any more (full): shown struck out and disabled, its `note` (`Full`) read with the time — never colour alone. */\n disabled?: boolean;\n /** Makes the time a link to this address (the booking page with the slot chosen). */\n href?: string;\n};\n\n/** A part of a day (`Morning`, `Afternoon`): the label comes from the host's messages. */\nexport type PickerGroup = {\n id: string;\n label: string;\n slots: readonly PickerSlot[];\n};\n\nexport type PickerDay = {\n /** A stable id (`2026-10-19`). */\n id: string;\n /** The day's name, translated (`Today`, `Mon`). */\n label: string;\n /** Under it (`19 Oct`). */\n sub?: string;\n /** Its times, in order — flat… */\n slots?: readonly PickerSlot[];\n /** …or in parts of the day (`Morning`, `Afternoon`), each under its own label. Wins over `slots`. */\n groups?: readonly PickerGroup[];\n};\n\nexport type SlotPickerProps = Omit<React.ComponentProps<\"div\">, \"onChange\" | \"defaultValue\"> & {\n /** The days that have free times, in order. */\n days: readonly PickerDay[];\n /** The name of the group (`Available times`), passed translated. */\n label: string;\n /** Said when no day has a free time. */\n emptyLabel: string;\n /** The chosen slot's id (controlled). */\n value?: string | null;\n /** Called with the chosen slot's id. */\n onValueChange?: (id: string) => void;\n /** The first day shown. Default: the first of `days`. */\n defaultDay?: string;\n /** The app's link component for the times that have an `href`, and for the week buttons when `weekHref` is set. */\n linkAs?: LinkComponent;\n /** The week shown, the ISO date of its first day (`2026-10-19`; controlled). Setting it turns on ← Today →. */\n week?: string;\n /** Called with the ISO date of the week asked for (± 7 days, or `todayWeek`). The host loads that week's days. */\n onWeekChange?: (week: string) => void;\n /** The earliest week the host offers (ISO date): ← is disabled there. */\n minWeek?: string;\n /** The latest week the host offers (ISO date): → is disabled there. */\n maxWeek?: string;\n /** The current week, where « Today » goes back to. Default: `minWeek`. */\n todayWeek?: string;\n /** The week in words, formatted by the host with `@krizaka/intl` (`19 – 25 Oct`); announced politely at every change. */\n weekLabel?: string;\n /** Names of the three week buttons, translated: `{ previous: \"Previous week\", today: \"Today\", next: \"Next week\" }`. */\n weekButtons?: { previous: string; today: string; next: string };\n /** Makes the week buttons links (the address holds the state: `?week=`), given the week they go to. */\n weekHref?: (week: string) => string;\n /** The context line under the times: time zone and duration (`Montréal (UTC−4) · 45 min`), formatted by the host. */\n footer?: React.ReactNode;\n};\n\n/** The ISO date `days` days after `iso` (UTC, so a time zone never moves it). */\nconst addDays = (iso: string, days: number) => {\n const d = new Date(`${iso}T00:00:00Z`);\n d.setUTCDate(d.getUTCDate() + days);\n return d.toISOString().slice(0, 10);\n};\n\nconst focusables = (root: Element | null) => [...(root?.querySelectorAll<HTMLElement>(\"button:not(:disabled), a[href]\") ?? [])];\n/** Arrows move focus inside one list of controls (`dir` -1/+1 on the arrows that follow the reading order). */\nfunction moveFocus(e: React.KeyboardEvent<HTMLElement>, keys: { prev: string[]; next: string[] }) {\n const dir = keys.prev.includes(e.key) ? -1 : keys.next.includes(e.key) ? 1 : 0;\n if (!dir) return;\n const items = focusables(e.currentTarget);\n const at = items.indexOf(document.activeElement as HTMLElement);\n if (at < 0) return;\n e.preventDefault();\n items[(at + dir + items.length) % items.length]?.focus();\n}\n\n/** Tappable free times by day: the day strip, then the day's chips (in parts of the day if asked) — links or toggles — and, with `week`, ← Today →. */\nexport function SlotPicker({\n days,\n label,\n emptyLabel,\n value,\n onValueChange,\n defaultDay,\n linkAs,\n week,\n onWeekChange,\n minWeek,\n maxWeek,\n todayWeek,\n weekLabel,\n weekButtons,\n weekHref,\n footer,\n className,\n ...props\n}: SlotPickerProps) {\n const [dayId, setDayId] = React.useState(defaultDay ?? days[0]?.id);\n const rootRef = React.useRef<HTMLDivElement>(null);\n const refocusDays = React.useRef(false);\n const active = days.find((d) => d.id === dayId) ?? days[0];\n // After a week change from the keyboard (Page Up / Down inside the times), focus goes to the day strip, which stays.\n React.useEffect(() => {\n if (!refocusDays.current) return;\n refocusDays.current = false;\n rootRef.current?.querySelector<HTMLElement>(\"[data-day][aria-pressed=true]\")?.focus();\n }, [week]);\n\n const weeks = week !== undefined;\n const prev = weeks ? addDays(week, -7) : undefined;\n const next = weeks ? addDays(week, 7) : undefined;\n const current = todayWeek ?? minWeek;\n const prevOff = !!prev && !!minWeek && prev < minWeek;\n const nextOff = !!next && !!maxWeek && next > maxWeek;\n const todayOff = !current || current === week;\n const go = (to: string | undefined, off: boolean) => {\n if (to && !off) onWeekChange?.(to);\n };\n\n const weekButton = (kind: \"previous\" | \"today\" | \"next\", to: string | undefined, off: boolean, text: string, shown: React.ReactNode) =>\n weekHref && to && !off ? (\n <BlockLink key={kind} href={weekHref(to)} linkAs={linkAs} aria-label={text} className={s.weekBtn()}>\n {shown}\n </BlockLink>\n ) : (\n <button key={kind} type=\"button\" aria-label={text} aria-disabled={off || undefined} onClick={() => go(to, off)} className={s.weekBtn()}>\n {shown}\n </button>\n );\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!weeks || (e.key !== \"PageUp\" && e.key !== \"PageDown\")) return;\n const to = e.key === \"PageUp\" ? prev : next;\n if (!to || (e.key === \"PageUp\" ? prevOff : nextOff)) return;\n e.preventDefault();\n refocusDays.current = true;\n onWeekChange?.(to);\n };\n\n const timeList = (slots: readonly PickerSlot[], name: string) => (\n <ul className={s.times()} aria-label={name} onKeyDown={(e) => moveFocus(e, { prev: [\"ArrowLeft\", \"ArrowUp\"], next: [\"ArrowRight\", \"ArrowDown\"] })}>\n {slots.map((slot) => (\n <li key={slot.id}>\n {slot.href && !slot.disabled ? (\n <BlockLink href={slot.href} linkAs={linkAs} className={s.time()}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </BlockLink>\n ) : (\n <button type=\"button\" aria-pressed={value === slot.id} disabled={slot.disabled} onClick={() => onValueChange?.(slot.id)} className={s.time({ className: \"group\" })}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </button>\n )}\n </li>\n ))}\n </ul>\n );\n\n const dayName = active ? `${active.label}${active.sub ? ` ${active.sub}` : \"\"}` : \"\";\n return (\n <div ref={rootRef} className={s.root({ className })} onKeyDown={onKeyDown} {...props}>\n {weeks && weekButtons && (\n <div className={s.weekBar()}>\n {weekLabel && (\n <p className={s.weekLabel()} role=\"status\" aria-live=\"polite\">\n {weekLabel}\n </p>\n )}\n <div className={s.weekNav()}>\n {weekButton(\"previous\", prev, prevOff, weekButtons.previous, <span aria-hidden=\"true\">←</span>)}\n {weekButton(\"today\", current, todayOff, weekButtons.today, weekButtons.today)}\n {weekButton(\"next\", next, nextOff, weekButtons.next, <span aria-hidden=\"true\">→</span>)}\n </div>\n </div>\n )}\n {!active ? (\n <p className={s.empty()}>{emptyLabel}</p>\n ) : (\n <>\n <div className={s.days()} role=\"group\" aria-label={label} onKeyDown={(e) => moveFocus(e, { prev: [\"ArrowLeft\"], next: [\"ArrowRight\"] })}>\n {days.map((day) => (\n <button key={day.id} type=\"button\" data-day=\"\" aria-pressed={day.id === active.id} onClick={() => setDayId(day.id)} className={s.day()}>\n <span className={s.dayName()}>{day.label}</span>\n {day.sub && <span className={s.daySub()}>{day.sub}</span>}\n </button>\n ))}\n </div>\n {active.groups ? (\n <ul className={s.groups()} aria-label={dayName}>\n {active.groups.map((group) => (\n <li key={group.id}>\n <p className={s.groupLabel()}>{group.label}</p>\n {timeList(group.slots, `${dayName} · ${group.label}`)}\n </li>\n ))}\n </ul>\n ) : (\n timeList(active.slots ?? [], dayName)\n )}\n </>\n )}\n {footer && <p className={s.footer()}>{footer}</p>}\n </div>\n );\n}\n"],"mappings":";;;;;;AAIA,YAAY,WAAW;AACvB,SAAS,UAAU;AAsKb,SA0DE,UA1DF,KAuBM,YAvBN;AAlKC,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KACE;AAAA,IAGF,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MACE;AAAA,IAGF,MAAM;AAAA,IACN,SAAS;AAAA,IACT,WAAW;AAAA,IACX,SAAS;AAAA,IACT,SACE;AAAA,IAEF,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AACF,CAAC;AACD,IAAM,IAAI,WAAW;AAuErB,IAAM,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O,WAAW,CAAC,MAAM,UAAU,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC,GACnI,eAAK,IAAI,CAAC,QACT,qBAAC,YAAoB,MAAK,UAAS,YAAS,IAAG,gBAAc,IAAI,OAAO,OAAO,IAAI,SAAS,MAAM,SAAS,IAAI,EAAE,GAAG,WAAW,EAAE,IAAI,GACnI;AAAA,4BAAC,UAAK,WAAW,EAAE,QAAQ,GAAI,cAAI,OAAM;AAAA,QACxC,IAAI,OAAO,oBAAC,UAAK,WAAW,EAAE,OAAO,GAAI,cAAI,KAAI;AAAA,WAFvC,IAAI,EAGjB,CACD,GACH;AAAA,MACC,OAAO,SACN,oBAAC,QAAG,WAAW,EAAE,OAAO,GAAG,cAAY,SACpC,iBAAO,OAAO,IAAI,CAAC,UAClB,qBAAC,QACC;AAAA,4BAAC,OAAE,WAAW,EAAE,WAAW,GAAI,gBAAM,OAAM;AAAA,QAC1C,SAAS,MAAM,OAAO,GAAG,OAAO,SAAM,MAAM,KAAK,EAAE;AAAA,WAF7C,MAAM,EAGf,CACD,GACH,IAEA,SAAS,OAAO,SAAS,CAAC,GAAG,OAAO;AAAA,OAExC;AAAA,IAED,UAAU,oBAAC,OAAE,WAAW,EAAE,OAAO,GAAI,kBAAO;AAAA,KAC/C;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/slot-picker/slot-picker.tsx"],"sourcesContent":["// Client (the chosen day). The next free times of a service as tappable chips: a strip of days, then the day's times.\n// A time is a link (`href`: the booking page with the time chosen) or a toggle the reader presses (`value`,\n// `onValueChange`). The app computes the slots (its availability is the truth) and formats the labels. With `week` the\n// picker moves through the weeks (← Today →): the host loads the days of the week it is asked for, the picker never computes.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\n\nexport const slotPicker = tv({\n slots: {\n root: \"flex min-w-0 flex-col gap-3\",\n days: \"flex gap-2 overflow-x-auto p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n day:\n \"flex min-h-12 min-w-[4.5rem] shrink-0 cursor-pointer flex-col items-center justify-center rounded-xl border border-border-default bg-surface-1 px-3 py-1.5 text-center leading-tight text-fg-secondary \" +\n \"transition-colors hover:border-border-strong hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent-soft aria-pressed:text-fg\",\n dayName: \"text-xs font-bold\",\n daySub: \"text-[11px] tabular-nums text-fg-muted\",\n times: \"m-0 flex list-none flex-wrap gap-2 p-0\",\n time:\n \"inline-flex min-h-11 min-w-[4.75rem] items-center justify-center gap-1.5 rounded-sm border border-border-default bg-surface-1 px-4 text-sm font-semibold tabular-nums text-fg no-underline \" +\n \"transition-colors hover:border-accent/60 hover:bg-accent-soft focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"aria-pressed:border-accent aria-pressed:bg-accent aria-pressed:text-on-accent disabled:cursor-not-allowed disabled:border-dashed disabled:bg-transparent disabled:text-fg-muted disabled:line-through disabled:hover:border-border-default disabled:hover:bg-transparent\",\n note: \"text-[11px] font-medium text-fg-secondary group-aria-pressed:text-on-accent\",\n weekBar: \"flex flex-wrap items-center justify-between gap-2\",\n weekLabel: \"m-0 min-w-0 text-sm font-semibold tabular-nums text-fg\",\n weekNav: \"flex items-center gap-1.5\",\n weekBtn:\n \"inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-sm border border-border-default bg-surface-1 px-3 text-sm font-semibold text-fg no-underline \" +\n \"transition-colors hover:border-border-strong focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-disabled:cursor-not-allowed aria-disabled:opacity-50\",\n groups: \"m-0 flex list-none flex-col gap-3 p-0\",\n groupLabel: \"m-0 mb-1.5 text-xs font-bold text-fg-secondary\",\n footer: \"m-0 text-xs text-fg-secondary\",\n empty: \"m-0 rounded-xl border border-dashed border-border-default px-4 py-6 text-center text-sm text-fg-secondary\",\n },\n});\nconst s = slotPicker();\n\nexport type PickerSlot = {\n /** A stable id (the slot's start as an ISO string). */\n id: string;\n /** The time in words, formatted by the app (`9 h 30`). */\n label: string;\n /** What to know about it (`2 places left`), shown beside the time and read with it. */\n note?: string;\n /** Not offered any more (full): shown struck out and disabled, its `note` (`Full`) read with the time — never colour alone. */\n disabled?: boolean;\n /** Makes the time a link to this address (the booking page with the slot chosen). */\n href?: string;\n};\n\n/** A part of a day (`Morning`, `Afternoon`): the label comes from the host's messages. */\nexport type PickerGroup = {\n id: string;\n label: string;\n slots: readonly PickerSlot[];\n};\n\nexport type PickerDay = {\n /** A stable id (`2026-10-19`). */\n id: string;\n /** The day's name, translated (`Today`, `Mon`). */\n label: string;\n /** Under it (`19 Oct`). */\n sub?: string;\n /** Its times, in order — flat… */\n slots?: readonly PickerSlot[];\n /** …or in parts of the day (`Morning`, `Afternoon`), each under its own label. Wins over `slots`. */\n groups?: readonly PickerGroup[];\n};\n\nexport type SlotPickerProps = Omit<React.ComponentProps<\"div\">, \"onChange\" | \"defaultValue\"> & {\n /** The days that have free times, in order. */\n days: readonly PickerDay[];\n /** The name of the group (`Available times`), passed translated. */\n label: string;\n /** Said when no day has a free time. */\n emptyLabel: string;\n /** The chosen slot's id (controlled). */\n value?: string | null;\n /** Called with the chosen slot's id. */\n onValueChange?: (id: string) => void;\n /** The first day shown. Default: the first of `days`. */\n defaultDay?: string;\n /** The app's link component for the times that have an `href`, and for the week buttons when `weekHref` is set. */\n linkAs?: LinkComponent;\n /** The week shown, the ISO date of its first day (`2026-10-19`; controlled). Setting it turns on ← Today →. */\n week?: string;\n /** Called with the ISO date of the week asked for (± 7 days, or `todayWeek`). The host loads that week's days. */\n onWeekChange?: (week: string) => void;\n /** The earliest week the host offers (ISO date): ← is disabled there. */\n minWeek?: string;\n /** The latest week the host offers (ISO date): → is disabled there. */\n maxWeek?: string;\n /** The current week, where « Today » goes back to. Default: `minWeek`. */\n todayWeek?: string;\n /** The week in words, formatted by the host with `@krizaka/intl` (`19 – 25 Oct`); announced politely at every change. */\n weekLabel?: string;\n /** Names of the three week buttons, translated: `{ previous: \"Previous week\", today: \"Today\", next: \"Next week\" }`. */\n weekButtons?: { previous: string; today: string; next: string };\n /** Makes the week buttons links (the address holds the state: `?week=`), given the week they go to. */\n weekHref?: (week: string) => string;\n /** The context line under the times: time zone and duration (`Montréal (UTC−4) · 45 min`), formatted by the host. */\n footer?: React.ReactNode;\n};\n\n/** The ISO date `days` days after `iso` (UTC, so a time zone never moves it). */\nconst addDays = (iso: string, days: number) => {\n const d = new Date(`${iso}T00:00:00Z`);\n d.setUTCDate(d.getUTCDate() + days);\n return d.toISOString().slice(0, 10);\n};\n\nconst focusables = (root: Element | null) => [...(root?.querySelectorAll<HTMLElement>(\"button:not(:disabled), a[href]\") ?? [])];\n/** Arrows move focus inside one list of controls (`dir` -1/+1 on the arrows that follow the reading order). */\nfunction moveFocus(e: React.KeyboardEvent<HTMLElement>, keys: { prev: string[]; next: string[] }) {\n let dir = 0;\n if (keys.prev.includes(e.key)) dir = -1;\n else if (keys.next.includes(e.key)) dir = 1;\n if (!dir) return;\n const items = focusables(e.currentTarget);\n const at = items.indexOf(document.activeElement as HTMLElement);\n if (at < 0) return;\n e.preventDefault();\n items[(at + dir + items.length) % items.length]?.focus();\n}\n\n/** Tappable free times by day: the day strip, then the day's chips (in parts of the day if asked) — links or toggles — and, with `week`, ← Today →. */\nexport function SlotPicker({\n days,\n label,\n emptyLabel,\n value,\n onValueChange,\n defaultDay,\n linkAs,\n week,\n onWeekChange,\n minWeek,\n maxWeek,\n todayWeek,\n weekLabel,\n weekButtons,\n weekHref,\n footer,\n className,\n ...props\n}: SlotPickerProps) {\n const [dayId, setDayId] = React.useState(defaultDay ?? days[0]?.id);\n const rootRef = React.useRef<HTMLDivElement>(null);\n const refocusDays = React.useRef(false);\n const active = days.find((d) => d.id === dayId) ?? days[0];\n // After a week change from the keyboard (Page Up / Down inside the times), focus goes to the day strip, which stays.\n React.useEffect(() => {\n if (!refocusDays.current) return;\n refocusDays.current = false;\n rootRef.current?.querySelector<HTMLElement>(\"[data-day][aria-pressed=true]\")?.focus();\n }, [week]);\n\n const weeks = week !== undefined;\n const prev = weeks ? addDays(week, -7) : undefined;\n const next = weeks ? addDays(week, 7) : undefined;\n const current = todayWeek ?? minWeek;\n const prevOff = !!prev && !!minWeek && prev < minWeek;\n const nextOff = !!next && !!maxWeek && next > maxWeek;\n const todayOff = !current || current === week;\n const go = (to: string | undefined, off: boolean) => {\n if (to && !off) onWeekChange?.(to);\n };\n\n const weekButton = (kind: \"previous\" | \"today\" | \"next\", to: string | undefined, off: boolean, text: string, shown: React.ReactNode) =>\n weekHref && to && !off ? (\n <BlockLink key={kind} href={weekHref(to)} linkAs={linkAs} aria-label={text} className={s.weekBtn()}>\n {shown}\n </BlockLink>\n ) : (\n <button key={kind} type=\"button\" aria-label={text} aria-disabled={off || undefined} onClick={() => go(to, off)} className={s.weekBtn()}>\n {shown}\n </button>\n );\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!weeks || (e.key !== \"PageUp\" && e.key !== \"PageDown\")) return;\n const to = e.key === \"PageUp\" ? prev : next;\n if (!to || (e.key === \"PageUp\" ? prevOff : nextOff)) return;\n e.preventDefault();\n refocusDays.current = true;\n onWeekChange?.(to);\n };\n\n const timeList = (slots: readonly PickerSlot[], name: string) => (\n <ul className={s.times()} aria-label={name} onKeyDown={(e) => moveFocus(e, { prev: [\"ArrowLeft\", \"ArrowUp\"], next: [\"ArrowRight\", \"ArrowDown\"] })}>\n {slots.map((slot) => (\n <li key={slot.id}>\n {slot.href && !slot.disabled ? (\n <BlockLink href={slot.href} linkAs={linkAs} className={s.time()}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </BlockLink>\n ) : (\n <button type=\"button\" aria-pressed={value === slot.id} disabled={slot.disabled} onClick={() => onValueChange?.(slot.id)} className={s.time({ className: \"group\" })}>\n {slot.label}\n {slot.note && <span className={s.note()}>{slot.note}</span>}\n </button>\n )}\n </li>\n ))}\n </ul>\n );\n\n const subText = active?.sub ? ` ${active.sub}` : \"\";\n const dayName = active ? `${active.label}${subText}` : \"\";\n return (\n <div ref={rootRef} className={s.root({ className })} onKeyDown={onKeyDown} {...props}>\n {weeks && weekButtons && (\n <div className={s.weekBar()}>\n {weekLabel && (\n <p className={s.weekLabel()} role=\"status\" aria-live=\"polite\">\n {weekLabel}\n </p>\n )}\n <div className={s.weekNav()}>\n {weekButton(\"previous\", prev, prevOff, weekButtons.previous, <span aria-hidden=\"true\">←</span>)}\n {weekButton(\"today\", current, todayOff, weekButtons.today, weekButtons.today)}\n {weekButton(\"next\", next, nextOff, weekButtons.next, <span aria-hidden=\"true\">→</span>)}\n </div>\n </div>\n )}\n {!active ? (\n <p className={s.empty()}>{emptyLabel}</p>\n ) : (\n <>\n <div className={s.days()} role=\"group\" aria-label={label} onKeyDown={(e) => moveFocus(e, { prev: [\"ArrowLeft\"], next: [\"ArrowRight\"] })}>\n {days.map((day) => (\n <button key={day.id} type=\"button\" data-day=\"\" aria-pressed={day.id === active.id} onClick={() => setDayId(day.id)} className={s.day()}>\n <span className={s.dayName()}>{day.label}</span>\n {day.sub && <span className={s.daySub()}>{day.sub}</span>}\n </button>\n ))}\n </div>\n {active.groups ? (\n <ul className={s.groups()} aria-label={dayName}>\n {active.groups.map((group) => (\n <li key={group.id}>\n <p className={s.groupLabel()}>{group.label}</p>\n {timeList(group.slots, `${dayName} · ${group.label}`)}\n </li>\n ))}\n </ul>\n ) : (\n timeList(active.slots ?? [], dayName)\n )}\n </>\n )}\n {footer && <p className={s.footer()}>{footer}</p>}\n </div>\n );\n}\n"],"mappings":";;;;;;AAIA,YAAY,WAAW;AACvB,SAAS,UAAU;AAwKb,SA2DE,UA3DF,KAuBM,YAvBN;AApKC,IAAM,aAAa,GAAG;AAAA,EAC3B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MA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 -38,7 +38,7 @@ type StatusChipProps = {
|
|
|
38
38
|
className?: string;
|
|
39
39
|
};
|
|
40
40
|
/** The state of a status set as a badge; a menu of the allowed moves when the set, the role and `onMove` allow it. */
|
|
41
|
-
declare function StatusChip({ set, state, role, locale, onMove, labels: given, size, className }: StatusChipProps): React.JSX.Element;
|
|
41
|
+
declare function StatusChip({ set, state, role, locale, onMove, labels: given, size, className }: Readonly<StatusChipProps>): React.JSX.Element;
|
|
42
42
|
|
|
43
43
|
export { StatusChip };
|
|
44
44
|
export type { StatusChipLabels, StatusChipProps, StatusMove };
|
package/dist/status-chip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/status-chip/status-chip.tsx"],"sourcesContent":["// Client (a Radix menu). A state of a status set (krizaka-ts#89, `@krizaka/organize`): the set says the states (label in\n// both languages, tone, final) and the transitions (who may move, whether a second press confirms, which reasons may be\n// picked). Read-only when the set is derived (an invoice's « paid » comes from the ledger), when no move is allowed to\n// the role, or when nobody listens (`onMove`); otherwise a menu of the moves the role may make, in the set's order. A\n// reason is picked from a list, never typed. The tone is a tint and a dot: the label always says the state.\nimport { movesFrom, stateOf,type StatusSet, type
|
|
1
|
+
{"version":3,"sources":["../src/status-chip/status-chip.tsx"],"sourcesContent":["// Client (a Radix menu). A state of a status set (krizaka-ts#89, `@krizaka/organize`): the set says the states (label in\n// both languages, tone, final) and the transitions (who may move, whether a second press confirms, which reasons may be\n// picked). Read-only when the set is derived (an invoice's « paid » comes from the ledger), when no move is allowed to\n// the role, or when nobody listens (`onMove`); otherwise a menu of the moves the role may make, in the set's order. A\n// reason is picked from a list, never typed. The tone is a tint and a dot: the label always says the state.\nimport { movesFrom, stateOf, type StatusSet, type StatusTransition } from \"@krizaka/organize/contract\";\nimport { DropdownMenu as MenuPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { badgeVariants } from \"../badge\";\nimport { cn } from \"../cn\";\nimport { DropdownMenu } from \"../dropdown-menu\";\nimport { ChevronGlyph } from \"../glyphs\";\n\nexport type { StatusSet, StatusTransition };\nexport type { StatusTone } from \"@krizaka/organize/contract\";\n\nexport type StatusMove = {\n /** The transition the person chose. */\n transition: StatusTransition;\n /** The key of the reason picked from the transition's list, or null when it has none. */\n reason: string | null;\n};\n\nexport type StatusChipLabels = {\n /** The menu's accessible name: `(state) => \"Change the status, now \" + state`. */\n menu: (state: string) => string;\n /** The item that waits for a second press: `(target) => \"Confirm: \" + target`. */\n confirm: (target: string) => string;\n /** The submenu that asks for a reason: `(target) => target + \" — pick a reason\"`. */\n reason: (target: string) => string;\n};\n\nconst defaultLabels: StatusChipLabels = {\n menu: (state) => `Change the status, now ${state}`,\n confirm: (target) => `Confirm: ${target}`,\n reason: (target) => `${target} — pick a reason`,\n};\n\nexport type StatusChipProps = {\n /** The kind's status set (`KindConfig.status`). */\n set: StatusSet;\n /** The key of the entity's state. */\n state: string;\n /** The role of the person: the moves are the ones this role may make. */\n role: string;\n /** The language the labels are read in. */\n locale: \"fr\" | \"en\";\n /** Called when a move is chosen (confirmed, with its reason when it asks for one). Without it the chip is read-only. */\n onMove?: (move: StatusMove) => void;\n /** The words of the menu, passed translated. */\n labels?: Partial<StatusChipLabels>;\n /**\n * sm · md.\n * @default \"sm\"\n */\n size?: \"sm\" | \"md\";\n /** Classes merged on the badge. */\n className?: string;\n};\n\n/** The state of a status set as a badge; a menu of the allowed moves when the set, the role and `onMove` allow it. */\nexport function StatusChip({ set, state, role, locale, onMove, labels: given, size = \"sm\", className }: Readonly<StatusChipProps>) {\n const labels = { ...defaultLabels, ...given };\n const current = stateOf(set, state);\n const text = current ? current.label[locale] : state;\n const tone = current?.tone ?? \"neutral\";\n const moves = onMove && set.mode === \"editable\" ? movesFrom(set, state, role) : [];\n const [armed, setArmed] = React.useState<string | null>(null);\n const [open, setOpen] = React.useState(false);\n const label = (key: string) => stateOf(set, key)?.label[locale] ?? key;\n\n if (moves.length === 0) {\n return (\n <span data-status={state} data-tone={tone} className={badgeVariants({ tone, size, className })}>\n <span data-dot=\"\" aria-hidden className=\"h-1.5 w-1.5 rounded-full bg-current\" />\n {text}\n </span>\n );\n }\n\n const choose = (move: StatusTransition, reason: string | null) => {\n setArmed(null);\n setOpen(false);\n onMove?.({ transition: move, reason });\n };\n\n return (\n <MenuPrimitive.Root\n open={open}\n onOpenChange={(next) => {\n setOpen(next);\n if (!next) setArmed(null);\n }}\n modal={false}\n >\n <MenuPrimitive.Trigger\n aria-label={labels.menu(text)}\n data-status={state}\n data-tone={tone}\n className={cn(\n badgeVariants({ tone, size }),\n \"cursor-pointer transition-colors hover:brightness-110 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n >\n <span data-dot=\"\" aria-hidden className=\"h-1.5 w-1.5 rounded-full bg-current\" />\n {text}\n <ChevronGlyph className=\"-mr-0.5 h-3.5 w-3.5\" />\n </MenuPrimitive.Trigger>\n <DropdownMenu.Content align=\"start\" aria-label={labels.menu(text)}>\n {moves.map((move) => {\n const target = label(move.to);\n const reasons = move.reasons ?? [];\n if (reasons.length > 0) {\n return (\n <DropdownMenu.Sub key={move.to}>\n <DropdownMenu.SubTrigger aria-label={labels.reason(target)}>{target}</DropdownMenu.SubTrigger>\n <DropdownMenu.SubContent>\n {reasons.map((reason) => (\n <DropdownMenu.Item key={reason.key} onSelect={() => choose(move, reason.key)}>\n {reason.label[locale]}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.SubContent>\n </DropdownMenu.Sub>\n );\n }\n const waiting = move.confirm && armed === move.to;\n return (\n <DropdownMenu.Item\n key={move.to}\n data-armed={waiting ? \"\" : undefined}\n className={waiting ? \"font-semibold text-fg-accent\" : undefined}\n onSelect={(event) => {\n if (move.confirm && !waiting) {\n // The first press asks, the second one moves: the menu stays open and says so.\n event.preventDefault();\n setArmed(move.to);\n return;\n }\n choose(move, null);\n }}\n >\n <span aria-live=\"polite\">{waiting ? labels.confirm(target) : target}</span>\n </DropdownMenu.Item>\n );\n })}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W,CAAC,SAAS;AAE5B,wBAAM,eAAe;AACrB,2BAAS,KAAK,EAAE;AAChB;AAAA,gBACF;AACA,uBAAO,MAAM,IAAI;AAAA,cACnB;AAAA,cAEA,8BAAC,UAAK,aAAU,UAAU,oBAAU,OAAO,QAAQ,MAAM,IAAI,QAAO;AAAA;AAAA,YAb/D,KAAK;AAAA,UAcZ;AAAA,QAEJ,CAAC,GACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/dist/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tabs/tabs.tsx"],"sourcesContent":["// Client (a context). Radix Tabs does the roles (tablist, tab, tabpanel), the aria-selected / aria-controls wiring,\n// the roving focus (arrows, Home, End) and automatic activation: this file only holds the three looks.\nimport { Slot, Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\n\nexport const tabs = tv({\n slots: {\n root: \"flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n // One light glides from the active tab to the next (`before:`, placed by useSlidingIndicator); until it is placed\n // (server render), each trigger carries its own active style.\n list:\n \"group/tabs relative isolate flex shrink-0 data-[orientation=vertical]:flex-col \" +\n \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:transition-[translate,width,height,opacity] before:duration-300 \" +\n \"motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n trigger:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n content: \"kz-tabs-panel min-w-0 flex-1 rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[state=inactive]:hidden\",\n },\n variants: {\n variant: {\n /* The section of a page: a line under the list, the active tab underlined in the accent. */\n underline: {\n list:\n \"gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-sm before:bg-accent \" +\n \"data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:left-0 data-[orientation=horizontal]:before:h-0.5 \" +\n \"data-[orientation=horizontal]:before:w-(--kz-ind-w) data-[orientation=horizontal]:before:translate-x-(--kz-ind-x) \" +\n \"data-[orientation=vertical]:before:-right-px data-[orientation=vertical]:before:top-0 data-[orientation=vertical]:before:w-0.5 \" +\n \"data-[orientation=vertical]:before:h-(--kz-ind-h) data-[orientation=vertical]:before:translate-y-(--kz-ind-y)\",\n trigger:\n \"relative rounded-md px-3 py-2.5 text-sm text-fg-secondary hover:text-fg data-[state=active]:text-fg \" +\n \"after:absolute after:rounded-sm after:bg-transparent data-[state=active]:after:bg-accent \" +\n \"data-[orientation=horizontal]:after:inset-x-2 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5 \" +\n \"data-[orientation=vertical]:justify-start data-[orientation=vertical]:after:inset-y-1.5 data-[orientation=vertical]:after:-right-px data-[orientation=vertical]:after:w-0.5 \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:after:bg-transparent\",\n },\n /* A view switch: equal segments in a track, the active one filled. */\n segmented: {\n list:\n \"inline-grid auto-cols-fr grid-flow-col gap-1 self-start rounded-xl border border-border-default bg-surface-1 p-1 data-[orientation=vertical]:grid-flow-row \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:bg-accent before:shadow-sm\",\n trigger:\n \"min-h-8 rounded-lg px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-2 hover:text-fg \" +\n \"data-[state=active]:bg-accent data-[state=active]:text-on-accent data-[state=active]:shadow-sm data-[state=active]:hover:bg-accent \" +\n \"transition-colors group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent group-data-[indicator=on]/tabs:data-[state=active]:shadow-none\",\n },\n /* Pills that scroll sideways on a phone: a feed's sections. */\n pills: {\n list:\n \"gap-1.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-1 -mt-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) \" +\n \"before:rounded-sm before:border before:border-accent before:bg-accent-soft\",\n trigger:\n \"h-9 rounded-sm border border-border-default bg-surface-1 px-4 text-xs text-fg-secondary hover:border-border-strong hover:text-fg \" +\n \"data-[state=active]:border-accent data-[state=active]:bg-accent-soft data-[state=active]:text-fg \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:border-transparent group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent\",\n },\n /*\n * Binder dividers (intercalaires, #648): organise collections, tags and statuses. Each tab is a divider with a\n * coloured top edge (`hue`), its words and a count; the active one is the page's colour and joins the content\n * under the list's line. Too many dividers scroll sideways, the edges fading. No paper texture: organisation only.\n */\n binder: {\n list:\n \"items-end gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain border-b border-border-default px-3 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"[mask-image:linear-gradient(to_right,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n trigger:\n \"relative -mb-px min-h-10 rounded-t-lg border border-b-0 border-border-default bg-surface-2 px-3.5 pb-2 pt-2.5 text-sm text-fg-secondary \" +\n \"before:absolute before:inset-x-0 before:-top-px before:h-1 before:rounded-t-lg before:bg-(--kz-hue,var(--kz-accent)) \" +\n \"hover:bg-surface-3 hover:text-fg data-[state=active]:z-[1] data-[state=active]:bg-surface-1 data-[state=active]:pb-2.5 data-[state=active]:text-fg \" +\n \"data-[state=active]:shadow-[0_1px_0_0_var(--kz-surface-1)] motion-reduce:transition-none\",\n },\n },\n },\n defaultVariants: { variant: \"underline\" },\n});\n\n/**\n * A divider's colour (`variant=\"binder\"`): the brand's accent by default, or a role of the theme — every one reads at 3:1 or\n * more on both themes. The colour is never the only signal: the words and the count say it.\n */\nexport type TabsHue = \"accent\" | \"success\" | \"warning\" | \"danger\" | \"neutral\";\n// The text roles where the fill role is too light on a light page (success, warning: 2:1): every edge reaches 3:1, tested.\nconst HUE: Record<TabsHue, string> = {\n accent: \"var(--kz-accent)\",\n success: \"var(--kz-success-text)\",\n warning: \"var(--kz-warning-text)\",\n danger: \"var(--kz-danger-text)\",\n neutral: \"var(--kz-text-muted)\",\n};\n/** The style that paints a divider's edge (`--kz-hue`), merged with the host's. */\nconst hueStyle = (hue: TabsHue | undefined, style: React.CSSProperties | undefined) =>\n hue ? { ...style, [\"--kz-hue\" as string]: HUE[hue] } : style;\n\n/** The count after a tab's words: part of its name (« Clients 12 »), muted, tabular. */\nfunction TabCount({ count }: { count: number | undefined }) {\n if (count === undefined) return null;\n return <span data-tab-count=\"\" className=\"font-mono text-xs font-medium tabular-nums text-fg-secondary\">{count}</span>;\n}\n\n/** « + Intercalaire »: a button after the dividers (outside the tab list: a tablist holds only tabs). */\nfunction AddButton({ add }: { add: TabsAdd }) {\n return (\n <button\n type=\"button\"\n onClick={add.onAdd}\n className=\"mb-1 ml-1 inline-flex min-h-9 shrink-0 items-center gap-1.5 rounded-lg px-2.5 text-sm font-medium text-fg-secondary hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden focusable=\"false\">\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n {add.label}\n </button>\n );\n}\n\nexport type TabsAdd = {\n /** Its words (« Intercalaire », « New tag ») — passed translated. */\n label: string;\n /** Adds a divider (opens the host's form). */\n onAdd: () => void;\n};\n\nexport type TabsVariants = VariantProps<typeof tabs>;\ntype Variant = NonNullable<TabsVariants[\"variant\"]>;\n\nconst VariantContext = React.createContext<Variant>(\"underline\");\n\nexport type TabsRootProps = React.ComponentProps<typeof TabsPrimitive.Root> & {\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers that organise collections, tags, statuses). */\n variant?: TabsVariants[\"variant\"];\n /** Binds the active tab to this search parameter of the URL (`?tab=…`): the URL is the state. Without it the state is local — only for an ephemeral choice. */\n routeKey?: string;\n /** The values the parameter may hold (the tabs' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation` (horizontal by default), `variant` for the list. */\nexport function TabsRoot({ variant = \"underline\", className, routeKey, routeValues, ...rest }: TabsRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n return (\n <VariantContext.Provider value={variant}>\n <TabsPrimitive.Root data-variant={variant} className={tabs({ variant }).root({ className })} {...props} />\n </VariantContext.Provider>\n );\n}\n\nexport type TabsListProps = React.ComponentProps<typeof TabsPrimitive.List> & {\n /** A « + » button after the tabs (`variant=\"binder\"`: « + Intercalaire »): its words and what it does. */\n add?: TabsAdd;\n};\n\n/** The tabs. Name it (`aria-label`) when no heading says what it switches. One light glides to the active tab. */\nexport function TabsList({ className, add, ...props }: TabsListProps) {\n const variant = React.useContext(VariantContext);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=tab]\", active: \"[role=tab][data-state=active]\" });\n const list = <TabsPrimitive.List ref={ref} data-variant={variant} className={tabs({ variant }).list({ className: cn(add && \"min-w-0 flex-1 border-b-0\", className) })} {...props} />;\n if (!add) return list;\n return (\n <div data-tabs-row=\"\" className={cn(\"flex min-w-0 items-end\", variant === \"binder\" && \"border-b border-border-default\")}>\n {list}\n <AddButton add={add} />\n </div>\n );\n}\n\nexport type TabsTriggerProps = React.ComponentProps<typeof TabsPrimitive.Trigger> & {\n /** A count after the words (clients in a collection, unread): part of the tab's name. */\n count?: number;\n /** `variant=\"binder\"`: the divider's colour (the accent by default). */\n hue?: TabsHue;\n};\n\nexport function TabsTrigger({ className, count, hue, style, children, ...props }: TabsTriggerProps) {\n const variant = React.useContext(VariantContext);\n return (\n <TabsPrimitive.Trigger className={tabs({ variant }).trigger({ className })} style={hueStyle(hue, style)} data-hue={hue} {...props}>\n {children}\n <TabCount count={count} />\n </TabsPrimitive.Trigger>\n );\n}\n\nexport function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return <TabsPrimitive.Content className={tabs().content({ className })} {...props} />;\n}\n\n// ── Route mode: tabs that are links; the URL is the state (Oussama, 2026-10-22) ──────────────────────────────────────\n\n/**\n * Is the link `href` the tab of the route `current` (a path, with its search: `/docs/api?tab=x`)? The path must equal the\n * link's (a trailing slash, a locale-free comparison and the hash do not count); with `exact` false (the default) a deeper\n * path of the same section counts too (`/docs/api/x` is in `/docs/api`); every search parameter of the link must be in\n * `current`. The hub link (`/`) is only ever active on `/` itself.\n */\nexport function isTabActive(current: string, href: string, exact = false): boolean {\n const split = (value: string) => {\n const url = new URL(value.split(\"#\")[0]!, \"https://tabs.invalid\");\n return { path: url.pathname.replace(/\\/+$/, \"\") || \"/\", search: url.searchParams };\n };\n const here = split(current);\n const target = split(href);\n const samePath = here.path === target.path;\n const deeper = !exact && target.path !== \"/\" && here.path.startsWith(`${target.path}/`);\n if (!samePath && !deeper) return false;\n for (const [key, value] of target.search) if (here.search.get(key) !== value) return false;\n return true;\n}\n\ninterface NavState {\n current: string;\n variant: Variant;\n}\nconst NavContext = React.createContext<NavState | null>(null);\n\nexport type TabsNavProps = Omit<React.ComponentProps<\"nav\">, \"children\"> & {\n /** A « + » button after the tabs (`variant=\"binder\"`: « + Intercalaire »). */\n add?: TabsAdd;\n /** The navigation's accessible name (« Sections »). */\n label: string;\n /** The current route, passed in: the path with its search (`usePathname()` + `useSearchParams()`, `/docs?tab=api`). The active tab comes from it; no local state. */\n current: string;\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers). */\n variant?: TabsVariants[\"variant\"];\n /** The tabs: `Tabs.NavLink`. */\n children: React.ReactNode;\n};\n\n/**\n * Tabs as routes: a `nav` of links, the URL is the state. Per WAI-ARIA these are links, not a tablist: each tab is an\n * anchor, the active one carries `aria-current=\"page\"`, the keyboard is the page's own (Tab walks the links, Enter\n * follows one) and there is no panel — the page is the panel. The same looks and the same gliding light as `Tabs.List`.\n */\nexport function TabsNav({ label, current, variant = \"underline\", add, className, children, ...props }: TabsNavProps) {\n const { ref } = useSlidingIndicator<HTMLElement>({ item: \"[data-tabs-link]\", active: \"[data-tabs-link][data-state=active]\" });\n const value = React.useMemo(() => ({ current, variant }), [current, variant]);\n const nav = (\n <nav ref={ref} aria-label={label} data-variant={variant} data-orientation=\"horizontal\" className={tabs({ variant }).list({ className: cn(add && \"min-w-0 flex-1 border-b-0\", className) })} {...props}>\n {children}\n </nav>\n );\n return (\n <NavContext.Provider value={value}>\n {add ? (\n <div data-tabs-row=\"\" className={cn(\"flex min-w-0 items-end\", variant === \"binder\" && \"border-b border-border-default\")}>\n {nav}\n <AddButton add={add} />\n </div>\n ) : (\n nav\n )}\n </NavContext.Provider>\n );\n}\n\nexport type TabsNavLinkProps = React.ComponentProps<\"a\"> & {\n /** Where the tab goes (`/docs/api`, `/docs?tab=api`). */\n href: string;\n /** Match this path only, not the pages below it. */\n exact?: boolean;\n /** Renders your router's `<Link>` (pass it as the only child; the `href` goes on this part and on the link). */\n asChild?: boolean;\n /** A count after the words (not with `asChild`: put it in your link). */\n count?: number;\n /** `variant=\"binder\"`: the divider's colour (the accent by default). */\n hue?: TabsHue;\n};\n\n/** One tab of `Tabs.Nav`: an anchor that is active when the current route is its `href`. */\nexport function TabsNavLink({ href, exact, asChild, count, hue, style, className, children, ...props }: TabsNavLinkProps) {\n const ctx = React.useContext(NavContext);\n if (!ctx) throw new Error(\"Tabs.NavLink must be inside <Tabs.Nav>\");\n const active = isTabActive(ctx.current, href, exact);\n const Comp = asChild ? Slot.Root : \"a\";\n return (\n <Comp\n data-tabs-link=\"\"\n data-state={active ? \"active\" : \"inactive\"}\n data-orientation=\"horizontal\"\n aria-current={active ? \"page\" : undefined}\n {...(asChild ? {} : { href })}\n data-hue={hue}\n style={hueStyle(hue, style)}\n className={cn(tabs({ variant: ctx.variant }).trigger(), \"no-underline\", className)}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <TabCount count={count} />\n </>\n )}\n </Comp>\n );\n}\n\n/** `Tabs.Root/List/Trigger/Content` — `variant` underline · segmented · pills · binder on the root. `Tabs.Nav` + `Tabs.NavLink`: the same tabs as routes. */\nexport const Tabs = { Root: TabsRoot, List: TabsList, Trigger: TabsTrigger, Content: TabsContent, Nav: TabsNav, NavLink: TabsNavLink };\n"],"mappings":";;;;;;;;;AAEA,SAAS,MAAM,QAAQ,qBAAqB;AAC5C,YAAY,WAAW;AACvB,SAAS,UAA6B;AAGtC,SAAS,uBAAuB;AA+FvB,SAgMD,UAhMC,KAML,YANK;AA5FF,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,MAAM;AAAA;AAAA;AAAA,IAGN,MACE;AAAA,IAGF,SACE;AAAA,IAEF,SAAS;AAAA,EACX;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA;AAAA,MAEP,WAAW;AAAA,QACT,MACE;AAAA,QAKF,SACE;AAAA,MAKJ;AAAA;AAAA,MAEA,WAAW;AAAA,QACT,MACE;AAAA,QAEF,SACE;AAAA,MAGJ;AAAA;AAAA,MAEA,OAAO;AAAA,QACL,MACE;AAAA,QAGF,SACE;AAAA,MAGJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,QAAQ;AAAA,QACN,MACE;AAAA,QAEF,SACE;AAAA,MAIJ;AAAA,IACF;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,YAAY;AAC1C,CAAC;AAQD,IAAM,MAA+B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,EAAE,KAAK;AAAA,MAC3B,YAAU;AAAA,MACV,OAAO,SAAS,KAAK,KAAK;AAAA,MAC1B,WAAW,GAAG,KAAK,EAAE,SAAS,IAAI,QAAQ,CAAC,EAAE,QAAQ,GAAG,gBAAgB,SAAS;AAAA,MAChF,GAAG;AAAA,MAEH,oBACC,WAEA,iCACG;AAAA;AAAA,QACD,oBAAC,YAAS,OAAc;AAAA,SAC1B;AAAA;AAAA,EAEJ;AAEJ;AAGO,IAAM,OAAO,EAAE,MAAM,UAAU,MAAM,UAAU,SAAS,aAAa,SAAS,aAAa,KAAK,SAAS,SAAS,YAAY;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/tabs/tabs.tsx"],"sourcesContent":["// Client (a context). Radix Tabs does the roles (tablist, tab, tabpanel), the aria-selected / aria-controls wiring,\n// the roving focus (arrows, Home, End) and automatic activation: this file only holds the three looks.\nimport { Slot, Tabs as TabsPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { useRouteBinding } from \"../router\";\nimport { useSlidingIndicator } from \"../sliding-indicator\";\n\nexport const tabs = tv({\n slots: {\n root: \"flex gap-4 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n // One light glides from the active tab to the next (`before:`, placed by useSlidingIndicator); until it is placed\n // (server render), each trigger carries its own active style.\n list:\n \"group/tabs relative isolate flex shrink-0 data-[orientation=vertical]:flex-col \" +\n \"before:pointer-events-none before:absolute before:-z-10 before:opacity-0 before:transition-[translate,width,height,opacity] before:duration-300 \" +\n \"motion-reduce:before:transition-none data-[indicator=on]:before:opacity-100\",\n trigger:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n content: \"kz-tabs-panel min-w-0 flex-1 rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[state=inactive]:hidden\",\n },\n variants: {\n variant: {\n /* The section of a page: a line under the list, the active tab underlined in the accent. */\n underline: {\n list:\n \"gap-1 border-border-default data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-r before:rounded-sm before:bg-accent \" +\n \"data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:left-0 data-[orientation=horizontal]:before:h-0.5 \" +\n \"data-[orientation=horizontal]:before:w-(--kz-ind-w) data-[orientation=horizontal]:before:translate-x-(--kz-ind-x) \" +\n \"data-[orientation=vertical]:before:-right-px data-[orientation=vertical]:before:top-0 data-[orientation=vertical]:before:w-0.5 \" +\n \"data-[orientation=vertical]:before:h-(--kz-ind-h) data-[orientation=vertical]:before:translate-y-(--kz-ind-y)\",\n trigger:\n \"relative rounded-md px-3 py-2.5 text-sm text-fg-secondary hover:text-fg data-[state=active]:text-fg \" +\n \"after:absolute after:rounded-sm after:bg-transparent data-[state=active]:after:bg-accent \" +\n \"data-[orientation=horizontal]:after:inset-x-2 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5 \" +\n \"data-[orientation=vertical]:justify-start data-[orientation=vertical]:after:inset-y-1.5 data-[orientation=vertical]:after:-right-px data-[orientation=vertical]:after:w-0.5 \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:after:bg-transparent\",\n },\n /* A view switch: equal segments in a track, the active one filled. */\n segmented: {\n list:\n \"inline-grid auto-cols-fr grid-flow-col gap-1 self-start rounded-xl border border-border-default bg-surface-1 p-1 data-[orientation=vertical]:grid-flow-row \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) before:rounded-lg before:bg-accent before:shadow-sm\",\n trigger:\n \"min-h-8 rounded-lg px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-2 hover:text-fg \" +\n \"data-[state=active]:bg-accent data-[state=active]:text-on-accent data-[state=active]:shadow-sm data-[state=active]:hover:bg-accent \" +\n \"transition-colors group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent group-data-[indicator=on]/tabs:data-[state=active]:shadow-none\",\n },\n /* Pills that scroll sideways on a phone: a feed's sections. */\n pills: {\n list:\n \"gap-1.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-1 -mt-1 pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"before:left-0 before:top-0 before:h-(--kz-ind-h) before:w-(--kz-ind-w) before:translate-x-(--kz-ind-x) before:translate-y-(--kz-ind-y) \" +\n \"before:rounded-sm before:border before:border-accent before:bg-accent-soft\",\n trigger:\n \"h-9 rounded-sm border border-border-default bg-surface-1 px-4 text-xs text-fg-secondary hover:border-border-strong hover:text-fg \" +\n \"data-[state=active]:border-accent data-[state=active]:bg-accent-soft data-[state=active]:text-fg \" +\n \"group-data-[indicator=on]/tabs:data-[state=active]:border-transparent group-data-[indicator=on]/tabs:data-[state=active]:bg-transparent\",\n },\n /*\n * Binder dividers (intercalaires, #648): organise collections, tags and statuses. Each tab is a divider with a\n * coloured top edge (`hue`), its words and a count; the active one is the page's colour and joins the content\n * under the list's line. Too many dividers scroll sideways, the edges fading. No paper texture: organisation only.\n */\n binder: {\n list:\n \"items-end gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain border-b border-border-default px-3 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden \" +\n \"[mask-image:linear-gradient(to_right,transparent,black_12px,black_calc(100%-12px),transparent)]\",\n trigger:\n \"relative -mb-px min-h-10 rounded-t-lg border border-b-0 border-border-default bg-surface-2 px-3.5 pb-2 pt-2.5 text-sm text-fg-secondary \" +\n \"before:absolute before:inset-x-0 before:-top-px before:h-1 before:rounded-t-lg before:bg-(--kz-hue,var(--kz-accent)) \" +\n \"hover:bg-surface-3 hover:text-fg data-[state=active]:z-[1] data-[state=active]:bg-surface-1 data-[state=active]:pb-2.5 data-[state=active]:text-fg \" +\n \"data-[state=active]:shadow-[0_1px_0_0_var(--kz-surface-1)] motion-reduce:transition-none\",\n },\n },\n },\n defaultVariants: { variant: \"underline\" },\n});\n\n/**\n * A divider's colour (`variant=\"binder\"`): the brand's accent by default, or a role of the theme — every one reads at 3:1 or\n * more on both themes. The colour is never the only signal: the words and the count say it.\n */\nexport type TabsHue = \"accent\" | \"success\" | \"warning\" | \"danger\" | \"neutral\";\n// The text roles where the fill role is too light on a light page (success, warning: 2:1): every edge reaches 3:1, tested.\nconst HUE: Record<TabsHue, string> = {\n accent: \"var(--kz-accent)\",\n success: \"var(--kz-success-text)\",\n warning: \"var(--kz-warning-text)\",\n danger: \"var(--kz-danger-text)\",\n neutral: \"var(--kz-text-muted)\",\n};\n/** The style that paints a divider's edge (`--kz-hue`), merged with the host's. */\nconst hueStyle = (hue: TabsHue | undefined, style: React.CSSProperties | undefined) =>\n hue ? { ...style, [\"--kz-hue\" as string]: HUE[hue] } : style;\n\n/** The count after a tab's words: part of its name (« Clients 12 »), muted, tabular. */\nfunction TabCount({ count }: Readonly<{ count: number | undefined }>) {\n if (count === undefined) return null;\n return <span data-tab-count=\"\" className=\"font-mono text-xs font-medium tabular-nums text-fg-secondary\">{count}</span>;\n}\n\n/** « + Intercalaire »: a button after the dividers (outside the tab list: a tablist holds only tabs). */\nfunction AddButton({ add }: Readonly<{ add: TabsAdd }>) {\n return (\n <button\n type=\"button\"\n onClick={add.onAdd}\n className=\"mb-1 ml-1 inline-flex min-h-9 shrink-0 items-center gap-1.5 rounded-lg px-2.5 text-sm font-medium text-fg-secondary hover:bg-surface-2 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden focusable=\"false\">\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n {add.label}\n </button>\n );\n}\n\nexport type TabsAdd = {\n /** Its words (« Intercalaire », « New tag ») — passed translated. */\n label: string;\n /** Adds a divider (opens the host's form). */\n onAdd: () => void;\n};\n\nexport type TabsVariants = VariantProps<typeof tabs>;\ntype Variant = NonNullable<TabsVariants[\"variant\"]>;\n\nconst VariantContext = React.createContext<Variant>(\"underline\");\n\nexport type TabsRootProps = React.ComponentProps<typeof TabsPrimitive.Root> & {\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers that organise collections, tags, statuses). */\n variant?: TabsVariants[\"variant\"];\n /** Binds the active tab to this search parameter of the URL (`?tab=…`): the URL is the state. Without it the state is local — only for an ephemeral choice. */\n routeKey?: string;\n /** The values the parameter may hold (the tabs' `value`s); the first is the default unless `defaultValue` says otherwise. */\n routeValues?: readonly string[];\n};\n\n/** `value`/`defaultValue` + `onValueChange`, `orientation` (horizontal by default), `variant` for the list. */\nexport function TabsRoot({ variant = \"underline\", className, routeKey, routeValues, ...rest }: TabsRootProps) {\n const props = useRouteBinding(routeKey, routeValues, rest);\n return (\n <VariantContext.Provider value={variant}>\n <TabsPrimitive.Root data-variant={variant} className={tabs({ variant }).root({ className })} {...props} />\n </VariantContext.Provider>\n );\n}\n\nexport type TabsListProps = React.ComponentProps<typeof TabsPrimitive.List> & {\n /** A « + » button after the tabs (`variant=\"binder\"`: « + Intercalaire »): its words and what it does. */\n add?: TabsAdd;\n};\n\n/** The tabs. Name it (`aria-label`) when no heading says what it switches. One light glides to the active tab. */\nexport function TabsList({ className, add, ...props }: TabsListProps) {\n const variant = React.useContext(VariantContext);\n const { ref } = useSlidingIndicator<HTMLDivElement>({ item: \"[role=tab]\", active: \"[role=tab][data-state=active]\" });\n const list = <TabsPrimitive.List ref={ref} data-variant={variant} className={tabs({ variant }).list({ className: cn(add && \"min-w-0 flex-1 border-b-0\", className) })} {...props} />;\n if (!add) return list;\n return (\n <div data-tabs-row=\"\" className={cn(\"flex min-w-0 items-end\", variant === \"binder\" && \"border-b border-border-default\")}>\n {list}\n <AddButton add={add} />\n </div>\n );\n}\n\nexport type TabsTriggerProps = React.ComponentProps<typeof TabsPrimitive.Trigger> & {\n /** A count after the words (clients in a collection, unread): part of the tab's name. */\n count?: number;\n /** `variant=\"binder\"`: the divider's colour (the accent by default). */\n hue?: TabsHue;\n};\n\nexport function TabsTrigger({ className, count, hue, style, children, ...props }: TabsTriggerProps) {\n const variant = React.useContext(VariantContext);\n return (\n <TabsPrimitive.Trigger className={tabs({ variant }).trigger({ className })} style={hueStyle(hue, style)} data-hue={hue} {...props}>\n {children}\n <TabCount count={count} />\n </TabsPrimitive.Trigger>\n );\n}\n\nexport function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return <TabsPrimitive.Content className={tabs().content({ className })} {...props} />;\n}\n\n// ── Route mode: tabs that are links; the URL is the state (Oussama, 2026-10-22) ──────────────────────────────────────\n\n/**\n * Is the link `href` the tab of the route `current` (a path, with its search: `/docs/api?tab=x`)? The path must equal the\n * link's (a trailing slash, a locale-free comparison and the hash do not count); with `exact` false (the default) a deeper\n * path of the same section counts too (`/docs/api/x` is in `/docs/api`); every search parameter of the link must be in\n * `current`. The hub link (`/`) is only ever active on `/` itself.\n */\nexport function isTabActive(current: string, href: string, exact = false): boolean {\n const split = (value: string) => {\n const url = new URL(value.split(\"#\")[0]!, \"https://tabs.invalid\");\n return { path: url.pathname.replace(/\\/+$/, \"\") || \"/\", search: url.searchParams };\n };\n const here = split(current);\n const target = split(href);\n const samePath = here.path === target.path;\n const deeper = !exact && target.path !== \"/\" && here.path.startsWith(`${target.path}/`);\n if (!samePath && !deeper) return false;\n for (const [key, value] of target.search) if (here.search.get(key) !== value) return false;\n return true;\n}\n\ninterface NavState {\n current: string;\n variant: Variant;\n}\nconst NavContext = React.createContext<NavState | null>(null);\n\nexport type TabsNavProps = Omit<React.ComponentProps<\"nav\">, \"children\"> & {\n /** A « + » button after the tabs (`variant=\"binder\"`: « + Intercalaire »). */\n add?: TabsAdd;\n /** The navigation's accessible name (« Sections »). */\n label: string;\n /** The current route, passed in: the path with its search (`usePathname()` + `useSearchParams()`, `/docs?tab=api`). The active tab comes from it; no local state. */\n current: string;\n /** underline (the sections of a page) · segmented (a view switch) · pills (a feed's sections) · binder (dividers). */\n variant?: TabsVariants[\"variant\"];\n /** The tabs: `Tabs.NavLink`. */\n children: React.ReactNode;\n};\n\n/**\n * Tabs as routes: a `nav` of links, the URL is the state. Per WAI-ARIA these are links, not a tablist: each tab is an\n * anchor, the active one carries `aria-current=\"page\"`, the keyboard is the page's own (Tab walks the links, Enter\n * follows one) and there is no panel — the page is the panel. The same looks and the same gliding light as `Tabs.List`.\n */\nexport function TabsNav({ label, current, variant = \"underline\", add, className, children, ...props }: TabsNavProps) {\n const { ref } = useSlidingIndicator<HTMLElement>({ item: \"[data-tabs-link]\", active: \"[data-tabs-link][data-state=active]\" });\n const value = React.useMemo(() => ({ current, variant }), [current, variant]);\n const nav = (\n <nav ref={ref} aria-label={label} data-variant={variant} data-orientation=\"horizontal\" className={tabs({ variant }).list({ className: cn(add && \"min-w-0 flex-1 border-b-0\", className) })} {...props}>\n {children}\n </nav>\n );\n return (\n <NavContext.Provider value={value}>\n {add ? (\n <div data-tabs-row=\"\" className={cn(\"flex min-w-0 items-end\", variant === \"binder\" && \"border-b border-border-default\")}>\n {nav}\n <AddButton add={add} />\n </div>\n ) : (\n nav\n )}\n </NavContext.Provider>\n );\n}\n\nexport type TabsNavLinkProps = React.ComponentProps<\"a\"> & {\n /** Where the tab goes (`/docs/api`, `/docs?tab=api`). */\n href: string;\n /** Match this path only, not the pages below it. */\n exact?: boolean;\n /** Renders your router's `<Link>` (pass it as the only child; the `href` goes on this part and on the link). */\n asChild?: boolean;\n /** A count after the words (not with `asChild`: put it in your link). */\n count?: number;\n /** `variant=\"binder\"`: the divider's colour (the accent by default). */\n hue?: TabsHue;\n};\n\n/** One tab of `Tabs.Nav`: an anchor that is active when the current route is its `href`. */\nexport function TabsNavLink({ href, exact, asChild, count, hue, style, className, children, ...props }: TabsNavLinkProps) {\n const ctx = React.useContext(NavContext);\n if (!ctx) throw new Error(\"Tabs.NavLink must be inside <Tabs.Nav>\");\n const active = isTabActive(ctx.current, href, exact);\n const Comp = asChild ? Slot.Root : \"a\";\n return (\n <Comp\n data-tabs-link=\"\"\n data-state={active ? \"active\" : \"inactive\"}\n data-orientation=\"horizontal\"\n aria-current={active ? \"page\" : undefined}\n {...(asChild ? {} : { href })}\n data-hue={hue}\n style={hueStyle(hue, style)}\n className={cn(tabs({ variant: ctx.variant }).trigger(), \"no-underline\", className)}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <TabCount count={count} />\n </>\n )}\n </Comp>\n );\n}\n\n/** `Tabs.Root/List/Trigger/Content` — `variant` underline · segmented · pills · binder on the root. `Tabs.Nav` + `Tabs.NavLink`: the same tabs as routes. */\nexport const Tabs = { Root: TabsRoot, List: TabsList, Trigger: TabsTrigger, Content: TabsContent, Nav: TabsNav, NavLink: TabsNavLink };\n"],"mappings":";;;;;;;;;AAEA,SAAS,MAAM,QAAQ,qBAAqB;AAC5C,YAAY,WAAW;AACvB,SAAS,UAA6B;AAGtC,SAAS,uBAAuB;AA+FvB,SAgMD,UAhMC,KAML,YANK;AA5FF,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,MAAM;AAAA;AAAA;AAAA,IAGN,MACE;AAAA,IAGF,SACE;AAAA,IAEF,SAAS;AAAA,EACX;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA;AAAA,MAEP,WAAW;AAAA,QACT,MACE;AAAA,QAKF,SACE;AAAA,MAKJ;AAAA;AAAA,MAEA,WAAW;AAAA,QACT,MACE;AAAA,QAEF,SACE;AAAA,MAGJ;AAAA;AAAA,MAEA,OAAO;AAAA,QACL,MACE;AAAA,QAGF,SACE;AAAA,MAGJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,QAAQ;AAAA,QACN,MACE;AAAA,QAEF,SACE;AAAA,MAIJ;AAAA,IACF;AAAA,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iB;AAAA,MACjB,gBAAc,SAAS,SAAS;AAAA,MAC/B,GAAI,UAAU,CAAC,IAAI,EAAE,KAAK;AAAA,MAC3B,YAAU;AAAA,MACV,OAAO,SAAS,KAAK,KAAK;AAAA,MAC1B,WAAW,GAAG,KAAK,EAAE,SAAS,IAAI,QAAQ,CAAC,EAAE,QAAQ,GAAG,gBAAgB,SAAS;AAAA,MAChF,GAAG;AAAA,MAEH,oBACC,WAEA,iCACG;AAAA;AAAA,QACD,oBAAC,YAAS,OAAc;AAAA,SAC1B;AAAA;AAAA,EAEJ;AAEJ;AAGO,IAAM,OAAO,EAAE,MAAM,UAAU,MAAM,UAAU,SAAS,aAAa,SAAS,aAAa,KAAK,SAAS,SAAS,YAAY;","names":[]}
|
package/dist/tag-input.js
CHANGED
package/dist/tag-selector.js
CHANGED
package/dist/text-style.js
CHANGED
|
@@ -223,12 +223,13 @@ function surfaceOf(element) {
|
|
|
223
223
|
}
|
|
224
224
|
let background = [0, 0, 0, 0];
|
|
225
225
|
for (const node of layers.reverse()) {
|
|
226
|
-
const color =
|
|
226
|
+
const color = getComputedStyle(node).backgroundColor;
|
|
227
227
|
const layer = color ? parseColorWithAlpha(color) : [0, 0, 0, 0];
|
|
228
228
|
if (!layer) return null;
|
|
229
229
|
background = over(layer, background);
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
const [red, green, blue, alpha] = background;
|
|
232
|
+
return alpha >= 1 ? [red, green, blue] : null;
|
|
232
233
|
}
|
|
233
234
|
function useContrast(ref, key) {
|
|
234
235
|
const [measurement, setMeasurement] = React.useState(null);
|
|
@@ -237,7 +238,7 @@ function useContrast(ref, key) {
|
|
|
237
238
|
if (!element) return;
|
|
238
239
|
const measure = () => {
|
|
239
240
|
const sample = element.querySelector("[data-text-style-sample]") ?? element;
|
|
240
|
-
const computed =
|
|
241
|
+
const computed = getComputedStyle(sample);
|
|
241
242
|
const foreground = parseColor(computed.color);
|
|
242
243
|
const background = surfaceOf(sample);
|
|
243
244
|
const fontSize = Number.parseFloat(computed.fontSize);
|