@krizaka/ui 3.76.0 → 3.76.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.
@@ -52,9 +52,9 @@ var styles = `
52
52
  .kz-sg[data-count="1"] .kz-sg-list{grid-template-columns:1fr}
53
53
  .kz-sg[data-count="1"] .kz-sg-list>li{aspect-ratio:16/9}
54
54
  .kz-sg[data-count="2"] .kz-sg-list>li,.kz-sg[data-count="2"] .kz-sg-list>li:first-child:nth-last-child(odd){aspect-ratio:4/3;grid-column:auto}
55
- .kz-sg:not([data-count="1"]):not([data-count="2"]) .kz-sg-list{grid-template-columns:repeat(4,1fr);grid-template-rows:repeat(2,1fr);aspect-ratio:2/1}
55
+ .kz-sg:not([data-count="1"]):not([data-count="2"]) .kz-sg-list{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));aspect-ratio:2/1}
56
56
  .kz-sg:not([data-count="1"]):not([data-count="2"]) .kz-sg-list>li,.kz-sg[data-strip=true] .kz-sg-list>li{aspect-ratio:auto;flex:none}
57
- .kz-sg:not([data-count="1"]):not([data-count="2"]) .kz-sg-list>li:first-child{grid-column:1/3;grid-row:1/3}
57
+ .kz-sg:not([data-count="1"]):not([data-count="2"]) .kz-sg-list>li:first-child{grid-column:1/3;grid-row:1/3;aspect-ratio:auto}
58
58
  .kz-sg[data-count="3"] .kz-sg-list>li:nth-child(n+2){grid-column:3/5}
59
59
  .kz-sg[data-count="4"] .kz-sg-list>li:nth-child(2){grid-column:3/5}
60
60
  .kz-sg[data-strip=true] .kz-sg-list>li:nth-child(n+6){display:none}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/shop-gallery/labels.ts","../src/shop-gallery/shop-gallery.tsx"],"sourcesContent":["export type ShopGalleryLabels = {\n /** The tile's name: `Open photo 3 of 12: Two chairs by the window`. */\n open: (alt: string, position: number, total: number) => string;\n /** The last tile of the mosaic: `+ 8 photos`. */\n more: (count: number) => string;\n /** The phone strip's counter: `3 / 12`. */\n counter: (position: number, total: number) => string;\n previous: string;\n next: string;\n close: string;\n /** The lightbox's title, read by a screen reader: `Photos of the salon`. */\n title: (label: string) => string;\n /** The lightbox's position: `3 of 12`. */\n position: (position: number, total: number) => string;\n};\n\nexport const shopGalleryLabels: ShopGalleryLabels = {\n open: (alt, position, total) => (alt ? `Open photo ${position} of ${total}: ${alt}` : `Open photo ${position} of ${total}`),\n more: (count) => `+ ${count} photos`,\n counter: (position, total) => `${position} / ${total}`,\n previous: \"Previous photo\",\n next: \"Next photo\",\n close: \"Close\",\n title: (label) => label,\n position: (position, total) => `${position} of ${total}`,\n};\n\nexport const shopGalleryLabelsFr: ShopGalleryLabels = {\n open: (alt, position, total) => (alt ? `Ouvrir la photo ${position} sur ${total} : ${alt}` : `Ouvrir la photo ${position} sur ${total}`),\n more: (count) => `+ ${count} photos`,\n counter: (position, total) => `${position} / ${total}`,\n previous: \"Photo précédente\",\n next: \"Photo suivante\",\n close: \"Fermer\",\n title: (label) => label,\n position: (position, total) => `${position} sur ${total}`,\n};\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type ShopGalleryLabels, shopGalleryLabels } from \"./labels\";\n\n// The lightbox is a lazy chunk: nothing of it is loaded until a photo is opened.\nconst Lightbox = React.lazy(() => import(\"./lightbox\"));\n\nexport type ShopGalleryPhoto = {\n id: string;\n /** The tile's image. */\n src: string;\n /** What it shows, in words: the tile's name and the lightbox's caption. */\n alt: string;\n /** The widths the product holds (`/a-400.avif 400w, /a-800.avif 800w, /a-1200.avif 1200w`). */\n srcSet?: string;\n /** The lightbox's image at full resolution (default: `src`). */\n fullSrc?: string;\n fullSrcSet?: string;\n};\n\nexport type ShopGalleryProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** The shop's photos, in order, already unique. */\n photos: readonly ShopGalleryPhoto[];\n /** The gallery's accessible name (`Photos of the salon`). */\n label: string;\n /** The tiles' `sizes` (default: the bento's share of a 72 rem page on a desktop, 78 vw on a phone). */\n sizes?: string;\n /** Translated texts; `shopGalleryLabelsFr` for French. */\n labels?: Partial<ShopGalleryLabels>;\n};\n\nconst BENTO = 5;\n\nconst styles = `\n.kz-sg{position:relative}\n.kz-sg-list{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem}\n.kz-sg-tile{position:relative;display:block;width:100%;height:100%;padding:0;overflow:hidden;cursor:zoom-in;border:1px solid var(--kz-border-subtle);border-radius:var(--kz-shop-photo-radius,.75rem);background:var(--kz-surface-2);color:var(--kz-text-on-media)}\n.kz-sg-tile img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}\n.kz-sg-tile:focus-visible{outline:2px solid var(--kz-ring);outline-offset:2px}\n.kz-sg-list>li{aspect-ratio:1/1;min-width:0}\n.kz-sg-list>li:first-child:nth-last-child(odd){grid-column:span 2;aspect-ratio:16/10}\n.kz-sg-more,.kz-sg-count{display:none}\n.kz-sg[data-strip=true] .kz-sg-list{display:flex;gap:.75rem;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;margin-inline:-1rem;padding-inline:1rem;scroll-padding-inline:1rem;-webkit-mask-image:linear-gradient(to right,transparent,currentcolor 1.25rem,currentcolor calc(100% - 1.25rem),transparent);mask-image:linear-gradient(to right,transparent,currentcolor 1.25rem,currentcolor calc(100% - 1.25rem),transparent)}\n.kz-sg[data-strip=true] .kz-sg-list::-webkit-scrollbar{display:none}\n.kz-sg[data-strip=true] .kz-sg-list>li{flex:0 0 78%;aspect-ratio:4/5;scroll-snap-align:start}\n.kz-sg[data-strip=true] .kz-sg-list>li:first-child:nth-last-child(odd){grid-column:auto;aspect-ratio:4/5}\n.kz-sg[data-strip=true] .kz-sg-count{display:block;margin:.5rem 0 0;text-align:end;font:600 .75rem/1 var(--kz-font-mono,monospace);color:var(--kz-text-secondary)}\n@media (prefers-reduced-motion:no-preference){.kz-sg[data-strip=true] .kz-sg-list{scroll-behavior:smooth}.kz-sg-tile img{transition:transform .35s ease}.kz-sg-tile:hover img{transform:scale(1.03)}}\n@media (min-width:40rem){\n.kz-sg-list{gap:.75rem}\n.kz-sg[data-strip=true] .kz-sg-list{display:grid;overflow:visible;margin-inline:0;padding-inline:0;-webkit-mask-image:none;mask-image:none}\n.kz-sg[data-strip=true] .kz-sg-count{display:none}\n.kz-sg[data-count=\"1\"] .kz-sg-list{grid-template-columns:1fr}\n.kz-sg[data-count=\"1\"] .kz-sg-list>li{aspect-ratio:16/9}\n.kz-sg[data-count=\"2\"] .kz-sg-list>li,.kz-sg[data-count=\"2\"] .kz-sg-list>li:first-child:nth-last-child(odd){aspect-ratio:4/3;grid-column:auto}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list{grid-template-columns:repeat(4,1fr);grid-template-rows:repeat(2,1fr);aspect-ratio:2/1}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list>li,.kz-sg[data-strip=true] .kz-sg-list>li{aspect-ratio:auto;flex:none}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list>li:first-child{grid-column:1/3;grid-row:1/3}\n.kz-sg[data-count=\"3\"] .kz-sg-list>li:nth-child(n+2){grid-column:3/5}\n.kz-sg[data-count=\"4\"] .kz-sg-list>li:nth-child(2){grid-column:3/5}\n.kz-sg[data-strip=true] .kz-sg-list>li:nth-child(n+6){display:none}\n.kz-sg[data-more=true] .kz-sg-list>li:nth-child(5) .kz-sg-more{position:absolute;inset:0;display:grid;place-items:center;background:color-mix(in srgb,var(--kz-scrim-strong) 62%,transparent);font:700 1.125rem/1.2 var(--kz-font-sans,system-ui);text-align:center}\n}\n`;\n\n/** A shop's photos: a bento mosaic (one 2×2 lead and four tiles, the last one « + N photos »), a snap strip on a phone, and a lightbox. */\nexport function ShopGallery({ photos, label, sizes, labels: given, className, ...props }: ShopGalleryProps) {\n const labels = { ...shopGalleryLabels, ...given };\n const total = photos.length;\n const strip = total >= BENTO;\n const [open, setOpen] = React.useState<number | null>(null);\n const [current, setCurrent] = React.useState(1);\n const tiles = React.useRef<(HTMLButtonElement | null)[]>([]);\n const opener = React.useRef<number>(0);\n if (total === 0) return null;\n\n const tileSizes = sizes ?? (strip ? \"(min-width: 40rem) 36rem, 78vw\" : \"(min-width: 40rem) 36rem, 50vw\");\n const onScroll = (event: React.UIEvent<HTMLUListElement>) => {\n const list = event.currentTarget;\n const first = list.children[0] as HTMLElement | undefined;\n const step = first ? first.offsetWidth + 12 : 0;\n if (step > 0) setCurrent(Math.min(total, Math.max(1, Math.round(list.scrollLeft / step) + 1)));\n };\n return (\n <div className={cn(\"kz-sg\", className)} data-count={total} data-strip={strip || undefined} data-more={total > BENTO || undefined} role=\"group\" aria-label={label} {...props}>\n <style>{styles}</style>\n <ul className=\"kz-sg-list\" onScroll={strip ? onScroll : undefined}>\n {photos.map((photo, i) => (\n <li key={photo.id}>\n <button\n type=\"button\"\n ref={(node) => {\n tiles.current[i] = node;\n }}\n className=\"kz-sg-tile\"\n aria-label={i === BENTO - 1 && total > BENTO ? `${labels.more(total - BENTO + 1)}: ${labels.open(photo.alt, i + 1, total)}` : labels.open(photo.alt, i + 1, total)}\n onClick={() => {\n opener.current = i;\n setOpen(i);\n }}\n >\n <img src={photo.src} srcSet={photo.srcSet} sizes={photo.srcSet ? tileSizes : undefined} alt=\"\" loading=\"lazy\" decoding=\"async\" />\n {i === BENTO - 1 && total > BENTO && <span className=\"kz-sg-more\" aria-hidden>{labels.more(total - BENTO + 1)}</span>}\n </button>\n </li>\n ))}\n </ul>\n {strip && <p className=\"kz-sg-count\" aria-hidden>{labels.counter(current, total)}</p>}\n {open !== null && (\n <React.Suspense fallback={null}>\n <Lightbox\n photos={photos}\n index={open}\n onIndexChange={setOpen}\n onClose={() => setOpen(null)}\n label={label}\n labels={labels}\n returnFocus={() => tiles.current[opener.current] ?? null}\n />\n </React.Suspense>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAgBO,IAAM,oBA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A;AAAA,8BAAC,SAAI,KAAK,MAAM,KAAK,QAAQ,MAAM,QAAQ,OAAO,MAAM,SAAS,YAAY,QAAW,KAAI,IAAG,SAAQ,QAAO,UAAS,SAAQ;AAAA,UAC9H,MAAM,QAAQ,KAAK,QAAQ,SAAS,oBAAC,UAAK,WAAU,cAAa,eAAW,MAAE,iBAAO,KAAK,QAAQ,QAAQ,CAAC,GAAE;AAAA;AAAA;AAAA,IAChH,KAfO,MAAM,EAgBf,CACD,GACH;AAAA,IACC,SAAS,oBAAC,OAAE,WAAU,eAAc,eAAW,MAAE,iBAAO,QAAQ,SAAS,KAAK,GAAE;AAAA,IAChF,SAAS,QACR,oBAAO,gBAAN,EAAe,UAAU,MACxB;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO;AAAA,QACP,eAAe;AAAA,QACf,SAAS,MAAM,QAAQ,IAAI;AAAA,QAC3B;AAAA,QACA;AAAA,QACA,aAAa,MAAM,MAAM,QAAQ,OAAO,OAAO,KAAK;AAAA;AAAA,IACtD,GACF;AAAA,KAEJ;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/shop-gallery/labels.ts","../src/shop-gallery/shop-gallery.tsx"],"sourcesContent":["export type ShopGalleryLabels = {\n /** The tile's name: `Open photo 3 of 12: Two chairs by the window`. */\n open: (alt: string, position: number, total: number) => string;\n /** The last tile of the mosaic: `+ 8 photos`. */\n more: (count: number) => string;\n /** The phone strip's counter: `3 / 12`. */\n counter: (position: number, total: number) => string;\n previous: string;\n next: string;\n close: string;\n /** The lightbox's title, read by a screen reader: `Photos of the salon`. */\n title: (label: string) => string;\n /** The lightbox's position: `3 of 12`. */\n position: (position: number, total: number) => string;\n};\n\nexport const shopGalleryLabels: ShopGalleryLabels = {\n open: (alt, position, total) => (alt ? `Open photo ${position} of ${total}: ${alt}` : `Open photo ${position} of ${total}`),\n more: (count) => `+ ${count} photos`,\n counter: (position, total) => `${position} / ${total}`,\n previous: \"Previous photo\",\n next: \"Next photo\",\n close: \"Close\",\n title: (label) => label,\n position: (position, total) => `${position} of ${total}`,\n};\n\nexport const shopGalleryLabelsFr: ShopGalleryLabels = {\n open: (alt, position, total) => (alt ? `Ouvrir la photo ${position} sur ${total} : ${alt}` : `Ouvrir la photo ${position} sur ${total}`),\n more: (count) => `+ ${count} photos`,\n counter: (position, total) => `${position} / ${total}`,\n previous: \"Photo précédente\",\n next: \"Photo suivante\",\n close: \"Fermer\",\n title: (label) => label,\n position: (position, total) => `${position} sur ${total}`,\n};\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type ShopGalleryLabels, shopGalleryLabels } from \"./labels\";\n\n// The lightbox is a lazy chunk: nothing of it is loaded until a photo is opened.\nconst Lightbox = React.lazy(() => import(\"./lightbox\"));\n\nexport type ShopGalleryPhoto = {\n id: string;\n /** The tile's image. */\n src: string;\n /** What it shows, in words: the tile's name and the lightbox's caption. */\n alt: string;\n /** The widths the product holds (`/a-400.avif 400w, /a-800.avif 800w, /a-1200.avif 1200w`). */\n srcSet?: string;\n /** The lightbox's image at full resolution (default: `src`). */\n fullSrc?: string;\n fullSrcSet?: string;\n};\n\nexport type ShopGalleryProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** The shop's photos, in order, already unique. */\n photos: readonly ShopGalleryPhoto[];\n /** The gallery's accessible name (`Photos of the salon`). */\n label: string;\n /** The tiles' `sizes` (default: the bento's share of a 72 rem page on a desktop, 78 vw on a phone). */\n sizes?: string;\n /** Translated texts; `shopGalleryLabelsFr` for French. */\n labels?: Partial<ShopGalleryLabels>;\n};\n\nconst BENTO = 5;\n\nconst styles = `\n.kz-sg{position:relative}\n.kz-sg-list{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem}\n.kz-sg-tile{position:relative;display:block;width:100%;height:100%;padding:0;overflow:hidden;cursor:zoom-in;border:1px solid var(--kz-border-subtle);border-radius:var(--kz-shop-photo-radius,.75rem);background:var(--kz-surface-2);color:var(--kz-text-on-media)}\n.kz-sg-tile img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}\n.kz-sg-tile:focus-visible{outline:2px solid var(--kz-ring);outline-offset:2px}\n.kz-sg-list>li{aspect-ratio:1/1;min-width:0}\n.kz-sg-list>li:first-child:nth-last-child(odd){grid-column:span 2;aspect-ratio:16/10}\n.kz-sg-more,.kz-sg-count{display:none}\n.kz-sg[data-strip=true] .kz-sg-list{display:flex;gap:.75rem;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;margin-inline:-1rem;padding-inline:1rem;scroll-padding-inline:1rem;-webkit-mask-image:linear-gradient(to right,transparent,currentcolor 1.25rem,currentcolor calc(100% - 1.25rem),transparent);mask-image:linear-gradient(to right,transparent,currentcolor 1.25rem,currentcolor calc(100% - 1.25rem),transparent)}\n.kz-sg[data-strip=true] .kz-sg-list::-webkit-scrollbar{display:none}\n.kz-sg[data-strip=true] .kz-sg-list>li{flex:0 0 78%;aspect-ratio:4/5;scroll-snap-align:start}\n.kz-sg[data-strip=true] .kz-sg-list>li:first-child:nth-last-child(odd){grid-column:auto;aspect-ratio:4/5}\n.kz-sg[data-strip=true] .kz-sg-count{display:block;margin:.5rem 0 0;text-align:end;font:600 .75rem/1 var(--kz-font-mono,monospace);color:var(--kz-text-secondary)}\n@media (prefers-reduced-motion:no-preference){.kz-sg[data-strip=true] .kz-sg-list{scroll-behavior:smooth}.kz-sg-tile img{transition:transform .35s ease}.kz-sg-tile:hover img{transform:scale(1.03)}}\n@media (min-width:40rem){\n.kz-sg-list{gap:.75rem}\n.kz-sg[data-strip=true] .kz-sg-list{display:grid;overflow:visible;margin-inline:0;padding-inline:0;-webkit-mask-image:none;mask-image:none}\n.kz-sg[data-strip=true] .kz-sg-count{display:none}\n.kz-sg[data-count=\"1\"] .kz-sg-list{grid-template-columns:1fr}\n.kz-sg[data-count=\"1\"] .kz-sg-list>li{aspect-ratio:16/9}\n.kz-sg[data-count=\"2\"] .kz-sg-list>li,.kz-sg[data-count=\"2\"] .kz-sg-list>li:first-child:nth-last-child(odd){aspect-ratio:4/3;grid-column:auto}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));aspect-ratio:2/1}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list>li,.kz-sg[data-strip=true] .kz-sg-list>li{aspect-ratio:auto;flex:none}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list>li:first-child{grid-column:1/3;grid-row:1/3;aspect-ratio:auto}\n.kz-sg[data-count=\"3\"] .kz-sg-list>li:nth-child(n+2){grid-column:3/5}\n.kz-sg[data-count=\"4\"] .kz-sg-list>li:nth-child(2){grid-column:3/5}\n.kz-sg[data-strip=true] .kz-sg-list>li:nth-child(n+6){display:none}\n.kz-sg[data-more=true] .kz-sg-list>li:nth-child(5) .kz-sg-more{position:absolute;inset:0;display:grid;place-items:center;background:color-mix(in srgb,var(--kz-scrim-strong) 62%,transparent);font:700 1.125rem/1.2 var(--kz-font-sans,system-ui);text-align:center}\n}\n`;\n\n/** A shop's photos: a bento mosaic (one 2×2 lead and four tiles, the last one « + N photos »), a snap strip on a phone, and a lightbox. */\nexport function ShopGallery({ photos, label, sizes, labels: given, className, ...props }: ShopGalleryProps) {\n const labels = { ...shopGalleryLabels, ...given };\n const total = photos.length;\n const strip = total >= BENTO;\n const [open, setOpen] = React.useState<number | null>(null);\n const [current, setCurrent] = React.useState(1);\n const tiles = React.useRef<(HTMLButtonElement | null)[]>([]);\n const opener = React.useRef<number>(0);\n if (total === 0) return null;\n\n const tileSizes = sizes ?? (strip ? \"(min-width: 40rem) 36rem, 78vw\" : \"(min-width: 40rem) 36rem, 50vw\");\n const onScroll = (event: React.UIEvent<HTMLUListElement>) => {\n const list = event.currentTarget;\n const first = list.children[0] as HTMLElement | undefined;\n const step = first ? first.offsetWidth + 12 : 0;\n if (step > 0) setCurrent(Math.min(total, Math.max(1, Math.round(list.scrollLeft / step) + 1)));\n };\n return (\n <div className={cn(\"kz-sg\", className)} data-count={total} data-strip={strip || undefined} data-more={total > BENTO || undefined} role=\"group\" aria-label={label} {...props}>\n <style>{styles}</style>\n <ul className=\"kz-sg-list\" onScroll={strip ? onScroll : undefined}>\n {photos.map((photo, i) => (\n <li key={photo.id}>\n <button\n type=\"button\"\n ref={(node) => {\n tiles.current[i] = node;\n }}\n className=\"kz-sg-tile\"\n aria-label={i === BENTO - 1 && total > BENTO ? `${labels.more(total - BENTO + 1)}: ${labels.open(photo.alt, i + 1, total)}` : labels.open(photo.alt, i + 1, total)}\n onClick={() => {\n opener.current = i;\n setOpen(i);\n }}\n >\n <img src={photo.src} srcSet={photo.srcSet} sizes={photo.srcSet ? tileSizes : undefined} alt=\"\" loading=\"lazy\" decoding=\"async\" />\n {i === BENTO - 1 && total > BENTO && <span className=\"kz-sg-more\" aria-hidden>{labels.more(total - BENTO + 1)}</span>}\n </button>\n </li>\n ))}\n </ul>\n {strip && <p className=\"kz-sg-count\" aria-hidden>{labels.counter(current, total)}</p>}\n {open !== null && (\n <React.Suspense fallback={null}>\n <Lightbox\n photos={photos}\n index={open}\n onIndexChange={setOpen}\n onClose={() => setOpen(null)}\n label={label}\n labels={labels}\n returnFocus={() => tiles.current[opener.current] ?? null}\n />\n </React.Suspense>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAgBO,IAAM,oBAAuC;AAAA,EAClD,MAAM,CAAC,KAAK,UAAU,UAAW,MAAM,cAAc,QAAQ,OAAO,KAAK,KAAK,GAAG,KAAK,cAAc,QAAQ,OAAO,KAAK;AAAA,EACxH,MAAM,CAAC,UAAU,KAAK,KAAK;AAAA,EAC3B,SAAS,CAAC,UAAU,UAAU,GAAG,QAAQ,MAAM,KAAK;AAAA,EACpD,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO,CAAC,UAAU;AAAA,EAClB,UAAU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AAC,OAAE,WAAU,eAAc,eAAW,MAAE,iBAAO,QAAQ,SAAS,KAAK,GAAE;AAAA,IAChF,SAAS,QACR,oBAAO,gBAAN,EAAe,UAAU,MACxB;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO;AAAA,QACP,eAAe;AAAA,QACf,SAAS,MAAM,QAAQ,IAAI;AAAA,QAC3B;AAAA,QACA;AAAA,QACA,aAAa,MAAM,MAAM,QAAQ,OAAO,OAAO,KAAK;AAAA;AAAA,IACtD,GACF;AAAA,KAEJ;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krizaka/ui",
3
- "version": "3.76.0",
3
+ "version": "3.76.1",
4
4
  "description": "The Krizaka front-end platform's components: the primitives (button, card, dialog, toast, menu, field, tabs, chip, switch, slider, command palette, theme, countdown…) on the semantic --kz-* tokens, the animated marks (Krizaka, Orazaka, Yomizaka, Akinaza) and the motion signature — web and /native.",
5
5
  "keywords": [
6
6
  "krizaka",
@@ -976,8 +976,8 @@
976
976
  "*.css"
977
977
  ],
978
978
  "peerDependencies": {
979
- "@krizaka/query": ">=0.2.2",
980
- "@krizaka/tailwind": ">=3.76.0",
979
+ "@krizaka/query": ">=0.3.0",
980
+ "@krizaka/tailwind": ">=3.76.1",
981
981
  "@maplibre/maplibre-react-native": ">=11",
982
982
  "@shopify/flash-list": ">=2",
983
983
  "expo-camera": ">=16",
@@ -1040,7 +1040,7 @@
1040
1040
  "tsup": "^9.0.0",
1041
1041
  "typescript": "^5.9.0",
1042
1042
  "vitest": "^5.0.5",
1043
- "@krizaka/query": "0.2.2"
1043
+ "@krizaka/query": "0.3.0"
1044
1044
  },
1045
1045
  "engines": {
1046
1046
  "node": ">=22"
@@ -3368,7 +3368,7 @@
3368
3368
  "zod": "^4.6.7",
3369
3369
  "@krizaka/intl": "^0.4.1",
3370
3370
  "@krizaka/pacer": "^0.1.0",
3371
- "@krizaka/tokens": "^3.76.0"
3371
+ "@krizaka/tokens": "^3.76.1"
3372
3372
  },
3373
3373
  "scripts": {
3374
3374
  "build": "node -e \"const fs=require('node:fs');fs.rmSync('dist',{recursive:true,force:true});for(const f of fs.readdirSync('registry/examples',{recursive:true}))if(/\\.(js|d\\.ts)$/.test(f))fs.rmSync('registry/examples/'+f)\" && tsup && node -e \"require('node:fs').copyFileSync('src/motion.css','dist/motion.css');require('node:fs').copyFileSync('src/blocks.css','dist/blocks.css');require('node:fs').copyFileSync('src/story.css','dist/story.css')\" && node scripts/build-registry.mjs",
@@ -350,7 +350,7 @@
350
350
  }
351
351
  ],
352
352
  "dependencies": [
353
- "@krizaka/tokens@^3.76.0"
353
+ "@krizaka/tokens@^3.76.1"
354
354
  ],
355
355
  "registryDependencies": [
356
356
  "account-menu",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krizaka/ui",
3
- "version": "3.76.0",
3
+ "version": "3.76.1",
4
4
  "templatePurposes": {
5
5
  "convince": {
6
6
  "title": "Convince",
@@ -1004,7 +1004,7 @@
1004
1004
  "native": 0
1005
1005
  },
1006
1006
  "dependencies": [
1007
- "@krizaka/tokens@^3.76.0"
1007
+ "@krizaka/tokens@^3.76.1"
1008
1008
  ],
1009
1009
  "registryDependencies": [
1010
1010
  "account-menu",
@@ -3977,7 +3977,7 @@
3977
3977
  "native": 2
3978
3978
  },
3979
3979
  "dependencies": [
3980
- "@krizaka/tokens@^3.76.0",
3980
+ "@krizaka/tokens@^3.76.1",
3981
3981
  "@protomaps/basemaps@5.7.2",
3982
3982
  "tailwind-variants@^3.3.1"
3983
3983
  ],
@@ -4385,7 +4385,7 @@
4385
4385
  "native": 0
4386
4386
  },
4387
4387
  "dependencies": [
4388
- "@krizaka/tokens@^3.76.0",
4388
+ "@krizaka/tokens@^3.76.1",
4389
4389
  "radix-ui@^1.8.1",
4390
4390
  "tailwind-variants@^3.3.1"
4391
4391
  ],
@@ -5253,7 +5253,7 @@
5253
5253
  "native": 0
5254
5254
  },
5255
5255
  "dependencies": [
5256
- "@krizaka/tokens@^3.76.0",
5256
+ "@krizaka/tokens@^3.76.1",
5257
5257
  "radix-ui@^1.8.1",
5258
5258
  "tailwind-variants@^3.3.1"
5259
5259
  ],
@@ -5700,7 +5700,7 @@
5700
5700
  "native": 0
5701
5701
  },
5702
5702
  "dependencies": [
5703
- "@krizaka/tokens@^3.76.0",
5703
+ "@krizaka/tokens@^3.76.1",
5704
5704
  "zod@^4.6.7"
5705
5705
  ],
5706
5706
  "registryDependencies": [
@@ -5920,7 +5920,7 @@
5920
5920
  "native": 0
5921
5921
  },
5922
5922
  "dependencies": [
5923
- "@krizaka/tokens@^3.76.0",
5923
+ "@krizaka/tokens@^3.76.1",
5924
5924
  "radix-ui@^1.8.1",
5925
5925
  "tailwind-variants@^3.3.1"
5926
5926
  ],
package/registry/map.json CHANGED
@@ -1077,7 +1077,7 @@
1077
1077
  }
1078
1078
  ],
1079
1079
  "dependencies": [
1080
- "@krizaka/tokens@^3.76.0",
1080
+ "@krizaka/tokens@^3.76.1",
1081
1081
  "@protomaps/basemaps@5.7.2",
1082
1082
  "tailwind-variants@^3.3.1"
1083
1083
  ],
@@ -711,7 +711,7 @@
711
711
  }
712
712
  ],
713
713
  "dependencies": [
714
- "@krizaka/tokens@^3.76.0",
714
+ "@krizaka/tokens@^3.76.1",
715
715
  "radix-ui@^1.8.1",
716
716
  "tailwind-variants@^3.3.1"
717
717
  ],
@@ -336,7 +336,7 @@
336
336
  }
337
337
  ],
338
338
  "dependencies": [
339
- "@krizaka/tokens@^3.76.0",
339
+ "@krizaka/tokens@^3.76.1",
340
340
  "radix-ui@^1.8.1",
341
341
  "tailwind-variants@^3.3.1"
342
342
  ],
@@ -154,7 +154,7 @@
154
154
  },
155
155
  {
156
156
  "path": "shop-gallery/shop-gallery.tsx",
157
- "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type ShopGalleryLabels, shopGalleryLabels } from \"./labels\";\n\n// The lightbox is a lazy chunk: nothing of it is loaded until a photo is opened.\nconst Lightbox = React.lazy(() => import(\"./lightbox\"));\n\nexport type ShopGalleryPhoto = {\n id: string;\n /** The tile's image. */\n src: string;\n /** What it shows, in words: the tile's name and the lightbox's caption. */\n alt: string;\n /** The widths the product holds (`/a-400.avif 400w, /a-800.avif 800w, /a-1200.avif 1200w`). */\n srcSet?: string;\n /** The lightbox's image at full resolution (default: `src`). */\n fullSrc?: string;\n fullSrcSet?: string;\n};\n\nexport type ShopGalleryProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** The shop's photos, in order, already unique. */\n photos: readonly ShopGalleryPhoto[];\n /** The gallery's accessible name (`Photos of the salon`). */\n label: string;\n /** The tiles' `sizes` (default: the bento's share of a 72 rem page on a desktop, 78 vw on a phone). */\n sizes?: string;\n /** Translated texts; `shopGalleryLabelsFr` for French. */\n labels?: Partial<ShopGalleryLabels>;\n};\n\nconst BENTO = 5;\n\nconst styles = `\n.kz-sg{position:relative}\n.kz-sg-list{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem}\n.kz-sg-tile{position:relative;display:block;width:100%;height:100%;padding:0;overflow:hidden;cursor:zoom-in;border:1px solid var(--kz-border-subtle);border-radius:var(--kz-shop-photo-radius,.75rem);background:var(--kz-surface-2);color:var(--kz-text-on-media)}\n.kz-sg-tile img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}\n.kz-sg-tile:focus-visible{outline:2px solid var(--kz-ring);outline-offset:2px}\n.kz-sg-list>li{aspect-ratio:1/1;min-width:0}\n.kz-sg-list>li:first-child:nth-last-child(odd){grid-column:span 2;aspect-ratio:16/10}\n.kz-sg-more,.kz-sg-count{display:none}\n.kz-sg[data-strip=true] .kz-sg-list{display:flex;gap:.75rem;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;margin-inline:-1rem;padding-inline:1rem;scroll-padding-inline:1rem;-webkit-mask-image:linear-gradient(to right,transparent,currentcolor 1.25rem,currentcolor calc(100% - 1.25rem),transparent);mask-image:linear-gradient(to right,transparent,currentcolor 1.25rem,currentcolor calc(100% - 1.25rem),transparent)}\n.kz-sg[data-strip=true] .kz-sg-list::-webkit-scrollbar{display:none}\n.kz-sg[data-strip=true] .kz-sg-list>li{flex:0 0 78%;aspect-ratio:4/5;scroll-snap-align:start}\n.kz-sg[data-strip=true] .kz-sg-list>li:first-child:nth-last-child(odd){grid-column:auto;aspect-ratio:4/5}\n.kz-sg[data-strip=true] .kz-sg-count{display:block;margin:.5rem 0 0;text-align:end;font:600 .75rem/1 var(--kz-font-mono,monospace);color:var(--kz-text-secondary)}\n@media (prefers-reduced-motion:no-preference){.kz-sg[data-strip=true] .kz-sg-list{scroll-behavior:smooth}.kz-sg-tile img{transition:transform .35s ease}.kz-sg-tile:hover img{transform:scale(1.03)}}\n@media (min-width:40rem){\n.kz-sg-list{gap:.75rem}\n.kz-sg[data-strip=true] .kz-sg-list{display:grid;overflow:visible;margin-inline:0;padding-inline:0;-webkit-mask-image:none;mask-image:none}\n.kz-sg[data-strip=true] .kz-sg-count{display:none}\n.kz-sg[data-count=\"1\"] .kz-sg-list{grid-template-columns:1fr}\n.kz-sg[data-count=\"1\"] .kz-sg-list>li{aspect-ratio:16/9}\n.kz-sg[data-count=\"2\"] .kz-sg-list>li,.kz-sg[data-count=\"2\"] .kz-sg-list>li:first-child:nth-last-child(odd){aspect-ratio:4/3;grid-column:auto}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list{grid-template-columns:repeat(4,1fr);grid-template-rows:repeat(2,1fr);aspect-ratio:2/1}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list>li,.kz-sg[data-strip=true] .kz-sg-list>li{aspect-ratio:auto;flex:none}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list>li:first-child{grid-column:1/3;grid-row:1/3}\n.kz-sg[data-count=\"3\"] .kz-sg-list>li:nth-child(n+2){grid-column:3/5}\n.kz-sg[data-count=\"4\"] .kz-sg-list>li:nth-child(2){grid-column:3/5}\n.kz-sg[data-strip=true] .kz-sg-list>li:nth-child(n+6){display:none}\n.kz-sg[data-more=true] .kz-sg-list>li:nth-child(5) .kz-sg-more{position:absolute;inset:0;display:grid;place-items:center;background:color-mix(in srgb,var(--kz-scrim-strong) 62%,transparent);font:700 1.125rem/1.2 var(--kz-font-sans,system-ui);text-align:center}\n}\n`;\n\n/** A shop's photos: a bento mosaic (one 2×2 lead and four tiles, the last one « + N photos »), a snap strip on a phone, and a lightbox. */\nexport function ShopGallery({ photos, label, sizes, labels: given, className, ...props }: ShopGalleryProps) {\n const labels = { ...shopGalleryLabels, ...given };\n const total = photos.length;\n const strip = total >= BENTO;\n const [open, setOpen] = React.useState<number | null>(null);\n const [current, setCurrent] = React.useState(1);\n const tiles = React.useRef<(HTMLButtonElement | null)[]>([]);\n const opener = React.useRef<number>(0);\n if (total === 0) return null;\n\n const tileSizes = sizes ?? (strip ? \"(min-width: 40rem) 36rem, 78vw\" : \"(min-width: 40rem) 36rem, 50vw\");\n const onScroll = (event: React.UIEvent<HTMLUListElement>) => {\n const list = event.currentTarget;\n const first = list.children[0] as HTMLElement | undefined;\n const step = first ? first.offsetWidth + 12 : 0;\n if (step > 0) setCurrent(Math.min(total, Math.max(1, Math.round(list.scrollLeft / step) + 1)));\n };\n return (\n <div className={cn(\"kz-sg\", className)} data-count={total} data-strip={strip || undefined} data-more={total > BENTO || undefined} role=\"group\" aria-label={label} {...props}>\n <style>{styles}</style>\n <ul className=\"kz-sg-list\" onScroll={strip ? onScroll : undefined}>\n {photos.map((photo, i) => (\n <li key={photo.id}>\n <button\n type=\"button\"\n ref={(node) => {\n tiles.current[i] = node;\n }}\n className=\"kz-sg-tile\"\n aria-label={i === BENTO - 1 && total > BENTO ? `${labels.more(total - BENTO + 1)}: ${labels.open(photo.alt, i + 1, total)}` : labels.open(photo.alt, i + 1, total)}\n onClick={() => {\n opener.current = i;\n setOpen(i);\n }}\n >\n <img src={photo.src} srcSet={photo.srcSet} sizes={photo.srcSet ? tileSizes : undefined} alt=\"\" loading=\"lazy\" decoding=\"async\" />\n {i === BENTO - 1 && total > BENTO && <span className=\"kz-sg-more\" aria-hidden>{labels.more(total - BENTO + 1)}</span>}\n </button>\n </li>\n ))}\n </ul>\n {strip && <p className=\"kz-sg-count\" aria-hidden>{labels.counter(current, total)}</p>}\n {open !== null && (\n <React.Suspense fallback={null}>\n <Lightbox\n photos={photos}\n index={open}\n onIndexChange={setOpen}\n onClose={() => setOpen(null)}\n label={label}\n labels={labels}\n returnFocus={() => tiles.current[opener.current] ?? null}\n />\n </React.Suspense>\n )}\n </div>\n );\n}\n"
157
+ "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { type ShopGalleryLabels, shopGalleryLabels } from \"./labels\";\n\n// The lightbox is a lazy chunk: nothing of it is loaded until a photo is opened.\nconst Lightbox = React.lazy(() => import(\"./lightbox\"));\n\nexport type ShopGalleryPhoto = {\n id: string;\n /** The tile's image. */\n src: string;\n /** What it shows, in words: the tile's name and the lightbox's caption. */\n alt: string;\n /** The widths the product holds (`/a-400.avif 400w, /a-800.avif 800w, /a-1200.avif 1200w`). */\n srcSet?: string;\n /** The lightbox's image at full resolution (default: `src`). */\n fullSrc?: string;\n fullSrcSet?: string;\n};\n\nexport type ShopGalleryProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** The shop's photos, in order, already unique. */\n photos: readonly ShopGalleryPhoto[];\n /** The gallery's accessible name (`Photos of the salon`). */\n label: string;\n /** The tiles' `sizes` (default: the bento's share of a 72 rem page on a desktop, 78 vw on a phone). */\n sizes?: string;\n /** Translated texts; `shopGalleryLabelsFr` for French. */\n labels?: Partial<ShopGalleryLabels>;\n};\n\nconst BENTO = 5;\n\nconst styles = `\n.kz-sg{position:relative}\n.kz-sg-list{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem}\n.kz-sg-tile{position:relative;display:block;width:100%;height:100%;padding:0;overflow:hidden;cursor:zoom-in;border:1px solid var(--kz-border-subtle);border-radius:var(--kz-shop-photo-radius,.75rem);background:var(--kz-surface-2);color:var(--kz-text-on-media)}\n.kz-sg-tile img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}\n.kz-sg-tile:focus-visible{outline:2px solid var(--kz-ring);outline-offset:2px}\n.kz-sg-list>li{aspect-ratio:1/1;min-width:0}\n.kz-sg-list>li:first-child:nth-last-child(odd){grid-column:span 2;aspect-ratio:16/10}\n.kz-sg-more,.kz-sg-count{display:none}\n.kz-sg[data-strip=true] .kz-sg-list{display:flex;gap:.75rem;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;margin-inline:-1rem;padding-inline:1rem;scroll-padding-inline:1rem;-webkit-mask-image:linear-gradient(to right,transparent,currentcolor 1.25rem,currentcolor calc(100% - 1.25rem),transparent);mask-image:linear-gradient(to right,transparent,currentcolor 1.25rem,currentcolor calc(100% - 1.25rem),transparent)}\n.kz-sg[data-strip=true] .kz-sg-list::-webkit-scrollbar{display:none}\n.kz-sg[data-strip=true] .kz-sg-list>li{flex:0 0 78%;aspect-ratio:4/5;scroll-snap-align:start}\n.kz-sg[data-strip=true] .kz-sg-list>li:first-child:nth-last-child(odd){grid-column:auto;aspect-ratio:4/5}\n.kz-sg[data-strip=true] .kz-sg-count{display:block;margin:.5rem 0 0;text-align:end;font:600 .75rem/1 var(--kz-font-mono,monospace);color:var(--kz-text-secondary)}\n@media (prefers-reduced-motion:no-preference){.kz-sg[data-strip=true] .kz-sg-list{scroll-behavior:smooth}.kz-sg-tile img{transition:transform .35s ease}.kz-sg-tile:hover img{transform:scale(1.03)}}\n@media (min-width:40rem){\n.kz-sg-list{gap:.75rem}\n.kz-sg[data-strip=true] .kz-sg-list{display:grid;overflow:visible;margin-inline:0;padding-inline:0;-webkit-mask-image:none;mask-image:none}\n.kz-sg[data-strip=true] .kz-sg-count{display:none}\n.kz-sg[data-count=\"1\"] .kz-sg-list{grid-template-columns:1fr}\n.kz-sg[data-count=\"1\"] .kz-sg-list>li{aspect-ratio:16/9}\n.kz-sg[data-count=\"2\"] .kz-sg-list>li,.kz-sg[data-count=\"2\"] .kz-sg-list>li:first-child:nth-last-child(odd){aspect-ratio:4/3;grid-column:auto}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));aspect-ratio:2/1}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list>li,.kz-sg[data-strip=true] .kz-sg-list>li{aspect-ratio:auto;flex:none}\n.kz-sg:not([data-count=\"1\"]):not([data-count=\"2\"]) .kz-sg-list>li:first-child{grid-column:1/3;grid-row:1/3;aspect-ratio:auto}\n.kz-sg[data-count=\"3\"] .kz-sg-list>li:nth-child(n+2){grid-column:3/5}\n.kz-sg[data-count=\"4\"] .kz-sg-list>li:nth-child(2){grid-column:3/5}\n.kz-sg[data-strip=true] .kz-sg-list>li:nth-child(n+6){display:none}\n.kz-sg[data-more=true] .kz-sg-list>li:nth-child(5) .kz-sg-more{position:absolute;inset:0;display:grid;place-items:center;background:color-mix(in srgb,var(--kz-scrim-strong) 62%,transparent);font:700 1.125rem/1.2 var(--kz-font-sans,system-ui);text-align:center}\n}\n`;\n\n/** A shop's photos: a bento mosaic (one 2×2 lead and four tiles, the last one « + N photos »), a snap strip on a phone, and a lightbox. */\nexport function ShopGallery({ photos, label, sizes, labels: given, className, ...props }: ShopGalleryProps) {\n const labels = { ...shopGalleryLabels, ...given };\n const total = photos.length;\n const strip = total >= BENTO;\n const [open, setOpen] = React.useState<number | null>(null);\n const [current, setCurrent] = React.useState(1);\n const tiles = React.useRef<(HTMLButtonElement | null)[]>([]);\n const opener = React.useRef<number>(0);\n if (total === 0) return null;\n\n const tileSizes = sizes ?? (strip ? \"(min-width: 40rem) 36rem, 78vw\" : \"(min-width: 40rem) 36rem, 50vw\");\n const onScroll = (event: React.UIEvent<HTMLUListElement>) => {\n const list = event.currentTarget;\n const first = list.children[0] as HTMLElement | undefined;\n const step = first ? first.offsetWidth + 12 : 0;\n if (step > 0) setCurrent(Math.min(total, Math.max(1, Math.round(list.scrollLeft / step) + 1)));\n };\n return (\n <div className={cn(\"kz-sg\", className)} data-count={total} data-strip={strip || undefined} data-more={total > BENTO || undefined} role=\"group\" aria-label={label} {...props}>\n <style>{styles}</style>\n <ul className=\"kz-sg-list\" onScroll={strip ? onScroll : undefined}>\n {photos.map((photo, i) => (\n <li key={photo.id}>\n <button\n type=\"button\"\n ref={(node) => {\n tiles.current[i] = node;\n }}\n className=\"kz-sg-tile\"\n aria-label={i === BENTO - 1 && total > BENTO ? `${labels.more(total - BENTO + 1)}: ${labels.open(photo.alt, i + 1, total)}` : labels.open(photo.alt, i + 1, total)}\n onClick={() => {\n opener.current = i;\n setOpen(i);\n }}\n >\n <img src={photo.src} srcSet={photo.srcSet} sizes={photo.srcSet ? tileSizes : undefined} alt=\"\" loading=\"lazy\" decoding=\"async\" />\n {i === BENTO - 1 && total > BENTO && <span className=\"kz-sg-more\" aria-hidden>{labels.more(total - BENTO + 1)}</span>}\n </button>\n </li>\n ))}\n </ul>\n {strip && <p className=\"kz-sg-count\" aria-hidden>{labels.counter(current, total)}</p>}\n {open !== null && (\n <React.Suspense fallback={null}>\n <Lightbox\n photos={photos}\n index={open}\n onIndexChange={setOpen}\n onClose={() => setOpen(null)}\n label={label}\n labels={labels}\n returnFocus={() => tiles.current[opener.current] ?? null}\n />\n </React.Suspense>\n )}\n </div>\n );\n}\n"
158
158
  }
159
159
  ],
160
160
  "dependencies": [],
@@ -648,7 +648,7 @@
648
648
  },
649
649
  {
650
650
  "path": "shop/services/services.tsx",
651
- "content": "// Server-safe: no hook. The services of a shop (ADR-007 §3). `menu` — the compact price board, the default of every preset:\n// one row per service (an optional 56 px square thumbnail of the service's own photo, the name, « Popular », a dotted leader,\n// the price in tabular figures, the duration and one line, a « Choose » button that names the service), grouped by category\n// under a lower-case typewriter note, in one column beside an `aside` or in two. `cards` (4:3, six at most), `index` (the\n// Cahier's stamped cards), `carousel` (a snap strip, phone first). The section receives resolved services; it never fetches.\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { buttonVariants } from \"@krizaka/ui/button\";\nimport { ServiceCard } from \"@krizaka/ui/service-card\";\nimport * as React from \"react\";\n\nimport { BlockLink, type LinkComponent } from \"../../block-link\";\nimport { cn } from \"../../cn\";\nimport type { ShopPhoto } from \"../frame\";\nimport { ShopSection } from \"../frame\";\nimport { SHOP_LIMITS } from \"../limits\";\nimport { Photo } from \"../photo\";\n\nexport type ServicesVariant = \"menu\" | \"cards\" | \"index\" | \"carousel\";\n\n/** A service as the product resolved it: its own photo (or none), its price already formatted. */\nexport type ShopService = {\n id: string;\n name: string;\n /** Formatted by the app (`$45`): the section never formats money. */\n price: string;\n /** The word before a varying price (`from`). */\n priceFrom?: string;\n /** `30 min`. */\n duration?: string;\n /** `Up to 5 dogs`. */\n capacity?: string;\n /** One line: what it is (truncated in the menu). */\n description?: string;\n /** What is included, one short line each (cards and index). */\n included?: readonly string[];\n /** The shop's category (`cuts`): the menu's group. */\n category?: string;\n /** The service's OWN photo. Never a default: without one the menu draws no thumbnail. */\n photo?: ShopPhoto;\n /** Booked most often (a real count): wears « Popular ». */\n popular?: boolean;\n /** The booking page with this service chosen. */\n href?: string;\n};\n\nexport type ServicesSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"menu\" */\n variant?: ServicesVariant;\n services: readonly ShopService[];\n /** The section's `h2` (`Services`). */\n title: React.ReactNode;\n lead?: React.ReactNode;\n /** `menu`: group by the services' `category`. @default \"category\" */\n groupBy?: \"category\" | \"none\";\n /** `menu` with no `aside`: one or two columns. @default 1 */\n columns?: 1 | 2;\n /** `menu`: the hours, the team and the address, beside the list from `lg` (sticky), below it on a phone. */\n aside?: React.ReactNode;\n /** The button's words (`Choose`); its accessible name is « Choose Short cut ». */\n chooseLabel: string;\n /** « Popular ». */\n popularLabel: string;\n /** The list's accessible name when there is no group (`Services`). */\n listLabel?: string;\n /** The app's link component for the booking addresses. */\n linkAs?: LinkComponent;\n};\n\nconst GROUP_NOTE = \"m-0 font-mono text-[13px] lowercase text-fg-secondary\";\n\nfunction groupsOf(services: readonly ShopService[], by: \"category\" | \"none\") {\n if (by === \"none\") return [{ name: undefined as string | undefined, items: services }];\n const groups: { name: string | undefined; items: ShopService[] }[] = [];\n for (const s of services) {\n const name = s.category;\n const group = groups.find((g) => g.name === name);\n if (group) group.items.push(s);\n else groups.push({ name, items: [s] });\n }\n return groups;\n}\n\nfunction MenuRow({ service, chooseLabel, popularLabel, linkAs }: { service: ShopService; chooseLabel: string; popularLabel: string; linkAs?: LinkComponent }) {\n const facts = [service.duration, service.capacity].filter(Boolean).join(\" · \");\n return (\n <li className=\"flex items-center gap-3 border-b border-border-subtle py-2.5 last:border-b-0\" data-service={service.id}>\n {service.photo && (\n <Photo photo={service.photo} ratio=\"1/1\" sizes=\"56px\" className=\"h-12 w-12 shrink-0 rounded-md sm:h-14 sm:w-14\" />\n )}\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline gap-2\">\n <h3 className=\"m-0 shrink truncate text-[15px] font-semibold leading-tight text-fg\">{service.name}</h3>\n {service.popular && <Badge tone=\"accent\" size=\"sm\" className=\"hidden shrink-0 self-center sm:inline-flex\">{popularLabel}</Badge>}\n <span aria-hidden className=\"min-w-4 flex-1 -translate-y-0.5 border-b border-dotted border-border-control\" />\n <span className=\"shrink-0 whitespace-nowrap text-[15px] font-bold tabular-nums text-fg\">\n {service.priceFrom && <span className=\"mr-1 text-xs font-medium text-fg-secondary\">{service.priceFrom}</span>}\n {service.price}\n </span>\n </div>\n <p className=\"m-0 mt-0.5 truncate text-[13px] leading-snug text-fg-secondary\">\n {service.popular && <Badge tone=\"accent\" size=\"sm\" className=\"mr-1.5 sm:hidden\">{popularLabel}</Badge>}\n <span className=\"font-mono tabular-nums\">{facts}</span>\n {facts && service.description && <span aria-hidden> · </span>}\n {service.description}\n </p>\n </div>\n {service.href && (\n <BlockLink\n href={service.href}\n linkAs={linkAs}\n aria-label={`${chooseLabel} ${service.name}`}\n className={cn(buttonVariants({ variant: \"secondary\", size: \"md\" }), \"min-h-11 shrink-0 no-underline\")}\n >\n {chooseLabel}\n </BlockLink>\n )}\n </li>\n );\n}\n\nfunction Menu({ services, groupBy, columns, aside, chooseLabel, popularLabel, listLabel, linkAs }: Required<Pick<ServicesSectionProps, \"services\" | \"groupBy\" | \"columns\" | \"chooseLabel\" | \"popularLabel\">> & Pick<ServicesSectionProps, \"aside\" | \"listLabel\" | \"linkAs\">) {\n const groups = groupsOf(services, groupBy);\n const uid = React.useId();\n const list = (\n <div className={cn(\"grid gap-x-12\", !aside && columns === 2 && \"lg:grid-cols-2\")}>\n {groups.map((g, i) => (\n <div key={g.name ?? i} className=\"mb-3 min-w-0 last:mb-0\">\n {g.name && <p className={GROUP_NOTE} id={`${uid}-grp-${i}`}>{g.name}</p>}\n <ul aria-label={g.name ? undefined : listLabel} aria-labelledby={g.name ? `${uid}-grp-${i}` : undefined} className=\"m-0 list-none p-0\">\n {g.items.map((s) => (\n <MenuRow key={s.id} service={s} chooseLabel={chooseLabel} popularLabel={popularLabel} linkAs={linkAs} />\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n if (!aside) return list;\n return (\n <div className=\"grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_20rem] lg:gap-12\">\n {list}\n <aside className=\"kz-shop-aside flex flex-col gap-4\">{aside}</aside>\n </div>\n );\n}\n\n/** The services of a shop: the price board by default, or cards, index cards, a carousel. */\nexport function ServicesSection({ variant = \"menu\", services, title, lead, groupBy = \"category\", columns = 1, aside, chooseLabel, popularLabel, listLabel, linkAs, className, ...props }: ServicesSectionProps) {\n const card = (s: ShopService, i: number, extra?: string) => (\n <ServiceCard\n key={s.id}\n name={s.name}\n price={s.price}\n priceFrom={s.priceFrom}\n duration={s.duration}\n capacity={s.capacity}\n description={s.description}\n included={s.included}\n tag={s.popular ? popularLabel : undefined}\n media={s.photo ? <img src={s.photo.src} srcSet={s.photo.srcSet} sizes=\"(min-width: 64rem) 18rem, 90vw\" alt={s.photo.alt} loading=\"lazy\" decoding=\"async\" /> : undefined}\n mediaRatio=\"photo\"\n variant={variant === \"index\" ? \"index\" : \"default\"}\n actionLabel={chooseLabel}\n href={s.href}\n linkAs={linkAs}\n className={extra}\n data-index={i}\n />\n );\n let body: React.ReactNode;\n if (variant === \"menu\") {\n body = <Menu services={services} groupBy={groupBy} columns={columns} aside={aside} chooseLabel={chooseLabel} popularLabel={popularLabel} listLabel={listLabel} linkAs={linkAs} />;\n } else if (variant === \"carousel\") {\n body = (\n <div role=\"group\" aria-label={listLabel ?? (typeof title === \"string\" ? title : undefined)} tabIndex={0} className=\"-mx-4 flex snap-x snap-mandatory gap-3 overflow-x-auto px-4 pb-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring sm:mx-0 sm:px-0\">\n {services.map((s, i) => card(s, i, \"w-[78vw] max-w-72 shrink-0 snap-start sm:w-72\"))}\n </div>\n );\n } else {\n const shown = variant === \"cards\" ? services.slice(0, SHOP_LIMITS.cards) : services;\n body = <div className=\"grid items-start gap-4 sm:grid-cols-2 lg:grid-cols-3\">{shown.map((s, i) => card(s, i, \"h-auto\"))}</div>;\n }\n return (\n <ShopSection title={title} lead={lead} className={className} data-variant={variant} {...props}>\n {body}\n </ShopSection>\n );\n}\n"
651
+ "content": "// Server-safe: no hook. The services of a shop (ADR-007 §3). `menu` — the compact price board, the default of every preset:\n// one row per service (an optional 56 px square thumbnail of the service's own photo, the name, « Popular », a dotted leader,\n// the price in tabular figures, the duration and one line, a « Choose » button that names the service), grouped by category\n// under a lower-case typewriter note, in one column beside an `aside` (a plain block, never a landmark) or in two. `cards` (4:3, six at most), `index` (the\n// Cahier's stamped cards), `carousel` (a snap strip, phone first). The section receives resolved services; it never fetches.\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { buttonVariants } from \"@krizaka/ui/button\";\nimport { ServiceCard } from \"@krizaka/ui/service-card\";\nimport * as React from \"react\";\n\nimport { BlockLink, type LinkComponent } from \"../../block-link\";\nimport { cn } from \"../../cn\";\nimport type { ShopPhoto } from \"../frame\";\nimport { ShopSection } from \"../frame\";\nimport { SHOP_LIMITS } from \"../limits\";\nimport { Photo } from \"../photo\";\n\nexport type ServicesVariant = \"menu\" | \"cards\" | \"index\" | \"carousel\";\n\n/** A service as the product resolved it: its own photo (or none), its price already formatted. */\nexport type ShopService = {\n id: string;\n name: string;\n /** Formatted by the app (`$45`): the section never formats money. */\n price: string;\n /** The word before a varying price (`from`). */\n priceFrom?: string;\n /** `30 min`. */\n duration?: string;\n /** `Up to 5 dogs`. */\n capacity?: string;\n /** One line: what it is (truncated in the menu). */\n description?: string;\n /** What is included, one short line each (cards and index). */\n included?: readonly string[];\n /** The shop's category (`cuts`): the menu's group. */\n category?: string;\n /** The service's OWN photo. Never a default: without one the menu draws no thumbnail. */\n photo?: ShopPhoto;\n /** Booked most often (a real count): wears « Popular ». */\n popular?: boolean;\n /** The booking page with this service chosen. */\n href?: string;\n};\n\nexport type ServicesSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"menu\" */\n variant?: ServicesVariant;\n services: readonly ShopService[];\n /** The section's `h2` (`Services`). */\n title: React.ReactNode;\n lead?: React.ReactNode;\n /** `menu`: group by the services' `category`. @default \"category\" */\n groupBy?: \"category\" | \"none\";\n /** `menu` with no `aside`: one or two columns. @default 1 */\n columns?: 1 | 2;\n /** `menu`: the hours, the team and the address, beside the list from `lg` (sticky), below it on a phone. */\n aside?: React.ReactNode;\n /** The button's words (`Choose`); its accessible name is « Choose Short cut ». */\n chooseLabel: string;\n /** « Popular ». */\n popularLabel: string;\n /** The list's accessible name when there is no group (`Services`). */\n listLabel?: string;\n /** The app's link component for the booking addresses. */\n linkAs?: LinkComponent;\n};\n\nconst GROUP_NOTE = \"m-0 font-mono text-[13px] lowercase text-fg-secondary\";\n\nfunction groupsOf(services: readonly ShopService[], by: \"category\" | \"none\") {\n if (by === \"none\") return [{ name: undefined as string | undefined, items: services }];\n const groups: { name: string | undefined; items: ShopService[] }[] = [];\n for (const s of services) {\n const name = s.category;\n const group = groups.find((g) => g.name === name);\n if (group) group.items.push(s);\n else groups.push({ name, items: [s] });\n }\n return groups;\n}\n\nfunction MenuRow({ service, chooseLabel, popularLabel, linkAs }: { service: ShopService; chooseLabel: string; popularLabel: string; linkAs?: LinkComponent }) {\n const facts = [service.duration, service.capacity].filter(Boolean).join(\" · \");\n return (\n <li className=\"flex items-center gap-3 border-b border-border-subtle py-2.5 last:border-b-0\" data-service={service.id}>\n {service.photo && (\n <Photo photo={service.photo} ratio=\"1/1\" sizes=\"56px\" className=\"h-12 w-12 shrink-0 rounded-md sm:h-14 sm:w-14\" />\n )}\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline gap-2\">\n <h3 className=\"m-0 shrink truncate text-[15px] font-semibold leading-tight text-fg\">{service.name}</h3>\n {service.popular && <Badge tone=\"accent\" size=\"sm\" className=\"hidden shrink-0 self-center sm:inline-flex\">{popularLabel}</Badge>}\n <span aria-hidden className=\"min-w-4 flex-1 -translate-y-0.5 border-b border-dotted border-border-control\" />\n <span className=\"shrink-0 whitespace-nowrap text-[15px] font-bold tabular-nums text-fg\">\n {service.priceFrom && <span className=\"mr-1 text-xs font-medium text-fg-secondary\">{service.priceFrom}</span>}\n {service.price}\n </span>\n </div>\n <p className=\"m-0 mt-0.5 truncate text-[13px] leading-snug text-fg-secondary\">\n {service.popular && <Badge tone=\"accent\" size=\"sm\" className=\"mr-1.5 sm:hidden\">{popularLabel}</Badge>}\n <span className=\"font-mono tabular-nums\">{facts}</span>\n {facts && service.description && <span aria-hidden> · </span>}\n {service.description}\n </p>\n </div>\n {service.href && (\n <BlockLink\n href={service.href}\n linkAs={linkAs}\n aria-label={`${chooseLabel} ${service.name}`}\n className={cn(buttonVariants({ variant: \"secondary\", size: \"md\" }), \"min-h-11 shrink-0 no-underline\")}\n >\n {chooseLabel}\n </BlockLink>\n )}\n </li>\n );\n}\n\nfunction Menu({ services, groupBy, columns, aside, chooseLabel, popularLabel, listLabel, linkAs }: Required<Pick<ServicesSectionProps, \"services\" | \"groupBy\" | \"columns\" | \"chooseLabel\" | \"popularLabel\">> & Pick<ServicesSectionProps, \"aside\" | \"listLabel\" | \"linkAs\">) {\n const groups = groupsOf(services, groupBy);\n const uid = React.useId();\n const list = (\n <div className={cn(\"grid gap-x-12\", !aside && columns === 2 && \"lg:grid-cols-2\")}>\n {groups.map((g, i) => (\n <div key={g.name ?? i} className=\"mb-3 min-w-0 last:mb-0\">\n {g.name && <p className={GROUP_NOTE} id={`${uid}-grp-${i}`}>{g.name}</p>}\n <ul aria-label={g.name ? undefined : listLabel} aria-labelledby={g.name ? `${uid}-grp-${i}` : undefined} className=\"m-0 list-none p-0\">\n {g.items.map((s) => (\n <MenuRow key={s.id} service={s} chooseLabel={chooseLabel} popularLabel={popularLabel} linkAs={linkAs} />\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n if (!aside) return list;\n return (\n <div className=\"grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_20rem] lg:gap-12\">\n {list}\n <div className=\"kz-shop-aside flex flex-col gap-4\">{aside}</div>\n </div>\n );\n}\n\n/** The services of a shop: the price board by default, or cards, index cards, a carousel. */\nexport function ServicesSection({ variant = \"menu\", services, title, lead, groupBy = \"category\", columns = 1, aside, chooseLabel, popularLabel, listLabel, linkAs, className, ...props }: ServicesSectionProps) {\n const card = (s: ShopService, i: number, extra?: string) => (\n <ServiceCard\n key={s.id}\n name={s.name}\n price={s.price}\n priceFrom={s.priceFrom}\n duration={s.duration}\n capacity={s.capacity}\n description={s.description}\n included={s.included}\n tag={s.popular ? popularLabel : undefined}\n media={s.photo ? <img src={s.photo.src} srcSet={s.photo.srcSet} sizes=\"(min-width: 64rem) 18rem, 90vw\" alt={s.photo.alt} loading=\"lazy\" decoding=\"async\" /> : undefined}\n mediaRatio=\"photo\"\n variant={variant === \"index\" ? \"index\" : \"default\"}\n actionLabel={chooseLabel}\n href={s.href}\n linkAs={linkAs}\n className={extra}\n data-index={i}\n />\n );\n let body: React.ReactNode;\n if (variant === \"menu\") {\n body = <Menu services={services} groupBy={groupBy} columns={columns} aside={aside} chooseLabel={chooseLabel} popularLabel={popularLabel} listLabel={listLabel} linkAs={linkAs} />;\n } else if (variant === \"carousel\") {\n body = (\n <div role=\"group\" aria-label={listLabel ?? (typeof title === \"string\" ? title : undefined)} tabIndex={0} className=\"-mx-4 flex snap-x snap-mandatory gap-3 overflow-x-auto px-4 pb-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring sm:mx-0 sm:px-0\">\n {services.map((s, i) => card(s, i, \"w-[78vw] max-w-72 shrink-0 snap-start sm:w-72\"))}\n </div>\n );\n } else {\n const shown = variant === \"cards\" ? services.slice(0, SHOP_LIMITS.cards) : services;\n body = <div className=\"grid items-start gap-4 sm:grid-cols-2 lg:grid-cols-3\">{shown.map((s, i) => card(s, i, \"h-auto\"))}</div>;\n }\n return (\n <ShopSection title={title} lead={lead} className={className} data-variant={variant} {...props}>\n {body}\n </ShopSection>\n );\n}\n"
652
652
  },
653
653
  {
654
654
  "path": "shop/social/index.ts",
@@ -700,7 +700,7 @@
700
700
  }
701
701
  ],
702
702
  "dependencies": [
703
- "@krizaka/tokens@^3.76.0",
703
+ "@krizaka/tokens@^3.76.1",
704
704
  "zod@^4.6.7"
705
705
  ],
706
706
  "registryDependencies": [
@@ -321,7 +321,7 @@
321
321
  }
322
322
  ],
323
323
  "dependencies": [
324
- "@krizaka/tokens@^3.76.0",
324
+ "@krizaka/tokens@^3.76.1",
325
325
  "radix-ui@^1.8.1",
326
326
  "tailwind-variants@^3.3.1"
327
327
  ],