@krizaka/ui 4.4.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/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-VUD4IEVJ.js → chunk-VZ6ZALIJ.js} +1 -1
- 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.js +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 +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-CL7t7xqb.d.ts → schema-Dd05m48Q.d.ts} +9 -9
- 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 +12 -12
- 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 +5 -5
- 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/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 +7 -7
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- 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 +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-VUD4IEVJ.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/code-block.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/code-block/code-block.tsx","../src/tabs/tabs.tsx","../src/sliding-indicator.ts","../src/code-block/tokens.tsx","../src/code-block/highlighter.ts"],"sourcesContent":["// Client (the copy button, the tabs). A sample of code (blocks.css): its language and its file name, the code\n// highlighted by TanStack Highlight (it scrolls sideways, never shrinks, and takes the keyboard's focus to scroll),\n// lines numbered or set apart (highlighted, added, removed, in focus), a copy button that says it copied in a polite\n// live region. CodeTabs puts several ways to write the same thing (Maven · Gradle · npm) under\n// the tabs of @krizaka/ui.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { CheckGlyph, CopyGlyph } from \"../glyphs\";\nimport { TabsContent, TabsList, TabsRoot, TabsTrigger } from \"../tabs/tabs\";\nimport { type CodeAnnotation, highlight } from \"./tokens\";\n\nexport type CodeBlockProps = Omit<React.HTMLAttributes<HTMLElement>, \"children\"> & {\n /** The code, as it is copied. */\n code: string;\n /**\n * Its language, shown as a tag and used by the highlighter: `ts`, `tsx`, `js`, `jsx`, `json`, `yaml`, `bash`, `html`\n * (`xml`), `css`, `java`, `kotlin`, `diff`, `properties`. Another one is shown as plain text.\n */\n language?: string;\n /** The file it belongs in (`pom.xml`, `application.yml`), or what it is (`Terminal`). */\n file?: React.ReactNode;\n /** The copy button's words, passed translated. Without them there is no copy button (a sample inside a text, say). */\n copyLabel?: string;\n /** What the button says once the code is copied (announced politely). */\n copiedLabel?: string;\n /**\n * Colours comments, strings, keywords, types, tags and numbers (the tokens' roles).\n * @default true\n */\n highlight?: boolean;\n /** A number before every line. */\n lineNumbers?: boolean;\n /** Lines set apart: `highlight`, `added`, `removed`, `error`, `warning`, `dim`, or `focus` (all the others are dimmed). */\n annotations?: readonly CodeAnnotation[];\n /** Called after the code is copied. */\n onCopy?: () => void;\n};\n\n/** A code sample: language and file name, highlighted code that scrolls sideways, a copy button. */\nexport function CodeBlock({ code, language = \"text\", file, copyLabel, copiedLabel, highlight: colour = true, lineNumbers, annotations, onCopy, className, ...props }: CodeBlockProps) {\n const [copied, setCopied] = React.useState(false);\n React.useEffect(() => {\n if (!copied) return;\n const t = setTimeout(() => setCopied(false), 1800);\n return () => clearTimeout(t);\n }, [copied]);\n const copy = () =>\n navigator.clipboard?.writeText(code).then(() => {\n setCopied(true);\n onCopy?.();\n });\n return (\n <figure className={cn(\"kz-code\", className)} {...props}>\n {file || language !== \"text\" || copyLabel ? (\n <figcaption className=\"kz-code-bar\">\n <span className=\"kz-code-file\">\n {language !== \"text\" && <span className=\"kz-code-lang\">{language}</span>}\n {file}\n </span>\n {copyLabel ? (\n <button type=\"button\" className=\"kz-code-copy\" onClick={copy} data-copied={copied ? \"\" : undefined}>\n {copied ? <CheckGlyph className=\"h-3.5 w-3.5\" /> : <CopyGlyph className=\"h-3.5 w-3.5\" />}\n <span aria-live=\"polite\">{copied ? (copiedLabel ?? copyLabel) : copyLabel}</span>\n </button>\n ) : null}\n </figcaption>\n ) : null}\n <pre tabIndex={0} className={lineNumbers ? \"th-code--line-numbers\" : undefined} data-focus={annotations?.some((a) => a.kind === \"focus\") ? \"\" : undefined}>\n <code data-language={language}>{colour ? highlight(code, language, { lineNumbers, annotations }) : code}</code>\n </pre>\n </figure>\n );\n}\n\nexport type CodeTabsProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"dir\" | \"defaultValue\"> & {\n /** What the tabs choose between (`Build tool`): the tab list's accessible name. */\n label: string;\n /** The ways to write it: an id, the tab's words, its sample (a `CodeBlock`). */\n tabs: readonly { id: string; label: React.ReactNode; content: React.ReactNode }[];\n /** The tab open at first. Defaults to the first one. */\n defaultValue?: string;\n};\n\n/** Several ways to write the same thing (Maven · Gradle · npm): segmented tabs above code samples. */\nexport function CodeTabs({ label, tabs, defaultValue, className, ...props }: CodeTabsProps) {\n return (\n <TabsRoot defaultValue={defaultValue ?? tabs[0]?.id} variant=\"segmented\" className={cn(\"kz-code-tabs\", className)} {...props}>\n <TabsList aria-label={label}>\n {tabs.map((t) => (\n <TabsTrigger key={t.id} value={t.id}>\n {t.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((t) => (\n <TabsContent key={t.id} value={t.id}>\n {t.content}\n </TabsContent>\n ))}\n </TabsRoot>\n );\n}\n","// 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","// The shared sliding indicator (NavBar, Tabs): one element that glides from item to item instead of each item lighting\n// up on its own. It writes the target's box as CSS variables on the list (`--kz-ind-x/y/w/h`) and `data-indicator=\"on\"`\n// — no re-render, no animation frame: the glide is a CSS transition (none under reduced motion). Before hydration the\n// items keep their own active style, so nothing flashes.\nimport * as React from \"react\";\n\nconst useIsoLayoutEffect = typeof window === \"undefined\" ? React.useEffect : React.useLayoutEffect;\n\n/**\n * `item`: the selector of an item; `active`: of the current one, where the light rests; `prefer`: an item that, when\n * present, holds the light before the current one (the NavBar's open menu); `follow`: the light follows the pointer\n * and the focus — over anything that is not an item (an open menu's panel) it goes back to rest.\n */\nexport function useSlidingIndicator<T extends HTMLElement>({ item, active, prefer, follow = false }: { item: string; active: string; prefer?: string; follow?: boolean }) {\n const ref = React.useRef<T>(null);\n const place = React.useCallback((target: Element | null) => {\n const list = ref.current;\n if (!list) return;\n if (!(target instanceof HTMLElement) || !list.contains(target)) {\n list.removeAttribute(\"data-indicator\");\n return;\n }\n const a = target.getBoundingClientRect();\n const b = list.getBoundingClientRect();\n list.style.setProperty(\"--kz-ind-x\", `${a.left - b.left + list.scrollLeft}px`);\n list.style.setProperty(\"--kz-ind-y\", `${a.top - b.top + list.scrollTop}px`);\n list.style.setProperty(\"--kz-ind-w\", `${a.width}px`);\n list.style.setProperty(\"--kz-ind-h\", `${a.height}px`);\n list.setAttribute(\"data-indicator\", \"on\");\n }, []);\n const rest = React.useCallback(\n () => {\n const list = ref.current;\n // An item re-rendered under a resting pointer (a menu closing) keeps the light the pointer gave it.\n const hovered = follow ? list?.querySelector(`${item}:hover`) : null;\n place((prefer ? list?.querySelector(prefer) : null) ?? hovered ?? list?.querySelector(active) ?? null);\n },\n [place, active, prefer, item, follow],\n );\n const follow_ = React.useCallback((target: EventTarget) => {\n const hit = target instanceof Element ? target.closest(item) : null;\n if (hit && ref.current?.contains(hit)) place(hit);\n else rest();\n }, [item, place, rest]);\n\n useIsoLayoutEffect(() => {\n const list = ref.current;\n if (!list) return;\n rest();\n const resize = new ResizeObserver(rest);\n resize.observe(list);\n const changes = new MutationObserver(rest);\n changes.observe(list, { subtree: true, attributes: true, attributeFilter: [\"data-state\", \"aria-current\", \"data-active\"] });\n return () => {\n resize.disconnect();\n changes.disconnect();\n };\n }, [rest]);\n\n const handlers = follow\n ? {\n onPointerOver: (e: React.PointerEvent) => follow_(e.target),\n onPointerLeave: rest,\n onFocus: (e: React.FocusEvent) => follow_(e.target),\n onBlur: rest,\n }\n : {};\n return { ref, handlers };\n}\n","// Code → React nodes, from TanStack Highlight's tokens: spans with the `th-*` classes that blocks.css paints with the\n// tokens' text roles (≥ 4.5:1 on the code surface, both themes). No raw HTML: the nodes are elements and text.\nimport { type HighlightDecoration, type HighlightRenderNode, renderTokens } from \"@tanstack/highlight/core\";\nimport * as React from \"react\";\n\nimport { codeHighlighter } from \"./highlighter\";\n\n/** What an annotation says about its lines. */\nexport type AnnotationKind = \"highlight\" | \"added\" | \"removed\" | \"focus\" | \"dim\" | \"error\" | \"warning\";\n\n/** Lines of a sample set apart: one line (`3`) or a range (`[3, 5]`), counted from 1. */\nexport type CodeAnnotation = {\n lines: number | readonly [number, number];\n kind: AnnotationKind;\n};\n\nexport type HighlightOptions = {\n /** A number before every line. */\n lineNumbers?: boolean;\n /** Lines set apart: highlighted, added, removed, in focus (the others are dimmed), dimmed, error, warning. */\n annotations?: readonly CodeAnnotation[];\n};\n\nconst toReact = (node: HighlightRenderNode, key: number): React.ReactNode => {\n if (node.type === \"text\") return node.value;\n const data = Object.fromEntries(Object.entries(node.data ?? {}).map(([name, value]) => [`data-${name}`, value]));\n return React.createElement(\"span\", { key, className: node.classNames.join(\" \"), ...data }, node.children.map(toReact));\n};\n\n/** Splits `code` into text and coloured spans (`th-keyword`, `th-string`…), and into lines when numbered or annotated. */\nexport function highlight(code: string, language = \"text\", { lineNumbers, annotations }: HighlightOptions = {}): React.ReactNode[] {\n const { tokens } = codeHighlighter.tokenize(code, { lang: language });\n const decorations: HighlightDecoration[] = (annotations ?? []).map(({ lines, kind }) => ({ lines, className: `kz-line kz-line-${kind}`, data: { kind } }));\n return renderTokens(tokens, { lineNumbers, decorations }).map(toReact);\n}\n\n/** The language a sample is tokenized in (`bash` → `shell`, `xml` → `html`, unknown → `plaintext`). */\nexport function normalizeCodeLanguage(language?: string): string {\n return codeHighlighter.normalizeLanguage(language);\n}\n","// The highlighter of every code sample: TanStack Highlight (a deterministic, synchronous tokenizer — the same markup on\n// the server and on the client) with the grammars a Krizaka page shows. Each grammar is registered by hand: nothing\n// else is bundled. An unknown language is plain text, never an error.\nimport { createHighlighter } from \"@tanstack/highlight/core\";\nimport { css } from \"@tanstack/highlight/languages/css\";\nimport { diff } from \"@tanstack/highlight/languages/diff\";\nimport { env } from \"@tanstack/highlight/languages/env\";\nimport { html } from \"@tanstack/highlight/languages/html\";\nimport { java } from \"@tanstack/highlight/languages/java\";\nimport { js } from \"@tanstack/highlight/languages/js\";\nimport { json } from \"@tanstack/highlight/languages/json\";\nimport { jsx } from \"@tanstack/highlight/languages/jsx\";\nimport { kotlin } from \"@tanstack/highlight/languages/kotlin\";\nimport { plaintext } from \"@tanstack/highlight/languages/plaintext\";\nimport { shell } from \"@tanstack/highlight/languages/shell\";\nimport { ts } from \"@tanstack/highlight/languages/ts\";\nimport { tsx } from \"@tanstack/highlight/languages/tsx\";\nimport { yaml } from \"@tanstack/highlight/languages/yaml\";\n\n/** The languages a sample can be written in, with the names they answer to (`bash`, `xml`, `yml`, `kt`, `properties`…). */\nexport const codeHighlighter = createHighlighter({\n languages: [css, diff, { ...env, aliases: [...(env.aliases ?? []), \"properties\"] }, html, java, js, json, jsx, kotlin, plaintext, shell, ts, tsx, yaml],\n fallbackLanguage: \"plaintext\",\n});\n"],"mappings":";;;;;;;;;;AAKA,YAAYA,YAAW;;;ACHvB,SAAS,MAAM,QAAQ,qBAAqB;AAC5C,YAAYC,YAAW;AACvB,SAAS,UAA6B;AAGtC,SAAS,uBAAuB;;;ACHhC,YAAY,WAAW;AAEvB,IAAM,qBAAqB,OAAO,WAAW,cAAoB,kBAAkB;AAO5E,SAAS,oBAA2C,EAAE,MAAM,QAAQ,QAA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9B,YAAE,SADa,EAAE,EAEpB,CACD,GACH;AAAA,IACCE,MAAK,IAAI,CAAC,MACT,gBAAAF,KAAC,eAAuB,OAAO,EAAE,IAC9B,YAAE,WADa,EAAE,EAEpB,CACD;AAAA,KACH;AAEJ;","names":["React","React","React","jsx","jsx","jsxs","tabs"]}
|
|
1
|
+
{"version":3,"sources":["../src/code-block/code-block.tsx","../src/tabs/tabs.tsx","../src/sliding-indicator.ts","../src/code-block/tokens.tsx","../src/code-block/highlighter.ts"],"sourcesContent":["// Client (the copy button, the tabs). A sample of code (blocks.css): its language and its file name, the code\n// highlighted by TanStack Highlight (it scrolls sideways, never shrinks, and takes the keyboard's focus to scroll),\n// lines numbered or set apart (highlighted, added, removed, in focus), a copy button that says it copied in a polite\n// live region. CodeTabs puts several ways to write the same thing (Maven · Gradle · npm) under\n// the tabs of @krizaka/ui.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { CheckGlyph, CopyGlyph } from \"../glyphs\";\nimport { TabsContent, TabsList, TabsRoot, TabsTrigger } from \"../tabs/tabs\";\nimport { type CodeAnnotation, highlight } from \"./tokens\";\n\nexport type CodeBlockProps = Omit<React.HTMLAttributes<HTMLElement>, \"children\"> & {\n /** The code, as it is copied. */\n code: string;\n /**\n * Its language, shown as a tag and used by the highlighter: `ts`, `tsx`, `js`, `jsx`, `json`, `yaml`, `bash`, `html`\n * (`xml`), `css`, `java`, `kotlin`, `diff`, `properties`. Another one is shown as plain text.\n */\n language?: string;\n /** The file it belongs in (`pom.xml`, `application.yml`), or what it is (`Terminal`). */\n file?: React.ReactNode;\n /** The copy button's words, passed translated. Without them there is no copy button (a sample inside a text, say). */\n copyLabel?: string;\n /** What the button says once the code is copied (announced politely). */\n copiedLabel?: string;\n /**\n * Colours comments, strings, keywords, types, tags and numbers (the tokens' roles).\n * @default true\n */\n highlight?: boolean;\n /** A number before every line. */\n lineNumbers?: boolean;\n /** Lines set apart: `highlight`, `added`, `removed`, `error`, `warning`, `dim`, or `focus` (all the others are dimmed). */\n annotations?: readonly CodeAnnotation[];\n /** Called after the code is copied. */\n onCopy?: () => void;\n};\n\n/** A code sample: language and file name, highlighted code that scrolls sideways, a copy button. */\nexport function CodeBlock({ code, language = \"text\", file, copyLabel, copiedLabel, highlight: colour = true, lineNumbers, annotations, onCopy, className, ...props }: CodeBlockProps) {\n const [copied, setCopied] = React.useState(false);\n React.useEffect(() => {\n if (!copied) return;\n const t = setTimeout(() => setCopied(false), 1800);\n return () => clearTimeout(t);\n }, [copied]);\n const copy = () =>\n navigator.clipboard?.writeText(code).then(() => {\n setCopied(true);\n onCopy?.();\n });\n return (\n <figure className={cn(\"kz-code\", className)} {...props}>\n {file || language !== \"text\" || copyLabel ? (\n <figcaption className=\"kz-code-bar\">\n <span className=\"kz-code-file\">\n {language !== \"text\" && <span className=\"kz-code-lang\">{language}</span>}\n {file}\n </span>\n {copyLabel ? (\n <button type=\"button\" className=\"kz-code-copy\" onClick={copy} data-copied={copied ? \"\" : undefined}>\n {copied ? <CheckGlyph className=\"h-3.5 w-3.5\" /> : <CopyGlyph className=\"h-3.5 w-3.5\" />}\n <span aria-live=\"polite\">{copied ? (copiedLabel ?? copyLabel) : copyLabel}</span>\n </button>\n ) : null}\n </figcaption>\n ) : null}\n <pre tabIndex={0} className={lineNumbers ? \"th-code--line-numbers\" : undefined} data-focus={annotations?.some((a) => a.kind === \"focus\") ? \"\" : undefined}>\n <code data-language={language}>{colour ? highlight(code, language, { lineNumbers, annotations }) : code}</code>\n </pre>\n </figure>\n );\n}\n\nexport type CodeTabsProps = Omit<React.HTMLAttributes<HTMLDivElement>, \"dir\" | \"defaultValue\"> & {\n /** What the tabs choose between (`Build tool`): the tab list's accessible name. */\n label: string;\n /** The ways to write it: an id, the tab's words, its sample (a `CodeBlock`). */\n tabs: readonly { id: string; label: React.ReactNode; content: React.ReactNode }[];\n /** The tab open at first. Defaults to the first one. */\n defaultValue?: string;\n};\n\n/** Several ways to write the same thing (Maven · Gradle · npm): segmented tabs above code samples. */\nexport function CodeTabs({ label, tabs, defaultValue, className, ...props }: CodeTabsProps) {\n return (\n <TabsRoot defaultValue={defaultValue ?? tabs[0]?.id} variant=\"segmented\" className={cn(\"kz-code-tabs\", className)} {...props}>\n <TabsList aria-label={label}>\n {tabs.map((t) => (\n <TabsTrigger key={t.id} value={t.id}>\n {t.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((t) => (\n <TabsContent key={t.id} value={t.id}>\n {t.content}\n </TabsContent>\n ))}\n </TabsRoot>\n );\n}\n","// 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","// The shared sliding indicator (NavBar, Tabs): one element that glides from item to item instead of each item lighting\n// up on its own. It writes the target's box as CSS variables on the list (`--kz-ind-x/y/w/h`) and `data-indicator=\"on\"`\n// — no re-render, no animation frame: the glide is a CSS transition (none under reduced motion). Before hydration the\n// items keep their own active style, so nothing flashes.\nimport * as React from \"react\";\n\nconst useIsoLayoutEffect = typeof window === \"undefined\" ? React.useEffect : React.useLayoutEffect;\n\n/**\n * `item`: the selector of an item; `active`: of the current one, where the light rests; `prefer`: an item that, when\n * present, holds the light before the current one (the NavBar's open menu); `follow`: the light follows the pointer\n * and the focus — over anything that is not an item (an open menu's panel) it goes back to rest.\n */\nexport function useSlidingIndicator<T extends HTMLElement>({ item, active, prefer, follow = false }: { item: string; active: string; prefer?: string; follow?: boolean }) {\n const ref = React.useRef<T>(null);\n const place = React.useCallback((target: Element | null) => {\n const list = ref.current;\n if (!list) return;\n if (!(target instanceof HTMLElement) || !list.contains(target)) {\n list.removeAttribute(\"data-indicator\");\n return;\n }\n const a = target.getBoundingClientRect();\n const b = list.getBoundingClientRect();\n list.style.setProperty(\"--kz-ind-x\", `${a.left - b.left + list.scrollLeft}px`);\n list.style.setProperty(\"--kz-ind-y\", `${a.top - b.top + list.scrollTop}px`);\n list.style.setProperty(\"--kz-ind-w\", `${a.width}px`);\n list.style.setProperty(\"--kz-ind-h\", `${a.height}px`);\n list.setAttribute(\"data-indicator\", \"on\");\n }, []);\n const rest = React.useCallback(\n () => {\n const list = ref.current;\n // An item re-rendered under a resting pointer (a menu closing) keeps the light the pointer gave it.\n const hovered = follow ? list?.querySelector(`${item}:hover`) : null;\n place((prefer ? list?.querySelector(prefer) : null) ?? hovered ?? list?.querySelector(active) ?? null);\n },\n [place, active, prefer, item, follow],\n );\n const follow_ = React.useCallback((target: EventTarget) => {\n const hit = target instanceof Element ? target.closest(item) : null;\n if (hit && ref.current?.contains(hit)) place(hit);\n else rest();\n }, [item, place, rest]);\n\n useIsoLayoutEffect(() => {\n const list = ref.current;\n if (!list) return;\n rest();\n const resize = new ResizeObserver(rest);\n resize.observe(list);\n const changes = new MutationObserver(rest);\n changes.observe(list, { subtree: true, attributes: true, attributeFilter: [\"data-state\", \"aria-current\", \"data-active\"] });\n return () => {\n resize.disconnect();\n changes.disconnect();\n };\n }, [rest]);\n\n const handlers = follow\n ? {\n onPointerOver: (e: React.PointerEvent) => follow_(e.target),\n onPointerLeave: rest,\n onFocus: (e: React.FocusEvent) => follow_(e.target),\n onBlur: rest,\n }\n : {};\n return { ref, handlers };\n}\n","// Code → React nodes, from TanStack Highlight's tokens: spans with the `th-*` classes that blocks.css paints with the\n// tokens' text roles (≥ 4.5:1 on the code surface, both themes). No raw HTML: the nodes are elements and text.\nimport { type HighlightDecoration, type HighlightRenderNode, renderTokens } from \"@tanstack/highlight/core\";\nimport * as React from \"react\";\n\nimport { codeHighlighter } from \"./highlighter\";\n\n/** What an annotation says about its lines. */\nexport type AnnotationKind = \"highlight\" | \"added\" | \"removed\" | \"focus\" | \"dim\" | \"error\" | \"warning\";\n\n/** Lines of a sample set apart: one line (`3`) or a range (`[3, 5]`), counted from 1. */\nexport type CodeAnnotation = {\n lines: number | readonly [number, number];\n kind: AnnotationKind;\n};\n\nexport type HighlightOptions = {\n /** A number before every line. */\n lineNumbers?: boolean;\n /** Lines set apart: highlighted, added, removed, in focus (the others are dimmed), dimmed, error, warning. */\n annotations?: readonly CodeAnnotation[];\n};\n\nconst toReact = (node: HighlightRenderNode, key: number): React.ReactNode => {\n if (node.type === \"text\") return node.value;\n const data = Object.fromEntries(Object.entries(node.data ?? {}).map(([name, value]) => [`data-${name}`, value]));\n return React.createElement(\"span\", { key, className: node.classNames.join(\" \"), ...data }, node.children.map(toReact));\n};\n\n/** Splits `code` into text and coloured spans (`th-keyword`, `th-string`…), and into lines when numbered or annotated. */\nexport function highlight(code: string, language = \"text\", { lineNumbers, annotations }: HighlightOptions = {}): React.ReactNode[] {\n const { tokens } = codeHighlighter.tokenize(code, { lang: language });\n const decorations: HighlightDecoration[] = (annotations ?? []).map(({ lines, kind }) => ({ lines, className: `kz-line kz-line-${kind}`, data: { kind } }));\n return renderTokens(tokens, { lineNumbers, decorations }).map(toReact);\n}\n\n/** The language a sample is tokenized in (`bash` → `shell`, `xml` → `html`, unknown → `plaintext`). */\nexport function normalizeCodeLanguage(language?: string): string {\n return codeHighlighter.normalizeLanguage(language);\n}\n","// The highlighter of every code sample: TanStack Highlight (a deterministic, synchronous tokenizer — the same markup on\n// the server and on the client) with the grammars a Krizaka page shows. Each grammar is registered by hand: nothing\n// else is bundled. An unknown language is plain text, never an error.\nimport { createHighlighter } from \"@tanstack/highlight/core\";\nimport { css } from \"@tanstack/highlight/languages/css\";\nimport { diff } from \"@tanstack/highlight/languages/diff\";\nimport { env } from \"@tanstack/highlight/languages/env\";\nimport { html } from \"@tanstack/highlight/languages/html\";\nimport { java } from \"@tanstack/highlight/languages/java\";\nimport { js } from \"@tanstack/highlight/languages/js\";\nimport { json } from \"@tanstack/highlight/languages/json\";\nimport { jsx } from \"@tanstack/highlight/languages/jsx\";\nimport { kotlin } from \"@tanstack/highlight/languages/kotlin\";\nimport { plaintext } from \"@tanstack/highlight/languages/plaintext\";\nimport { shell } from \"@tanstack/highlight/languages/shell\";\nimport { ts } from \"@tanstack/highlight/languages/ts\";\nimport { tsx } from \"@tanstack/highlight/languages/tsx\";\nimport { yaml } from \"@tanstack/highlight/languages/yaml\";\n\n/** The languages a sample can be written in, with the names they answer to (`bash`, `xml`, `yml`, `kt`, `properties`…). */\nexport const codeHighlighter = createHighlighter({\n languages: [css, diff, { ...env, aliases: [...(env.aliases ?? []), \"properties\"] }, html, java, js, json, jsx, kotlin, plaintext, shell, ts, tsx, yaml],\n fallbackLanguage: \"plaintext\",\n});\n"],"mappings":";;;;;;;;;;AAKA,YAAYA,YAAW;;;ACHvB,SAAS,MAAM,QAAQ,qBAAqB;AAC5C,YAAYC,YAAW;AACvB,SAAS,UAA6B;AAGtC,SAAS,uBAAuB;;;ACHhC,YAAY,WAAW;AAEvB,IAAM,qBAAqB,OAAO,WAAW,cAAoB,kBAAkB;AAO5E,SAAS,oBAA2C,EAAE,MAAM,QAAQ,QAAQ,SAAS,MAAM,GAAwE;AACxK,QAAM,MAAY,aAAU,IAAI;AAChC,QAAM,QAAc,kBAAY,CAAC,WAA2B;AAC1D,UAAM,OAAO,IAAI;AACjB,QAAI,CAAC,KAAM;AACX,QAAI,EAAE,kBAAkB,gBAAgB,CAAC,KAAK,SAAS,MAAM,GAAG;AAC9D,WAAK,gBAAgB,gBAAgB;AACrC;AAAA,IACF;AACA,UAAM,IAAI,OAAO,sBAAsB;AACvC,UAAM,IAAI,KAAK,sBAAsB;AACrC,SAAK,MAAM,YAAY,cAAc,GAAG,EAAE,OAAO,EAAE,OAAO,KAAK,UAAU,IAAI;AAC7E,SAAK,MAAM,YAAY,cAAc,GAAG,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,IAAI;AAC1E,SAAK,MAAM,YAAY,cAAc,GAAG,EAAE,KAAK,IAAI;AACnD,SAAK,MAAM,YAAY,cAAc,GAAG,EAAE,MAAM,IAAI;AACpD,SAAK,aAAa,kBAAkB,IAAI;AAAA,EAC1C,GAAG,CAAC,CAAC;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AAA,OACN,IACE;AAAA,IACJ,gBAAAA,KAAC,SAAI,UAAU,GAAG,WAAW,cAAc,0BAA0B,QAAW,cAAY,aAAa,KAAK,CAAC,MAAM,EAAE,SAAS,OAAO,IAAI,KAAK,QAC9I,0BAAAA,KAAC,UAAK,iBAAe,UAAW,mBAAS,UAAU,MAAM,UAAU,EAAE,aAAa,YAAY,CAAC,IAAI,MAAK,GAC1G;AAAA,KACF;AAEJ;AAYO,SAAS,SAAS,EAAE,OAAO,MAAAE,OAAM,cAAc,WAAW,GAAG,MAAM,GAAkB;AAC1F,SACE,gBAAAD,MAAC,YAAS,cAAc,gBAAgBC,MAAK,CAAC,GAAG,IAAI,SAAQ,aAAY,WAAW,GAAG,gBAAgB,SAAS,GAAI,GAAG,OACrH;AAAA,oBAAAF,KAAC,YAAS,cAAY,OACnB,UAAAE,MAAK,IAAI,CAAC,MACT,gBAAAF,KAAC,eAAuB,OAAO,EAAE,IAC9B,YAAE,SADa,EAAE,EAEpB,CACD,GACH;AAAA,IACCE,MAAK,IAAI,CAAC,MACT,gBAAAF,KAAC,eAAuB,OAAO,EAAE,IAC9B,YAAE,WADa,EAAE,EAEpB,CACD;AAAA,KACH;AAEJ;","names":["React","React","React","jsx","jsx","jsxs","tabs"]}
|
package/dist/combobox.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
Combobox,
|
|
4
4
|
combobox,
|
|
5
5
|
comboboxLabels
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-SG2RKUVJ.js";
|
|
7
|
+
import "./chunk-5VZ37TY3.js";
|
|
8
8
|
import "./chunk-D3T54RSL.js";
|
|
9
9
|
import "./chunk-NSLXEDIS.js";
|
|
10
10
|
import "./chunk-ZIXB33X7.js";
|
package/dist/copy-button.js
CHANGED
|
@@ -21,8 +21,8 @@ function CopyButton({ value, label, copiedLabel, fallbackLabel, iconOnly, icon,
|
|
|
21
21
|
const fieldRef = React.useRef(null);
|
|
22
22
|
React.useEffect(() => {
|
|
23
23
|
if (!copied) return;
|
|
24
|
-
const timer =
|
|
25
|
-
return () =>
|
|
24
|
+
const timer = globalThis.setTimeout(() => setCopied(false), resetMs);
|
|
25
|
+
return () => globalThis.clearTimeout(timer);
|
|
26
26
|
}, [copied, resetMs]);
|
|
27
27
|
React.useEffect(() => {
|
|
28
28
|
if (manual) fieldRef.current?.select();
|
package/dist/copy-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/copy-button/copy-button.tsx"],"sourcesContent":["// Client (a state, the clipboard). Copies a value and says so in a polite live region. Without the Clipboard API\n// (an insecure page, an old webview) it falls back to a selected, read-only field the person copies by hand: the\n// failure is never silent.\nimport * as React from \"react\";\n\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { CheckGlyph, CopyGlyph } from \"../glyphs\";\n\nexport type CopyButtonProps = Omit<ButtonProps, \"onClick\" | \"asChild\" | \"value\" | \"children\"> & {\n /** The text to copy. */\n value: string;\n /** The words of the button (and its accessible name), passed translated: \"Copy link\". Icon only: set `iconOnly`. */\n label: string;\n /** What it says once copied, announced politely: \"Copied\". */\n copiedLabel: string;\n /** Said when the clipboard is unavailable, above the selected value: \"Press Ctrl+C to copy\". */\n fallbackLabel: string;\n /** Shows only the icon (the label stays the accessible name). */\n iconOnly?: boolean;\n /** Replaces the copy icon (a `@krizaka/icons` one, say). */\n icon?: React.ReactNode;\n /** Replaces the check icon shown once copied. */\n copiedIcon?: React.ReactNode;\n /** How long \"Copied\" stays, in milliseconds (1800 by default). */\n resetMs?: number;\n /** Called after the value is copied. */\n onCopy?: () => void;\n};\n\n/** A button that copies `value`. State: `data-copied`. */\nexport function CopyButton({ value, label, copiedLabel, fallbackLabel, iconOnly, icon, copiedIcon, resetMs = 1800, onCopy, variant = \"secondary\", className, ...props }: CopyButtonProps) {\n const [copied, setCopied] = React.useState(false);\n const [manual, setManual] = React.useState(false);\n const fieldRef = React.useRef<HTMLInputElement>(null);\n React.useEffect(() => {\n if (!copied) return;\n const timer =
|
|
1
|
+
{"version":3,"sources":["../src/copy-button/copy-button.tsx"],"sourcesContent":["// Client (a state, the clipboard). Copies a value and says so in a polite live region. Without the Clipboard API\n// (an insecure page, an old webview) it falls back to a selected, read-only field the person copies by hand: the\n// failure is never silent.\nimport * as React from \"react\";\n\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { CheckGlyph, CopyGlyph } from \"../glyphs\";\n\nexport type CopyButtonProps = Omit<ButtonProps, \"onClick\" | \"asChild\" | \"value\" | \"children\"> & {\n /** The text to copy. */\n value: string;\n /** The words of the button (and its accessible name), passed translated: \"Copy link\". Icon only: set `iconOnly`. */\n label: string;\n /** What it says once copied, announced politely: \"Copied\". */\n copiedLabel: string;\n /** Said when the clipboard is unavailable, above the selected value: \"Press Ctrl+C to copy\". */\n fallbackLabel: string;\n /** Shows only the icon (the label stays the accessible name). */\n iconOnly?: boolean;\n /** Replaces the copy icon (a `@krizaka/icons` one, say). */\n icon?: React.ReactNode;\n /** Replaces the check icon shown once copied. */\n copiedIcon?: React.ReactNode;\n /** How long \"Copied\" stays, in milliseconds (1800 by default). */\n resetMs?: number;\n /** Called after the value is copied. */\n onCopy?: () => void;\n};\n\n/** A button that copies `value`. State: `data-copied`. */\nexport function CopyButton({ value, label, copiedLabel, fallbackLabel, iconOnly, icon, copiedIcon, resetMs = 1800, onCopy, variant = \"secondary\", className, ...props }: CopyButtonProps) {\n const [copied, setCopied] = React.useState(false);\n const [manual, setManual] = React.useState(false);\n const fieldRef = React.useRef<HTMLInputElement>(null);\n React.useEffect(() => {\n if (!copied) return;\n const timer = globalThis.setTimeout(() => setCopied(false), resetMs);\n return () => globalThis.clearTimeout(timer);\n }, [copied, resetMs]);\n React.useEffect(() => {\n if (manual) fieldRef.current?.select();\n }, [manual]);\n const copy = async () => {\n try {\n await navigator.clipboard.writeText(value);\n setManual(false);\n setCopied(true);\n onCopy?.();\n } catch {\n // No Clipboard API, or refused: show the value selected, to copy by hand.\n setManual(true);\n }\n };\n const name = copied ? copiedLabel : label;\n return (\n <span className=\"inline-flex flex-col gap-1.5\">\n <Button type=\"button\" variant={variant} aria-label={iconOnly ? name : undefined} title={iconOnly ? name : undefined} data-copied={copied ? \"\" : undefined} className={cn(className)} onClick={() => void copy()} {...props}>\n {copied ? (copiedIcon ?? <CheckGlyph />) : (icon ?? <CopyGlyph />)}\n {!iconOnly && <span>{name}</span>}\n </Button>\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {copied ? copiedLabel : \"\"}\n </span>\n {manual && (\n <label className=\"flex flex-col gap-1 text-xs text-fg-secondary\">\n {fallbackLabel}\n <input ref={fieldRef} readOnly value={value} onFocus={(event) => event.currentTarget.select()} className=\"h-9 rounded-lg border border-border-control bg-surface-2 px-2 text-sm text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\" />\n </label>\n )}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,YAAY,WAAW;AAsDjB,SAC2B,KAD3B;AA1BC,SAAS,WAAW,EAAE,OAAO,OAAO,aAAa,eAAe,UAAU,MAAM,YAAY,UAAU,MAAM,QAAQ,UAAU,aAAa,WAAW,GAAG,MAAM,GAAoB;AACxL,QAAM,CAAC,QAAQ,SAAS,IAAU,eAAS,KAAK;AAChD,QAAM,CAAC,QAAQ,SAAS,IAAU,eAAS,KAAK;AAChD,QAAM,WAAiB,aAAyB,IAAI;AACpD,EAAM,gBAAU,MAAM;AACpB,QAAI,CAAC,OAAQ;AACb,UAAM,QAAQ,WAAW,WAAW,MAAM,UAAU,KAAK,GAAG,OAAO;AACnE,WAAO,MAAM,WAAW,aAAa,KAAK;AAAA,EAC5C,GAAG,CAAC,QAAQ,OAAO,CAAC;AACpB,EAAM,gBAAU,MAAM;AACpB,QAAI,OAAQ,UAAS,SAAS,OAAO;AAAA,EACvC,GAAG,CAAC,MAAM,CAAC;AACX,QAAM,OAAO,YAAY;AACvB,QAAI;AACF,YAAM,UAAU,UAAU,UAAU,KAAK;AACzC,gBAAU,KAAK;AACf,gBAAU,IAAI;AACd,eAAS;AAAA,IACX,QAAQ;AAEN,gBAAU,IAAI;AAAA,IAChB;AAAA,EACF;AACA,QAAM,OAAO,SAAS,cAAc;AACpC,SACE,qBAAC,UAAK,WAAU,gCACd;AAAA,yBAAC,UAAO,MAAK,UAAS,SAAkB,cAAY,WAAW,OAAO,QAAW,OAAO,WAAW,OAAO,QAAW,eAAa,SAAS,KAAK,QAAW,WAAW,GAAG,SAAS,GAAG,SAAS,MAAM,KAAK,KAAK,GAAI,GAAG,OAClN;AAAA,eAAU,cAAc,oBAAC,cAAW,IAAO,QAAQ,oBAAC,aAAU;AAAA,MAC9D,CAAC,YAAY,oBAAC,UAAM,gBAAK;AAAA,OAC5B;AAAA,IACA,oBAAC,UAAK,MAAK,UAAS,aAAU,UAAS,WAAU,WAC9C,mBAAS,cAAc,IAC1B;AAAA,IACC,UACC,qBAAC,WAAM,WAAU,iDACd;AAAA;AAAA,MACD,oBAAC,WAAM,KAAK,UAAU,UAAQ,MAAC,OAAc,SAAS,CAAC,UAAU,MAAM,cAAc,OAAO,GAAG,WAAU,2JAA0J;AAAA,OACrQ;AAAA,KAEJ;AAEJ;","names":[]}
|
package/dist/data-table.js
CHANGED
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
selectionBarLabels,
|
|
18
18
|
useDataTable,
|
|
19
19
|
writeTable
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NQENOT6L.js";
|
|
21
21
|
import "./chunk-JXLDUDTD.js";
|
|
22
22
|
import "./chunk-3X3OF4TI.js";
|
|
23
23
|
import "./chunk-ZPOVOEO3.js";
|
|
24
24
|
import "./chunk-KR2W4ONJ.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-MDSP7DJR.js";
|
|
26
|
+
import "./chunk-5VZ37TY3.js";
|
|
27
27
|
import "./chunk-D3T54RSL.js";
|
|
28
28
|
import "./chunk-J3NC6ER4.js";
|
|
29
29
|
import "./chunk-NSLXEDIS.js";
|
package/dist/desktop-window.d.ts
CHANGED
|
@@ -196,7 +196,7 @@ interface DesktopWindowProps {
|
|
|
196
196
|
className?: string;
|
|
197
197
|
}
|
|
198
198
|
/** The window of a Mac app: sidebar · content · inspector, a toolbar that moves the window, the desktop's density. */
|
|
199
|
-
declare function DesktopWindow({ sidebar, children, inspector, title, toolbarStart, toolbarEnd, labels, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, inspectorOpen, defaultInspectorOpen, onInspectorOpenChange, defaultSizes, onSizesChange, contentMin, shortcuts, className, }: DesktopWindowProps): React.JSX.Element;
|
|
199
|
+
declare function DesktopWindow({ sidebar, children, inspector, title, toolbarStart, toolbarEnd, labels, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, inspectorOpen, defaultInspectorOpen, onInspectorOpenChange, defaultSizes, onSizesChange, contentMin, shortcuts, className, }: Readonly<DesktopWindowProps>): React.JSX.Element;
|
|
200
200
|
/**
|
|
201
201
|
* The window's commands as one source: registers their chords in the page (`useShortcuts`, the browser's too) and returns
|
|
202
202
|
* the native menu bar's data — `menus` and `handlers` for `setNativeMenu(bridge, { labels, menus }, handlers)` of
|
package/dist/desktop-window.js
CHANGED
|
@@ -158,7 +158,9 @@ function DesktopWindow({
|
|
|
158
158
|
return () => observer.disconnect();
|
|
159
159
|
}, []);
|
|
160
160
|
const ceiling = (edge) => {
|
|
161
|
-
|
|
161
|
+
let other;
|
|
162
|
+
if (edge === "sidebar") other = inspShown ? sizes.inspector : 0;
|
|
163
|
+
else other = sideShown ? sizes.sidebar : 0;
|
|
162
164
|
const limits = edge === "sidebar" ? SIDEBAR : INSPECTOR;
|
|
163
165
|
return paneMax(limits, width || Number.POSITIVE_INFINITY, other, contentMin, 0);
|
|
164
166
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/app-shell/shortcuts.ts","../src/desktop-window/commands.ts","../src/desktop-window/desktop-window.tsx","../src/desktop-window/panes.ts"],"sourcesContent":["// Keyboard shortcuts for an application: a combination (`mod+k`, `shift+/`, `alt+arrowup`) or a sequence (`g d`: press G,\n// then D). `mod` is ⌘ on Apple devices and Ctrl elsewhere. Plain keys and sequences stay out of text fields; a combination\n// with `mod` works in an input (not in a rich-text editor, where ⌘B is bold). Nothing is decided here about the words.\nimport * as React from \"react\";\n\nimport { useLatest } from \"../media\";\n\nexport type ShortcutMap = Readonly<Record<string, ((event: KeyboardEvent) => void) | undefined>>;\n\nconst isApple = () => typeof navigator !== \"undefined\" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);\n\nconst ALIASES: Record<string, string> = { esc: \"escape\", return: \"enter\", space: \" \", spacebar: \" \", up: \"arrowup\", down: \"arrowdown\", left: \"arrowleft\", right: \"arrowright\", del: \"delete\", plus: \"+\" };\ntype Modifier = \"mod\" | \"ctrl\" | \"alt\" | \"shift\" | \"meta\";\n\ntype Combo = { key: string; mod: boolean; ctrl: boolean; alt: boolean; shift: boolean; meta: boolean };\n\n/** `\"mod+shift+k\"` → its parts. A lone `+` key is written `plus`. */\nexport function parseCombo(combo: string): Combo {\n const parts = combo.toLowerCase().split(\"+\").filter(Boolean);\n const key = ALIASES[parts.at(-1) ?? \"\"] ?? parts.at(-1) ?? \"\";\n const has = (name: Modifier) => parts.slice(0, -1).includes(name);\n return { key, mod: has(\"mod\"), ctrl: has(\"ctrl\"), alt: has(\"alt\"), shift: has(\"shift\"), meta: has(\"meta\") };\n}\n\n/** Whether a key event is this combination: its modifiers exactly (`mod` is ⌘ or Ctrl by platform), then its key. */\nexport function matchesCombo(event: Pick<KeyboardEvent, \"key\" | \"metaKey\" | \"ctrlKey\" | \"altKey\" | \"shiftKey\">, combo: string, apple = isApple()): boolean {\n const want = parseCombo(combo);\n const meta = want.meta || (want.mod && apple);\n const ctrl = want.ctrl || (want.mod && !apple);\n if (event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== want.alt) return false;\n // Shift is only checked when the binding names it: `?` and `/` need it on most layouts.\n if (want.shift && !event.shiftKey) return false;\n return event.key.toLowerCase() === want.key;\n}\n\n/** The keys of a shortcut to show on a keycap: `[\"⌘\", \"K\"]` on a Mac, `[\"Ctrl\", \"K\"]` elsewhere; a sequence `g d` is `[\"G\", \"D\"]`. */\nexport function formatShortcut(shortcut: string, apple = isApple()): string[] {\n if (shortcut.includes(\" \")) return shortcut.split(/\\s+/).map((key) => key.toUpperCase());\n const parts = shortcut.split(\"+\").filter(Boolean);\n const key = parts.at(-1) ?? \"\";\n const names: Record<string, [string, string]> = { mod: [\"⌘\", \"Ctrl\"], meta: [\"⌘\", \"Win\"], ctrl: [\"⌃\", \"Ctrl\"], alt: [\"⌥\", \"Alt\"], shift: [\"⇧\", \"Shift\"] };\n const shown = parts.slice(0, -1).map((part) => names[part.toLowerCase()]?.[apple ? 0 : 1] ?? part);\n const glyph: Record<string, string> = { escape: \"Esc\", enter: \"↵\", arrowup: \"↑\", arrowdown: \"↓\", arrowleft: \"←\", arrowright: \"→\", \" \": \"Space\" };\n const last = glyph[ALIASES[key.toLowerCase()] ?? key.toLowerCase()] ?? key.toUpperCase();\n return [...shown, last];\n}\n\n/**\n * The accelerator of a combination for a desktop app's native menu bar (Tauri's `MenuItem`, Electron's — ADR-002):\n * `mod+k` → `CmdOrCtrl+K`, `shift+mod+/` → `Shift+CmdOrCtrl+/`. The menu and the shell then answer the same keys, and the\n * menu shows them. A sequence (`g d`) has none: a menu item takes one chord.\n */\nexport function acceleratorOf(shortcut: string): string | undefined {\n if (shortcut.trim().includes(\" \")) return undefined;\n const parts = shortcut.split(\"+\").filter(Boolean);\n const names: Record<string, string> = { mod: \"CmdOrCtrl\", meta: \"Super\", ctrl: \"Ctrl\", alt: \"Alt\", shift: \"Shift\" };\n const raw = (parts.at(-1) ?? \"\").toLowerCase();\n const key = ALIASES[raw] ?? raw;\n const keys: Record<string, string> = { escape: \"Escape\", enter: \"Enter\", \" \": \"Space\", arrowup: \"Up\", arrowdown: \"Down\", arrowleft: \"Left\", arrowright: \"Right\", delete: \"Delete\", backspace: \"Backspace\", tab: \"Tab\", \"+\": \"Plus\" };\n const last = keys[key] ?? (key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1));\n return [...parts.slice(0, -1).map((part) => names[part.toLowerCase()] ?? part), last].join(\"+\");\n}\n\nconst noop = () => () => undefined;\n\n/** Whether the person is on an Apple device — `false` on the server and in the first client render (no mismatch), then right. */\nexport function useApple(): boolean {\n return React.useSyncExternalStore(noop, isApple, () => false);\n}\n\n/** The `aria-keyshortcuts` of a combination (`Control+K`, `Meta+K` on a Mac); a sequence has none (it is not a chord). */\nexport function ariaKeyShortcuts(shortcut: string, apple = isApple()): string | undefined {\n if (shortcut.includes(\" \")) return undefined;\n const parts = shortcut.split(\"+\").filter(Boolean);\n const names: Record<string, string> = { mod: apple ? \"Meta\" : \"Control\", meta: \"Meta\", ctrl: \"Control\", alt: \"Alt\", shift: \"Shift\" };\n const key = parts.at(-1) ?? \"\";\n return [...parts.slice(0, -1).map((part) => names[part.toLowerCase()] ?? part), key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1)].join(\"+\");\n}\n\n/** Whether a key press happens in something you type in. */\nfunction isEditable(target: EventTarget | null): { field: boolean; rich: boolean } {\n const element = target instanceof HTMLElement ? target : null;\n if (!element) return { field: false, rich: false };\n const rich = element.isContentEditable;\n return { field: rich || /^(input|textarea|select)$/i.test(element.tagName), rich };\n}\n\n/**\n * Binds shortcuts for as long as the component lives (`enabled` turns them off). Each key is a combination or a sequence,\n * each value runs when it is pressed; the handler may change on every render. A shortcut that fires is `preventDefault`ed.\n * A sequence waits `timeout` ms for its next key.\n */\nexport function useShortcuts(map: ShortcutMap, { enabled = true, timeout = 900 }: { enabled?: boolean; timeout?: number } = {}) {\n const latest = useLatest(map);\n const names = Object.keys(map).sort((a, b) => a.localeCompare(b)).join(\"\\n\");\n React.useEffect(() => {\n if (!enabled) return;\n const bindings = names.split(\"\\n\").filter(Boolean);\n let buffer: { key: string; at: number }[] = [];\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.isComposing || event.repeat || !event.key) return;\n const editing = isEditable(event.target);\n const chord = event.metaKey || event.ctrlKey || event.altKey;\n const now = Date.now();\n buffer = [...buffer.filter((entry) => now - entry.at <= timeout), { key: event.key.toLowerCase(), at: now }].slice(-4);\n for (const binding of bindings) {\n const handler = latest.current[binding];\n if (!handler) continue;\n const keys = binding.toLowerCase().split(/\\s+/).map((key) => ALIASES[key] ?? key);\n const fired =\n keys.length > 1\n ? !chord && !editing.field && buffer.length >= keys.length && keys.every((key, i) => buffer[buffer.length - keys.length + i]?.key === key)\n : matchesCombo(event, binding) && (chord ? !editing.rich : !editing.field);\n if (!fired) continue;\n event.preventDefault();\n buffer = [];\n handler(event);\n return;\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [enabled, names, latest, timeout]);\n}\n","// Pure: the commands of a desktop window, written once and read by three things — the native menu bar (through\n// `setNativeMenu` of @krizaka/app-desktop), the in-page shortcuts (`useShortcuts`, also the browser's), and the palette.\nimport { acceleratorOf } from \"../app-shell/shortcuts\";\n\nexport interface DesktopCommand {\n /** Sent back by the menu when chosen: lowercase letters, digits, `.` and `-` (`view.sidebar`). */\n id: string;\n /** The menu item's words, passed translated (`Hide sidebar`). */\n label: string;\n /** The menu it belongs to (`View`, `File`), passed translated: the product's menus sit between Edit and Window. */\n menu: string;\n /** A chord (`mod+b`): the menu shows it and the page answers it. A sequence (`g d`) is the page's only. */\n shortcut?: string;\n /** Runs the command. */\n run: () => void;\n /** A separator before it in its menu. */\n separated?: boolean;\n /** Dimmed in the menu while false (default true). */\n enabled?: boolean;\n}\n\n/** The shape `setNativeMenu` takes for its `menus` (structurally the same as `MenuSpec[\"menus\"]` of @krizaka/app-desktop). */\nexport interface DesktopMenu {\n title: string;\n items: { id: string; label: string; accelerator?: string; enabled?: boolean; separated?: boolean }[];\n}\n\nconst ID = /^[a-z0-9][a-z0-9.-]*$/;\n\nexport interface DesktopMenus {\n /** For `setNativeMenu(bridge, { labels, menus }, handlers)`. */\n menus: DesktopMenu[];\n /** For its `handlers`: the id of the chosen item → what it does. */\n handlers: Record<string, () => void>;\n /** For `useShortcuts`: the chords of the commands, answered in the page. */\n shortcuts: Record<string, () => void>;\n}\n\n/** Refuses an id the native side would refuse, or one already declared. */\nfunction checkId(out: DesktopMenus, id: string): void {\n if (!ID.test(id)) throw new Error(`desktopMenus: \"${id}\" is not a menu id (lowercase letters, digits, \".\" and \"-\").`);\n if (out.handlers[id]) throw new Error(`desktopMenus: \"${id}\" is declared twice.`);\n}\n\n/** Records the chord of a command for the page, refusing one given to two commands. */\nfunction addShortcut(out: DesktopMenus, shortcut: string, run: () => void): void {\n const key = shortcut.toLowerCase();\n if (out.shortcuts[key]) throw new Error(`desktopMenus: \"${shortcut}\" is the shortcut of two commands.`);\n out.shortcuts[key] = run;\n}\n\n/** The menu item of a command: its accelerator, and only the flags it sets. */\nfunction itemOf(command: DesktopCommand): DesktopMenu[\"items\"][number] {\n const accelerator = command.shortcut ? acceleratorOf(command.shortcut) : undefined;\n return {\n id: command.id,\n label: command.label,\n ...(accelerator ? { accelerator } : {}),\n ...(command.enabled === false ? { enabled: false } : {}),\n ...(command.separated ? { separated: true } : {}),\n };\n}\n\n/** Turns the commands into the menu bar's menus, its handlers and the page's shortcuts — one source for the three. Throws on a bad or repeated id, or a shortcut given twice. */\nexport function desktopMenus(commands: readonly DesktopCommand[]): DesktopMenus {\n const out: DesktopMenus = { menus: [], handlers: {}, shortcuts: {} };\n for (const command of commands) {\n checkId(out, command.id);\n out.handlers[command.id] = command.run;\n if (command.shortcut) addShortcut(out, command.shortcut, command.run);\n let menu = out.menus.find((m) => m.title === command.menu);\n if (!menu) out.menus.push((menu = { title: command.menu, items: [] }));\n menu.items.push(itemOf(command));\n }\n return out;\n}\n","// Client (the panes' sizes, the pointer, the shortcuts). The window of a Mac app (Tauri 2 on the system WebView, ADR-002):\n// a sidebar, the content and an inspector in a three-pane split — resizable by pointer and keyboard, collapsible — under a\n// toolbar that moves the window and clears the traffic lights, at the desktop's density with a native-feeling focus ring.\n// The commands (`desktopMenus`) are written once for the native menu bar, the page's shortcuts and the palette.\nimport { type ShortcutMap, useShortcuts } from \"@krizaka/ui/app-shell\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { type DesktopCommand, type DesktopMenus, desktopMenus } from \"./commands\";\nimport { clamp, dragged, keyed, paneMax } from \"./panes\";\n\nexport const desktopWindow = tv({\n slots: {\n root:\n \"kz-desktop-window flex h-[var(--kz-window-height,100dvh)] min-w-0 select-none overflow-hidden bg-surface-0 text-[13px] text-fg \" +\n // The macOS focus ring: a 3 px halo of the accent, over a 1 px accent edge, only for the keyboard.\n \"[&_:focus-visible]:outline-hidden [&_:focus-visible]:ring-[3px]! [&_:focus-visible]:ring-ring/50! [&_:focus-visible]:ring-offset-0!\",\n pane: \"relative flex min-h-0 shrink-0 flex-col overflow-hidden data-[collapsed]:hidden\",\n sidebar: \"border-e border-border-subtle bg-surface-1\",\n titlebar: \"h-[var(--kz-titlebar-inset,1.75rem)] shrink-0\",\n scroll: \"min-h-0 flex-1 overflow-y-auto\",\n middle: \"flex min-h-0 min-w-0 flex-1 flex-col\",\n inspector: \"border-s border-border-subtle bg-surface-1\",\n separator:\n \"group/sep relative z-10 -mx-[3px] w-[6px] shrink-0 cursor-col-resize touch-none data-[collapsed]:hidden \" +\n \"after:absolute after:inset-y-0 after:left-[2px] after:w-px after:bg-transparent hover:after:bg-border-strong data-[active]:after:bg-accent focus-visible:after:bg-accent\",\n content: \"min-h-0 min-w-0 flex-1 overflow-y-auto select-text\",\n toolbar:\n \"flex h-[var(--kz-toolbar-height,3rem)] shrink-0 items-center gap-2 border-b border-border-subtle bg-surface-0 px-3 \" +\n // With the sidebar folded the traffic lights sit over the toolbar: its first control starts after them.\n \"[[data-sidebar=closed]_&]:ps-[var(--kz-traffic-lights-inset,4.75rem)]\",\n toolbarTitle: \"min-w-0 flex-1 truncate text-[13px] font-semibold\",\n toolbarGroup: \"flex shrink-0 items-center gap-1\",\n toggle:\n \"inline-flex h-7 w-7 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-2 hover:text-fg cursor-default aria-pressed:text-fg-accent\",\n },\n});\nconst s = desktopWindow();\n\nexport interface DesktopWindowLabels {\n /** The sidebar's accessible name (`Library`). */\n sidebar: string;\n /** The inspector's accessible name (`Details`). */\n inspector: string;\n /** The separators' names (`Resize the sidebar`, `Resize the inspector`). */\n resizeSidebar: string;\n resizeInspector: string;\n /** The toolbar buttons that fold the panes (`Show or hide the sidebar`). */\n toggleSidebar: string;\n toggleInspector: string;\n}\n\nexport interface DesktopWindowProps {\n /** The sidebar's content: a list of places, a `Tree`. It scrolls by itself. */\n sidebar: React.ReactNode;\n /** The main content under the toolbar. */\n children: React.ReactNode;\n /** The inspector's content: the selected item's details. Without it, a two-pane window. */\n inspector?: React.ReactNode;\n /** The toolbar's title, centred in the drag region. */\n title?: React.ReactNode;\n /** After the sidebar's toggle, at the start of the toolbar (back, forward). */\n toolbarStart?: React.ReactNode;\n /** Before the inspector's toggle, at the end of the toolbar (actions, search). */\n toolbarEnd?: React.ReactNode;\n /** The words of the panes, the dividers and the toggles — passed translated. */\n labels: DesktopWindowLabels;\n /** The sidebar is open (controlled). Pair with `onSidebarOpenChange`: the menu bar's command toggles it too. */\n sidebarOpen?: boolean;\n /** The sidebar starts open (default true) when uncontrolled. */\n defaultSidebarOpen?: boolean;\n /** Called when the sidebar folds or unfolds (the toolbar, a divider, the shortcut). */\n onSidebarOpenChange?: (open: boolean) => void;\n /** The inspector is open (controlled). */\n inspectorOpen?: boolean;\n /** The inspector starts open (default true) when uncontrolled. */\n defaultInspectorOpen?: boolean;\n /** Called when the inspector folds or unfolds. */\n onInspectorOpenChange?: (open: boolean) => void;\n /** The sizes in px: the sidebar's, the inspector's. Persist them with `onSizesChange`. */\n defaultSizes?: { sidebar?: number; inspector?: number };\n /** Called with the sizes in px after a drag or a key: persist them. */\n onSizesChange?: (sizes: { sidebar: number; inspector: number }) => void;\n /** The least the content keeps when the window is narrow (default 360). */\n contentMin?: number;\n /** The keys that fold the panes (a chord, or `false` for none): ⌘B and ⌘I by default. Pass `false` when the menu bar's commands (`useDesktopCommands`) own them. */\n shortcuts?: { sidebar?: string | false; inspector?: string | false };\n /** Classes for the window (`[--kz-window-height:34rem]` to size it inside a page). */\n className?: string;\n}\n\nconst SIDEBAR: { min: number; max: number } = { min: 180, max: 360 };\nconst INSPECTOR: { min: number; max: number } = { min: 240, max: 480 };\n\nconst glyph = (d: string) => (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={d} />\n </svg>\n);\n\nfunction useOpen(controlled: boolean | undefined, initial: boolean, onChange?: (open: boolean) => void) {\n const [own, setOwn] = React.useState(initial);\n const open = controlled ?? own;\n const set = React.useCallback(\n (next: boolean) => {\n if (controlled === undefined) setOwn(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [open, set] as const;\n}\n\ntype Edge = \"sidebar\" | \"inspector\";\n\n/** The window of a Mac app: sidebar · content · inspector, a toolbar that moves the window, the desktop's density. */\nexport function DesktopWindow({\n sidebar, children, inspector, title, toolbarStart, toolbarEnd, labels, sidebarOpen, defaultSidebarOpen = true, onSidebarOpenChange, inspectorOpen, defaultInspectorOpen = true, onInspectorOpenChange, defaultSizes, onSizesChange, contentMin = 360, shortcuts, className,\n}: DesktopWindowProps) {\n const [sideOpen, setSideOpen] = useOpen(sidebarOpen, defaultSidebarOpen, onSidebarOpenChange);\n const [inspOpen, setInspOpen] = useOpen(inspectorOpen, defaultInspectorOpen, onInspectorOpenChange);\n const [sizes, setSizes] = React.useState({ sidebar: clamp(defaultSizes?.sidebar ?? 240, SIDEBAR.min, SIDEBAR.max), inspector: clamp(defaultSizes?.inspector ?? 300, INSPECTOR.min, INSPECTOR.max) });\n const [active, setActive] = React.useState<Edge | null>(null);\n const root = React.useRef<HTMLDivElement>(null);\n const [width, setWidth] = React.useState(0);\n const toggles = React.useRef<Record<Edge, HTMLButtonElement | null>>({ sidebar: null, inspector: null });\n const sidebarId = React.useId();\n const inspectorId = React.useId();\n const hasInspector = inspector != null;\n const sideShown = sideOpen;\n const inspShown = hasInspector && inspOpen;\n\n const keys = { sidebar: shortcuts?.sidebar === undefined ? \"mod+b\" : shortcuts.sidebar, inspector: shortcuts?.inspector === undefined ? \"mod+i\" : shortcuts.inspector };\n const map: Record<string, () => void> = {};\n if (keys.sidebar) map[keys.sidebar] = () => setSideOpen(!sideOpen);\n if (keys.inspector && hasInspector) map[keys.inspector] = () => setInspOpen(!inspOpen);\n useShortcuts(map as ShortcutMap);\n\n const commit = (edge: Edge, size: number) => {\n const next = { ...sizes, [edge]: size };\n setSizes(next);\n onSizesChange?.(next);\n };\n // The window's width, to keep the content its room: measured, and followed while the window is resized.\n React.useLayoutEffect(() => {\n const element = root.current;\n if (!element) return;\n const measure = () => setWidth(element.getBoundingClientRect().width);\n measure();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, []);\n const ceiling = (edge: Edge) => {\n const other = edge === \"sidebar\" ? (inspShown ? sizes.inspector : 0) : sideShown ? sizes.sidebar : 0;\n const limits = edge === \"sidebar\" ? SIDEBAR : INSPECTOR;\n // The separators overlap the panes (negative margins): they take no width of their own.\n return paneMax(limits, width || Number.POSITIVE_INFINITY, other, contentMin, 0);\n };\n const direction = (): 1 | -1 => (root.current && getComputedStyle(root.current).direction === \"rtl\" ? -1 : 1);\n const sideOf = (edge: Edge): 1 | -1 => (edge === \"sidebar\" ? 1 : -1);\n const limitsOf = (edge: Edge) => (edge === \"sidebar\" ? SIDEBAR : INSPECTOR);\n\n const onPointerDown = (edge: Edge) => (event: React.PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return;\n event.currentTarget.setPointerCapture(event.pointerId);\n const startX = event.clientX;\n const start = sizes[edge];\n const max = ceiling(edge);\n const dir = direction();\n setActive(edge);\n const target = event.currentTarget;\n const move = (e: PointerEvent) => commit(edge, dragged(start, e.clientX - startX, dir, sideOf(edge), limitsOf(edge), max));\n const stop = () => {\n setActive(null);\n target.removeEventListener(\"pointermove\", move);\n target.removeEventListener(\"pointerup\", stop);\n target.removeEventListener(\"pointercancel\", stop);\n };\n target.addEventListener(\"pointermove\", move);\n target.addEventListener(\"pointerup\", stop);\n target.addEventListener(\"pointercancel\", stop);\n };\n const onKeyDown = (edge: Edge) => (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n (edge === \"sidebar\" ? setSideOpen : setInspOpen)(false);\n // The separator goes with the pane: the focus goes to the button that brings it back.\n queueMicrotask(() => toggles.current[edge]?.focus());\n return;\n }\n const next = keyed(event.key, sizes[edge], direction(), sideOf(edge), limitsOf(edge), event.shiftKey, ceiling(edge));\n if (next === null) return;\n event.preventDefault();\n commit(edge, next);\n };\n\n const separator = (edge: Edge, controls: string, label: string) => (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={label}\n aria-controls={controls}\n aria-valuemin={limitsOf(edge).min}\n aria-valuemax={ceiling(edge)}\n aria-valuenow={sizes[edge]}\n tabIndex={0}\n data-edge={edge}\n data-active={active === edge ? \"\" : undefined}\n className={s.separator()}\n onPointerDown={onPointerDown(edge)}\n onKeyDown={onKeyDown(edge)}\n onDoubleClick={() => (edge === \"sidebar\" ? setSideOpen(false) : setInspOpen(false))}\n />\n );\n const toggle = (edge: Edge, label: string, pressed: boolean, onClick: () => void, d: string) => (\n <button type=\"button\" ref={(el) => { toggles.current[edge] = el; }} className={s.toggle()} aria-label={label} aria-pressed={pressed} onClick={onClick}>\n {glyph(d)}\n </button>\n );\n\n return (\n <div ref={root} data-desktop=\"\" data-sidebar={sideShown ? \"open\" : \"closed\"} className={s.root({ className })}>\n <aside id={sidebarId} aria-label={labels.sidebar} data-collapsed={sideShown ? undefined : \"\"} className={s.pane({ className: s.sidebar() })} style={{ width: sizes.sidebar }}>\n <div aria-hidden data-tauri-drag-region=\"\" className={s.titlebar()} />\n <div className={s.scroll()}>{sidebar}</div>\n </aside>\n {sideShown && separator(\"sidebar\", sidebarId, labels.resizeSidebar)}\n <div className={s.middle()}>\n <header data-tauri-drag-region=\"\" className={s.toolbar()}>\n <div className={s.toolbarGroup()}>\n {toggle(\"sidebar\", labels.toggleSidebar, sideShown, () => setSideOpen(!sideOpen), \"M4 5h16v14H4zM9 5v14\")}\n {toolbarStart}\n </div>\n <div data-tauri-drag-region=\"\" className={s.toolbarTitle()}>\n {title}\n </div>\n <div className={s.toolbarGroup()}>\n {toolbarEnd}\n {hasInspector && toggle(\"inspector\", labels.toggleInspector, inspShown, () => setInspOpen(!inspOpen), \"M4 5h16v14H4zM15 5v14\")}\n </div>\n </header>\n <main id=\"content\" tabIndex={-1} className={s.content()}>\n {children}\n </main>\n </div>\n {inspShown && separator(\"inspector\", inspectorId, labels.resizeInspector)}\n {hasInspector && (\n <aside id={inspectorId} aria-label={labels.inspector} data-collapsed={inspShown ? undefined : \"\"} className={s.pane({ className: s.inspector() })} style={{ width: sizes.inspector }}>\n <div className={s.scroll()}>{inspector}</div>\n </aside>\n )}\n </div>\n );\n}\n\n/**\n * The window's commands as one source: registers their chords in the page (`useShortcuts`, the browser's too) and returns\n * the native menu bar's data — `menus` and `handlers` for `setNativeMenu(bridge, { labels, menus }, handlers)` of\n * `@krizaka/app-desktop` — so the menu shows the keys the page answers.\n */\nexport function useDesktopCommands(commands: readonly DesktopCommand[]): DesktopMenus {\n const menus = React.useMemo(() => desktopMenus(commands), [commands]);\n useShortcuts(menus.shortcuts as ShortcutMap);\n return menus;\n}\n","// Pure: the arithmetic of the resizable panes, so it is tested without a pointer.\n\nexport interface PaneLimits {\n min: number;\n max: number;\n}\n\nexport const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), Math.max(min, max));\n\n/**\n * The most a pane may take: its own maximum, and what leaves the content its minimum beside the other open pane and the\n * two separators. A window that is too small for both gives the content priority, down to the pane's own minimum.\n */\nexport function paneMax(limits: PaneLimits, windowWidth: number, otherOpenWidth: number, contentMin: number, separators: number): number {\n return Math.max(limits.min, Math.min(limits.max, windowWidth - otherOpenWidth - contentMin - separators));\n}\n\n/** The size after a drag of `delta` px along the reading direction (`direction` 1 in LTR, -1 in RTL; `side` 1 for the start pane, -1 for the end one). */\nexport function dragged(start: number, delta: number, direction: 1 | -1, side: 1 | -1, limits: PaneLimits, ceiling = limits.max): number {\n return clamp(start + delta * direction * side, limits.min, ceiling);\n}\n\n/** The size after an arrow key: the arrow that points away from the pane's edge grows it (→ for the start pane in LTR). `null` for another key. */\nexport function keyed(key: string, current: number, direction: 1 | -1, side: 1 | -1, limits: PaneLimits, shift: boolean, ceiling = limits.max): number | null {\n const step = shift ? 64 : 16;\n if (key === \"Home\") return limits.min;\n if (key === \"End\") return Math.max(limits.min, ceiling);\n if (key !== \"ArrowLeft\" && key !== \"ArrowRight\") return null;\n const toward = key === \"ArrowRight\" ? 1 : -1;\n return clamp(current + step * toward * direction * side, limits.min, ceiling);\n}\n"],"mappings":";;;AAGA,YAAY,WAAW;AAQvB,IAAM,UAAkC,EAAE,KAAK,UAAU,QAAQ,SAAS,OAAO,KAAK,UAAU,KAAK,IAAI,WAAW,MAAM,aAAa,MAAM,aAAa,OAAO,cAAc,KAAK,UAAU,MAAM,IAAI;AAyCjM,SAAS,cAAc,UAAsC;AAClE,MAAI,SAAS,KAAK,EAAE,SAAS,GAAG,EAAG,QAAO;AAC1C,QAAM,QAAQ,SAAS,MAAM,GAAG,EAAE,OAAO,OAAO;AAChD,QAA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AAa,cAAY,OAAO,WAAW,kBAAgB,YAAY,SAAY,IAAI,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,GAAG,OAAO,EAAE,OAAO,MAAM,UAAU,GACjL,8BAAC,SAAI,WAAW,EAAE,OAAO,GAAI,qBAAU,GACzC;AAAA,KAEJ;AAEJ;AAOO,SAAS,mBAAmB,UAAmD;AACpF,QAAM,QAAc,eAAQ,MAAM,aAAa,QAAQ,GAAG,CAAC,QAAQ,CAAC;AACpE,eAAa,MAAM,SAAwB;AAC3C,SAAO;AACT;","names":["React"]}
|
|
1
|
+
{"version":3,"sources":["../src/app-shell/shortcuts.ts","../src/desktop-window/commands.ts","../src/desktop-window/desktop-window.tsx","../src/desktop-window/panes.ts"],"sourcesContent":["// Keyboard shortcuts for an application: a combination (`mod+k`, `shift+/`, `alt+arrowup`) or a sequence (`g d`: press G,\n// then D). `mod` is ⌘ on Apple devices and Ctrl elsewhere. Plain keys and sequences stay out of text fields; a combination\n// with `mod` works in an input (not in a rich-text editor, where ⌘B is bold). Nothing is decided here about the words.\nimport * as React from \"react\";\n\nimport { useLatest } from \"../media\";\n\nexport type ShortcutMap = Readonly<Record<string, ((event: KeyboardEvent) => void) | undefined>>;\n\nconst isApple = () => typeof navigator !== \"undefined\" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);\n\nconst ALIASES: Record<string, string> = { esc: \"escape\", return: \"enter\", space: \" \", spacebar: \" \", up: \"arrowup\", down: \"arrowdown\", left: \"arrowleft\", right: \"arrowright\", del: \"delete\", plus: \"+\" };\ntype Modifier = \"mod\" | \"ctrl\" | \"alt\" | \"shift\" | \"meta\";\n\ntype Combo = { key: string; mod: boolean; ctrl: boolean; alt: boolean; shift: boolean; meta: boolean };\n\n/** `\"mod+shift+k\"` → its parts. A lone `+` key is written `plus`. */\nexport function parseCombo(combo: string): Combo {\n const parts = combo.toLowerCase().split(\"+\").filter(Boolean);\n const key = ALIASES[parts.at(-1) ?? \"\"] ?? parts.at(-1) ?? \"\";\n const has = (name: Modifier) => parts.slice(0, -1).includes(name);\n return { key, mod: has(\"mod\"), ctrl: has(\"ctrl\"), alt: has(\"alt\"), shift: has(\"shift\"), meta: has(\"meta\") };\n}\n\n/** Whether a key event is this combination: its modifiers exactly (`mod` is ⌘ or Ctrl by platform), then its key. */\nexport function matchesCombo(event: Pick<KeyboardEvent, \"key\" | \"metaKey\" | \"ctrlKey\" | \"altKey\" | \"shiftKey\">, combo: string, apple = isApple()): boolean {\n const want = parseCombo(combo);\n const meta = want.meta || (want.mod && apple);\n const ctrl = want.ctrl || (want.mod && !apple);\n if (event.metaKey !== meta || event.ctrlKey !== ctrl || event.altKey !== want.alt) return false;\n // Shift is only checked when the binding names it: `?` and `/` need it on most layouts.\n if (want.shift && !event.shiftKey) return false;\n return event.key.toLowerCase() === want.key;\n}\n\n/** The keys of a shortcut to show on a keycap: `[\"⌘\", \"K\"]` on a Mac, `[\"Ctrl\", \"K\"]` elsewhere; a sequence `g d` is `[\"G\", \"D\"]`. */\nexport function formatShortcut(shortcut: string, apple = isApple()): string[] {\n if (shortcut.includes(\" \")) return shortcut.split(/\\s+/).map((key) => key.toUpperCase());\n const parts = shortcut.split(\"+\").filter(Boolean);\n const key = parts.at(-1) ?? \"\";\n const names: Record<string, [string, string]> = { mod: [\"⌘\", \"Ctrl\"], meta: [\"⌘\", \"Win\"], ctrl: [\"⌃\", \"Ctrl\"], alt: [\"⌥\", \"Alt\"], shift: [\"⇧\", \"Shift\"] };\n const shown = parts.slice(0, -1).map((part) => names[part.toLowerCase()]?.[apple ? 0 : 1] ?? part);\n const glyph: Record<string, string> = { escape: \"Esc\", enter: \"↵\", arrowup: \"↑\", arrowdown: \"↓\", arrowleft: \"←\", arrowright: \"→\", \" \": \"Space\" };\n const last = glyph[ALIASES[key.toLowerCase()] ?? key.toLowerCase()] ?? key.toUpperCase();\n return [...shown, last];\n}\n\n/**\n * The accelerator of a combination for a desktop app's native menu bar (Tauri's `MenuItem`, Electron's — ADR-002):\n * `mod+k` → `CmdOrCtrl+K`, `shift+mod+/` → `Shift+CmdOrCtrl+/`. The menu and the shell then answer the same keys, and the\n * menu shows them. A sequence (`g d`) has none: a menu item takes one chord.\n */\nexport function acceleratorOf(shortcut: string): string | undefined {\n if (shortcut.trim().includes(\" \")) return undefined;\n const parts = shortcut.split(\"+\").filter(Boolean);\n const names: Record<string, string> = { mod: \"CmdOrCtrl\", meta: \"Super\", ctrl: \"Ctrl\", alt: \"Alt\", shift: \"Shift\" };\n const raw = (parts.at(-1) ?? \"\").toLowerCase();\n const key = ALIASES[raw] ?? raw;\n const keys: Record<string, string> = { escape: \"Escape\", enter: \"Enter\", \" \": \"Space\", arrowup: \"Up\", arrowdown: \"Down\", arrowleft: \"Left\", arrowright: \"Right\", delete: \"Delete\", backspace: \"Backspace\", tab: \"Tab\", \"+\": \"Plus\" };\n const last = keys[key] ?? (key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1));\n return [...parts.slice(0, -1).map((part) => names[part.toLowerCase()] ?? part), last].join(\"+\");\n}\n\nconst noop = () => () => undefined;\n\n/** Whether the person is on an Apple device — `false` on the server and in the first client render (no mismatch), then right. */\nexport function useApple(): boolean {\n return React.useSyncExternalStore(noop, isApple, () => false);\n}\n\n/** The `aria-keyshortcuts` of a combination (`Control+K`, `Meta+K` on a Mac); a sequence has none (it is not a chord). */\nexport function ariaKeyShortcuts(shortcut: string, apple = isApple()): string | undefined {\n if (shortcut.includes(\" \")) return undefined;\n const parts = shortcut.split(\"+\").filter(Boolean);\n const names: Record<string, string> = { mod: apple ? \"Meta\" : \"Control\", meta: \"Meta\", ctrl: \"Control\", alt: \"Alt\", shift: \"Shift\" };\n const key = parts.at(-1) ?? \"\";\n return [...parts.slice(0, -1).map((part) => names[part.toLowerCase()] ?? part), key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1)].join(\"+\");\n}\n\n/** Whether a key press happens in something you type in. */\nfunction isEditable(target: EventTarget | null): { field: boolean; rich: boolean } {\n const element = target instanceof HTMLElement ? target : null;\n if (!element) return { field: false, rich: false };\n const rich = element.isContentEditable;\n return { field: rich || /^(input|textarea|select)$/i.test(element.tagName), rich };\n}\n\n/**\n * Binds shortcuts for as long as the component lives (`enabled` turns them off). Each key is a combination or a sequence,\n * each value runs when it is pressed; the handler may change on every render. A shortcut that fires is `preventDefault`ed.\n * A sequence waits `timeout` ms for its next key.\n */\nexport function useShortcuts(map: ShortcutMap, { enabled = true, timeout = 900 }: { enabled?: boolean; timeout?: number } = {}) {\n const latest = useLatest(map);\n const names = Object.keys(map).sort((a, b) => a.localeCompare(b)).join(\"\\n\");\n React.useEffect(() => {\n if (!enabled) return;\n const bindings = names.split(\"\\n\").filter(Boolean);\n let buffer: { key: string; at: number }[] = [];\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.isComposing || event.repeat || !event.key) return;\n const editing = isEditable(event.target);\n const chord = event.metaKey || event.ctrlKey || event.altKey;\n const now = Date.now();\n buffer = [...buffer.filter((entry) => now - entry.at <= timeout), { key: event.key.toLowerCase(), at: now }].slice(-4);\n for (const binding of bindings) {\n const handler = latest.current[binding];\n if (!handler) continue;\n const keys = binding.toLowerCase().split(/\\s+/).map((key) => ALIASES[key] ?? key);\n const fired =\n keys.length > 1\n ? !chord && !editing.field && buffer.length >= keys.length && keys.every((key, i) => buffer[buffer.length - keys.length + i]?.key === key)\n : matchesCombo(event, binding) && (chord ? !editing.rich : !editing.field);\n if (!fired) continue;\n event.preventDefault();\n buffer = [];\n handler(event);\n return;\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [enabled, names, latest, timeout]);\n}\n","// Pure: the commands of a desktop window, written once and read by three things — the native menu bar (through\n// `setNativeMenu` of @krizaka/app-desktop), the in-page shortcuts (`useShortcuts`, also the browser's), and the palette.\nimport { acceleratorOf } from \"../app-shell/shortcuts\";\n\nexport interface DesktopCommand {\n /** Sent back by the menu when chosen: lowercase letters, digits, `.` and `-` (`view.sidebar`). */\n id: string;\n /** The menu item's words, passed translated (`Hide sidebar`). */\n label: string;\n /** The menu it belongs to (`View`, `File`), passed translated: the product's menus sit between Edit and Window. */\n menu: string;\n /** A chord (`mod+b`): the menu shows it and the page answers it. A sequence (`g d`) is the page's only. */\n shortcut?: string;\n /** Runs the command. */\n run: () => void;\n /** A separator before it in its menu. */\n separated?: boolean;\n /** Dimmed in the menu while false (default true). */\n enabled?: boolean;\n}\n\n/** The shape `setNativeMenu` takes for its `menus` (structurally the same as `MenuSpec[\"menus\"]` of @krizaka/app-desktop). */\nexport interface DesktopMenu {\n title: string;\n items: { id: string; label: string; accelerator?: string; enabled?: boolean; separated?: boolean }[];\n}\n\nconst ID = /^[a-z0-9][a-z0-9.-]*$/;\n\nexport interface DesktopMenus {\n /** For `setNativeMenu(bridge, { labels, menus }, handlers)`. */\n menus: DesktopMenu[];\n /** For its `handlers`: the id of the chosen item → what it does. */\n handlers: Record<string, () => void>;\n /** For `useShortcuts`: the chords of the commands, answered in the page. */\n shortcuts: Record<string, () => void>;\n}\n\n/** Refuses an id the native side would refuse, or one already declared. */\nfunction checkId(out: DesktopMenus, id: string): void {\n if (!ID.test(id)) throw new Error(`desktopMenus: \"${id}\" is not a menu id (lowercase letters, digits, \".\" and \"-\").`);\n if (out.handlers[id]) throw new Error(`desktopMenus: \"${id}\" is declared twice.`);\n}\n\n/** Records the chord of a command for the page, refusing one given to two commands. */\nfunction addShortcut(out: DesktopMenus, shortcut: string, run: () => void): void {\n const key = shortcut.toLowerCase();\n if (out.shortcuts[key]) throw new Error(`desktopMenus: \"${shortcut}\" is the shortcut of two commands.`);\n out.shortcuts[key] = run;\n}\n\n/** The menu item of a command: its accelerator, and only the flags it sets. */\nfunction itemOf(command: DesktopCommand): DesktopMenu[\"items\"][number] {\n const accelerator = command.shortcut ? acceleratorOf(command.shortcut) : undefined;\n return {\n id: command.id,\n label: command.label,\n ...(accelerator ? { accelerator } : {}),\n ...(command.enabled === false ? { enabled: false } : {}),\n ...(command.separated ? { separated: true } : {}),\n };\n}\n\n/** Turns the commands into the menu bar's menus, its handlers and the page's shortcuts — one source for the three. Throws on a bad or repeated id, or a shortcut given twice. */\nexport function desktopMenus(commands: readonly DesktopCommand[]): DesktopMenus {\n const out: DesktopMenus = { menus: [], handlers: {}, shortcuts: {} };\n for (const command of commands) {\n checkId(out, command.id);\n out.handlers[command.id] = command.run;\n if (command.shortcut) addShortcut(out, command.shortcut, command.run);\n let menu = out.menus.find((m) => m.title === command.menu);\n if (!menu) out.menus.push((menu = { title: command.menu, items: [] }));\n menu.items.push(itemOf(command));\n }\n return out;\n}\n","// Client (the panes' sizes, the pointer, the shortcuts). The window of a Mac app (Tauri 2 on the system WebView, ADR-002):\n// a sidebar, the content and an inspector in a three-pane split — resizable by pointer and keyboard, collapsible — under a\n// toolbar that moves the window and clears the traffic lights, at the desktop's density with a native-feeling focus ring.\n// The commands (`desktopMenus`) are written once for the native menu bar, the page's shortcuts and the palette.\nimport { type ShortcutMap, useShortcuts } from \"@krizaka/ui/app-shell\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { type DesktopCommand, type DesktopMenus, desktopMenus } from \"./commands\";\nimport { clamp, dragged, keyed, paneMax } from \"./panes\";\n\nexport const desktopWindow = tv({\n slots: {\n root:\n \"kz-desktop-window flex h-[var(--kz-window-height,100dvh)] min-w-0 select-none overflow-hidden bg-surface-0 text-[13px] text-fg \" +\n // The macOS focus ring: a 3 px halo of the accent, over a 1 px accent edge, only for the keyboard.\n \"[&_:focus-visible]:outline-hidden [&_:focus-visible]:ring-[3px]! [&_:focus-visible]:ring-ring/50! [&_:focus-visible]:ring-offset-0!\",\n pane: \"relative flex min-h-0 shrink-0 flex-col overflow-hidden data-[collapsed]:hidden\",\n sidebar: \"border-e border-border-subtle bg-surface-1\",\n titlebar: \"h-[var(--kz-titlebar-inset,1.75rem)] shrink-0\",\n scroll: \"min-h-0 flex-1 overflow-y-auto\",\n middle: \"flex min-h-0 min-w-0 flex-1 flex-col\",\n inspector: \"border-s border-border-subtle bg-surface-1\",\n separator:\n \"group/sep relative z-10 -mx-[3px] w-[6px] shrink-0 cursor-col-resize touch-none data-[collapsed]:hidden \" +\n \"after:absolute after:inset-y-0 after:left-[2px] after:w-px after:bg-transparent hover:after:bg-border-strong data-[active]:after:bg-accent focus-visible:after:bg-accent\",\n content: \"min-h-0 min-w-0 flex-1 overflow-y-auto select-text\",\n toolbar:\n \"flex h-[var(--kz-toolbar-height,3rem)] shrink-0 items-center gap-2 border-b border-border-subtle bg-surface-0 px-3 \" +\n // With the sidebar folded the traffic lights sit over the toolbar: its first control starts after them.\n \"[[data-sidebar=closed]_&]:ps-[var(--kz-traffic-lights-inset,4.75rem)]\",\n toolbarTitle: \"min-w-0 flex-1 truncate text-[13px] font-semibold\",\n toolbarGroup: \"flex shrink-0 items-center gap-1\",\n toggle:\n \"inline-flex h-7 w-7 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-surface-2 hover:text-fg cursor-default aria-pressed:text-fg-accent\",\n },\n});\nconst s = desktopWindow();\n\nexport interface DesktopWindowLabels {\n /** The sidebar's accessible name (`Library`). */\n sidebar: string;\n /** The inspector's accessible name (`Details`). */\n inspector: string;\n /** The separators' names (`Resize the sidebar`, `Resize the inspector`). */\n resizeSidebar: string;\n resizeInspector: string;\n /** The toolbar buttons that fold the panes (`Show or hide the sidebar`). */\n toggleSidebar: string;\n toggleInspector: string;\n}\n\nexport interface DesktopWindowProps {\n /** The sidebar's content: a list of places, a `Tree`. It scrolls by itself. */\n sidebar: React.ReactNode;\n /** The main content under the toolbar. */\n children: React.ReactNode;\n /** The inspector's content: the selected item's details. Without it, a two-pane window. */\n inspector?: React.ReactNode;\n /** The toolbar's title, centred in the drag region. */\n title?: React.ReactNode;\n /** After the sidebar's toggle, at the start of the toolbar (back, forward). */\n toolbarStart?: React.ReactNode;\n /** Before the inspector's toggle, at the end of the toolbar (actions, search). */\n toolbarEnd?: React.ReactNode;\n /** The words of the panes, the dividers and the toggles — passed translated. */\n labels: DesktopWindowLabels;\n /** The sidebar is open (controlled). Pair with `onSidebarOpenChange`: the menu bar's command toggles it too. */\n sidebarOpen?: boolean;\n /** The sidebar starts open (default true) when uncontrolled. */\n defaultSidebarOpen?: boolean;\n /** Called when the sidebar folds or unfolds (the toolbar, a divider, the shortcut). */\n onSidebarOpenChange?: (open: boolean) => void;\n /** The inspector is open (controlled). */\n inspectorOpen?: boolean;\n /** The inspector starts open (default true) when uncontrolled. */\n defaultInspectorOpen?: boolean;\n /** Called when the inspector folds or unfolds. */\n onInspectorOpenChange?: (open: boolean) => void;\n /** The sizes in px: the sidebar's, the inspector's. Persist them with `onSizesChange`. */\n defaultSizes?: { sidebar?: number; inspector?: number };\n /** Called with the sizes in px after a drag or a key: persist them. */\n onSizesChange?: (sizes: { sidebar: number; inspector: number }) => void;\n /** The least the content keeps when the window is narrow (default 360). */\n contentMin?: number;\n /** The keys that fold the panes (a chord, or `false` for none): ⌘B and ⌘I by default. Pass `false` when the menu bar's commands (`useDesktopCommands`) own them. */\n shortcuts?: { sidebar?: string | false; inspector?: string | false };\n /** Classes for the window (`[--kz-window-height:34rem]` to size it inside a page). */\n className?: string;\n}\n\nconst SIDEBAR: { min: number; max: number } = { min: 180, max: 360 };\nconst INSPECTOR: { min: number; max: number } = { min: 240, max: 480 };\n\nconst glyph = (d: string) => (\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={d} />\n </svg>\n);\n\nfunction useOpen(controlled: boolean | undefined, initial: boolean, onChange?: (open: boolean) => void) {\n const [own, setOwn] = React.useState(initial);\n const open = controlled ?? own;\n const set = React.useCallback(\n (next: boolean) => {\n if (controlled === undefined) setOwn(next);\n onChange?.(next);\n },\n [controlled, onChange],\n );\n return [open, set] as const;\n}\n\ntype Edge = \"sidebar\" | \"inspector\";\n\n/** The window of a Mac app: sidebar · content · inspector, a toolbar that moves the window, the desktop's density. */\nexport function DesktopWindow({\n sidebar, children, inspector, title, toolbarStart, toolbarEnd, labels, sidebarOpen, defaultSidebarOpen = true, onSidebarOpenChange, inspectorOpen, defaultInspectorOpen = true, onInspectorOpenChange, defaultSizes, onSizesChange, contentMin = 360, shortcuts, className,\n}: Readonly<DesktopWindowProps>) {\n const [sideOpen, setSideOpen] = useOpen(sidebarOpen, defaultSidebarOpen, onSidebarOpenChange);\n const [inspOpen, setInspOpen] = useOpen(inspectorOpen, defaultInspectorOpen, onInspectorOpenChange);\n const [sizes, setSizes] = React.useState({ sidebar: clamp(defaultSizes?.sidebar ?? 240, SIDEBAR.min, SIDEBAR.max), inspector: clamp(defaultSizes?.inspector ?? 300, INSPECTOR.min, INSPECTOR.max) });\n const [active, setActive] = React.useState<Edge | null>(null);\n const root = React.useRef<HTMLDivElement>(null);\n const [width, setWidth] = React.useState(0);\n const toggles = React.useRef<Record<Edge, HTMLButtonElement | null>>({ sidebar: null, inspector: null });\n const sidebarId = React.useId();\n const inspectorId = React.useId();\n const hasInspector = inspector != null;\n const sideShown = sideOpen;\n const inspShown = hasInspector && inspOpen;\n\n const keys = { sidebar: shortcuts?.sidebar === undefined ? \"mod+b\" : shortcuts.sidebar, inspector: shortcuts?.inspector === undefined ? \"mod+i\" : shortcuts.inspector };\n const map: Record<string, () => void> = {};\n if (keys.sidebar) map[keys.sidebar] = () => setSideOpen(!sideOpen);\n if (keys.inspector && hasInspector) map[keys.inspector] = () => setInspOpen(!inspOpen);\n useShortcuts(map as ShortcutMap);\n\n const commit = (edge: Edge, size: number) => {\n const next = { ...sizes, [edge]: size };\n setSizes(next);\n onSizesChange?.(next);\n };\n // The window's width, to keep the content its room: measured, and followed while the window is resized.\n React.useLayoutEffect(() => {\n const element = root.current;\n if (!element) return;\n const measure = () => setWidth(element.getBoundingClientRect().width);\n measure();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, []);\n const ceiling = (edge: Edge) => {\n let other: number;\n if (edge === \"sidebar\") other = inspShown ? sizes.inspector : 0;\n else other = sideShown ? sizes.sidebar : 0;\n const limits = edge === \"sidebar\" ? SIDEBAR : INSPECTOR;\n // The separators overlap the panes (negative margins): they take no width of their own.\n return paneMax(limits, width || Number.POSITIVE_INFINITY, other, contentMin, 0);\n };\n const direction = (): 1 | -1 => (root.current && getComputedStyle(root.current).direction === \"rtl\" ? -1 : 1);\n const sideOf = (edge: Edge): 1 | -1 => (edge === \"sidebar\" ? 1 : -1);\n const limitsOf = (edge: Edge) => (edge === \"sidebar\" ? SIDEBAR : INSPECTOR);\n\n const onPointerDown = (edge: Edge) => (event: React.PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return;\n event.currentTarget.setPointerCapture(event.pointerId);\n const startX = event.clientX;\n const start = sizes[edge];\n const max = ceiling(edge);\n const dir = direction();\n setActive(edge);\n const target = event.currentTarget;\n const move = (e: PointerEvent) => commit(edge, dragged(start, e.clientX - startX, dir, sideOf(edge), limitsOf(edge), max));\n const stop = () => {\n setActive(null);\n target.removeEventListener(\"pointermove\", move);\n target.removeEventListener(\"pointerup\", stop);\n target.removeEventListener(\"pointercancel\", stop);\n };\n target.addEventListener(\"pointermove\", move);\n target.addEventListener(\"pointerup\", stop);\n target.addEventListener(\"pointercancel\", stop);\n };\n const onKeyDown = (edge: Edge) => (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n (edge === \"sidebar\" ? setSideOpen : setInspOpen)(false);\n // The separator goes with the pane: the focus goes to the button that brings it back.\n queueMicrotask(() => toggles.current[edge]?.focus());\n return;\n }\n const next = keyed(event.key, sizes[edge], direction(), sideOf(edge), limitsOf(edge), event.shiftKey, ceiling(edge));\n if (next === null) return;\n event.preventDefault();\n commit(edge, next);\n };\n\n const separator = (edge: Edge, controls: string, label: string) => (\n <div\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={label}\n aria-controls={controls}\n aria-valuemin={limitsOf(edge).min}\n aria-valuemax={ceiling(edge)}\n aria-valuenow={sizes[edge]}\n tabIndex={0}\n data-edge={edge}\n data-active={active === edge ? \"\" : undefined}\n className={s.separator()}\n onPointerDown={onPointerDown(edge)}\n onKeyDown={onKeyDown(edge)}\n onDoubleClick={() => (edge === \"sidebar\" ? setSideOpen(false) : setInspOpen(false))}\n />\n );\n const toggle = (edge: Edge, label: string, pressed: boolean, onClick: () => void, d: string) => (\n <button type=\"button\" ref={(el) => { toggles.current[edge] = el; }} className={s.toggle()} aria-label={label} aria-pressed={pressed} onClick={onClick}>\n {glyph(d)}\n </button>\n );\n\n return (\n <div ref={root} data-desktop=\"\" data-sidebar={sideShown ? \"open\" : \"closed\"} className={s.root({ className })}>\n <aside id={sidebarId} aria-label={labels.sidebar} data-collapsed={sideShown ? undefined : \"\"} className={s.pane({ className: s.sidebar() })} style={{ width: sizes.sidebar }}>\n <div aria-hidden data-tauri-drag-region=\"\" className={s.titlebar()} />\n <div className={s.scroll()}>{sidebar}</div>\n </aside>\n {sideShown && separator(\"sidebar\", sidebarId, labels.resizeSidebar)}\n <div className={s.middle()}>\n <header data-tauri-drag-region=\"\" className={s.toolbar()}>\n <div className={s.toolbarGroup()}>\n {toggle(\"sidebar\", labels.toggleSidebar, sideShown, () => setSideOpen(!sideOpen), \"M4 5h16v14H4zM9 5v14\")}\n {toolbarStart}\n </div>\n <div data-tauri-drag-region=\"\" className={s.toolbarTitle()}>\n {title}\n </div>\n <div className={s.toolbarGroup()}>\n {toolbarEnd}\n {hasInspector && toggle(\"inspector\", labels.toggleInspector, inspShown, () => setInspOpen(!inspOpen), \"M4 5h16v14H4zM15 5v14\")}\n </div>\n </header>\n <main id=\"content\" tabIndex={-1} className={s.content()}>\n {children}\n </main>\n </div>\n {inspShown && separator(\"inspector\", inspectorId, labels.resizeInspector)}\n {hasInspector && (\n <aside id={inspectorId} aria-label={labels.inspector} data-collapsed={inspShown ? undefined : \"\"} className={s.pane({ className: s.inspector() })} style={{ width: sizes.inspector }}>\n <div className={s.scroll()}>{inspector}</div>\n </aside>\n )}\n </div>\n );\n}\n\n/**\n * The window's commands as one source: registers their chords in the page (`useShortcuts`, the browser's too) and returns\n * the native menu bar's data — `menus` and `handlers` for `setNativeMenu(bridge, { labels, menus }, handlers)` of\n * `@krizaka/app-desktop` — so the menu shows the keys the page answers.\n */\nexport function useDesktopCommands(commands: readonly DesktopCommand[]): DesktopMenus {\n const menus = React.useMemo(() => desktopMenus(commands), [commands]);\n useShortcuts(menus.shortcuts as ShortcutMap);\n return menus;\n}\n","// Pure: the arithmetic of the resizable panes, so it is tested without a pointer.\n\nexport interface PaneLimits {\n min: number;\n max: number;\n}\n\nexport const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), Math.max(min, max));\n\n/**\n * The most a pane may take: its own maximum, and what leaves the content its minimum beside the other open pane and the\n * two separators. A window that is too small for both gives the content priority, down to the pane's own minimum.\n */\nexport function paneMax(limits: PaneLimits, windowWidth: number, otherOpenWidth: number, contentMin: number, separators: number): number {\n return Math.max(limits.min, Math.min(limits.max, windowWidth - otherOpenWidth - contentMin - separators));\n}\n\n/** The size after a drag of `delta` px along the reading direction (`direction` 1 in LTR, -1 in RTL; `side` 1 for the start pane, -1 for the end one). */\nexport function dragged(start: number, delta: number, direction: 1 | -1, side: 1 | -1, limits: PaneLimits, ceiling = limits.max): number {\n return clamp(start + delta * direction * side, limits.min, ceiling);\n}\n\n/** The size after an arrow key: the arrow that points away from the pane's edge grows it (→ for the start pane in LTR). `null` for another key. */\nexport function keyed(key: string, current: number, direction: 1 | -1, side: 1 | -1, limits: PaneLimits, shift: boolean, ceiling = limits.max): number | null {\n const step = shift ? 64 : 16;\n if (key === \"Home\") return limits.min;\n if (key === \"End\") return Math.max(limits.min, ceiling);\n if (key !== \"ArrowLeft\" && key !== \"ArrowRight\") return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vG;AAAA,WACH;AAAA,QACA,oBAAC,SAAI,0BAAuB,IAAG,WAAW,EAAE,aAAa,GACtD,iBACH;AAAA,QACA,qBAAC,SAAI,WAAW,EAAE,aAAa,GAC5B;AAAA;AAAA,UACA,gBAAgB,OAAO,aAAa,OAAO,iBAAiB,WAAW,MAAM,YAAY,CAAC,QAAQ,GAAG,uBAAuB;AAAA,WAC/H;AAAA,SACF;AAAA,MACA,oBAAC,UAAK,IAAG,WAAU,UAAU,IAAI,WAAW,EAAE,QAAQ,GACnD,UACH;AAAA,OACF;AAAA,IACC,aAAa,UAAU,aAAa,aAAa,OAAO,eAAe;AAAA,IACvE,gBACC,oBAAC,WAAM,IAAI,aAAa,cAAY,OAAO,WAAW,kBAAgB,YAAY,SAAY,IAAI,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,GAAG,OAAO,EAAE,OAAO,MAAM,UAAU,GACjL,8BAAC,SAAI,WAAW,EAAE,OAAO,GAAI,qBAAU,GACzC;AAAA,KAEJ;AAEJ;AAOO,SAAS,mBAAmB,UAAmD;AACpF,QAAM,QAAc,eAAQ,MAAM,aAAa,QAAQ,GAAG,CAAC,QAAQ,CAAC;AACpE,eAAa,MAAM,SAAwB;AAC3C,SAAO;AACT;","names":["React"]}
|
package/dist/drop-overlay.js
CHANGED
|
@@ -70,15 +70,15 @@ function DropOverlay({
|
|
|
70
70
|
const { accepted, rejected } = splitDropped(files, latest.current.accept);
|
|
71
71
|
latest.current.onFiles?.(accepted, rejected);
|
|
72
72
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
globalThis.addEventListener("dragenter", enter);
|
|
74
|
+
globalThis.addEventListener("dragover", over);
|
|
75
|
+
globalThis.addEventListener("dragleave", leave);
|
|
76
|
+
globalThis.addEventListener("drop", drop);
|
|
77
77
|
return () => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
globalThis.removeEventListener("dragenter", enter);
|
|
79
|
+
globalThis.removeEventListener("dragover", over);
|
|
80
|
+
globalThis.removeEventListener("dragleave", leave);
|
|
81
|
+
globalThis.removeEventListener("drop", drop);
|
|
82
82
|
reset();
|
|
83
83
|
};
|
|
84
84
|
}, [disabled, isControlled]);
|
package/dist/drop-overlay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/drop-overlay/drop-overlay.tsx","../src/drop-overlay/files.ts"],"sourcesContent":["// Client (window listeners). The whole window is the drop target: while files are dragged over the page a full-window overlay\n// says so, and the dropped files go to `onFiles` (accepted, rejected). No dashed box in the page; the product keeps a real\n// file input behind its primary action for the keyboard and for phones. Motion: motion.css (« DROP OVERLAY »).\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type AcceptRule, dragHasFiles, splitDropped } from \"./files\";\n\nexport type DropOverlayProps = Omit<React.ComponentProps<\"div\">, \"children\" | \"onDrop\"> & {\n /** What the overlay says (“Drop to check”) — passed translated. */\n label: string;\n /** One line under it (“PDF or text”). */\n hint?: string;\n /** What is accepted: MIME types, families (`image/*`) or extensions (`.pdf`). */\n accept?: readonly AcceptRule[];\n /** Turns the window back into a plain page (while a modal is open, signed out). */\n disabled?: boolean;\n} & (\n | {\n /** Controlled form (a desktop app's native drops, which arrive as paths): shown while true, the DOM listeners are off. */\n active: boolean;\n /** Not called in the controlled form. */\n onFiles?: (accepted: File[], rejected: File[]) => void;\n }\n | {\n /** Leave undefined to handle DOM drops. */\n active?: undefined;\n /** The files dropped: the accepted ones, then the ones `accept` refused. */\n onFiles: (accepted: File[], rejected: File[]) => void;\n }\n);\n\n/** Drag a file anywhere on the page: a full-window overlay accepts it. */\nexport function DropOverlay({\n label,\n hint,\n onFiles,\n accept,\n disabled,\n active: controlled,\n className,\n ...props\n}: DropOverlayProps) {\n const isControlled = controlled !== undefined;\n const [dragging, setActive] = React.useState(false);\n const depth = React.useRef(0);\n const latest = React.useRef({ onFiles, accept });\n React.useEffect(() => {\n latest.current = { onFiles, accept };\n });\n\n React.useEffect(() => {\n if (disabled || isControlled) return;\n const reset = () => {\n depth.current = 0;\n setActive(false);\n };\n const carrying = (event: Event) => dragHasFiles((event as DragEvent).dataTransfer);\n const enter = (event: Event) => {\n if (!carrying(event)) return;\n depth.current += 1;\n setActive(true);\n };\n const over = (event: Event) => {\n if (carrying(event)) event.preventDefault();\n };\n const leave = (event: Event) => {\n if (!carrying(event)) return;\n depth.current = Math.max(0, depth.current - 1);\n if (depth.current === 0) setActive(false);\n };\n const drop = (event: Event) => {\n if (!carrying(event)) return;\n event.preventDefault();\n const files = Array.from((event as DragEvent).dataTransfer?.files ?? []);\n reset();\n const { accepted, rejected } = splitDropped(files, latest.current.accept);\n latest.current.onFiles?.(accepted, rejected);\n };\n
|
|
1
|
+
{"version":3,"sources":["../src/drop-overlay/drop-overlay.tsx","../src/drop-overlay/files.ts"],"sourcesContent":["// Client (window listeners). The whole window is the drop target: while files are dragged over the page a full-window overlay\n// says so, and the dropped files go to `onFiles` (accepted, rejected). No dashed box in the page; the product keeps a real\n// file input behind its primary action for the keyboard and for phones. Motion: motion.css (« DROP OVERLAY »).\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type AcceptRule, dragHasFiles, splitDropped } from \"./files\";\n\nexport type DropOverlayProps = Omit<React.ComponentProps<\"div\">, \"children\" | \"onDrop\"> & {\n /** What the overlay says (“Drop to check”) — passed translated. */\n label: string;\n /** One line under it (“PDF or text”). */\n hint?: string;\n /** What is accepted: MIME types, families (`image/*`) or extensions (`.pdf`). */\n accept?: readonly AcceptRule[];\n /** Turns the window back into a plain page (while a modal is open, signed out). */\n disabled?: boolean;\n} & (\n | {\n /** Controlled form (a desktop app's native drops, which arrive as paths): shown while true, the DOM listeners are off. */\n active: boolean;\n /** Not called in the controlled form. */\n onFiles?: (accepted: File[], rejected: File[]) => void;\n }\n | {\n /** Leave undefined to handle DOM drops. */\n active?: undefined;\n /** The files dropped: the accepted ones, then the ones `accept` refused. */\n onFiles: (accepted: File[], rejected: File[]) => void;\n }\n);\n\n/** Drag a file anywhere on the page: a full-window overlay accepts it. */\nexport function DropOverlay({\n label,\n hint,\n onFiles,\n accept,\n disabled,\n active: controlled,\n className,\n ...props\n}: DropOverlayProps) {\n const isControlled = controlled !== undefined;\n const [dragging, setActive] = React.useState(false);\n const depth = React.useRef(0);\n const latest = React.useRef({ onFiles, accept });\n React.useEffect(() => {\n latest.current = { onFiles, accept };\n });\n\n React.useEffect(() => {\n if (disabled || isControlled) return;\n const reset = () => {\n depth.current = 0;\n setActive(false);\n };\n const carrying = (event: Event) => dragHasFiles((event as DragEvent).dataTransfer);\n const enter = (event: Event) => {\n if (!carrying(event)) return;\n depth.current += 1;\n setActive(true);\n };\n const over = (event: Event) => {\n if (carrying(event)) event.preventDefault();\n };\n const leave = (event: Event) => {\n if (!carrying(event)) return;\n depth.current = Math.max(0, depth.current - 1);\n if (depth.current === 0) setActive(false);\n };\n const drop = (event: Event) => {\n if (!carrying(event)) return;\n event.preventDefault();\n const files = Array.from((event as DragEvent).dataTransfer?.files ?? []);\n reset();\n const { accepted, rejected } = splitDropped(files, latest.current.accept);\n latest.current.onFiles?.(accepted, rejected);\n };\n globalThis.addEventListener(\"dragenter\", enter);\n globalThis.addEventListener(\"dragover\", over);\n globalThis.addEventListener(\"dragleave\", leave);\n globalThis.addEventListener(\"drop\", drop);\n return () => {\n globalThis.removeEventListener(\"dragenter\", enter);\n globalThis.removeEventListener(\"dragover\", over);\n globalThis.removeEventListener(\"dragleave\", leave);\n globalThis.removeEventListener(\"drop\", drop);\n reset();\n };\n }, [disabled, isControlled]);\n\n if (!(isControlled ? controlled && !disabled : dragging)) return null;\n return (\n <div role=\"status\" data-state=\"open\" className={cn(\"kz-drop-overlay\", className)} {...props}>\n <div className=\"kz-drop-overlay-card\">\n <span className=\"text-lg font-semibold text-fg\">{label}</span>\n {hint ? <span className=\"text-sm text-fg-secondary\">{hint}</span> : null}\n </div>\n </div>\n );\n}\n","// Headless: what a drag carries and which of the dropped files a product accepts.\n\n/** True while the drag carries files (not text or a link): the only drag that should raise the overlay. */\nexport function dragHasFiles(transfer: { types?: readonly string[] | DOMStringList } | null | undefined): boolean {\n return Array.from(transfer?.types ?? []).includes(\"Files\");\n}\n\n/** One accepted kind: a MIME type (`application/pdf`), a family (`image/*`) or an extension (`.pdf`). */\nexport type AcceptRule = string;\n\nfunction matches(file: Pick<File, \"name\" | \"type\">, rule: AcceptRule): boolean {\n const wanted = rule.trim().toLowerCase();\n if (wanted.startsWith(\".\")) return file.name.toLowerCase().endsWith(wanted);\n if (wanted.endsWith(\"/*\")) return file.type.toLowerCase().startsWith(wanted.slice(0, -1));\n return file.type.toLowerCase() === wanted;\n}\n\nexport interface DropSplit<F> {\n accepted: F[];\n rejected: F[];\n}\n\n/** Splits dropped files by `accept` (no rule: everything is accepted). */\nexport function splitDropped<F extends Pick<File, \"name\" | \"type\">>(files: readonly F[], accept?: readonly AcceptRule[]): DropSplit<F> {\n if (!accept || accept.length === 0) return { accepted: [...files], rejected: [] };\n const accepted: F[] = [];\n const rejected: F[] = [];\n for (const file of files) (accept.some((rule) => matches(file, rule)) ? accepted : rejected).push(file);\n return { accepted, rejected };\n}\n"],"mappings":";;;;;AAGA,YAAY,WAAW;;;ACAhB,SAAS,aAAa,UAAqF;AAChH,SAAO,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC,EAAE,SAAS,OAAO;AAC3D;AAKA,SAAS,QAAQ,MAAmC,MAA2B;AAC7E,QAAM,SAAS,KAAK,KAAK,EAAE,YAAY;AACvC,MAAI,OAAO,WAAW,GAAG,EAAG,QAAO,KAAK,KAAK,YAAY,EAAE,SAAS,MAAM;AAC1E,MAAI,OAAO,SAAS,IAAI,EAAG,QAAO,KAAK,KAAK,YAAY,EAAE,WAAW,OAAO,MAAM,GAAG,EAAE,CAAC;AACxF,SAAO,KAAK,KAAK,YAAY,MAAM;AACrC;AAQO,SAAS,aAAoD,OAAqB,QAA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K;AAAA,IAC1C;AACA,UAAM,OAAO,CAAC,UAAiB;AAC7B,UAAI,CAAC,SAAS,KAAK,EAAG;AACtB,YAAM,eAAe;AACrB,YAAM,QAAQ,MAAM,KAAM,MAAoB,cAAc,SAAS,CAAC,CAAC;AACvE,YAAM;AACN,YAAM,EAAE,UAAU,SAAS,IAAI,aAAa,OAAO,OAAO,QAAQ,MAAM;AACxE,aAAO,QAAQ,UAAU,UAAU,QAAQ;AAAA,IAC7C;AACA,eAAW,iBAAiB,aAAa,KAAK;AAC9C,eAAW,iBAAiB,YAAY,IAAI;AAC5C,eAAW,iBAAiB,aAAa,KAAK;AAC9C,eAAW,iBAAiB,QAAQ,IAAI;AACxC,WAAO,MAAM;AACX,iBAAW,oBAAoB,aAAa,KAAK;AACjD,iBAAW,oBAAoB,YAAY,IAAI;AAC/C,iBAAW,oBAAoB,aAAa,KAAK;AACjD,iBAAW,oBAAoB,QAAQ,IAAI;AAC3C,YAAM;AAAA,IACR;AAAA,EACF,GAAG,CAAC,UAAU,YAAY,CAAC;AAE3B,MAAI,EAAE,eAAe,cAAc,CAAC,WAAW,UAAW,QAAO;AACjE,SACE,oBAAC,SAAI,MAAK,UAAS,cAAW,QAAO,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OACpF,+BAAC,SAAI,WAAU,wBACb;AAAA,wBAAC,UAAK,WAAU,iCAAiC,iBAAM;AAAA,IACtD,OAAO,oBAAC,UAAK,WAAU,6BAA6B,gBAAK,IAAU;AAAA,KACtE,GACF;AAEJ;","names":[]}
|
package/dist/elephant.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ interface ElephantProps extends Omit<SVGProps<SVGSVGElement>, "width" | "height"
|
|
|
17
17
|
* both themes; decorative by default.
|
|
18
18
|
* @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.
|
|
19
19
|
*/
|
|
20
|
-
declare function Elephant({ pose, size, animated, title, className, ...rest }: ElephantProps): React.JSX.Element;
|
|
20
|
+
declare function Elephant({ pose, size, animated, title, className, ...rest }: Readonly<ElephantProps>): React.JSX.Element;
|
|
21
21
|
|
|
22
22
|
/** @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0. */
|
|
23
23
|
declare const ELEPHANT: {
|
package/dist/elephant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/elephant/geometry.ts","../src/elephant/elephant.tsx"],"sourcesContent":["/**\n * The elephant's geometry (200 × 200 view box, a pen line of 8, square caps, mitred joins — the Cahier grammar of the\n * marks and of @krizaka/icons: straight runs and 45° cuts, no rounded outline). It faces right. Two poses of one\n * animal: `standing`, the ear folded down beside the head, and `flying`, the ear spread up like a wing (the darija\n * joke: « l'éléphant avec ses oreilles, il peut voler »), the legs tucked, three lines of wind behind.\n *\n * The body and the trunk are sage, the ear and the wing sand: the two stops of a sand → sage gradient, each ≥ 3:1 on the page surfaces of both themes. Flat colours: no glow, no gradient.\n */\nexport const SAND = \"#a4773d\";\nexport const SAGE = \"#5d894d\";\n\n/** @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0. */\nexport const ELEPHANT = {\n viewBox: \"0 0 200 200\",\n stroke: 8,\n sand: SAND,\n sage: SAGE,\n /** The eye: one node, a filled dot. */\n eye: { cx: 154, cy: 66, r: 5 },\n standing: {\n /** Body, head and the two legs, one closed outline: straight runs and 45° cuts. */\n body: \"M30 88 L44 74 H112 V54 L126 40 H158 L176 56 V100 L168 108 H132 V168 H108 V138 H62 V168 H38 V138 H30 Z\",\n /** The trunk: down from the head's front, curling up at its tip. */\n trunk: \"M164 108 V146 L172 158 H184 V144\",\n /** The ear, folded down over the shoulder. */\n ear: \"M116 52 L92 56 L84 100 L104 124 L128 112 Z\",\n tail: \"M30 90 L20 108 V118\",\n },\n flying: {\n body: \"M30 88 L44 74 H112 V54 L126 40 H158 L176 56 V100 L168 108 H132 V140 H108 V128 H62 V140 H38 V128 H30 Z\",\n trunk: \"M164 108 V142 L172 154 H184 V140\",\n /** The ear, spread up and back: the wing. */\n ear: \"M116 78 L120 30 L90 10 L78 34 L52 24 L56 52 L30 60 L66 84 Z\",\n tail: \"M30 90 L18 102 V112\",\n wind: \"M22 150 H50 M12 166 H44 M32 180 H58\",\n },\n /** The flap: a few degrees around the shoulder, 1.6 s. */\n motion: { flap: 1.6, origin: \"114px 80px\", angle: 7 },\n} as const;\n","import type { SVGProps } from \"react\";\n\nimport { warnDeprecated } from \"../deprecated\";\nimport { ELEPHANT as G } from \"./geometry\";\n\nexport interface ElephantProps extends Omit<SVGProps<SVGSVGElement>, \"width\" | \"height\" | \"title\"> {\n /** `standing` with the ear folded down, or `flying` with the ear spread like a wing. */\n pose?: \"standing\" | \"flying\";\n /** Width and height in pixels. */\n size?: number;\n /** The wing flaps gently (a flying elephant only). Off with `false`; always off under prefers-reduced-motion. */\n animated?: boolean;\n /** An accessible name (the mark becomes an image); without it the mark is decorative. */\n title?: string;\n}\n\nconst CSS = `\n.kz-elephant-flap { transform-box: view-box; transform-origin: ${G.motion.origin}; animation: kz-elephant-flap ${G.motion.flap}s ease-in-out infinite; }\n@keyframes kz-elephant-flap { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-${G.motion.angle}deg); } }\n@media (prefers-reduced-motion: reduce) { .kz-elephant-flap { animation: none; } }\n`;\n\nconst line = { strokeWidth: G.stroke, strokeLinecap: \"square\", strokeLinejoin: \"miter\", fill: \"none\" } as const;\n\n/**\n * The elephant: a small, playful mark from the neighbour joke — « the elephant with those ears can fly ». Not a product\n * logo: a quiet figure for the hero of a page or the closing of a chat. Sage body, sand ear, flat colours that read on\n * both themes; decorative by default.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function Elephant({ pose = \"standing\", size = 64, animated = true, title, className, ...rest }: ElephantProps) {\n warnDeprecated(\"elephant\");\n const flying = pose === \"flying\";\n const p = flying ? G.flying : G.standing;\n const a11y = title ? { role: \"img\" as const, \"aria-label\": title } : { \"aria-hidden\": true as const };\n return (\n <svg width={size} height={size} viewBox={G.viewBox} xmlns=\"http://www.w3.org/2000/svg\" className={className} data-pose={pose} {...a11y} {...rest}>\n {flying && animated ? <style>{CSS}</style> : null}\n {flying ? <path d={G.flying.wind} stroke={G.sage} opacity=\".45\" {...line} /> : null}\n <path d={p.body} stroke={G.sage} {...line} />\n <path d={p.trunk} stroke={G.sage} {...line} />\n <path d={p.tail} stroke={G.sage} {...line} />\n <g className={flying && animated ? \"kz-elephant-flap\" : undefined}>\n <path d={p.ear} stroke={G.sand} {...line} />\n </g>\n <circle cx={G.eye.cx} cy={G.eye.cy} r={G.eye.r} fill={G.sage} />\n </svg>\n );\n}\n"],"mappings":";;;;;;AAQO,IAAM,OAAO;AACb,IAAM,OAAO;AAGb,IAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA;AAAA,EAEN,KAAK,EAAE,IAAI,KAAK,IAAI,IAAI,GAAG,EAAE;AAAA,EAC7B,UAAU;AAAA;AAAA,IAER,MAAM;AAAA;AAAA,IAEN,OAAO;AAAA;AAAA,IAEP,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA;AAAA,IAEP,KAAK;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA;AAAA,EAEA,QAAQ,EAAE,MAAM,KAAK,QAAQ,cAAc,OAAO,EAAE;AACtD;;;ACFI,SACwB,KADxB;AApBJ,IAAM,MAAM;AAAA,iEACqD,SAAE,OAAO,MAAM,iCAAiC,SAAE,OAAO,IAAI;AAAA,+FAC/B,SAAE,OAAO,KAAK;AAAA;AAAA;AAI7G,IAAM,OAAO,EAAE,aAAa,SAAE,QAAQ,eAAe,UAAU,gBAAgB,SAAS,MAAM,OAAO;AAQ9F,SAAS,SAAS,EAAE,OAAO,YAAY,OAAO,IAAI,WAAW,MAAM,OAAO,WAAW,GAAG,KAAK,
|
|
1
|
+
{"version":3,"sources":["../src/elephant/geometry.ts","../src/elephant/elephant.tsx"],"sourcesContent":["/**\n * The elephant's geometry (200 × 200 view box, a pen line of 8, square caps, mitred joins — the Cahier grammar of the\n * marks and of @krizaka/icons: straight runs and 45° cuts, no rounded outline). It faces right. Two poses of one\n * animal: `standing`, the ear folded down beside the head, and `flying`, the ear spread up like a wing (the darija\n * joke: « l'éléphant avec ses oreilles, il peut voler »), the legs tucked, three lines of wind behind.\n *\n * The body and the trunk are sage, the ear and the wing sand: the two stops of a sand → sage gradient, each ≥ 3:1 on the page surfaces of both themes. Flat colours: no glow, no gradient.\n */\nexport const SAND = \"#a4773d\";\nexport const SAGE = \"#5d894d\";\n\n/** @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0. */\nexport const ELEPHANT = {\n viewBox: \"0 0 200 200\",\n stroke: 8,\n sand: SAND,\n sage: SAGE,\n /** The eye: one node, a filled dot. */\n eye: { cx: 154, cy: 66, r: 5 },\n standing: {\n /** Body, head and the two legs, one closed outline: straight runs and 45° cuts. */\n body: \"M30 88 L44 74 H112 V54 L126 40 H158 L176 56 V100 L168 108 H132 V168 H108 V138 H62 V168 H38 V138 H30 Z\",\n /** The trunk: down from the head's front, curling up at its tip. */\n trunk: \"M164 108 V146 L172 158 H184 V144\",\n /** The ear, folded down over the shoulder. */\n ear: \"M116 52 L92 56 L84 100 L104 124 L128 112 Z\",\n tail: \"M30 90 L20 108 V118\",\n },\n flying: {\n body: \"M30 88 L44 74 H112 V54 L126 40 H158 L176 56 V100 L168 108 H132 V140 H108 V128 H62 V140 H38 V128 H30 Z\",\n trunk: \"M164 108 V142 L172 154 H184 V140\",\n /** The ear, spread up and back: the wing. */\n ear: \"M116 78 L120 30 L90 10 L78 34 L52 24 L56 52 L30 60 L66 84 Z\",\n tail: \"M30 90 L18 102 V112\",\n wind: \"M22 150 H50 M12 166 H44 M32 180 H58\",\n },\n /** The flap: a few degrees around the shoulder, 1.6 s. */\n motion: { flap: 1.6, origin: \"114px 80px\", angle: 7 },\n} as const;\n","import type { SVGProps } from \"react\";\n\nimport { warnDeprecated } from \"../deprecated\";\nimport { ELEPHANT as G } from \"./geometry\";\n\nexport interface ElephantProps extends Omit<SVGProps<SVGSVGElement>, \"width\" | \"height\" | \"title\"> {\n /** `standing` with the ear folded down, or `flying` with the ear spread like a wing. */\n pose?: \"standing\" | \"flying\";\n /** Width and height in pixels. */\n size?: number;\n /** The wing flaps gently (a flying elephant only). Off with `false`; always off under prefers-reduced-motion. */\n animated?: boolean;\n /** An accessible name (the mark becomes an image); without it the mark is decorative. */\n title?: string;\n}\n\nconst CSS = `\n.kz-elephant-flap { transform-box: view-box; transform-origin: ${G.motion.origin}; animation: kz-elephant-flap ${G.motion.flap}s ease-in-out infinite; }\n@keyframes kz-elephant-flap { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-${G.motion.angle}deg); } }\n@media (prefers-reduced-motion: reduce) { .kz-elephant-flap { animation: none; } }\n`;\n\nconst line = { strokeWidth: G.stroke, strokeLinecap: \"square\", strokeLinejoin: \"miter\", fill: \"none\" } as const;\n\n/**\n * The elephant: a small, playful mark from the neighbour joke — « the elephant with those ears can fly ». Not a product\n * logo: a quiet figure for the hero of a page or the closing of a chat. Sage body, sand ear, flat colours that read on\n * both themes; decorative by default.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function Elephant({ pose = \"standing\", size = 64, animated = true, title, className, ...rest }: Readonly<ElephantProps>) {\n warnDeprecated(\"elephant\");\n const flying = pose === \"flying\";\n const p = flying ? G.flying : G.standing;\n const a11y = title ? { role: \"img\" as const, \"aria-label\": title } : { \"aria-hidden\": true as const };\n return (\n <svg width={size} height={size} viewBox={G.viewBox} xmlns=\"http://www.w3.org/2000/svg\" className={className} data-pose={pose} {...a11y} {...rest}>\n {flying && animated ? <style>{CSS}</style> : null}\n {flying ? <path d={G.flying.wind} stroke={G.sage} opacity=\".45\" {...line} /> : null}\n <path d={p.body} stroke={G.sage} {...line} />\n <path d={p.trunk} stroke={G.sage} {...line} />\n <path d={p.tail} stroke={G.sage} {...line} />\n <g className={flying && animated ? \"kz-elephant-flap\" : undefined}>\n <path d={p.ear} stroke={G.sand} {...line} />\n </g>\n <circle cx={G.eye.cx} cy={G.eye.cy} r={G.eye.r} fill={G.sage} />\n </svg>\n );\n}\n"],"mappings":";;;;;;AAQO,IAAM,OAAO;AACb,IAAM,OAAO;AAGb,IAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA;AAAA,EAEN,KAAK,EAAE,IAAI,KAAK,IAAI,IAAI,GAAG,EAAE;AAAA,EAC7B,UAAU;AAAA;AAAA,IAER,MAAM;AAAA;AAAA,IAEN,OAAO;AAAA;AAAA,IAEP,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA;AAAA,IAEP,KAAK;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA;AAAA,EAEA,QAAQ,EAAE,MAAM,KAAK,QAAQ,cAAc,OAAO,EAAE;AACtD;;;ACFI,SACwB,KADxB;AApBJ,IAAM,MAAM;AAAA,iEACqD,SAAE,OAAO,MAAM,iCAAiC,SAAE,OAAO,IAAI;AAAA,+FAC/B,SAAE,OAAO,KAAK;AAAA;AAAA;AAI7G,IAAM,OAAO,EAAE,aAAa,SAAE,QAAQ,eAAe,UAAU,gBAAgB,SAAS,MAAM,OAAO;AAQ9F,SAAS,SAAS,EAAE,OAAO,YAAY,OAAO,IAAI,WAAW,MAAM,OAAO,WAAW,GAAG,KAAK,GAA4B;AAC9H,iBAAe,UAAU;AACzB,QAAM,SAAS,SAAS;AACxB,QAAM,IAAI,SAAS,SAAE,SAAS,SAAE;AAChC,QAAM,OAAO,QAAQ,EAAE,MAAM,OAAgB,cAAc,MAAM,IAAI,EAAE,eAAe,KAAc;AACpG,SACE,qBAAC,SAAI,OAAO,MAAM,QAAQ,MAAM,SAAS,SAAE,SAAS,OAAM,8BAA6B,WAAsB,aAAW,MAAO,GAAG,MAAO,GAAG,MACzI;AAAA,cAAU,WAAW,oBAAC,WAAO,eAAI,IAAW;AAAA,IAC5C,SAAS,oBAAC,UAAK,GAAG,SAAE,OAAO,MAAM,QAAQ,SAAE,MAAM,SAAQ,OAAO,GAAG,MAAM,IAAK;AAAA,IAC/E,oBAAC,UAAK,GAAG,EAAE,MAAM,QAAQ,SAAE,MAAO,GAAG,MAAM;AAAA,IACrC,oBAAC,UAAK,GAAG,EAAE,OAAO,QAAQ,SAAE,MAAO,GAAG,MAAM;AAAA,IAClD,oBAAC,UAAK,GAAG,EAAE,MAAM,QAAQ,SAAE,MAAO,GAAG,MAAM;AAAA,IAC3C,oBAAC,OAAE,WAAW,UAAU,WAAW,qBAAqB,QACtD,8BAAC,UAAK,GAAG,EAAE,KAAK,QAAQ,SAAE,MAAO,GAAG,MAAM,GAC5C;AAAA,IACA,oBAAC,YAAO,IAAI,SAAE,IAAI,IAAI,IAAI,SAAE,IAAI,IAAI,GAAG,SAAE,IAAI,GAAG,MAAM,SAAE,MAAM;AAAA,KAChE;AAEJ;","names":[]}
|
package/dist/embed-facade.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ interface EmbedFacadeProps extends Omit<React.ComponentProps<"div">, "title" | "
|
|
|
31
31
|
onLoad?: () => void;
|
|
32
32
|
}
|
|
33
33
|
/** A short video from a platform, behind a button: the frame exists only after the click. */
|
|
34
|
-
declare function EmbedFacade({ platform, url, title, playLabel, poster, notice, aspectRatio, onLoad, className, style, ...props }: EmbedFacadeProps): React.JSX.Element | null;
|
|
34
|
+
declare function EmbedFacade({ platform, url, title, playLabel, poster, notice, aspectRatio, onLoad, className, style, ...props }: Readonly<EmbedFacadeProps>): React.JSX.Element | null;
|
|
35
35
|
|
|
36
36
|
export { EMBED_PLATFORMS, EmbedFacade, embedUrl, isOwnPoster };
|
|
37
37
|
export type { EmbedFacadeProps, EmbedPlatform };
|