@krizaka/ui 3.76.1 → 3.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/blocks.css +14 -0
  2. package/dist/chunk-NM2DEHFZ.js +25 -0
  3. package/dist/chunk-NM2DEHFZ.js.map +1 -0
  4. package/dist/document-viewer.d.ts +23 -6
  5. package/dist/document-viewer.js +21 -5
  6. package/dist/document-viewer.js.map +1 -1
  7. package/dist/filter-bar.d.ts +3 -3
  8. package/dist/map/cards.d.ts +145 -0
  9. package/dist/map/cards.js +74 -0
  10. package/dist/map/cards.js.map +1 -0
  11. package/dist/map/pin.d.ts +57 -0
  12. package/dist/map/pin.js +53 -0
  13. package/dist/map/pin.js.map +1 -0
  14. package/dist/map/sheet.d.ts +80 -0
  15. package/dist/map/sheet.js +61 -0
  16. package/dist/map/sheet.js.map +1 -0
  17. package/dist/map.d.ts +41 -14
  18. package/dist/map.js +85 -112
  19. package/dist/map.js.map +1 -1
  20. package/dist/native/map.d.ts +29 -10
  21. package/dist/native/map.js +81 -107
  22. package/dist/native/map.js.map +1 -1
  23. package/dist/virtual.d.ts +3 -3
  24. package/dist/wall.d.ts +10 -5
  25. package/dist/wall.js +10 -4
  26. package/dist/wall.js.map +1 -1
  27. package/package.json +51 -6
  28. package/registry/app-frame.json +1 -1
  29. package/registry/document-viewer.json +9 -8
  30. package/registry/examples/document-viewer/highlights.js +2 -1
  31. package/registry/examples/document-viewer/highlights.tsx +3 -0
  32. package/registry/examples/map/pins.d.ts +4 -0
  33. package/registry/examples/map/pins.js +20 -0
  34. package/registry/examples/map/pins.tsx +27 -0
  35. package/registry/examples/map/place-sheet.d.ts +4 -0
  36. package/registry/examples/map/place-sheet.js +34 -0
  37. package/registry/examples/map/place-sheet.tsx +35 -0
  38. package/registry/examples/wall/tidy.d.ts +4 -0
  39. package/registry/examples/wall/tidy.js +27 -0
  40. package/registry/examples/wall/tidy.tsx +19 -0
  41. package/registry/index.json +9 -9
  42. package/registry/map.json +81 -13
  43. package/registry/nav-bar.json +1 -1
  44. package/registry/rail-nav.json +1 -1
  45. package/registry/shop.json +1 -1
  46. package/registry/site-footer.json +1 -1
  47. package/registry/wall.json +24 -2
@@ -276,6 +276,13 @@
276
276
  "description": "Desktop object width in pixels (minimum 120); defaults to 240 and never exceeds the surface.",
277
277
  "required": false
278
278
  },
279
+ {
280
+ "name": "layout",
281
+ "type": "\"pinned\" | \"tidy\"",
282
+ "default": "pinned",
283
+ "description": "`pinned` (default): objects placed at x / y on a fixed surface. `tidy`: the Cahier pinboard — a dense CSS grid (3 columns,\n2 on a phone, 1 on a very small one), a note may span two, each tilted 1–2° by its id (no random position), no JS layout.",
284
+ "required": false
285
+ },
279
286
  {
280
287
  "name": "max",
281
288
  "type": "number",
@@ -310,6 +317,14 @@
310
317
  "module": "@krizaka/ui/registry/examples/wall/composition-fr",
311
318
  "code": "import { Wall } from \"@krizaka/ui/wall\";\n\nexport default function FrenchCompositionExample() {\n const m = {\n wallLabel: \"Dans notre atelier\", photoAlt: \"La montagne au-dessus de notre atelier\",\n caption: \"La vue d’ici\", note: \"Fait avec patience. Partagé avec plaisir.\",\n signature: \"Sam\", sign: \"Atelier du coin\",\n };\n return <div lang=\"fr\"><Wall aria-label={m.wallLabel} texture=\"brick\" itemWidth={220} items={[\n { kind: \"polaroid\", id: \"photo\", z: 1, x: 8, y: 18, rotation: -4, attachment: \"tape\", attachmentRotation: 6, caption: m.caption,\n img: <svg viewBox=\"0 0 240 240\" role=\"img\" aria-label={m.photoAlt}>\n <rect width=\"240\" height=\"240\" fill=\"var(--kz-accent-soft)\" />\n <path d=\"m0 240 100-190 55 110 35-45 50 125Z\" fill=\"var(--kz-accent)\" />\n </svg> },\n { kind: \"note\", id: \"word\", z: 2, x: 52, y: 75, rotation: 3, attachment: \"pin\", text: m.note, signature: m.signature },\n { kind: \"sign\", id: \"sign\", z: 3, x: 94, y: 22, rotation: -2, variant: \"enamel\", logo: m.sign },\n ]} /></div>;\n}\n"
312
319
  },
320
+ {
321
+ "name": "tidy",
322
+ "title": "The tidy pinboard",
323
+ "description": "layout=\"tidy\": a dense grid (3 columns, 2 on a phone, 1 on a very small one), a note spanning two, a tilt of 1-2 degrees derived from each id, no coordinates.",
324
+ "path": "examples/wall/tidy.tsx",
325
+ "module": "@krizaka/ui/registry/examples/wall/tidy",
326
+ "code": "import { Wall, type WallItem } from \"@krizaka/ui/wall\";\n\nconst m = {\n wallLabel: \"From the shop\",\n photo: (alt: string, hue: string) => <svg role=\"img\" aria-label={alt} viewBox=\"0 0 240 240\"><rect width=\"240\" height=\"240\" fill={hue} /><path d=\"m0 240 100-190 55 110 35-45 50 125Z\" fill=\"var(--kz-accent)\" opacity=\".8\" /></svg>,\n};\nconst items: WallItem[] = [\n { id: \"front\", kind: \"polaroid\", z: 1, img: m.photo(\"The shop front\", \"var(--kz-accent-soft)\"), caption: \"Rue Saint-Denis, since 2019\" },\n { id: \"note\", kind: \"note\", z: 2, text: \"Open late on Fridays. Walk-ins welcome.\", signature: \"Rose\", attachment: \"pin\" },\n { id: \"chair\", kind: \"polaroid\", z: 3, img: m.photo(\"The first chair\", \"var(--kz-surface-3)\"), caption: \"The first chair\", attachment: \"pin\" },\n { id: \"window\", kind: \"polaroid\", z: 4, img: m.photo(\"The window\", \"var(--kz-surface-2)\"), caption: \"The window in May\" },\n { id: \"sign\", kind: \"sign\", z: 5, logo: \"Atelier Rose\", variant: \"enamel\" },\n { id: \"wash\", kind: \"polaroid\", z: 6, img: m.photo(\"The wash basin\", \"var(--kz-accent-soft)\"), caption: \"The wash basin\" },\n { id: \"note2\", kind: \"note\", z: 7, text: \"Bring a photo of the cut you like.\", signature: \"Rose\" },\n];\n\nexport default function WallTidy() {\n return <Wall aria-label={m.wallLabel} layout=\"tidy\" texture=\"plaster\" items={items} />;\n}\n"
327
+ },
313
328
  {
314
329
  "name": "brick",
315
330
  "title": "Montréal brick",
@@ -384,7 +399,7 @@
384
399
  },
385
400
  {
386
401
  "path": "wall/meta.ts",
387
- "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Wall\",\n summary: \"A read-only wall of photos, short notes and the owner's sign: Montréal brick, Moroccan eight-point zellige, Grenoble ridgelines or warm plaster, over a real keyboard-reachable list.\",\n status: \"beta\",\n category: \"blocks\",\n domain: \"page-blocks\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"An ornamental storefront surface belongs to web pages; native content should stay in a scrolling gallery.\" }, desktop: \"web\" },\n whenToUse: [\"A shop or community page whose owner's photos, words and identity should feel personally pinned up.\"],\n whenNotToUse: [\n { when: \"Rows of data to compare or sort.\", use: \"data-table\" },\n ],\n bestPractices: [\n \"Import @krizaka/ui/blocks.css once. All four components are exported from @krizaka/ui/wall.\",\n \"Each example includes its own words, so copied snippets are self-contained. Choose the host locale and pass its words as data; the French composition demonstrates the same surface unchanged.\",\n \"Wall draws at most `max` items (12 by default, the first in z order) in a fixed 16:9 box on a desktop; show the rest behind a « see the whole wall » of your own. Pass `height` only for a fixed pixel height. On a phone it stacks them in z order, straight.\",\n \"`ShopSign` renders its text children as the heading (`as=\\\"h1\\\"` by default): the page's one h1 is the sign. On a Wall a sign is a paragraph unless you pass `as`. `variant=\\\"none\\\"` is the name alone on paper; the neon flickers once, the first time it is seen, and never loops.\",\n \"`PinnedNote`: `hold` (tape or pin, through Stuck), `ink` (blue, margin, hue) and `lines` (a fixed box of N lines, default 4, read in full by assistive technology); `attachment` still works as an alias of `hold`.\",\n \"`PinnedNote` also takes `paper` (plain, or a post-it: butter, rose, mint, sky), an `action` slot (a link kept inside the note, keyboard reachable) and a `limit` of code points (default 140) for a message that is read whole.\",\n \"Provide stable ids, explicit x/y percentages, rotation in degrees and z for every item. Positions are clamped to 0–100; z sorts the real list stably, including keyboard and phone order.\",\n \"Use kind polaroid with img, kind note with text, or kind sign with logo. Items carry the same props as their standalone component; no editor or random placement is added.\",\n \"Use height and itemWidth for layout, not style: style is intentionally omitted from the public props so percentage placement and the mobile stack cannot be overwritten accidentally.\",\n \"Keep the wall sparse and tilts small. On screens narrower than 48rem it grows into an untilted single column in z order, without overlap.\",\n \"The img ReactNode accepts next/image, including fill: the square photo frame is positioned. Supply an informative alt, or an empty alt for decoration.\",\n \"Captions and signatures use the existing --kz-font-cahier handwriting role (Krizaka Cahier from @krizaka/fonts); load the font in the host.\",\n \"PinnedNote caps text at 140 Unicode code points. Keep the full message elsewhere when more detail matters.\",\n \"Set attachment and attachmentRotation for tape or a pin, rotation for the object; neon's animated=false and Polaroid's develop=false opt out of motion.\",\n \"Wall textures adapt to dark, light and brand themes. Polaroid composes TapedPhoto: its --kz-print paper stays pale in both themes, with --kz-print-ink captions and --kz-tape strips instead of a second print material.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Tab / Shift+Tab\", action: \"Visit each object in ascending z order, preserving input order for ties.\" }],\n notes: [\n \"Wall is a real ul with an explicit list role, preserving Safari semantics despite list-style:none, and focusable li objects; give it an aria-label describing the collection. Textures, tape, pins and screws are hidden from assistive technology.\",\n \"Every word and all photo/logo alternatives come from the host. Standalone objects keep their natural figure/article/div semantics; Wall supplies their focus target.\",\n \"Polaroid only develops after its first observed intersection. With reduced motion, without an observer, or before hydration the photo remains sharp; preference changes stop motion immediately.\",\n \"Neon only flickers softly once, never flashes or loops. All effects stop under prefers-reduced-motion; reading and focus order never depend on visual positions.\",\n ],\n },\n related: [\"taped-photo\", \"cover-hero\", \"media-gallery\", \"profile-card\"],\n web: {\n imports: [\"Wall\", \"Polaroid\", \"PinnedNote\", \"ShopSign\"],\n examples: [\n { name: \"composition\", title: \"The owner's wall\", description: \"A photograph, a signed word and an enamel sign, positioned from deterministic data.\" },\n { name: \"composition-fr\", title: \"The owner's wall in French\", description: \"The same deterministic layout reads its French words and alternatives from the example's local catalogue.\" },\n { name: \"brick\", title: \"Montréal brick\", description: \"Staggered masonry and mortar on a warm token-based surface.\" },\n { name: \"zellige\", title: \"Moroccan zellige\", description: \"A repeating deterministic eight-point SVG star, without an image download.\" },\n { name: \"ridge\", title: \"Grenoble ridges\", description: \"Three layered mountain silhouettes behind the owner's words.\" },\n { name: \"plaster\", title: \"Warm plaster\", description: \"A quiet lightly textured wall when the content should speak first.\" },\n { name: \"polaroid\", title: \"Polaroids\", description: \"A photo slot, handwritten caption, deterministic tilt, and tape or pin.\" },\n { name: \"pinned-note\", title: \"Pinned notes\", description: \"Short signed words on cut-corner paper, held by a pin or tape.\" },\n { name: \"shop-sign\", title: \"Shop signs\", description: \"The owner's mark as enamel with screws, soft neon, or weathered painted lettering.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
402
+ "content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Wall\",\n summary: \"A read-only wall of photos, short notes and the owner's sign: Montréal brick, Moroccan eight-point zellige, Grenoble ridgelines or warm plaster, over a real keyboard-reachable list.\",\n status: \"beta\",\n category: \"blocks\",\n domain: \"page-blocks\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"An ornamental storefront surface belongs to web pages; native content should stay in a scrolling gallery.\" }, desktop: \"web\" },\n whenToUse: [\"A shop or community page whose owner's photos, words and identity should feel personally pinned up.\"],\n whenNotToUse: [\n { when: \"Rows of data to compare or sort.\", use: \"data-table\" },\n ],\n bestPractices: [\n \"Import @krizaka/ui/blocks.css once. All four components are exported from @krizaka/ui/wall.\",\n \"Each example includes its own words, so copied snippets are self-contained. Choose the host locale and pass its words as data; the French composition demonstrates the same surface unchanged.\",\n \"Wall draws at most `max` items (12 by default, the first in z order) in a fixed 16:9 box on a desktop; show the rest behind a « see the whole wall » of your own. Pass `height` only for a fixed pixel height. On a phone it stacks them in z order, straight.\",\n \"`ShopSign` renders its text children as the heading (`as=\\\"h1\\\"` by default): the page's one h1 is the sign. On a Wall a sign is a paragraph unless you pass `as`. `variant=\\\"none\\\"` is the name alone on paper; the neon flickers once, the first time it is seen, and never loops.\",\n \"`PinnedNote`: `hold` (tape or pin, through Stuck), `ink` (blue, margin, hue) and `lines` (a fixed box of N lines, default 4, read in full by assistive technology); `attachment` still works as an alias of `hold`.\",\n \"`PinnedNote` also takes `paper` (plain, or a post-it: butter, rose, mint, sky), an `action` slot (a link kept inside the note, keyboard reachable) and a `limit` of code points (default 140) for a message that is read whole.\",\n \"Provide stable ids, explicit x/y percentages, rotation in degrees and z for every item. Positions are clamped to 0–100; z sorts the real list stably, including keyboard and phone order.\",\n \"Use kind polaroid with img, kind note with text, or kind sign with logo. Items carry the same props as their standalone component; no editor or random placement is added.\",\n \"Use height and itemWidth for layout, not style: style is intentionally omitted from the public props so percentage placement and the mobile stack cannot be overwritten accidentally.\",\n \"Keep the wall sparse and tilts small. On screens narrower than 48rem it grows into an untilted single column in z order, without overlap.\",\n \"The img ReactNode accepts next/image, including fill: the square photo frame is positioned. Supply an informative alt, or an empty alt for decoration.\",\n \"Captions and signatures use the existing --kz-font-cahier handwriting role (Krizaka Cahier from @krizaka/fonts); load the font in the host.\",\n \"PinnedNote caps text at 140 Unicode code points. Keep the full message elsewhere when more detail matters.\",\n \"Set attachment and attachmentRotation for tape or a pin, rotation for the object; neon's animated=false and Polaroid's develop=false opt out of motion.\",\n \"Wall textures adapt to dark, light and brand themes. Polaroid composes TapedPhoto: its --kz-print paper stays pale in both themes, with --kz-print-ink captions and --kz-tape strips instead of a second print material.\",\n ],\n accessibility: {\n keyboard: [{ keys: \"Tab / Shift+Tab\", action: \"Visit each object in ascending z order, preserving input order for ties.\" }],\n notes: [\n \"Wall is a real ul with an explicit list role, preserving Safari semantics despite list-style:none, and focusable li objects; give it an aria-label describing the collection. Textures, tape, pins and screws are hidden from assistive technology.\",\n \"Every word and all photo/logo alternatives come from the host. Standalone objects keep their natural figure/article/div semantics; Wall supplies their focus target.\",\n \"Polaroid only develops after its first observed intersection. With reduced motion, without an observer, or before hydration the photo remains sharp; preference changes stop motion immediately.\",\n \"Neon only flickers softly once, never flashes or loops. All effects stop under prefers-reduced-motion; reading and focus order never depend on visual positions.\",\n ],\n },\n related: [\"taped-photo\", \"cover-hero\", \"media-gallery\", \"profile-card\"],\n web: {\n imports: [\"Wall\", \"Polaroid\", \"PinnedNote\", \"ShopSign\"],\n examples: [\n { name: \"composition\", title: \"The owner's wall\", description: \"A photograph, a signed word and an enamel sign, positioned from deterministic data.\" },\n { name: \"composition-fr\", title: \"The owner's wall in French\", description: \"The same deterministic layout reads its French words and alternatives from the example's local catalogue.\" },\n { name: \"tidy\", title: \"The tidy pinboard\", description: \"layout=\\\"tidy\\\": a dense grid (3 columns, 2 on a phone, 1 on a very small one), a note spanning two, a tilt of 1-2 degrees derived from each id, no coordinates.\" },\n { name: \"brick\", title: \"Montréal brick\", description: \"Staggered masonry and mortar on a warm token-based surface.\" },\n { name: \"zellige\", title: \"Moroccan zellige\", description: \"A repeating deterministic eight-point SVG star, without an image download.\" },\n { name: \"ridge\", title: \"Grenoble ridges\", description: \"Three layered mountain silhouettes behind the owner's words.\" },\n { name: \"plaster\", title: \"Warm plaster\", description: \"A quiet lightly textured wall when the content should speak first.\" },\n { name: \"polaroid\", title: \"Polaroids\", description: \"A photo slot, handwritten caption, deterministic tilt, and tape or pin.\" },\n { name: \"pinned-note\", title: \"Pinned notes\", description: \"Short signed words on cut-corner paper, held by a pin or tape.\" },\n { name: \"shop-sign\", title: \"Shop signs\", description: \"The owner's mark as enamel with screws, soft neon, or weathered painted lettering.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
388
403
  },
389
404
  {
390
405
  "path": "wall/pinned-note.tsx",
@@ -400,7 +415,7 @@
400
415
  },
401
416
  {
402
417
  "path": "wall/wall.tsx",
403
- "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { finite } from \"./attachment\";\nimport { PinnedNote, type PinnedNoteProps } from \"./pinned-note\";\nimport { Polaroid, type PolaroidProps } from \"./polaroid\";\nimport { ShopSign, type ShopSignProps } from \"./shop-sign\";\n\nexport interface WallPosition {\n /** Stable identity for this object. */\n id: string;\n /** Horizontal placement as a percentage (0–100); clamped to the wall. */\n x: number;\n /** Vertical placement as a percentage (0–100); clamped to the wall. */\n y: number;\n /** Tilt in degrees; defaults to zero. */\n rotation?: number;\n /** Stacking and reading order, ascending; ties preserve input order. */\n z: number;\n}\n\n/** The item's kind chooses its component; its remaining fields are that component's props. */\nexport type WallItem = WallPosition & (\n | ({ /** A framed photo. */ kind: \"polaroid\" } & PolaroidProps)\n | ({ /** A short pinned message. */ kind: \"note\" } & PinnedNoteProps)\n | ({ /** The owner's sign. */ kind: \"sign\" } & ShopSignProps)\n);\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\nexport interface WallProps extends Omit<React.ComponentProps<\"ul\">, \"children\" | \"style\" | \"role\"> {\n /** The read-only objects; never mutated. Sorted by z for reading, keyboard and phone order. */\n items: readonly WallItem[];\n /** CSS/SVG texture; no image download. Defaults to plaster. */\n texture?: \"brick\" | \"zellige\" | \"ridge\" | \"plaster\";\n /** Draws at most this many items (the first in z order); defaults to 12. The rest belongs to the host's « see the whole wall ». */\n max?: number;\n /** A fixed desktop surface height in pixels (minimum 320). Absent, the surface is a fixed 16:9 box. Phones grow with content. */\n height?: number;\n /** Desktop object width in pixels (minimum 120); defaults to 240 and never exceeds the surface. */\n itemWidth?: number;\n}\n\n/** The object of one item, straight: the wall places and tilts it. A sign on a wall is a paragraph, not a second h1. */\nfunction WallObject({ item }: { readonly item: DistributiveOmit<WallItem, keyof WallPosition> }) {\n if (item.kind === \"polaroid\") return <Polaroid {...item} rotation={0} />;\n if (item.kind === \"note\") return <PinnedNote {...item} rotation={0} />;\n return <ShopSign {...item} as={item.as ?? \"p\"} rotation={0} />;\n}\n\n/** A decorative textured surface over a real keyboard-reachable list; never an editor. */\nexport function Wall({ items, texture = \"plaster\", max = 12, height, itemWidth = 240, className, ...props }: WallProps) {\n const patternId = React.useId().replace(/:/g, \"\");\n const drawn = Math.max(0, Math.floor(finite(max)));\n return (\n <ul {...props} role=\"list\" className={cn(\"kz-wall\", className)} data-texture={texture} data-count={Math.min(items.length, drawn)} data-fixed-height={height === undefined ? undefined : \"\"} style={{ ...(height === undefined ? null : { \"--kz-wall-height\": `${Math.max(320, finite(height))}px` }), \"--kz-wall-item-width\": `${Math.max(120, finite(itemWidth))}px` } as React.CSSProperties}>\n {[...items].sort((a, b) => finite(a.z) - finite(b.z)).slice(0, drawn).map(({ id, x, y, rotation = 0, z: _z, ...item }, rank) => (\n <li key={id} className=\"kz-wall-item\" tabIndex={0} style={{\n \"--kz-wall-x\": `${Math.min(100, Math.max(0, finite(x)))}%`,\n \"--kz-wall-y\": `${Math.min(100, Math.max(0, finite(y)))}%`,\n \"--kz-wall-rotation\": `${finite(rotation)}deg`,\n zIndex: rank,\n } as React.CSSProperties}>\n <WallObject item={item} />\n </li>\n ))}\n {texture === \"brick\" && <li className=\"kz-wall-decoration\" aria-hidden=\"true\" role=\"presentation\"><svg width=\"100%\" height=\"100%\" aria-hidden=\"true\">\n <defs><pattern id={patternId} width=\"96\" height=\"48\" patternUnits=\"userSpaceOnUse\">\n <path d=\"M0 0H96M0 24H96M0 48H96M48 0V24M0 24V48M96 24V48\" fill=\"none\" stroke=\"var(--kz-border-default)\" strokeWidth=\"2\" />\n </pattern></defs><rect width=\"100%\" height=\"100%\" fill={`url(#${patternId})`} />\n </svg></li>}\n {texture === \"zellige\" && <li className=\"kz-wall-decoration\" aria-hidden=\"true\" role=\"presentation\"><svg width=\"100%\" height=\"100%\" aria-hidden=\"true\">\n <defs><pattern id={patternId} width=\"64\" height=\"64\" patternUnits=\"userSpaceOnUse\">\n <path d=\"M32 3 39 15 52 12 49 25 61 32 49 39 52 52 39 49 32 61 25 49 12 52 15 39 3 32 15 25 12 12 25 15Z\" fill=\"var(--kz-accent-soft)\" stroke=\"var(--kz-border-default)\" />\n <path d=\"m32 18 14 14-14 14-14-14Z\" fill=\"var(--kz-surface-2)\" stroke=\"var(--kz-accent-2)\" />\n </pattern></defs><rect width=\"100%\" height=\"100%\" fill={`url(#${patternId})`} />\n </svg></li>}\n {texture === \"ridge\" && <li className=\"kz-wall-decoration\" aria-hidden=\"true\" role=\"presentation\"><svg viewBox=\"0 0 1000 600\" preserveAspectRatio=\"none\" width=\"100%\" height=\"100%\" aria-hidden=\"true\">\n <path d=\"M0 380 170 100 290 300 450 70 620 330 790 120 1000 350V600H0Z\" fill=\"var(--kz-accent-soft)\" />\n <path d=\"M0 470 200 280 370 440 600 190 760 400 920 260 1000 390V600H0Z\" fill=\"var(--kz-surface-2)\" />\n <path d=\"M0 540 180 430 360 520 540 390 760 520 900 410 1000 480V600H0Z\" fill=\"var(--kz-surface-3)\" />\n </svg></li>}\n </ul>\n );\n}\n"
418
+ "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { finite } from \"./attachment\";\nimport { PinnedNote, type PinnedNoteProps } from \"./pinned-note\";\nimport { Polaroid, type PolaroidProps } from \"./polaroid\";\nimport { ShopSign, type ShopSignProps } from \"./shop-sign\";\n\nexport interface WallPosition {\n /** Stable identity for this object. */\n id: string;\n /** Horizontal placement as a percentage (0–100); clamped to the wall. Unused by the tidy layout. */\n x?: number;\n /** Vertical placement as a percentage (0–100); clamped to the wall. Unused by the tidy layout. */\n y?: number;\n /** Tilt in degrees; defaults to zero. */\n rotation?: number;\n /** Stacking and reading order, ascending; ties preserve input order. */\n z: number;\n}\n\n/** The item's kind chooses its component; its remaining fields are that component's props. */\nexport type WallItem = WallPosition & (\n | ({ /** A framed photo. */ kind: \"polaroid\" } & PolaroidProps)\n | ({ /** A short pinned message. */ kind: \"note\" } & PinnedNoteProps)\n | ({ /** The owner's sign. */ kind: \"sign\" } & ShopSignProps)\n);\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\nexport interface WallProps extends Omit<React.ComponentProps<\"ul\">, \"children\" | \"style\" | \"role\"> {\n /** The read-only objects; never mutated. Sorted by z for reading, keyboard and phone order. */\n items: readonly WallItem[];\n /** CSS/SVG texture; no image download. Defaults to plaster. */\n texture?: \"brick\" | \"zellige\" | \"ridge\" | \"plaster\";\n /** Draws at most this many items (the first in z order); defaults to 12. The rest belongs to the host's « see the whole wall ». */\n max?: number;\n /** A fixed desktop surface height in pixels (minimum 320). Absent, the surface is a fixed 16:9 box. Phones grow with content. */\n height?: number;\n /** Desktop object width in pixels (minimum 120); defaults to 240 and never exceeds the surface. */\n itemWidth?: number;\n /**\n * `pinned` (default): objects placed at x / y on a fixed surface. `tidy`: the Cahier pinboard — a dense CSS grid (3 columns,\n * 2 on a phone, 1 on a very small one), a note may span two, each tilted 1–2° by its id (no random position), no JS layout.\n */\n layout?: \"pinned\" | \"tidy\";\n}\n\n/** A tilt of 1 to 2 degrees, either way, derived from the id: the same wall draws the same everywhere (server and client). */\nexport function tidyTilt(id: string): number {\n let h = 2166136261;\n for (let i = 0; i < id.length; i += 1) h = Math.imul(h ^ id.charCodeAt(i), 16777619);\n const n = (h >>> 0) % 4; // 0..3\n return [-2, -1, 1, 2][n]!;\n}\n\n/** The object of one item, straight: the wall places and tilts it. A sign on a wall is a paragraph, not a second h1. */\nfunction WallObject({ item }: { readonly item: DistributiveOmit<WallItem, keyof WallPosition> }) {\n if (item.kind === \"polaroid\") return <Polaroid {...item} rotation={0} />;\n if (item.kind === \"note\") return <PinnedNote {...item} rotation={0} />;\n return <ShopSign {...item} as={item.as ?? \"p\"} rotation={0} />;\n}\n\n/** A decorative textured surface over a real keyboard-reachable list; never an editor. */\nexport function Wall({ items, texture = \"plaster\", max = 12, height, itemWidth = 240, layout = \"pinned\", className, ...props }: WallProps) {\n const patternId = React.useId().replace(/:/g, \"\");\n const drawn = Math.max(0, Math.floor(finite(max)));\n return (\n <ul {...props} role=\"list\" className={cn(\"kz-wall\", className)} data-texture={texture} data-layout={layout === \"tidy\" ? \"tidy\" : undefined} data-count={Math.min(items.length, drawn)} data-fixed-height={height === undefined ? undefined : \"\"} style={{ ...(height === undefined ? null : { \"--kz-wall-height\": `${Math.max(320, finite(height))}px` }), \"--kz-wall-item-width\": `${Math.max(120, finite(itemWidth))}px` } as React.CSSProperties}>\n {[...items].sort((a, b) => finite(a.z) - finite(b.z)).slice(0, drawn).map(({ id, x = 0, y = 0, rotation, z: _z, ...item }, rank) => (\n <li key={id} className=\"kz-wall-item\" tabIndex={0} data-span={layout === \"tidy\" && item.kind === \"note\" ? \"2\" : undefined} style={{\n \"--kz-wall-x\": `${Math.min(100, Math.max(0, finite(x)))}%`,\n \"--kz-wall-y\": `${Math.min(100, Math.max(0, finite(y)))}%`,\n \"--kz-wall-rotation\": `${layout === \"tidy\" ? tidyTilt(id) : finite(rotation ?? 0)}deg`,\n zIndex: rank,\n } as React.CSSProperties}>\n <WallObject item={item} />\n </li>\n ))}\n {texture === \"brick\" && <li className=\"kz-wall-decoration\" aria-hidden=\"true\" role=\"presentation\"><svg width=\"100%\" height=\"100%\" aria-hidden=\"true\">\n <defs><pattern id={patternId} width=\"96\" height=\"48\" patternUnits=\"userSpaceOnUse\">\n <path d=\"M0 0H96M0 24H96M0 48H96M48 0V24M0 24V48M96 24V48\" fill=\"none\" stroke=\"var(--kz-border-default)\" strokeWidth=\"2\" />\n </pattern></defs><rect width=\"100%\" height=\"100%\" fill={`url(#${patternId})`} />\n </svg></li>}\n {texture === \"zellige\" && <li className=\"kz-wall-decoration\" aria-hidden=\"true\" role=\"presentation\"><svg width=\"100%\" height=\"100%\" aria-hidden=\"true\">\n <defs><pattern id={patternId} width=\"64\" height=\"64\" patternUnits=\"userSpaceOnUse\">\n <path d=\"M32 3 39 15 52 12 49 25 61 32 49 39 52 52 39 49 32 61 25 49 12 52 15 39 3 32 15 25 12 12 25 15Z\" fill=\"var(--kz-accent-soft)\" stroke=\"var(--kz-border-default)\" />\n <path d=\"m32 18 14 14-14 14-14-14Z\" fill=\"var(--kz-surface-2)\" stroke=\"var(--kz-accent-2)\" />\n </pattern></defs><rect width=\"100%\" height=\"100%\" fill={`url(#${patternId})`} />\n </svg></li>}\n {texture === \"ridge\" && <li className=\"kz-wall-decoration\" aria-hidden=\"true\" role=\"presentation\"><svg viewBox=\"0 0 1000 600\" preserveAspectRatio=\"none\" width=\"100%\" height=\"100%\" aria-hidden=\"true\">\n <path d=\"M0 380 170 100 290 300 450 70 620 330 790 120 1000 350V600H0Z\" fill=\"var(--kz-accent-soft)\" />\n <path d=\"M0 470 200 280 370 440 600 190 760 400 920 260 1000 390V600H0Z\" fill=\"var(--kz-surface-2)\" />\n <path d=\"M0 540 180 430 360 520 540 390 760 520 900 410 1000 480V600H0Z\" fill=\"var(--kz-surface-3)\" />\n </svg></li>}\n </ul>\n );\n}\n"
404
419
  }
405
420
  ],
406
421
  "dependencies": [],
@@ -618,6 +633,13 @@
618
633
  "description": "Desktop object width in pixels (minimum 120); defaults to 240 and never exceeds the surface.",
619
634
  "required": false
620
635
  },
636
+ {
637
+ "name": "layout",
638
+ "type": "\"pinned\" | \"tidy\"",
639
+ "default": "pinned",
640
+ "description": "`pinned` (default): objects placed at x / y on a fixed surface. `tidy`: the Cahier pinboard — a dense CSS grid (3 columns,\n2 on a phone, 1 on a very small one), a note may span two, each tilted 1–2° by its id (no random position), no JS layout.",
641
+ "required": false
642
+ },
621
643
  {
622
644
  "name": "max",
623
645
  "type": "number",