@krizaka/ui 3.71.0 → 3.72.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.
- package/dist/blocks.css +26 -0
- package/dist/chunk-M3T5RQYV.js +34 -0
- package/dist/chunk-M3T5RQYV.js.map +1 -0
- package/dist/chunk-ZFR6ZNXD.js +203 -0
- package/dist/chunk-ZFR6ZNXD.js.map +1 -0
- package/dist/{frame-D6Xv83t8.d.ts → frame-CNZ5VgDD.d.ts} +11 -4
- package/dist/schema-DgjBz7-8.d.ts +242 -0
- package/dist/shop/booking.d.ts +2 -2
- package/dist/shop/booking.js +1 -1
- package/dist/shop/booking.js.map +1 -1
- package/dist/shop/bulletin.js +1 -1
- package/dist/shop/faq.d.ts +2 -1
- package/dist/shop/faq.js +1 -1
- package/dist/shop/faq.js.map +1 -1
- package/dist/shop/gallery.js +1 -1
- package/dist/shop/look.d.ts +43 -0
- package/dist/shop/look.js +52 -0
- package/dist/shop/look.js.map +1 -0
- package/dist/shop/policies.d.ts +2 -1
- package/dist/shop/policies.js +1 -1
- package/dist/shop/policies.js.map +1 -1
- package/dist/shop/reviews.d.ts +2 -1
- package/dist/shop/reviews.js +1 -1
- package/dist/shop/reviews.js.map +1 -1
- package/dist/shop/services.js +1 -1
- package/dist/shop/social.js +1 -1
- package/dist/shop/story.d.ts +2 -1
- package/dist/shop/story.js +1 -1
- package/dist/shop/story.js.map +1 -1
- package/dist/shop/team.js +1 -1
- package/dist/shop/video.js +1 -1
- package/dist/shop/visit.js +1 -1
- package/dist/shop-composer.d.ts +29 -0
- package/dist/shop-composer.js +156 -89
- package/dist/shop-composer.js.map +1 -1
- package/dist/shop.d.ts +6 -240
- package/dist/shop.js +24 -212
- package/dist/shop.js.map +1 -1
- package/package.json +25 -6
- package/registry/app-frame.json +1 -1
- package/registry/elephant.json +1 -1
- package/registry/index.json +9 -8
- package/registry/map.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/rail-nav.json +1 -1
- package/registry/shop-composer.json +9 -5
- package/registry/shop.json +50 -9
- package/registry/site-footer.json +1 -1
- package/dist/chunk-A7MQPIEG.js +0 -31
- package/dist/chunk-A7MQPIEG.js.map +0 -1
package/dist/shop/booking.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/booking/booking.tsx"],"sourcesContent":["// Server-safe (the phone bar is a client island imported through its own entry). The way to book (ADR-007 §3): `strip` —\n// the next free times, one tap each, in one line; `panel` — the closing call in a box; `closing` — the closing call of a look (the shop's photo or mark, the next free time, Book); `sticky` — the phone bar, held at the bottom\n// edge and never over content. The times are resolved by the product: the section draws them, it never fetches.\nimport { buttonVariants } from \"@krizaka/ui/button\";\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { StickyAction } from \"@krizaka/ui/sticky-action\";\nimport * as React from \"react\";\n\nimport { BlockLink, type LinkComponent } from \"../../block-link\";\nimport { cn } from \"../../cn\";\nimport { Page } from \"../../page/page\";\nimport { type ShopPhoto, ShopSection } from \"../frame\";\nimport { Photo } from \"../photo\";\n\nexport type BookingVariant = \"strip\" | \"panel\" | \"closing\" | \"sticky\";\n\n/** `closing`: the second action beside « Book » (`Call`, `Directions`): the host chooses it from the shop's settings. */\nexport type BookingSecondary = { label: string; href: string };\n\nexport type BookingTime = {\n id: string;\n /** In words, formatted by the app (`Today 4:30 pm`). */\n label: string;\n /** The booking page with this time chosen. */\n href: string;\n};\n\nexport type BookingSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"strip\" */\n variant?: BookingVariant;\n /** `strip`: the next free times, in order (the first `count`). */\n times?: readonly BookingTime[];\n /** `strip`: the group's name (`Next free times`). */\n label: string;\n /** `strip`: said when no time is free. */\n emptyLabel?: string;\n /** The booking page (`All times →`, `Book`). */\n href: string;\n /** The words of that link / button. */\n actionLabel: string;\n /** `panel`: the invitation (`Ready when you are`), and why. */\n title?: React.ReactNode;\n body?: React.ReactNode;\n /** `closing`: the shop's photo, one the page does not already show (the host plans it). Wins over `mark`. */\n photo?: ShopPhoto;\n /** `closing`: the shop's mark, when there is no photo. Decorative (hidden from assistive technology). */\n mark?: React.ReactNode;\n /**\n * `closing`: the next free time (`Tomorrow 9 am`). On a closed day it is the next opening's. Absent, the call is the\n * title and the primary action alone: never an empty box.\n */\n nextTime?: BookingTime;\n /** `closing`: the words before the time (`Next free time`). */\n nextTimeLabel?: string;\n /** `closing`: « Call » or « Directions ». */\n secondary?: BookingSecondary;\n linkAs?: LinkComponent;\n /** `sticky`: the selector of the page's own action (`#hero-book`): while it is on screen the bar hides. */\n hideWhileVisible?: string;\n};\n\ntype ClosingCallProps = Omit<React.ComponentProps<\"section\">, \"title\"> &\n Pick<BookingSectionProps, \"body\" | \"photo\" | \"mark\" | \"nextTime\" | \"nextTimeLabel\" | \"secondary\" | \"href\" | \"actionLabel\" | \"linkAs\"> & { title: React.ReactNode };\n\n/** The photo, or the mark when there is none, or nothing: the call then reads on one column. */\nfunction ClosingMedia({ photo, mark }: Pick<BookingSectionProps, \"photo\" | \"mark\">) {\n if (photo) return <Photo photo={photo} ratio=\"4/3\" sizes=\"(min-width: 64rem) 36rem, calc(100vw - 2rem)\" />;\n if (!mark) return null;\n return (\n <div aria-hidden className=\"grid aspect-[4/3] w-full place-items-center overflow-hidden rounded-xl bg-accent-soft text-fg-accent [&>svg]:h-1/2 [&>svg]:w-auto\">\n {mark}\n </div>\n );\n}\n\nfunction ClosingCall({ title, body, photo, mark, nextTime, nextTimeLabel, secondary, href, actionLabel, linkAs, className, ...props }: ClosingCallProps) {\n const headingId = React.useId();\n const hasMedia = Boolean(photo ?? mark);\n return (\n <ShopSection aria-labelledby={headingId} data-variant=\"closing\" bleed className={className} {...props}>\n <Page>\n <div className={cn(\"grid items-center gap-6 rounded-2xl bg-surface-1 p-4 sm:p-6 lg:gap-10 lg:p-8\", hasMedia && \"lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]\")}>\n <ClosingMedia photo={photo} mark={mark} />\n <div className=\"flex min-w-0 flex-col items-start gap-4\">\n <h2 id={headingId} className=\"m-0 text-2xl font-bold leading-tight text-fg sm:text-3xl\">\n {title}\n </h2>\n {body ? <p className=\"m-0 max-w-prose text-[15px] leading-relaxed text-fg-secondary\">{body}</p> : null}\n {nextTime ? (\n <p className=\"m-0 flex flex-wrap items-center gap-2 text-sm text-fg-secondary\">\n {nextTimeLabel ? <span>{nextTimeLabel}</span> : null}\n <BlockLink href={nextTime.href} linkAs={linkAs} className=\"inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-2 px-3 text-sm font-semibold tabular-nums text-fg no-underline hover:border-accent hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {nextTime.label}\n </BlockLink>\n </p>\n ) : null}\n <div className=\"flex flex-wrap items-center gap-3\">\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size: \"lg\" }), \"no-underline\")}>\n {actionLabel}\n </BlockLink>\n {secondary ? (\n <BlockLink href={secondary.href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"secondary\", size: \"lg\" }), \"no-underline\")}>\n {secondary.label}\n </BlockLink>\n ) : null}\n </div>\n </div>\n </div>\n </Page>\n </ShopSection>\n );\n}\n\n/** The way to book: the next free times, a closing call, or the phone bar. */\nexport function BookingSection({ variant = \"strip\", times = [], label, emptyLabel, href, actionLabel, title, body, linkAs, hideWhileVisible, photo, mark, nextTime, nextTimeLabel, secondary, className, ...props }: BookingSectionProps) {\n const action = (size: \"md\" | \"lg\") => (\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size }), \"no-underline\")}>\n {actionLabel}\n </BlockLink>\n );\n if (variant === \"sticky\") {\n return (\n <StickyAction hideWhileVisible={hideWhileVisible} data-variant=\"sticky\" className={className} {...(props as object)}>\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size: \"lg\" }), \"w-full justify-center no-underline\")}>\n {actionLabel}\n </BlockLink>\n </StickyAction>\n );\n }\n if (variant === \"closing\") {\n return <ClosingCall title={title ?? label} body={body} photo={photo} mark={mark} nextTime={nextTime} nextTimeLabel={nextTimeLabel} secondary={secondary} href={href} actionLabel={actionLabel} linkAs={linkAs} className={className} {...props} />;\n }\n if (variant === \"panel\") {\n return (\n <ShopSection aria-label={typeof title === \"string\" ? title : label} data-variant=\"panel\" className={className} {...props}>\n <CtaPanel title={title ?? label} body={body}>\n {action(\"lg\")}\n </CtaPanel>\n </ShopSection>\n );\n }\n return (\n <ShopSection aria-label={label} data-variant=\"strip\" className={className} {...props}>\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-2 rounded-xl border border-border-default bg-surface-1 p-3 sm:px-4\">\n <p className=\"m-0 order-1 text-sm font-semibold text-fg\">{label}</p>\n {times.length > 0 ? (\n <ul className=\"m-0 order-3 grid w-full list-none grid-cols-2 gap-2 p-0 sm:order-2 sm:flex sm:w-auto sm:min-w-0 sm:flex-1 sm:flex-wrap\">\n {times.map((t) => (\n <li key={t.id}>\n <BlockLink href={t.href} linkAs={linkAs} className=\"inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-2 px-3 text-[13px] font-semibold tabular-nums text-fg no-underline hover:border-accent hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {t.label}\n </BlockLink>\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"m-0 order-3 w-full text-sm text-fg-secondary sm:order-2 sm:w-auto sm:flex-1\">{emptyLabel}</p>\n )}\n <BlockLink href={href} linkAs={linkAs} className=\"order-2 ml-auto inline-flex min-h-11 items-center gap-1 text-[13px] sm:order-3 font-semibold text-fg-accent no-underline hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {actionLabel} <span aria-hidden>→</span>\n </BlockLink>\n </div>\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,SAAS,sBAAs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HO,EAAE,EAIX,CACD,GACH,IAEA,oBAAC,OAAE,WAAU,+EAA+E,sBAAW;AAAA,IAEzG,qBAAC,aAAU,MAAY,QAAgB,WAAU,8NAC9C;AAAA;AAAA,MAAY;AAAA,MAAC,oBAAC,UAAK,eAAW,MAAC,oBAAC;AAAA,OACnC;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/shop/booking/booking.tsx"],"sourcesContent":["// Server-safe (the phone bar is a client island imported through its own entry). The way to book (ADR-007 §3): `strip` —\n// the next free times, one tap each, in one line; `panel` — the closing call in a box; `closing` — the closing call of a look (the shop's photo or mark, the next free time, Book); `sticky` — the phone bar, held at the bottom\n// edge and never over content. The times are resolved by the product: the section draws them, it never fetches.\nimport { buttonVariants } from \"@krizaka/ui/button\";\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { StickyAction } from \"@krizaka/ui/sticky-action\";\nimport * as React from \"react\";\n\nimport { BlockLink, type LinkComponent } from \"../../block-link\";\nimport { cn } from \"../../cn\";\nimport { Page } from \"../../page/page\";\nimport { type ShopPhoto, ShopSection, type ShopSectionProps } from \"../frame\";\nimport { Photo } from \"../photo\";\n\nexport type BookingVariant = \"strip\" | \"panel\" | \"closing\" | \"sticky\";\n\n/** `closing`: the second action beside « Book » (`Call`, `Directions`): the host chooses it from the shop's settings. */\nexport type BookingSecondary = { label: string; href: string };\n\nexport type BookingTime = {\n id: string;\n /** In words, formatted by the app (`Today 4:30 pm`). */\n label: string;\n /** The booking page with this time chosen. */\n href: string;\n};\n\nexport type BookingSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & Pick<ShopSectionProps, \"mascot\"> & {\n /** @default \"strip\" */\n variant?: BookingVariant;\n /** `strip`: the next free times, in order (the first `count`). */\n times?: readonly BookingTime[];\n /** `strip`: the group's name (`Next free times`). */\n label: string;\n /** `strip`: said when no time is free. */\n emptyLabel?: string;\n /** The booking page (`All times →`, `Book`). */\n href: string;\n /** The words of that link / button. */\n actionLabel: string;\n /** `panel`: the invitation (`Ready when you are`), and why. */\n title?: React.ReactNode;\n body?: React.ReactNode;\n /** `closing`: the shop's photo, one the page does not already show (the host plans it). Wins over `mark`. */\n photo?: ShopPhoto;\n /** `closing`: the shop's mark, when there is no photo. Decorative (hidden from assistive technology). */\n mark?: React.ReactNode;\n /**\n * `closing`: the next free time (`Tomorrow 9 am`). On a closed day it is the next opening's. Absent, the call is the\n * title and the primary action alone: never an empty box.\n */\n nextTime?: BookingTime;\n /** `closing`: the words before the time (`Next free time`). */\n nextTimeLabel?: string;\n /** `closing`: « Call » or « Directions ». */\n secondary?: BookingSecondary;\n linkAs?: LinkComponent;\n /** `sticky`: the selector of the page's own action (`#hero-book`): while it is on screen the bar hides. */\n hideWhileVisible?: string;\n};\n\ntype ClosingCallProps = Omit<React.ComponentProps<\"section\">, \"title\"> & Pick<ShopSectionProps, \"mascot\"> &\n Pick<BookingSectionProps, \"body\" | \"photo\" | \"mark\" | \"nextTime\" | \"nextTimeLabel\" | \"secondary\" | \"href\" | \"actionLabel\" | \"linkAs\"> & { title: React.ReactNode };\n\n/** The photo, or the mark when there is none, or nothing: the call then reads on one column. */\nfunction ClosingMedia({ photo, mark }: Pick<BookingSectionProps, \"photo\" | \"mark\">) {\n if (photo) return <Photo photo={photo} ratio=\"4/3\" sizes=\"(min-width: 64rem) 36rem, calc(100vw - 2rem)\" />;\n if (!mark) return null;\n return (\n <div aria-hidden className=\"grid aspect-[4/3] w-full place-items-center overflow-hidden rounded-xl bg-accent-soft text-fg-accent [&>svg]:h-1/2 [&>svg]:w-auto\">\n {mark}\n </div>\n );\n}\n\nfunction ClosingCall({ title, body, photo, mark, nextTime, nextTimeLabel, secondary, href, actionLabel, linkAs, className, ...props }: ClosingCallProps) {\n const headingId = React.useId();\n const hasMedia = Boolean(photo ?? mark);\n return (\n <ShopSection aria-labelledby={headingId} data-variant=\"closing\" bleed className={className} {...props}>\n <Page>\n <div className={cn(\"grid items-center gap-6 rounded-2xl bg-surface-1 p-4 sm:p-6 lg:gap-10 lg:p-8\", hasMedia && \"lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]\")}>\n <ClosingMedia photo={photo} mark={mark} />\n <div className=\"flex min-w-0 flex-col items-start gap-4\">\n <h2 id={headingId} className=\"m-0 text-2xl font-bold leading-tight text-fg sm:text-3xl\">\n {title}\n </h2>\n {body ? <p className=\"m-0 max-w-prose text-[15px] leading-relaxed text-fg-secondary\">{body}</p> : null}\n {nextTime ? (\n <p className=\"m-0 flex flex-wrap items-center gap-2 text-sm text-fg-secondary\">\n {nextTimeLabel ? <span>{nextTimeLabel}</span> : null}\n <BlockLink href={nextTime.href} linkAs={linkAs} className=\"inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-2 px-3 text-sm font-semibold tabular-nums text-fg no-underline hover:border-accent hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {nextTime.label}\n </BlockLink>\n </p>\n ) : null}\n <div className=\"flex flex-wrap items-center gap-3\">\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size: \"lg\" }), \"no-underline\")}>\n {actionLabel}\n </BlockLink>\n {secondary ? (\n <BlockLink href={secondary.href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"secondary\", size: \"lg\" }), \"no-underline\")}>\n {secondary.label}\n </BlockLink>\n ) : null}\n </div>\n </div>\n </div>\n </Page>\n </ShopSection>\n );\n}\n\n/** The way to book: the next free times, a closing call, or the phone bar. */\nexport function BookingSection({ variant = \"strip\", times = [], label, emptyLabel, href, actionLabel, title, body, linkAs, hideWhileVisible, photo, mark, nextTime, nextTimeLabel, secondary, className, ...props }: BookingSectionProps) {\n const action = (size: \"md\" | \"lg\") => (\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size }), \"no-underline\")}>\n {actionLabel}\n </BlockLink>\n );\n if (variant === \"sticky\") {\n return (\n <StickyAction hideWhileVisible={hideWhileVisible} data-variant=\"sticky\" className={className} {...(props as object)}>\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size: \"lg\" }), \"w-full justify-center no-underline\")}>\n {actionLabel}\n </BlockLink>\n </StickyAction>\n );\n }\n if (variant === \"closing\") {\n return <ClosingCall title={title ?? label} body={body} photo={photo} mark={mark} nextTime={nextTime} nextTimeLabel={nextTimeLabel} secondary={secondary} href={href} actionLabel={actionLabel} linkAs={linkAs} className={className} {...props} />;\n }\n if (variant === \"panel\") {\n return (\n <ShopSection aria-label={typeof title === \"string\" ? title : label} data-variant=\"panel\" className={className} {...props}>\n <CtaPanel title={title ?? label} body={body}>\n {action(\"lg\")}\n </CtaPanel>\n </ShopSection>\n );\n }\n return (\n <ShopSection aria-label={label} data-variant=\"strip\" className={className} {...props}>\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-2 rounded-xl border border-border-default bg-surface-1 p-3 sm:px-4\">\n <p className=\"m-0 order-1 text-sm font-semibold text-fg\">{label}</p>\n {times.length > 0 ? (\n <ul className=\"m-0 order-3 grid w-full list-none grid-cols-2 gap-2 p-0 sm:order-2 sm:flex sm:w-auto sm:min-w-0 sm:flex-1 sm:flex-wrap\">\n {times.map((t) => (\n <li key={t.id}>\n <BlockLink href={t.href} linkAs={linkAs} className=\"inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-2 px-3 text-[13px] font-semibold tabular-nums text-fg no-underline hover:border-accent hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {t.label}\n </BlockLink>\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"m-0 order-3 w-full text-sm text-fg-secondary sm:order-2 sm:w-auto sm:flex-1\">{emptyLabel}</p>\n )}\n <BlockLink href={href} linkAs={linkAs} className=\"order-2 ml-auto inline-flex min-h-11 items-center gap-1 text-[13px] sm:order-3 font-semibold text-fg-accent no-underline hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-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WAAU,0HACX,gBAAM,IAAI,CAAC,MACV,oBAAC,QACC,8BAAC,aAAU,MAAM,EAAE,MAAM,QAAgB,WAAU,sRAChD,YAAE,OACL,KAHO,EAAE,EAIX,CACD,GACH,IAEA,oBAAC,OAAE,WAAU,+EAA+E,sBAAW;AAAA,IAEzG,qBAAC,aAAU,MAAY,QAAgB,WAAU,8NAC9C;AAAA;AAAA,MAAY;AAAA,MAAC,oBAAC,UAAK,eAAW,MAAC,oBAAC;AAAA,OACnC;AAAA,KACF,GACF;AAEJ;","names":[]}
|
package/dist/shop/bulletin.js
CHANGED
package/dist/shop/faq.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ShopSectionProps } from '../shop.js';
|
|
2
3
|
|
|
3
4
|
type ShopQuestion = {
|
|
4
5
|
id: string;
|
|
5
6
|
question: string;
|
|
6
7
|
answer: string;
|
|
7
8
|
};
|
|
8
|
-
type FaqSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
9
|
+
type FaqSectionProps = Omit<React.ComponentProps<"section">, "title"> & Pick<ShopSectionProps, "mascot"> & {
|
|
9
10
|
/** @default "list" */
|
|
10
11
|
variant?: "list";
|
|
11
12
|
title: React.ReactNode;
|
package/dist/shop/faq.js
CHANGED
package/dist/shop/faq.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/faq/faq.tsx"],"sourcesContent":["// Server-safe. The questions clients ask (ADR-007 §3): a native `details` each — no script — and the page's FAQPage\n// JSON-LD, so a search engine reads the same answers.\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type ShopQuestion = { id: string; question: string; answer: string };\n\nexport type FaqSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"list\" */\n variant?: \"list\";\n title: React.ReactNode;\n questions: readonly ShopQuestion[];\n};\n\n/** The FAQPage structured data of a list of questions, as a JSON string safe inside a `script`. */\nexport function faqJsonLd(questions: readonly ShopQuestion[]): string {\n const data = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"FAQPage\",\n mainEntity: questions.map((q) => ({ \"@type\": \"Question\", name: q.question, acceptedAnswer: { \"@type\": \"Answer\", text: q.answer } })),\n };\n return JSON.stringify(data).replace(/</g, \"\\\\u003c\");\n}\n\n/** The questions and their answers. */\nexport function FaqSection({ title, questions, className, ...props }: FaqSectionProps) {\n if (questions.length === 0) return null;\n return (\n <ShopSection title={title} className={className} data-variant=\"list\" {...props}>\n <div className=\"max-w-3xl divide-y divide-border-subtle border-y border-border-subtle\">\n {questions.map((q) => (\n <details key={q.id} className=\"group py-3\">\n <summary className=\"flex min-h-11 cursor-pointer list-none items-center justify-between gap-4 font-semibold text-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden\">\n {q.question}\n <span aria-hidden className=\"shrink-0 text-fg-secondary transition-transform group-open:rotate-45 motion-reduce:transition-none\">+</span>\n </summary>\n <p className=\"m-0 mt-2 text-[15px] leading-relaxed text-fg-secondary\">{q.answer}</p>\n </details>\n ))}\n </div>\n <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: faqJsonLd(questions) }} />\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAiCY,SAEE,KAFF;AAjBL,SAAS,UAAU,WAA4C;AACpE,QAAM,OAAO;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,YAAY,UAAU,IAAI,CAAC,OAAO,EAAE,SAAS,YAAY,MAAM,EAAE,UAAU,gBAAgB,EAAE,SAAS,UAAU,MAAM,EAAE,OAAO,EAAE,EAAE;AAAA,EACrI;AACA,SAAO,KAAK,UAAU,IAAI,EAAE,QAAQ,MAAM,SAAS;AACrD;AAGO,SAAS,WAAW,EAAE,OAAO,WAAW,WAAW,GAAG,MAAM,GAAoB;AACrF,MAAI,UAAU,WAAW,EAAG,QAAO;AACnC,SACE,qBAAC,eAAY,OAAc,WAAsB,gBAAa,QAAQ,GAAG,OACvE;AAAA,wBAAC,SAAI,WAAU,yEACZ,oBAAU,IAAI,CAAC,MACd,qBAAC,aAAmB,WAAU,cAC5B;AAAA,2BAAC,aAAQ,WAAU,wNAChB;AAAA,UAAE;AAAA,QACH,oBAAC,UAAK,eAAW,MAAC,WAAU,sGAAqG,eAAC;AAAA,SACpI;AAAA,MACA,oBAAC,OAAE,WAAU,0DAA0D,YAAE,QAAO;AAAA,SALpE,EAAE,EAMhB,CACD,GACH;AAAA,IACA,oBAAC,YAAO,MAAK,uBAAsB,yBAAyB,EAAE,QAAQ,UAAU,SAAS,EAAE,GAAG;AAAA,KAChG;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/shop/faq/faq.tsx"],"sourcesContent":["// Server-safe. The questions clients ask (ADR-007 §3): a native `details` each — no script — and the page's FAQPage\n// JSON-LD, so a search engine reads the same answers.\nimport * as React from \"react\";\n\nimport { ShopSection, type ShopSectionProps } from \"../frame\";\n\nexport type ShopQuestion = { id: string; question: string; answer: string };\n\nexport type FaqSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & Pick<ShopSectionProps, \"mascot\"> & {\n /** @default \"list\" */\n variant?: \"list\";\n title: React.ReactNode;\n questions: readonly ShopQuestion[];\n};\n\n/** The FAQPage structured data of a list of questions, as a JSON string safe inside a `script`. */\nexport function faqJsonLd(questions: readonly ShopQuestion[]): string {\n const data = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"FAQPage\",\n mainEntity: questions.map((q) => ({ \"@type\": \"Question\", name: q.question, acceptedAnswer: { \"@type\": \"Answer\", text: q.answer } })),\n };\n return JSON.stringify(data).replace(/</g, \"\\\\u003c\");\n}\n\n/** The questions and their answers. */\nexport function FaqSection({ title, questions, className, ...props }: FaqSectionProps) {\n if (questions.length === 0) return null;\n return (\n <ShopSection title={title} className={className} data-variant=\"list\" {...props}>\n <div className=\"max-w-3xl divide-y divide-border-subtle border-y border-border-subtle\">\n {questions.map((q) => (\n <details key={q.id} className=\"group py-3\">\n <summary className=\"flex min-h-11 cursor-pointer list-none items-center justify-between gap-4 font-semibold text-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden\">\n {q.question}\n <span aria-hidden className=\"shrink-0 text-fg-secondary transition-transform group-open:rotate-45 motion-reduce:transition-none\">+</span>\n </summary>\n <p className=\"m-0 mt-2 text-[15px] leading-relaxed text-fg-secondary\">{q.answer}</p>\n </details>\n ))}\n </div>\n <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: faqJsonLd(questions) }} />\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAiCY,SAEE,KAFF;AAjBL,SAAS,UAAU,WAA4C;AACpE,QAAM,OAAO;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,YAAY,UAAU,IAAI,CAAC,OAAO,EAAE,SAAS,YAAY,MAAM,EAAE,UAAU,gBAAgB,EAAE,SAAS,UAAU,MAAM,EAAE,OAAO,EAAE,EAAE;AAAA,EACrI;AACA,SAAO,KAAK,UAAU,IAAI,EAAE,QAAQ,MAAM,SAAS;AACrD;AAGO,SAAS,WAAW,EAAE,OAAO,WAAW,WAAW,GAAG,MAAM,GAAoB;AACrF,MAAI,UAAU,WAAW,EAAG,QAAO;AACnC,SACE,qBAAC,eAAY,OAAc,WAAsB,gBAAa,QAAQ,GAAG,OACvE;AAAA,wBAAC,SAAI,WAAU,yEACZ,oBAAU,IAAI,CAAC,MACd,qBAAC,aAAmB,WAAU,cAC5B;AAAA,2BAAC,aAAQ,WAAU,wNAChB;AAAA,UAAE;AAAA,QACH,oBAAC,UAAK,eAAW,MAAC,WAAU,sGAAqG,eAAC;AAAA,SACpI;AAAA,MACA,oBAAC,OAAE,WAAU,0DAA0D,YAAE,QAAO;AAAA,SALpE,EAAE,EAMhB,CACD,GACH;AAAA,IACA,oBAAC,YAAO,MAAK,uBAAsB,yBAAyB,EAAE,QAAQ,UAAU,SAAS,EAAE,GAAG;AAAA,KAChG;AAEJ;","names":[]}
|
package/dist/shop/gallery.js
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as _krizaka_tokens_shop_presets from '@krizaka/tokens/shop-presets';
|
|
2
|
+
import { ShopPage, Section } from '../shop.js';
|
|
3
|
+
import { MascotBird } from '@krizaka/ui/mascots';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import 'zod/mini';
|
|
6
|
+
|
|
7
|
+
/** What `applyLook` reads of a look: its id and version, and one variant per section type. */
|
|
8
|
+
type ShopLookLike = {
|
|
9
|
+
id: string;
|
|
10
|
+
version: number;
|
|
11
|
+
variants: Readonly<Record<string, string>>;
|
|
12
|
+
};
|
|
13
|
+
/** The six looks, in the order of the addendum (Cahier first). */
|
|
14
|
+
declare const SHOP_LOOKS: _krizaka_tokens_shop_presets.ShopPreset[];
|
|
15
|
+
/** A look by id, or undefined for a trade preset or an unknown id. */
|
|
16
|
+
declare const shopLookOf: (id: string) => _krizaka_tokens_shop_presets.ShopPreset | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The page wearing a look: its preset reference, the look's own density and accent, and the variants of its sections. Everything
|
|
19
|
+
* else is the owner's and stays: `applyLook(applyLook(p, a), b)` has the content of `p`.
|
|
20
|
+
*/
|
|
21
|
+
declare function applyLook(page: ShopPage, look: ShopLookLike): ShopPage;
|
|
22
|
+
|
|
23
|
+
/** The section (and booking variant) that carries a bird, and which: the beaver builds the shop, the owl reads, the falcon watches, the crane listens, the flamingo answers, the pigeon delivers. */
|
|
24
|
+
declare const MASCOT_SLOTS: {
|
|
25
|
+
readonly "booking:strip": "beaver";
|
|
26
|
+
readonly reviews: "owl";
|
|
27
|
+
readonly policies: "falcon";
|
|
28
|
+
readonly story: "crane";
|
|
29
|
+
readonly faq: "flamingo";
|
|
30
|
+
readonly "booking:closing": "pigeon";
|
|
31
|
+
};
|
|
32
|
+
/** The bird of a section under a look, or none: only a look with `mascots: "on"`; never the hero, the gallery, the wall or the TV. */
|
|
33
|
+
declare function mascotFor(section: Pick<Section, "type" | "variant">, look: {
|
|
34
|
+
mascots?: string;
|
|
35
|
+
} | undefined): MascotBird | undefined;
|
|
36
|
+
/** The bird, small, in the brand's accent: decorative (`aria-hidden`), the words stay beside it. */
|
|
37
|
+
declare function ShopMascot({ bird, size }: {
|
|
38
|
+
bird: MascotBird;
|
|
39
|
+
size?: number;
|
|
40
|
+
}): React.JSX.Element;
|
|
41
|
+
|
|
42
|
+
export { MASCOT_SLOTS, SHOP_LOOKS, ShopMascot, applyLook, mascotFor, shopLookOf };
|
|
43
|
+
export type { ShopLookLike };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SECTION_DEFINITIONS
|
|
3
|
+
} from "../chunk-ZFR6ZNXD.js";
|
|
4
|
+
import "../chunk-ZYHWJ7U5.js";
|
|
5
|
+
|
|
6
|
+
// src/shop/look/apply-look.ts
|
|
7
|
+
import { shopPresets } from "@krizaka/tokens/shop-presets";
|
|
8
|
+
var SHOP_LOOKS = ["look-cahier", "look-krizaka", "look-editorial", "look-boutique", "look-affiche", "look-nuit"].map((id) => shopPresets.find((p) => p.id === id)).filter((p) => p !== void 0);
|
|
9
|
+
var shopLookOf = (id) => SHOP_LOOKS.find((p) => p.id === id);
|
|
10
|
+
var REWRITTEN_BOOKING = /* @__PURE__ */ new Set(["strip", "panel"]);
|
|
11
|
+
var variantsOf = (type) => SECTION_DEFINITIONS.find((d) => d.type === type)?.variants;
|
|
12
|
+
function restyle(section, look) {
|
|
13
|
+
const variant = look.variants[section.type];
|
|
14
|
+
if (!variant || variant === section.variant || !variantsOf(section.type)?.includes(variant)) return section;
|
|
15
|
+
if (section.type === "booking" && !REWRITTEN_BOOKING.has(section.variant)) return section;
|
|
16
|
+
return { ...section, variant };
|
|
17
|
+
}
|
|
18
|
+
function applyLook(page, look) {
|
|
19
|
+
const sections = page.sections.map((s) => restyle(s, look));
|
|
20
|
+
const same = page.preset.id === look.id && page.preset.version === look.version && page.density === void 0 && page.accent === void 0 && sections.every((s, i) => s === page.sections[i]);
|
|
21
|
+
if (same) return page;
|
|
22
|
+
return { ...page, preset: { id: look.id, version: look.version }, density: void 0, accent: void 0, sections };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/shop/look/mascots.tsx
|
|
26
|
+
import { Mascot } from "@krizaka/ui/mascots";
|
|
27
|
+
import { jsx } from "react/jsx-runtime";
|
|
28
|
+
var MASCOT_SLOTS = {
|
|
29
|
+
"booking:strip": "beaver",
|
|
30
|
+
reviews: "owl",
|
|
31
|
+
policies: "falcon",
|
|
32
|
+
story: "crane",
|
|
33
|
+
faq: "flamingo",
|
|
34
|
+
"booking:closing": "pigeon"
|
|
35
|
+
};
|
|
36
|
+
function mascotFor(section, look) {
|
|
37
|
+
if (look?.mascots !== "on") return void 0;
|
|
38
|
+
const slots = MASCOT_SLOTS;
|
|
39
|
+
return slots[`${section.type}:${section.variant}`] ?? (section.type === "booking" ? void 0 : slots[section.type]);
|
|
40
|
+
}
|
|
41
|
+
function ShopMascot({ bird, size = 56 }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(Mascot, { bird, tone: "brand", size, life: true, "aria-hidden": true });
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
MASCOT_SLOTS,
|
|
46
|
+
SHOP_LOOKS,
|
|
47
|
+
ShopMascot,
|
|
48
|
+
applyLook,
|
|
49
|
+
mascotFor,
|
|
50
|
+
shopLookOf
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=look.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shop/look/apply-look.ts","../../src/shop/look/mascots.tsx"],"sourcesContent":["// Pure. A look (`look-*` of @krizaka/tokens, akinaza#478) is applied to a shop page by rewriting the variants of the sections the\n// page already has — never their order, settings, blocks, text or photos. The closing call and the sticky bar are different jobs\n// from the strip of next times, so a look leaves them as they are.\nimport { shopPresets } from \"@krizaka/tokens/shop-presets\";\n\nimport { SECTION_DEFINITIONS } from \"../catalogue\";\nimport type { Section, ShopPage } from \"../schema\";\n\n/** What `applyLook` reads of a look: its id and version, and one variant per section type. */\nexport type ShopLookLike = { id: string; version: number; variants: Readonly<Record<string, string>> };\n\n/** The six looks, in the order of the addendum (Cahier first). */\nexport const SHOP_LOOKS = [\"look-cahier\", \"look-krizaka\", \"look-editorial\", \"look-boutique\", \"look-affiche\", \"look-nuit\"]\n .map((id) => shopPresets.find((p) => p.id === id))\n .filter((p): p is (typeof shopPresets)[number] => p !== undefined);\n\n/** A look by id, or undefined for a trade preset or an unknown id. */\nexport const shopLookOf = (id: string) => SHOP_LOOKS.find((p) => p.id === id);\n\n/** Booking variants a look rewrites: the strip of next times and the panel. `closing` and `sticky` keep their own job. */\nconst REWRITTEN_BOOKING = new Set([\"strip\", \"panel\"]);\n\nconst variantsOf = (type: string) => SECTION_DEFINITIONS.find((d) => d.type === type)?.variants as readonly string[] | undefined;\n\nfunction restyle(section: Section, look: ShopLookLike): Section {\n const variant = look.variants[section.type];\n if (!variant || variant === section.variant || !variantsOf(section.type)?.includes(variant)) return section;\n if (section.type === \"booking\" && !REWRITTEN_BOOKING.has(section.variant)) return section;\n return { ...section, variant } as Section;\n}\n\n/**\n * The page wearing a look: its preset reference, the look's own density and accent, and the variants of its sections. Everything\n * else is the owner's and stays: `applyLook(applyLook(p, a), b)` has the content of `p`.\n */\nexport function applyLook(page: ShopPage, look: ShopLookLike): ShopPage {\n const sections = page.sections.map((s) => restyle(s, look));\n const same = page.preset.id === look.id && page.preset.version === look.version && page.density === undefined && page.accent === undefined && sections.every((s, i) => s === page.sections[i]);\n if (same) return page;\n return { ...page, preset: { id: look.id, version: look.version }, density: undefined, accent: undefined, sections };\n}\n","// Server-safe. The Krizaka look's birds (akinaza#478): at most one per section, each one doing its job, never on the first\n// screen nor on the pictures. The host asks `mascotFor` and hands the result to the section's `mascot` slot.\nimport { Mascot, type MascotBird } from \"@krizaka/ui/mascots\";\nimport * as React from \"react\";\n\nimport type { Section } from \"../schema\";\n\n/** The section (and booking variant) that carries a bird, and which: the beaver builds the shop, the owl reads, the falcon watches, the crane listens, the flamingo answers, the pigeon delivers. */\nexport const MASCOT_SLOTS = {\n \"booking:strip\": \"beaver\",\n reviews: \"owl\",\n policies: \"falcon\",\n story: \"crane\",\n faq: \"flamingo\",\n \"booking:closing\": \"pigeon\",\n} as const satisfies Record<string, MascotBird>;\n\n/** The bird of a section under a look, or none: only a look with `mascots: \"on\"`; never the hero, the gallery, the wall or the TV. */\nexport function mascotFor(section: Pick<Section, \"type\" | \"variant\">, look: { mascots?: string } | undefined): MascotBird | undefined {\n if (look?.mascots !== \"on\") return undefined;\n const slots = MASCOT_SLOTS as Record<string, MascotBird>;\n return slots[`${section.type}:${section.variant}`] ?? (section.type === \"booking\" ? undefined : slots[section.type]);\n}\n\n/** The bird, small, in the brand's accent: decorative (`aria-hidden`), the words stay beside it. */\nexport function ShopMascot({ bird, size = 56 }: { bird: MascotBird; size?: number }) {\n return <Mascot bird={bird} tone=\"brand\" size={size} life aria-hidden />;\n}\n"],"mappings":";;;;;;AAGA,SAAS,mBAAmB;AASrB,IAAM,aAAa,CAAC,eAAe,gBAAgB,kBAAkB,iBAAiB,gBAAgB,WAAW,EACrH,IAAI,CAAC,OAAO,YAAY,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAChD,OAAO,CAAC,MAAyC,MAAM,MAAS;AAG5D,IAAM,aAAa,CAAC,OAAe,WAAW,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE;AAG5E,IAAM,oBAAoB,oBAAI,IAAI,CAAC,SAAS,OAAO,CAAC;AAEpD,IAAM,aAAa,CAAC,SAAiB,oBAAoB,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI,GAAG;AAEvF,SAAS,QAAQ,SAAkB,MAA6B;AAC9D,QAAM,UAAU,KAAK,SAAS,QAAQ,IAAI;AAC1C,MAAI,CAAC,WAAW,YAAY,QAAQ,WAA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
|
|
2
3
|
|
|
3
4
|
type ShopPolicy = {
|
|
4
5
|
id: string;
|
|
5
6
|
term: string;
|
|
6
7
|
details: React.ReactNode;
|
|
7
8
|
};
|
|
8
|
-
type PoliciesSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
9
|
+
type PoliciesSectionProps = Omit<React.ComponentProps<"section">, "title"> & Pick<ShopSectionProps, "mascot"> & {
|
|
9
10
|
/** @default "inline" */
|
|
10
11
|
variant?: "inline";
|
|
11
12
|
title: React.ReactNode;
|
package/dist/shop/policies.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/policies/policies.tsx"],"sourcesContent":["// Server-safe. The rules of the shop, in the open (ADR-007 §3): cancellation, prices, the booking window — a real\n// description list, the owner's own words.\nimport { DescriptionList } from \"@krizaka/ui/description-list\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type ShopPolicy = { id: string; term: string; details: React.ReactNode };\n\nexport type PoliciesSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"inline\" */\n variant?: \"inline\";\n title: React.ReactNode;\n items: readonly ShopPolicy[];\n};\n\n/** Cancellation, prices and the booking window, as term and value. */\nexport function PoliciesSection({ title, items, className, ...props }: PoliciesSectionProps) {\n if (items.length === 0) return null;\n return (\n <ShopSection title={title} className={className} data-variant=\"inline\" {...props}>\n <DescriptionList layout=\"inline\" className=\"max-w-3xl\" items={items.map((p) => ({ id: p.id, term: p.term, details: p.details }))} />\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAEA,SAAS,uBAAuB;AAmB1B;AAJC,SAAS,gBAAgB,EAAE,OAAO,OAAO,WAAW,GAAG,MAAM,GAAyB;AAC3F,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SACE,oBAAC,eAAY,OAAc,WAAsB,gBAAa,UAAU,GAAG,OACzE,8BAAC,mBAAgB,QAAO,UAAS,WAAU,aAAY,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,MAAM,EAAE,MAAM,SAAS,EAAE,QAAQ,EAAE,GAAG,GACpI;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/shop/policies/policies.tsx"],"sourcesContent":["// Server-safe. The rules of the shop, in the open (ADR-007 §3): cancellation, prices, the booking window — a real\n// description list, the owner's own words.\nimport { DescriptionList } from \"@krizaka/ui/description-list\";\nimport * as React from \"react\";\n\nimport { ShopSection, type ShopSectionProps } from \"../frame\";\n\nexport type ShopPolicy = { id: string; term: string; details: React.ReactNode };\n\nexport type PoliciesSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & Pick<ShopSectionProps, \"mascot\"> & {\n /** @default \"inline\" */\n variant?: \"inline\";\n title: React.ReactNode;\n items: readonly ShopPolicy[];\n};\n\n/** Cancellation, prices and the booking window, as term and value. */\nexport function PoliciesSection({ title, items, className, ...props }: PoliciesSectionProps) {\n if (items.length === 0) return null;\n return (\n <ShopSection title={title} className={className} data-variant=\"inline\" {...props}>\n <DescriptionList layout=\"inline\" className=\"max-w-3xl\" items={items.map((p) => ({ id: p.id, term: p.term, details: p.details }))} />\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAEA,SAAS,uBAAuB;AAmB1B;AAJC,SAAS,gBAAgB,EAAE,OAAO,OAAO,WAAW,GAAG,MAAM,GAAyB;AAC3F,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SACE,oBAAC,eAAY,OAAc,WAAsB,gBAAa,UAAU,GAAG,OACzE,8BAAC,mBAAgB,QAAO,UAAS,WAAU,aAAY,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,MAAM,EAAE,MAAM,SAAS,EAAE,QAAQ,EAAE,GAAG,GACpI;AAEJ;","names":[]}
|
package/dist/shop/reviews.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ReviewSummaryProps, ReviewCardProps } from '@krizaka/ui/reviews';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { ShopSectionProps } from '../shop.js';
|
|
3
4
|
|
|
4
5
|
type ReviewsVariant = "summary-cards" | "quote" | "strip";
|
|
5
6
|
type ShopReview = Omit<ReviewCardProps, "className" | "style"> & {
|
|
6
7
|
id: string;
|
|
7
8
|
};
|
|
8
|
-
type ReviewsSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
9
|
+
type ReviewsSectionProps = Omit<React.ComponentProps<"section">, "title"> & Pick<ShopSectionProps, "mascot"> & {
|
|
9
10
|
/** @default "summary-cards" */
|
|
10
11
|
variant?: ReviewsVariant;
|
|
11
12
|
title: React.ReactNode;
|
package/dist/shop/reviews.js
CHANGED
package/dist/shop/reviews.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/reviews/reviews.tsx"],"sourcesContent":["// Server-safe. What clients say (ADR-007 §3): `summary-cards` — the score stamp with its distribution beside two or three\n// reviews; `quote` — one large review; `strip` — the score as one line (a hero's fact). Nothing is drawn under the host's\n// `minCount` of verified reviews: a shop with two reviews shows none (the composer says why).\nimport { ReviewCard, type ReviewCardProps, ReviewSummary, type ReviewSummaryProps } from \"@krizaka/ui/reviews\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type ReviewsVariant = \"summary-cards\" | \"quote\" | \"strip\";\n\nexport type ShopReview = Omit<ReviewCardProps, \"className\" | \"style\"> & { id: string };\n\nexport type ReviewsSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"summary-cards\" */\n variant?: ReviewsVariant;\n title: React.ReactNode;\n /** The score and its distribution, with the words that name them (the stamp's, the count's, the meters'). */\n summary: Omit<ReviewSummaryProps, \"minCount\" | \"className\" | \"style\">;\n /** The reviews the host chose (`best` or `latest`), in order: two or three are drawn. */\n reviews: readonly ShopReview[];\n /** How many reviews are drawn beside the stamp. @default 2 */\n count?: 1 | 2 | 3;\n /** The fewest verified reviews that may be shown at all. @default 5 */\n minCount?: number;\n};\n\n/** The score of the shop and what its clients wrote. */\nexport function ReviewsSection({ variant = \"summary-cards\", title, summary, reviews, count = 2, minCount = 5, className, ...props }: ReviewsSectionProps) {\n if (summary.count < Math.max(1, minCount) || reviews.length === 0) return null;\n const shown = reviews.slice(0, count);\n if (variant === \"strip\") {\n return (\n <ShopSection aria-label={typeof title === \"string\" ? title : summary.summaryText} data-variant=\"strip\" className={className} {...props}>\n <p className=\"m-0 flex flex-wrap items-baseline gap-x-3 gap-y-1 text-sm text-fg-secondary\">\n <span className=\"rounded-sm border-2 border-border-strong px-2 py-0.5 font-mono text-base font-bold text-fg tabular-nums\">{summary.scoreText}</span>\n <span>{summary.countText}</span>\n <span className=\"sr-only\">{summary.summaryText}</span>\n </p>\n </ShopSection>\n );\n }\n if (variant === \"quote\") {\n const r = shown[0]!;\n const { text, author, date, dateTime, service, ratingText } = r;\n return (\n <ShopSection title={title} className={className} data-variant=\"quote\" {...props}>\n <figure className=\"m-0 max-w-3xl\">\n <blockquote className=\"m-0 font-display text-2xl leading-snug text-fg sm:text-3xl\">“{text}”</blockquote>\n <figcaption className=\"mt-3 flex flex-wrap items-baseline gap-x-2 text-sm text-fg-secondary\">\n <span className=\"font-semibold text-fg\">{author}</span>\n <time dateTime={dateTime}>{date}</time>\n {service && <span>· {service}</span>}\n <span className=\"sr-only\">{ratingText}</span>\n </figcaption>\n </figure>\n </ShopSection>\n );\n }\n return (\n <ShopSection title={title} className={className} data-variant=\"summary-cards\" {...props}>\n <div className=\"grid items-start gap-4 lg:grid-cols-[18rem_minmax(0,1fr)] lg:gap-8\">\n <ReviewSummary {...summary} minCount={minCount} />\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-[repeat(auto-fit,minmax(14rem,1fr))]\">\n {shown.map(({ id, ...review }) => (\n <ReviewCard key={id} {...review} />\n ))}\n </div>\n </div>\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAGA,SAAS,YAAkC,qBAA8C;AA8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AAe,GAAG,SAAS,UAAoB;AAAA,IAChD,oBAAC,SAAI,WAAU,+EACZ,gBAAM,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,MAC1B,oBAAC,cAAqB,GAAG,UAAR,EAAgB,CAClC,GACH;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/shop/reviews/reviews.tsx"],"sourcesContent":["// Server-safe. What clients say (ADR-007 §3): `summary-cards` — the score stamp with its distribution beside two or three\n// reviews; `quote` — one large review; `strip` — the score as one line (a hero's fact). Nothing is drawn under the host's\n// `minCount` of verified reviews: a shop with two reviews shows none (the composer says why).\nimport { ReviewCard, type ReviewCardProps, ReviewSummary, type ReviewSummaryProps } from \"@krizaka/ui/reviews\";\nimport * as React from \"react\";\n\nimport { ShopSection, type ShopSectionProps } from \"../frame\";\n\nexport type ReviewsVariant = \"summary-cards\" | \"quote\" | \"strip\";\n\nexport type ShopReview = Omit<ReviewCardProps, \"className\" | \"style\"> & { id: string };\n\nexport type ReviewsSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & Pick<ShopSectionProps, \"mascot\"> & {\n /** @default \"summary-cards\" */\n variant?: ReviewsVariant;\n title: React.ReactNode;\n /** The score and its distribution, with the words that name them (the stamp's, the count's, the meters'). */\n summary: Omit<ReviewSummaryProps, \"minCount\" | \"className\" | \"style\">;\n /** The reviews the host chose (`best` or `latest`), in order: two or three are drawn. */\n reviews: readonly ShopReview[];\n /** How many reviews are drawn beside the stamp. @default 2 */\n count?: 1 | 2 | 3;\n /** The fewest verified reviews that may be shown at all. @default 5 */\n minCount?: number;\n};\n\n/** The score of the shop and what its clients wrote. */\nexport function ReviewsSection({ variant = \"summary-cards\", title, summary, reviews, count = 2, minCount = 5, className, ...props }: ReviewsSectionProps) {\n if (summary.count < Math.max(1, minCount) || reviews.length === 0) return null;\n const shown = reviews.slice(0, count);\n if (variant === \"strip\") {\n return (\n <ShopSection aria-label={typeof title === \"string\" ? title : summary.summaryText} data-variant=\"strip\" className={className} {...props}>\n <p className=\"m-0 flex flex-wrap items-baseline gap-x-3 gap-y-1 text-sm text-fg-secondary\">\n <span className=\"rounded-sm border-2 border-border-strong px-2 py-0.5 font-mono text-base font-bold text-fg tabular-nums\">{summary.scoreText}</span>\n <span>{summary.countText}</span>\n <span className=\"sr-only\">{summary.summaryText}</span>\n </p>\n </ShopSection>\n );\n }\n if (variant === \"quote\") {\n const r = shown[0]!;\n const { text, author, date, dateTime, service, ratingText } = r;\n return (\n <ShopSection title={title} className={className} data-variant=\"quote\" {...props}>\n <figure className=\"m-0 max-w-3xl\">\n <blockquote className=\"m-0 font-display text-2xl leading-snug text-fg sm:text-3xl\">“{text}”</blockquote>\n <figcaption className=\"mt-3 flex flex-wrap items-baseline gap-x-2 text-sm text-fg-secondary\">\n <span className=\"font-semibold text-fg\">{author}</span>\n <time dateTime={dateTime}>{date}</time>\n {service && <span>· {service}</span>}\n <span className=\"sr-only\">{ratingText}</span>\n </figcaption>\n </figure>\n </ShopSection>\n );\n }\n return (\n <ShopSection title={title} className={className} data-variant=\"summary-cards\" {...props}>\n <div className=\"grid items-start gap-4 lg:grid-cols-[18rem_minmax(0,1fr)] lg:gap-8\">\n <ReviewSummary {...summary} minCount={minCount} />\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-[repeat(auto-fit,minmax(14rem,1fr))]\">\n {shown.map(({ id, ...review }) => (\n <ReviewCard key={id} {...review} />\n ))}\n </div>\n </div>\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAGA,SAAS,YAAkC,qBAA8C;AA8BjF,SACE,KADF;AAND,SAAS,eAAe,EAAE,UAAU,iBAAiB,OAAO,SAAS,SAAS,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,GAAwB;AACxJ,MAAI,QAAQ,QAAQ,KAAK,IAAI,GAAG,QAAQ,KAAK,QAAQ,WAAW,EAAG,QAAO;AAC1E,QAAM,QAAQ,QAAQ,MAAM,GAAG,KAAK;AACpC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ANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ShopSectionProps } from '../shop.js';
|
|
2
3
|
|
|
3
4
|
type StoryVariant = "quote" | "owner";
|
|
4
|
-
type StorySectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
5
|
+
type StorySectionProps = Omit<React.ComponentProps<"section">, "title"> & Pick<ShopSectionProps, "mascot"> & {
|
|
5
6
|
/** @default "quote" */
|
|
6
7
|
variant?: StoryVariant;
|
|
7
8
|
title: React.ReactNode;
|
package/dist/shop/story.js
CHANGED
package/dist/shop/story.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/story/story.tsx"],"sourcesContent":["// Server-safe. The owner's words (ADR-007 §3): `quote` — a pull quote and a paragraph; `owner` — the owner's face, a\n// paragraph, and a way to call or write. The words are the owner's, in the visitor's language; nothing is invented.\nimport { Avatar } from \"@krizaka/ui/avatar\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type StoryVariant = \"quote\" | \"owner\";\n\nexport type StorySectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"quote\" */\n variant?: StoryVariant;\n title: React.ReactNode;\n /** `quote`: the pull quote. */\n quote?: string;\n /** The paragraph. */\n body: string;\n /** `owner`: who speaks. */\n owner?: { name: string; photo?: string };\n /** `owner`: call or write (`ButtonLink`s). */\n actions?: React.ReactNode;\n};\n\n/** The owner's story, as a pull quote or a face and a paragraph. */\nexport function StorySection({ variant = \"quote\", title, quote, body, owner, actions, className, ...props }: StorySectionProps) {\n if (!body && !quote) return null;\n return (\n <ShopSection title={title} className={className} data-variant={variant} {...props}>\n {variant === \"owner\" ? (\n <div className=\"flex max-w-3xl items-start gap-4\">\n {owner && <Avatar src={owner.photo} alt=\"\" fallback={owner.name.slice(0, 1)} size=\"xl\" />}\n <div className=\"min-w-0\">\n {owner && <p className=\"m-0 font-semibold text-fg\">{owner.name}</p>}\n <p className=\"m-0 mt-1 text-base leading-relaxed text-fg-secondary\">{body}</p>\n {actions && <div className=\"mt-3 flex flex-wrap gap-2\">{actions}</div>}\n </div>\n </div>\n ) : (\n <div className=\"grid max-w-4xl gap-4 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] md:gap-10\">\n {quote && <blockquote className=\"m-0 border-s-2 border-accent ps-4 font-display text-2xl leading-snug text-fg\">{quote}</blockquote>}\n <p className=\"m-0 text-base leading-relaxed text-fg-secondary\">{body}</p>\n </div>\n )}\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAEA,SAAS,cAAc;AA4BH,cACV,YADU;AANb,SAAS,aAAa,EAAE,UAAU,SAAS,OAAO,OAAO,MAAM,OAAO,SAAS,WAAW,GAAG,MAAM,GAAsB;AAC9H,MAAI,CAAC,QAAQ,CAAC,MAAO,QAAO;AAC5B,SACE,oBAAC,eAAY,OAAc,WAAsB,gBAAc,SAAU,GAAG,OACzE,sBAAY,UACX,qBAAC,SAAI,WAAU,oCACZ;AAAA,aAAS,oBAAC,UAAO,KAAK,MAAM,OAAO,KAAI,IAAG,UAAU,MAAM,KAAK,MAAM,GAAG,CAAC,GAAG,MAAK,MAAK;AAAA,IACvF,qBAAC,SAAI,WAAU,WACZ;AAAA,eAAS,oBAAC,OAAE,WAAU,6BAA6B,gBAAM,MAAK;AAAA,MAC/D,oBAAC,OAAE,WAAU,wDAAwD,gBAAK;AAAA,MACzE,WAAW,oBAAC,SAAI,WAAU,6BAA6B,mBAAQ;AAAA,OAClE;AAAA,KACF,IAEA,qBAAC,SAAI,WAAU,6EACZ;AAAA,aAAS,oBAAC,gBAAW,WAAU,gFAAgF,iBAAM;AAAA,IACtH,oBAAC,OAAE,WAAU,mDAAmD,gBAAK;AAAA,KACvE,GAEJ;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/shop/story/story.tsx"],"sourcesContent":["// Server-safe. The owner's words (ADR-007 §3): `quote` — a pull quote and a paragraph; `owner` — the owner's face, a\n// paragraph, and a way to call or write. The words are the owner's, in the visitor's language; nothing is invented.\nimport { Avatar } from \"@krizaka/ui/avatar\";\nimport * as React from \"react\";\n\nimport { ShopSection, type ShopSectionProps } from \"../frame\";\n\nexport type StoryVariant = \"quote\" | \"owner\";\n\nexport type StorySectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & Pick<ShopSectionProps, \"mascot\"> & {\n /** @default \"quote\" */\n variant?: StoryVariant;\n title: React.ReactNode;\n /** `quote`: the pull quote. */\n quote?: string;\n /** The paragraph. */\n body: string;\n /** `owner`: who speaks. */\n owner?: { name: string; photo?: string };\n /** `owner`: call or write (`ButtonLink`s). */\n actions?: React.ReactNode;\n};\n\n/** The owner's story, as a pull quote or a face and a paragraph. */\nexport function StorySection({ variant = \"quote\", title, quote, body, owner, actions, className, ...props }: StorySectionProps) {\n if (!body && !quote) return null;\n return (\n <ShopSection title={title} className={className} data-variant={variant} {...props}>\n {variant === \"owner\" ? (\n <div className=\"flex max-w-3xl items-start gap-4\">\n {owner && <Avatar src={owner.photo} alt=\"\" fallback={owner.name.slice(0, 1)} size=\"xl\" />}\n <div className=\"min-w-0\">\n {owner && <p className=\"m-0 font-semibold text-fg\">{owner.name}</p>}\n <p className=\"m-0 mt-1 text-base leading-relaxed text-fg-secondary\">{body}</p>\n {actions && <div className=\"mt-3 flex flex-wrap gap-2\">{actions}</div>}\n </div>\n </div>\n ) : (\n <div className=\"grid max-w-4xl gap-4 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] md:gap-10\">\n {quote && <blockquote className=\"m-0 border-s-2 border-accent ps-4 font-display text-2xl leading-snug text-fg\">{quote}</blockquote>}\n <p className=\"m-0 text-base leading-relaxed text-fg-secondary\">{body}</p>\n </div>\n )}\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAEA,SAAS,cAAc;AA4BH,cACV,YADU;AANb,SAAS,aAAa,EAAE,UAAU,SAAS,OAAO,OAAO,MAAM,OAAO,SAAS,WAAW,GAAG,MAAM,GAAsB;AAC9H,MAAI,CAAC,QAAQ,CAAC,MAAO,QAAO;AAC5B,SACE,oBAAC,eAAY,OAAc,WAAsB,gBAAc,SAAU,GAAG,OACzE,sBAAY,UACX,qBAAC,SAAI,WAAU,oCACZ;AAAA,aAAS,oBAAC,UAAO,KAAK,MAAM,OAAO,KAAI,IAAG,UAAU,MAAM,KAAK,MAAM,GAAG,CAAC,GAAG,MAAK,MAAK;AAAA,IACvF,qBAAC,SAAI,WAAU,WACZ;AAAA,eAAS,oBAAC,OAAE,WAAU,6BAA6B,gBAAM,MAAK;AAAA,MAC/D,oBAAC,OAAE,WAAU,wDAAwD,gBAAK;AAAA,MACzE,WAAW,oBAAC,SAAI,WAAU,6BAA6B,mBAAQ;AAAA,OAClE;AAAA,KACF,IAEA,qBAAC,SAAI,WAAU,6EACZ;AAAA,aAAS,oBAAC,gBAAW,WAAU,gFAAgF,iBAAM;AAAA,IACtH,oBAAC,OAAE,WAAU,mDAAmD,gBAAK;AAAA,KACvE,GAEJ;AAEJ;","names":[]}
|
package/dist/shop/team.js
CHANGED
package/dist/shop/video.js
CHANGED
package/dist/shop/visit.js
CHANGED
package/dist/shop-composer.d.ts
CHANGED
|
@@ -195,9 +195,17 @@ type ShopPage = {
|
|
|
195
195
|
schema: typeof SHOP_SCHEMA_VERSION;
|
|
196
196
|
preset: z.output<typeof presetRef>;
|
|
197
197
|
density?: "compact" | "airy" | undefined;
|
|
198
|
+
accent?: string | undefined;
|
|
198
199
|
sections: Section[];
|
|
199
200
|
};
|
|
200
201
|
|
|
202
|
+
/** What `applyLook` reads of a look: its id and version, and one variant per section type. */
|
|
203
|
+
type ShopLookLike = {
|
|
204
|
+
id: string;
|
|
205
|
+
version: number;
|
|
206
|
+
variants: Readonly<Record<string, string>>;
|
|
207
|
+
};
|
|
208
|
+
|
|
201
209
|
type Rec = Record<string, unknown>;
|
|
202
210
|
type Command =
|
|
203
211
|
/** Adds a section (its type's default settings, the given or the default variant) at an index; a hero goes first. */
|
|
@@ -245,6 +253,16 @@ type Command =
|
|
|
245
253
|
} | {
|
|
246
254
|
type: "setDensity";
|
|
247
255
|
density: "compact" | "airy" | undefined;
|
|
256
|
+
}
|
|
257
|
+
/** A whole look (`look-*`): the variants of the sections, nothing of their content (`applyLook`). */
|
|
258
|
+
| {
|
|
259
|
+
type: "applyLook";
|
|
260
|
+
look: ShopLookLike;
|
|
261
|
+
}
|
|
262
|
+
/** The accent within the look's tested list. */
|
|
263
|
+
| {
|
|
264
|
+
type: "setAccent";
|
|
265
|
+
accent: string | undefined;
|
|
248
266
|
} | {
|
|
249
267
|
type: "addBlock";
|
|
250
268
|
key: string;
|
|
@@ -348,6 +366,14 @@ type ShopComposerMessages = {
|
|
|
348
366
|
removeBlock: string;
|
|
349
367
|
/** The look. */
|
|
350
368
|
look: string;
|
|
369
|
+
/** The six looks, as a group of swatches. */
|
|
370
|
+
lookChoice: string;
|
|
371
|
+
/** Said when a look is applied (`{name}`). */
|
|
372
|
+
lookApplied: string;
|
|
373
|
+
/** The accent within the chosen look. */
|
|
374
|
+
accentChoice: string;
|
|
375
|
+
/** The names of the accents a look lists (`krizaka`, `akinaza:accent-2`…); an unknown one reads as its id. */
|
|
376
|
+
accentNames: Readonly<Record<string, string>>;
|
|
351
377
|
preset: string;
|
|
352
378
|
density: string;
|
|
353
379
|
densityCompact: string;
|
|
@@ -397,6 +423,9 @@ type ShopComposerPreset = {
|
|
|
397
423
|
name: string;
|
|
398
424
|
density: "compact" | "airy";
|
|
399
425
|
variants: Readonly<Record<string, string>>;
|
|
426
|
+
/** A look's (`look-*`): the accent it starts with and the tested list the owner chooses from. Presets without a list are trade presets (the « Style » select). */
|
|
427
|
+
accent?: string;
|
|
428
|
+
accents?: readonly string[];
|
|
400
429
|
};
|
|
401
430
|
type ShopComposerProps = {
|
|
402
431
|
/** The draft to edit. The composer keeps its own history from it. */
|