@krizaka/ui 4.3.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-menu.d.ts +1 -1
- package/dist/account-menu.js +1 -1
- package/dist/account-menu.js.map +1 -1
- package/dist/account-settings.d.ts +1 -1
- package/dist/account-settings.js +13 -6
- package/dist/account-settings.js.map +1 -1
- package/dist/agenda.d.ts +1 -1
- package/dist/agenda.js +2 -1
- package/dist/agenda.js.map +1 -1
- package/dist/analysis-report.js +19 -11
- package/dist/analysis-report.js.map +1 -1
- package/dist/app-frame.d.ts +1 -1
- package/dist/app-frame.js.map +1 -1
- package/dist/app-header/search.js +2 -2
- package/dist/app-header/search.js.map +1 -1
- package/dist/avatar/defaults.js +3 -1
- package/dist/avatar/defaults.js.map +1 -1
- package/dist/avatar.js +3 -1
- package/dist/avatar.js.map +1 -1
- package/dist/bird-plate.js +8 -2
- package/dist/bird-plate.js.map +1 -1
- package/dist/blocks.css +4 -0
- package/dist/chapter.js +7 -4
- package/dist/chapter.js.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.js +1 -1
- package/dist/{chunk-SNSQLGGS.js → chunk-5VZ37TY3.js} +1 -1
- package/dist/{chunk-XWJDBQU7.js.map → chunk-5VZ37TY3.js.map} +1 -1
- package/dist/{chunk-MTVX4RRF.js → chunk-HP7BDMVK.js} +11 -3
- package/dist/chunk-HP7BDMVK.js.map +1 -0
- package/dist/{chunk-PK3L6WQT.js → chunk-LNAAWT4Y.js} +4 -2
- package/dist/{chunk-PK3L6WQT.js.map → chunk-LNAAWT4Y.js.map} +1 -1
- package/dist/{chunk-UIP3WX5O.js → chunk-MDSP7DJR.js} +2 -2
- package/dist/chunk-MDSP7DJR.js.map +1 -0
- package/dist/{chunk-IEGTRCDI.js → chunk-NQENOT6L.js} +2 -2
- package/dist/{chunk-IEGTRCDI.js.map → chunk-NQENOT6L.js.map} +1 -1
- package/dist/{chunk-FM42KOAU.js → chunk-P7AFIKWG.js} +5 -3
- package/dist/chunk-P7AFIKWG.js.map +1 -0
- package/dist/{chunk-BCD2CRFG.js → chunk-PJNR4NTS.js} +2 -2
- package/dist/chunk-PJNR4NTS.js.map +1 -0
- package/dist/{chunk-ZFR6ZNXD.js → chunk-PVQ2KKPZ.js} +1 -1
- package/dist/chunk-PVQ2KKPZ.js.map +1 -0
- package/dist/{chunk-U4XTZMB7.js → chunk-QA3WETWT.js} +1 -1
- package/dist/{chunk-U4XTZMB7.js.map → chunk-QA3WETWT.js.map} +1 -1
- package/dist/{chunk-YXETEQQJ.js → chunk-SG2RKUVJ.js} +2 -2
- package/dist/{chunk-EOWV6BNQ.js → chunk-TXFX4PMN.js} +4 -2
- package/dist/{chunk-EOWV6BNQ.js.map → chunk-TXFX4PMN.js.map} +1 -1
- package/dist/{chunk-XWJDBQU7.js → chunk-V5RO6JYI.js} +1 -1
- package/dist/{chunk-SNSQLGGS.js.map → chunk-V5RO6JYI.js.map} +1 -1
- package/dist/chunk-VZ6ZALIJ.js +13 -0
- package/dist/chunk-VZ6ZALIJ.js.map +1 -0
- package/dist/{chunk-2DHL7NJW.js → chunk-XVRKKYWU.js} +5 -3
- package/dist/{chunk-2DHL7NJW.js.map → chunk-XVRKKYWU.js.map} +1 -1
- package/dist/{chunk-CDNOT2KR.js → chunk-YTYNKMNS.js} +1 -1
- package/dist/chunk-YTYNKMNS.js.map +1 -0
- package/dist/code-block.js.map +1 -1
- package/dist/combobox.js +2 -2
- package/dist/copy-button.js +2 -2
- package/dist/copy-button.js.map +1 -1
- package/dist/data-table.js +3 -3
- package/dist/desktop-window.d.ts +1 -1
- package/dist/desktop-window.js +3 -1
- package/dist/desktop-window.js.map +1 -1
- package/dist/drop-overlay.js +8 -8
- package/dist/drop-overlay.js.map +1 -1
- package/dist/elephant.d.ts +1 -1
- package/dist/elephant.js.map +1 -1
- package/dist/embed-facade.d.ts +1 -1
- package/dist/embed-facade.js +3 -1
- package/dist/embed-facade.js.map +1 -1
- package/dist/engine-flow.js +7 -2
- package/dist/engine-flow.js.map +1 -1
- package/dist/entity-header.js +9 -3
- package/dist/entity-header.js.map +1 -1
- package/dist/file-upload.d.ts +1 -1
- package/dist/file-upload.js.map +1 -1
- package/dist/filter-bar.d.ts +4 -4
- package/dist/filter-bar.js +2 -2
- package/dist/flock.js +9 -6
- package/dist/flock.js.map +1 -1
- package/dist/form.d.ts +3 -3
- package/dist/form.js.map +1 -1
- package/dist/genui.js +3 -3
- package/dist/glossary-term.d.ts +1 -1
- package/dist/glossary-term.js.map +1 -1
- package/dist/glossary.d.ts +1 -1
- package/dist/glossary.js.map +1 -1
- package/dist/identity-card.js +1 -1
- package/dist/index.js +1 -1
- package/dist/kind-config-editor.d.ts +2 -2
- package/dist/kind-config-editor.js +1 -1
- package/dist/kind-config-editor.js.map +1 -1
- package/dist/kpi-explained.d.ts +1 -1
- package/dist/kpi-explained.js +4 -4
- package/dist/kpi-explained.js.map +1 -1
- package/dist/landing-page.d.ts +10 -3
- package/dist/landing-page.js +8 -6
- package/dist/landing-page.js.map +1 -1
- package/dist/{lightbox-Q45BZ3HW.js → lightbox-MRB2YZEP.js} +1 -1
- package/dist/lightbox-MRB2YZEP.js.map +1 -0
- package/dist/map/cards.js +4 -2
- package/dist/map/cards.js.map +1 -1
- package/dist/map/pin.js +2 -1
- package/dist/map/pin.js.map +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js.map +1 -1
- package/dist/mascot-quote.js +1 -1
- package/dist/mascot-state.js +1 -1
- package/dist/mascots.js +1 -1
- package/dist/match-dialog.js +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js.map +1 -1
- package/dist/native/form.d.ts +3 -3
- package/dist/native/form.js.map +1 -1
- package/dist/native/markdown.d.ts +1 -1
- package/dist/native/markdown.js.map +1 -1
- package/dist/native/vertical-video.js.map +1 -1
- package/dist/native.d.ts +12 -12
- package/dist/native.js +12 -7
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.d.ts +2 -2
- package/dist/nav-bar.js +1 -1
- package/dist/nav-bar.js.map +1 -1
- package/dist/next-actions.d.ts +1 -1
- package/dist/next-actions.js.map +1 -1
- package/dist/notification-preferences.d.ts +1 -1
- package/dist/notification-preferences.js +5 -2
- package/dist/notification-preferences.js.map +1 -1
- package/dist/page-index.js +2 -2
- package/dist/page-index.js.map +1 -1
- package/dist/product-page.js +4 -4
- package/dist/product-page.js.map +1 -1
- package/dist/promo-code-field.d.ts +1 -1
- package/dist/promo-code-field.js.map +1 -1
- package/dist/qr-code.d.ts +1 -1
- package/dist/qr-code.js +1 -1
- package/dist/rail-nav.js +3 -3
- package/dist/rail-nav.js.map +1 -1
- package/dist/retro-tv.d.ts +1 -1
- package/dist/retro-tv.js.map +1 -1
- package/dist/reviews.d.ts +2 -2
- package/dist/reviews.js.map +1 -1
- package/dist/router.d.ts +1 -1
- package/dist/router.js +8 -8
- package/dist/router.js.map +1 -1
- package/dist/{schema-DgjBz7-8.d.ts → schema-Dd05m48Q.d.ts} +8 -8
- package/dist/service-card.js +22 -13
- package/dist/service-card.js.map +1 -1
- package/dist/settings-layout.js +1 -1
- package/dist/shop/booking.js.map +1 -1
- package/dist/shop/gallery.js +7 -6
- package/dist/shop/gallery.js.map +1 -1
- package/dist/shop/hero.js.map +1 -1
- package/dist/shop/look.d.ts +2 -2
- package/dist/shop/look.js +1 -1
- package/dist/shop/look.js.map +1 -1
- package/dist/shop/map-gate.d.ts +1 -1
- package/dist/shop/map-gate.js +2 -2
- package/dist/shop/map-gate.js.map +1 -1
- package/dist/shop/services.js.map +1 -1
- package/dist/shop-composer.d.ts +10 -10
- package/dist/shop-composer.js +27 -14
- package/dist/shop-composer.js.map +1 -1
- package/dist/shop-gallery.js +1 -1
- package/dist/shop.d.ts +2 -2
- package/dist/shop.js +2 -2
- package/dist/shop.js.map +1 -1
- package/dist/signature.js +2 -1
- package/dist/signature.js.map +1 -1
- package/dist/site-cahier.js +7 -3
- package/dist/site-cahier.js.map +1 -1
- package/dist/site-footer.js +6 -2
- package/dist/site-footer.js.map +1 -1
- package/dist/slot-picker.js +5 -2
- package/dist/slot-picker.js.map +1 -1
- package/dist/stat.js +1 -1
- package/dist/status-chip.d.ts +1 -1
- package/dist/status-chip.js.map +1 -1
- package/dist/tabs.js.map +1 -1
- package/dist/tag-input.js +2 -2
- package/dist/tag-selector.js +1 -1
- package/dist/text-style.js +4 -3
- package/dist/text-style.js.map +1 -1
- package/dist/usage.js +8 -3
- package/dist/usage.js.map +1 -1
- package/dist/versus-card.js +1 -1
- package/dist/versus-card.js.map +1 -1
- package/dist/vertical-video.js +1 -1
- package/dist/vertical-video.js.map +1 -1
- package/dist/wall.d.ts +4 -4
- package/dist/wall.js +1 -1
- package/dist/wall.js.map +1 -1
- package/package.json +6 -6
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +2 -2
- package/registry/agenda.json +1 -1
- package/registry/analysis-report.json +2 -2
- package/registry/app-frame.json +3 -3
- package/registry/app-header.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +2 -2
- package/registry/bird-plate.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/copy-button.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/desktop-window.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/elephant.json +1 -1
- package/registry/embed-facade.json +2 -2
- package/registry/engine-flow.json +2 -2
- package/registry/entity-header.json +1 -1
- package/registry/examples/landing-page/showcase.d.ts +4 -0
- package/registry/examples/landing-page/showcase.js +45 -0
- package/registry/examples/landing-page/showcase.tsx +42 -0
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +2 -2
- package/registry/form.json +7 -7
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/index.json +19 -10
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +61 -21
- package/registry/map.json +4 -4
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +2 -2
- package/registry/nav-bar.json +4 -4
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +4 -0
- package/registry/product-page.json +1 -1
- package/registry/promo-code-field.json +1 -1
- package/registry/qr-code.json +2 -2
- package/registry/rail-nav.json +3 -3
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +7 -7
- package/registry/shop-gallery.json +1 -1
- package/registry/shop.json +11 -11
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +3 -3
- package/registry/slot-picker.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/usage.json +2 -2
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/wall.json +5 -5
- package/registry/waveform.json +2 -2
- package/dist/chunk-BCD2CRFG.js.map +0 -1
- package/dist/chunk-CDNOT2KR.js.map +0 -1
- package/dist/chunk-FM42KOAU.js.map +0 -1
- package/dist/chunk-MTVX4RRF.js.map +0 -1
- package/dist/chunk-UIP3WX5O.js.map +0 -1
- package/dist/chunk-ZFR6ZNXD.js.map +0 -1
- package/dist/lightbox-Q45BZ3HW.js.map +0 -1
- /package/dist/{chunk-YXETEQQJ.js.map → chunk-SG2RKUVJ.js.map} +0 -0
package/dist/service-card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/service-card/service-card.tsx"],"sourcesContent":["// Server-safe: no hook, no context. A service a shop sells, as a card that argues: icon or photo, name, duration, price\n// (« from » when it varies), what is included, the capacity, a « Popular » tag — and one way in: a link (the booking page\n// with this service chosen) or a button (`onSelect`, from a client parent). The whole card takes the press.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { buttonVariants } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { CheckGlyph } from \"../glyphs\";\nimport { Stamp } from \"../specimen-tag/specimen-tag\";\n\nexport const serviceCard = tv({\n slots: {\n root:\n \"group relative flex h-full min-w-0 flex-col overflow-hidden rounded-xl border border-border-default bg-surface-1 text-fg transition-colors duration-150 hover:border-border-strong hover:bg-surface-2 \" +\n \"hover:border-accent/50 focus-within:ring-2 focus-within:ring-ring data-[selected]:border-accent data-[selected]:bg-accent-soft\",\n media: \"relative aspect-[16/9] w-full overflow-hidden bg-media [&>img]:h-full [&>img]:w-full [&>img]:object-cover\",\n body: \"flex flex-1 flex-col gap-3 p-4 sm:p-5\",\n head: \"flex items-start gap-3\",\n icon: \"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-fg-accent [&>svg]:h-5 [&>svg]:w-5\",\n titles: \"flex min-w-0 flex-1 flex-col gap-1\",\n name: \"m-0 font-display text-lg font-bold leading-tight tracking-tight text-fg\",\n facts: \"m-0 flex list-none flex-wrap gap-x-2 gap-y-0.5 p-0 text-xs text-fg-secondary\",\n tag: \"shrink-0 rounded-sm bg-accent px-2 py-0.5 text-[10px] font-extrabold text-on-accent\",\n description: \"m-0 text-sm leading-relaxed text-fg-secondary\",\n included: \"m-0 flex list-none flex-col gap-1.5 p-0 text-sm text-fg-secondary\",\n includedItem: \"flex items-start gap-2 [&>svg]:mt-0.5 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 [&>svg]:text-fg-accent\",\n foot: \"mt-auto flex items-end justify-between gap-3 border-t border-border-subtle pt-3\",\n priceBlock: \"flex flex-col leading-none\",\n from: \"mb-1 text-[11px] font-semibold text-fg-secondary\",\n price: \"font-display text-2xl font-black tabular-nums text-fg\",\n action:\n \"inline-flex min-h-9 items-center gap-1 rounded-sm text-sm font-bold text-fg-accent no-underline \" +\n \"after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden group-data-[selected]:text-fg\",\n },\n variants: {\n // The Cahier's stamped index card (krizaka-ui#603): ruled, straight, a punched hole, the facts stamped, a secondary Button.\n // Same elements and same accessible output as the default card; only the drawing changes. The card is not the link, so\n // the name stays selectable.\n variant: {\n default: {},\n index: {\n root:\n \"rounded-none border-border-default bg-surface-1 shadow-[4px_5px_0_-2px_var(--kz-border-default)] \" +\n \"transition-[transform,box-shadow,border-color] duration-120 hover:border-border-strong hover:bg-surface-1 hover:-translate-y-0.5 \" +\n \"hover:shadow-[6px_7px_0_-2px_var(--kz-border-default)] focus-within:-translate-y-0.5 focus-within:shadow-[6px_7px_0_-2px_var(--kz-border-default)] \" +\n \"motion-reduce:transition-none motion-reduce:hover:translate-y-0 motion-reduce:focus-within:translate-y-0\",\n body: \"relative pt-8 sm:pt-9\",\n head: \"border-b border-(--kz-paper-rule-major) pb-3\",\n name: \"font-display font-normal\",\n facts: \"gap-2 text-fg\",\n foot: \"border-t-0 pt-1\",\n },\n },\n // `density=\"list\"` is deprecated (ADR-007): a list of services is `ServicesSection variant=\"menu\"` of `@krizaka/ui/shop/services`.\n density: { grid: {}, list: {} },\n // The photo's box: the wide 16:9 band, or the 4:3 of `services · cards` (ADR-007 §6).\n mediaRatio: { wide: {}, photo: { media: \"aspect-[4/3]\" } },\n },\n compoundVariants: [\n { variant: \"index\", density: \"list\", class: { root: \"sm:flex-row\", media: \"sm:aspect-auto sm:w-1/3 sm:shrink-0\", body: \"sm:flex-1\" } },\n ],\n defaultVariants: { variant: \"default\", density: \"grid\", mediaRatio: \"wide\" },\n});\n\nexport type ServiceCardProps = Omit<React.ComponentProps<\"article\">, \"title\" | \"children\"> & {\n /** The service's name (the heading). */\n name: string;\n /** Its price, formatted by the app (`22,00 $`): the card never formats money. */\n price: string;\n /** The words before the price when it varies (`From`, `À partir de`), passed translated. */\n priceFrom?: string;\n /** How long it takes (`30 min`) — the first fact. */\n duration?: string;\n /** How many it takes (`Up to 5 dogs`, `1 person`) — the second fact. */\n capacity?: string;\n /** One or two sentences: what it is. */\n description?: string;\n /** What is included, one short line each (a check precedes it). */\n included?: readonly string[];\n /** A tag on the top right (`Popular`): only from real data, never decoration. */\n tag?: string;\n /** An icon tile before the name (a signature icon): decorative. */\n icon?: React.ReactNode;\n /** A photo or a loop above the card (an `img`, a `video`): fills a 16:9 band. */\n media?: React.ReactNode;\n /** This service is the chosen one (the accent, `data-selected`). */\n selected?: boolean;\n /** The words of the way in (`Book`, `Choose`): the accessible name of the press. */\n actionLabel: string;\n /** The way in, as an address (the booking page with this service preselected). */\n href?: string;\n /** The app's link component for internal addresses (Next's `Link`). */\n linkAs?: LinkComponent;\n /** The way in, as a press (a client parent). Ignored when `href` is set. */\n onSelect?: () => void;\n /**\n * `index` — the Cahier's stamped index card: a ruled card with a punched hole, straight, the duration and the price as\n * stamps, a secondary button. The same props and the same accessible output; only the drawing changes.\n * @default \"default\"\n */\n variant?: \"default\" | \"index\";\n /**\n * `variant=\"index\"`: `list` lays the card out as a row for a single column (the media on the left from `sm`).\n * @deprecated Since 3.64: use `ServicesSection variant=\"menu\"` of `@krizaka/ui/shop/services` (the compact price board). Removed in 4.0.0.\n * @default \"grid\"\n */\n density?: \"grid\" | \"list\";\n /**\n * The photo's box: `wide` (16:9) or `photo` (4:3).\n * @default \"wide\"\n */\n mediaRatio?: \"wide\" | \"photo\";\n /**\n * The heading level of the name.\n * @default \"h3\"\n */\n titleAs?: \"h2\" | \"h3\" | \"h4\";\n /** Enters on scroll (MotionObserver): the index in the grid becomes the delay. */\n reveal?: number;\n};\n\n/** A service as a card: icon or photo, duration, price, what is included, the capacity, a tag — one way in. */\nexport function ServiceCard({\n name, price, priceFrom, duration, capacity, description, included, tag, icon, media, selected, actionLabel, href, linkAs, onSelect, titleAs: Title = \"h3\", reveal, variant = \"default\", density = \"grid\", mediaRatio = \"wide\", className, style, ...props\n}: ServiceCardProps) {\n const s = serviceCard({ variant, density, mediaRatio });\n const index = variant === \"index\";\n const id = React.useId();\n const facts = [duration, capacity].filter(Boolean);\n const actionClass = index ? cn(buttonVariants({ variant: \"secondary\", size: \"md\" }), \"min-h-11 rounded-none no-underline\") : s.action();\n const arrow = <span aria-hidden>→</span>;\n const revealStyle = reveal === undefined ? style : ({ ...style, \"--kz-delay\": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` } as React.CSSProperties);\n return (\n <article\n aria-labelledby={id}\n data-selected={selected ? \"\" : undefined}\n data-variant={variant}\n data-density={index ? density : undefined}\n data-reveal={reveal === undefined ? undefined : \"\"}\n style={revealStyle}\n className={s.root({ className })}\n {...props}\n >\n {media && <div className={s.media()}>{media}</div>}\n <div className={s.body()}>\n {index && (\n <svg data-hole aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 16 16\" className=\"absolute start-3 top-3 h-4 w-4\">\n <circle cx=\"8\" cy=\"8\" r=\"5.5\" fill=\"var(--kz-surface-0)\" stroke=\"var(--kz-border-strong)\" strokeWidth=\"1.5\" />\n </svg>\n )}\n <div className={s.head()}>\n {icon && <span aria-hidden className={s.icon()}>{icon}</span>}\n <div className={s.titles()}>\n <Title id={id} className={s.name()}>{name}</Title>\n {facts.length > 0 && (\n <ul className={s.facts()}>\n {facts.map((fact, i) => (\n <li key={i}>\n {index ? <Stamp tone=\"ink\" size=\"sm\">{fact}</Stamp> : <>{i > 0 && <span aria-hidden>· </span>}{fact}</>}\n </li>\n ))}\n </ul>\n )}\n </div>\n {tag && <span className={s.tag()}>{tag}</span>}\n </div>\n {description && <p className={s.description()}>{description}</p>}\n {included && included.length > 0 && (\n <ul className={s.included()}>\n {included.map((line) => (\n <li key={line} className={s.includedItem()}>\n <CheckGlyph />\n <span>{line}</span>\n </li>\n ))}\n </ul>\n )}\n <div className={s.foot()}>\n <p className={s.priceBlock()}>\n {priceFrom && <span className={s.from()}>{priceFrom}</span>}\n {index ? <Stamp tone=\"ink\" size=\"sm\" data-figure=\"\" className=\"tabular-nums\">{price}</Stamp> : <span className={s.price()}>{price}</span>}\n </p>\n {href ? (\n <BlockLink href={href} linkAs={linkAs} className={actionClass} aria-describedby={id}>\n {actionLabel} {arrow}\n </BlockLink>\n ) : onSelect ? (\n <button type=\"button\" onClick={onSelect} aria-pressed={selected ?? false} aria-describedby={id} className={actionClass}>\n {actionLabel} {arrow}\n </button>\n ) : null}\n </div>\n </div>\n </article>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAgIH,SA4B0D,UA5B1D,KA4B0D,YA5B1D;AAxHT,IAAM,cAAc,GAAG;AAAA,EAC5B,OAAO;AAAA,IACL,MACE;AAAA,IAEF,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,IACV,cAAc;AAAA,IACd,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QACE;AAAA,EAEJ;AAAA,EACA,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,SAAS;AAAA,MACP,SAAS,CAAC;AAAA,MACV,OAAO;AAAA,QACL,MACE;AAAA,QAIF,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA;AAAA,IAEA,SAAS,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE;AAAA;AAAA,IAE9B,YAAY,EAAE,MAAM,CAAC,GAAG,OAAO,EAAE,OAAO,eAAe,EAAE;AAAA,EAC3D;AAAA,EACA,kBAAkB;AAAA,IAChB,EAAE,SAAS,SAAS,SAAS,QAAQ,OAAO,EAAE,MAAM,eAAe,OAAO,uCAAuC,MAAM,YAAY,EAAE;AAAA,EACvI;AAAA,EACA,iBAA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AC,SAAM,MAAK,OAAM,MAAK,MAAK,eAAY,IAAG,WAAU,gBAAgB,iBAAM,IAAW,oBAAC,UAAK,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,eACpI;AAAA,YACC,OACC,qBAAC,aAAU,MAAY,QAAgB,WAAW,aAAa,oBAAkB,IAC9E;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE,WACF,qBAAC,YAAO,MAAK,UAAS,SAAS,UAAU,gBAAc,YAAY,OAAO,oBAAkB,IAAI,WAAW,aACxG;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE;AAAA,aACN;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/service-card/service-card.tsx"],"sourcesContent":["// Server-safe: no hook, no context. A service a shop sells, as a card that argues: icon or photo, name, duration, price\n// (« from » when it varies), what is included, the capacity, a « Popular » tag — and one way in: a link (the booking page\n// with this service chosen) or a button (`onSelect`, from a client parent). The whole card takes the press.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { buttonVariants } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { CheckGlyph } from \"../glyphs\";\nimport { Stamp } from \"../specimen-tag/specimen-tag\";\n\nexport const serviceCard = tv({\n slots: {\n root:\n \"group relative flex h-full min-w-0 flex-col overflow-hidden rounded-xl border border-border-default bg-surface-1 text-fg transition-colors duration-150 hover:border-border-strong hover:bg-surface-2 \" +\n \"hover:border-accent/50 focus-within:ring-2 focus-within:ring-ring data-[selected]:border-accent data-[selected]:bg-accent-soft\",\n media: \"relative aspect-[16/9] w-full overflow-hidden bg-media [&>img]:h-full [&>img]:w-full [&>img]:object-cover\",\n body: \"flex flex-1 flex-col gap-3 p-4 sm:p-5\",\n head: \"flex items-start gap-3\",\n icon: \"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-fg-accent [&>svg]:h-5 [&>svg]:w-5\",\n titles: \"flex min-w-0 flex-1 flex-col gap-1\",\n name: \"m-0 font-display text-lg font-bold leading-tight tracking-tight text-fg\",\n facts: \"m-0 flex list-none flex-wrap gap-x-2 gap-y-0.5 p-0 text-xs text-fg-secondary\",\n tag: \"shrink-0 rounded-sm bg-accent px-2 py-0.5 text-[10px] font-extrabold text-on-accent\",\n description: \"m-0 text-sm leading-relaxed text-fg-secondary\",\n included: \"m-0 flex list-none flex-col gap-1.5 p-0 text-sm text-fg-secondary\",\n includedItem: \"flex items-start gap-2 [&>svg]:mt-0.5 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 [&>svg]:text-fg-accent\",\n foot: \"mt-auto flex items-end justify-between gap-3 border-t border-border-subtle pt-3\",\n priceBlock: \"flex flex-col leading-none\",\n from: \"mb-1 text-[11px] font-semibold text-fg-secondary\",\n price: \"font-display text-2xl font-black tabular-nums text-fg\",\n action:\n \"inline-flex min-h-9 items-center gap-1 rounded-sm text-sm font-bold text-fg-accent no-underline \" +\n \"after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden group-data-[selected]:text-fg\",\n },\n variants: {\n // The Cahier's stamped index card (krizaka-ui#603): ruled, straight, a punched hole, the facts stamped, a secondary Button.\n // Same elements and same accessible output as the default card; only the drawing changes. The card is not the link, so\n // the name stays selectable.\n variant: {\n default: {},\n index: {\n root:\n \"rounded-none border-border-default bg-surface-1 shadow-[4px_5px_0_-2px_var(--kz-border-default)] \" +\n \"transition-[transform,box-shadow,border-color] duration-120 hover:border-border-strong hover:bg-surface-1 hover:-translate-y-0.5 \" +\n \"hover:shadow-[6px_7px_0_-2px_var(--kz-border-default)] focus-within:-translate-y-0.5 focus-within:shadow-[6px_7px_0_-2px_var(--kz-border-default)] \" +\n \"motion-reduce:transition-none motion-reduce:hover:translate-y-0 motion-reduce:focus-within:translate-y-0\",\n body: \"relative pt-8 sm:pt-9\",\n head: \"border-b border-(--kz-paper-rule-major) pb-3\",\n name: \"font-display font-normal\",\n facts: \"gap-2 text-fg\",\n foot: \"border-t-0 pt-1\",\n },\n },\n // `density=\"list\"` is deprecated (ADR-007): a list of services is `ServicesSection variant=\"menu\"` of `@krizaka/ui/shop/services`.\n density: { grid: {}, list: {} },\n // The photo's box: the wide 16:9 band, or the 4:3 of `services · cards` (ADR-007 §6).\n mediaRatio: { wide: {}, photo: { media: \"aspect-[4/3]\" } },\n },\n compoundVariants: [\n { variant: \"index\", density: \"list\", class: { root: \"sm:flex-row\", media: \"sm:aspect-auto sm:w-1/3 sm:shrink-0\", body: \"sm:flex-1\" } },\n ],\n defaultVariants: { variant: \"default\", density: \"grid\", mediaRatio: \"wide\" },\n});\n\nexport type ServiceCardProps = Omit<React.ComponentProps<\"article\">, \"title\" | \"children\"> & {\n /** The service's name (the heading). */\n name: string;\n /** Its price, formatted by the app (`22,00 $`): the card never formats money. */\n price: string;\n /** The words before the price when it varies (`From`, `À partir de`), passed translated. */\n priceFrom?: string;\n /** How long it takes (`30 min`) — the first fact. */\n duration?: string;\n /** How many it takes (`Up to 5 dogs`, `1 person`) — the second fact. */\n capacity?: string;\n /** One or two sentences: what it is. */\n description?: string;\n /** What is included, one short line each (a check precedes it). */\n included?: readonly string[];\n /** A tag on the top right (`Popular`): only from real data, never decoration. */\n tag?: string;\n /** An icon tile before the name (a signature icon): decorative. */\n icon?: React.ReactNode;\n /** A photo or a loop above the card (an `img`, a `video`): fills a 16:9 band. */\n media?: React.ReactNode;\n /** This service is the chosen one (the accent, `data-selected`). */\n selected?: boolean;\n /** The words of the way in (`Book`, `Choose`): the accessible name of the press. */\n actionLabel: string;\n /** The way in, as an address (the booking page with this service preselected). */\n href?: string;\n /** The app's link component for internal addresses (Next's `Link`). */\n linkAs?: LinkComponent;\n /** The way in, as a press (a client parent). Ignored when `href` is set. */\n onSelect?: () => void;\n /**\n * `index` — the Cahier's stamped index card: a ruled card with a punched hole, straight, the duration and the price as\n * stamps, a secondary button. The same props and the same accessible output; only the drawing changes.\n * @default \"default\"\n */\n variant?: \"default\" | \"index\";\n /**\n * `variant=\"index\"`: `list` lays the card out as a row for a single column (the media on the left from `sm`).\n * @deprecated Since 3.64: use `ServicesSection variant=\"menu\"` of `@krizaka/ui/shop/services` (the compact price board). Removed in 4.0.0.\n * @default \"grid\"\n */\n density?: \"grid\" | \"list\";\n /**\n * The photo's box: `wide` (16:9) or `photo` (4:3).\n * @default \"wide\"\n */\n mediaRatio?: \"wide\" | \"photo\";\n /**\n * The heading level of the name.\n * @default \"h3\"\n */\n titleAs?: \"h2\" | \"h3\" | \"h4\";\n /** Enters on scroll (MotionObserver): the index in the grid becomes the delay. */\n reveal?: number;\n};\n\n/** A service as a card: icon or photo, duration, price, what is included, the capacity, a tag — one way in. */\nexport function ServiceCard({\n name, price, priceFrom, duration, capacity, description, included, tag, icon, media, selected, actionLabel, href, linkAs, onSelect, titleAs: Title = \"h3\", reveal, variant = \"default\", density = \"grid\", mediaRatio = \"wide\", className, style, ...props\n}: ServiceCardProps) {\n const s = serviceCard({ variant, density, mediaRatio });\n const index = variant === \"index\";\n const id = React.useId();\n const facts = [\n { key: \"duration\", value: duration },\n { key: \"capacity\", value: capacity },\n ].filter((f) => Boolean(f.value));\n const actionClass = index ? cn(buttonVariants({ variant: \"secondary\", size: \"md\" }), \"min-h-11 rounded-none no-underline\") : s.action();\n const arrow = <span aria-hidden>→</span>;\n const revealStyle = reveal === undefined ? style : ({ ...style, \"--kz-delay\": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` } as React.CSSProperties);\n let cta: React.ReactNode = null;\n if (href) {\n cta = (\n <BlockLink href={href} linkAs={linkAs} className={actionClass} aria-describedby={id}>\n {actionLabel} {arrow}\n </BlockLink>\n );\n } else if (onSelect) {\n cta = (\n <button type=\"button\" onClick={onSelect} aria-pressed={selected ?? false} aria-describedby={id} className={actionClass}>\n {actionLabel} {arrow}\n </button>\n );\n }\n return (\n <article\n aria-labelledby={id}\n data-selected={selected ? \"\" : undefined}\n data-variant={variant}\n data-density={index ? density : undefined}\n data-reveal={reveal === undefined ? undefined : \"\"}\n style={revealStyle}\n className={s.root({ className })}\n {...props}\n >\n {media && <div className={s.media()}>{media}</div>}\n <div className={s.body()}>\n {index && (\n <svg data-hole aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 16 16\" className=\"absolute start-3 top-3 h-4 w-4\">\n <circle cx=\"8\" cy=\"8\" r=\"5.5\" fill=\"var(--kz-surface-0)\" stroke=\"var(--kz-border-strong)\" strokeWidth=\"1.5\" />\n </svg>\n )}\n <div className={s.head()}>\n {icon && <span aria-hidden className={s.icon()}>{icon}</span>}\n <div className={s.titles()}>\n <Title id={id} className={s.name()}>{name}</Title>\n {facts.length > 0 && (\n <ul className={s.facts()}>\n {facts.map((fact, i) => (\n <li key={fact.key}>\n {index ? <Stamp tone=\"ink\" size=\"sm\">{fact.value}</Stamp> : <>{i > 0 && <span aria-hidden>· </span>}{fact.value}</>}\n </li>\n ))}\n </ul>\n )}\n </div>\n {tag && <span className={s.tag()}>{tag}</span>}\n </div>\n {description && <p className={s.description()}>{description}</p>}\n {included && included.length > 0 && (\n <ul className={s.included()}>\n {included.map((line) => (\n <li key={line} className={s.includedItem()}>\n <CheckGlyph />\n <span>{line}</span>\n </li>\n ))}\n </ul>\n )}\n <div className={s.foot()}>\n <p className={s.priceBlock()}>\n {priceFrom && <span className={s.from()}>{priceFrom}</span>}\n {index ? <Stamp tone=\"ink\" size=\"sm\" data-figure=\"\" className=\"tabular-nums\">{price}</Stamp> : <span className={s.price()}>{price}</span>}\n </p>\n {cta}\n </div>\n </div>\n </article>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAmIH,SA0CgE,UA1ChE,KAKV,YALU;AA3HT,IAAM,cAAc,GAAG;AAAA,EAC5B,OAAO;AAAA,IACL,MACE;AAAA,IAEF,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,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B,iBAAM,IAAW,oBAAC,UAAK,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,eACpI;AAAA,YACC;AAAA,aACH;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/dist/settings-layout.js
CHANGED
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, 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-ring\">\n {actionLab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BAAM,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":[]}
|
|
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 }: Readonly<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,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,YAAY,WAAW;AA4DH,cAuBN,YAvBM;AADpB,SAAS,aAAa,EAAE,OAAO,KAAK,GAA0D;AAC5F,MAAI,MAAO,QAAO,oBAAC,SAAM,OAAc,OAAM,OAAM,OAAM,gDAA+C;AACxG,MAAI,CAAC,KAAM,QAAO;AAClB,SACE,oBAAC,SAAI,eAAW,MAAC,WAAU,qIACxB,gBACH;AAEJ;AAEA,SAAS,YAAY,EAAE,OAAO,MAAM,OAAO,MAAM,UAAU,eAAe,WAAW,MAAM,aAAa,QAAQ,WAAW,GAAG,MAAM,GAAqB;AACvJ,QAAM,YAAkB,YAAM;AAC9B,QAAM,WAAW,QAAQ,SAAS,IAAI;AACtC,SACE,oBAAC,eAAY,mBAAiB,WAAW,gBAAa,WAAU,OAAK,MAAC,WAAuB,GAAG,OAC9F,8BAAC,QACC,+BAAC,SAAI,WAAW,GAAG,gFAAgF,YAAY,4CAA4C,GACzJ;AAAA,wBAAC,gBAAa,OAAc,MAAY;AAAA,IACxC,qBAAC,SAAI,WAAU,2CACb;AAAA,0BAAC,QAAG,IAAI,WAAW,WAAU,4DAC1B,iBACH;AAAA,MACC,OAAO,oBAAC,OAAE,WAAU,iEAAiE,gBAAK,IAAO;AAAA,MACjG,WACC,qBAAC,OAAE,WAAU,mEACV;AAAA,wBAAgB,oBAAC,UAAM,yBAAc,IAAU;AAAA,QAChD,oBAAC,aAAU,MAAM,SAAS,MAAM,QAAgB,WAAU,kRACvD,mBAAS,OACZ;AAAA,SACF,IACE;AAAA,MACJ,qBAAC,SAAI,WAAU,qCACb;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BAAC,SAAI,WAAU,gHACb;AAAA,wBAAC,OAAE,WAAU,6CAA6C,iBAAM;AAAA,IAC/D,MAAM,SAAS,IACd,oBAAC,QAAG,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/gallery.js
CHANGED
|
@@ -22,7 +22,8 @@ function wallLayout(count) {
|
|
|
22
22
|
const col = i % perRow;
|
|
23
23
|
const inRow = Math.min(perRow, count - row * perRow);
|
|
24
24
|
const x = inRow === 1 ? 50 : col / (inRow - 1) * 100;
|
|
25
|
-
|
|
25
|
+
let y = 92 - col % 2 * 6;
|
|
26
|
+
if (row === 0) y = count <= perRow ? 50 : 8 + col % 2 * 6;
|
|
26
27
|
return { x, y, rotation: [-2.2, 1.6, -1.2, 2.4, -1.8][(i * 3 + 1) % 5] };
|
|
27
28
|
});
|
|
28
29
|
}
|
|
@@ -55,10 +56,10 @@ function ShopWall({ photos, notes, sign, texture, label }) {
|
|
|
55
56
|
function GallerySection({ variant = "mosaic", photos, title, lead, label, notes = [], sign, texture = "plaster", className, ...props }) {
|
|
56
57
|
const shown = photos.slice(0, SHOP_LIMITS.photos);
|
|
57
58
|
const bodies = {
|
|
58
|
-
mosaic:
|
|
59
|
-
filmstrip:
|
|
60
|
-
wall:
|
|
61
|
-
grid:
|
|
59
|
+
mosaic: /* @__PURE__ */ jsx(Mosaic, { photos: shown }),
|
|
60
|
+
filmstrip: /* @__PURE__ */ jsx(Filmstrip, { photos: shown, label }),
|
|
61
|
+
wall: /* @__PURE__ */ jsx(ShopWall, { photos: shown, notes, sign, texture, label }),
|
|
62
|
+
grid: /* @__PURE__ */ jsx(
|
|
62
63
|
MediaGallery,
|
|
63
64
|
{
|
|
64
65
|
label,
|
|
@@ -66,7 +67,7 @@ function GallerySection({ variant = "mosaic", photos, title, lead, label, notes
|
|
|
66
67
|
}
|
|
67
68
|
)
|
|
68
69
|
};
|
|
69
|
-
const body = bodies[variant]
|
|
70
|
+
const body = bodies[variant];
|
|
70
71
|
return /* @__PURE__ */ jsx(ShopSection, { title, lead, className: cn(className), "data-variant": variant, ...props, children: body });
|
|
71
72
|
}
|
|
72
73
|
export {
|
package/dist/shop/gallery.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/gallery/gallery.tsx"],"sourcesContent":["// Server-safe (the wall and the grid are client islands imported through their own entries). The photos of a shop\n// (ADR-007 §3): `mosaic` (one 4:5 lead and four squares), `filmstrip` (3:4, a snap strip), `wall` (polaroids, notes and the\n// sign on a textured wall) and `grid` (today's media gallery). A photo appears once: the product's resolver hands each id at\n// most once, and a section that runs out shows fewer tiles — never a repeat.\nimport { MediaGallery } from \"@krizaka/ui/media-gallery\";\nimport { Wall, type WallItem } from \"@krizaka/ui/wall\";\nimport * as React from \"react\";\n\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 GalleryVariant = \"mosaic\" | \"filmstrip\" | \"wall\" | \"grid\";\n\nexport type ShopGalleryPhoto = {\n id: string;\n photo: ShopPhoto;\n caption?: string;\n /** `grid`: a muted loop over the still. */\n video?: { webm?: string; mp4?: string };\n};\n\nexport type ShopGalleryNote = { id: string; text: string; signature?: string };\n\nexport type GallerySectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"mosaic\" */\n variant?: GalleryVariant;\n /** The shop's own photos, in order, already unique. */\n photos: readonly ShopGalleryPhoto[];\n title: React.ReactNode;\n lead?: React.ReactNode;\n /** The gallery's accessible name (`Photos of the salon`). */\n label: string;\n /** `wall`: short notes pinned between the photos. */\n notes?: readonly ShopGalleryNote[];\n /** `wall`: the shop's name on its sign. */\n sign?: string;\n /** `wall`: the wall's texture. @default \"plaster\" */\n texture?: \"plaster\" | \"brick\" | \"ridge\" | \"zellige\";\n};\n\n/** A deterministic scatter: the same photos always hang the same way (no random, so no hydration mismatch). */\nexport function wallLayout(count: number): { x: number; y: number; rotation: number }[] {\n const perRow = Math.min(5, Math.max(1, Math.ceil(count / 2)));\n return Array.from({ length: count }, (_, i) => {\n const row = Math.floor(i / perRow);\n const col = i % perRow;\n const inRow = Math.min(perRow, count - row * perRow);\n const x = inRow === 1 ? 50 : (col / (inRow - 1)) * 100;\n
|
|
1
|
+
{"version":3,"sources":["../../src/shop/gallery/gallery.tsx"],"sourcesContent":["// Server-safe (the wall and the grid are client islands imported through their own entries). The photos of a shop\n// (ADR-007 §3): `mosaic` (one 4:5 lead and four squares), `filmstrip` (3:4, a snap strip), `wall` (polaroids, notes and the\n// sign on a textured wall) and `grid` (today's media gallery). A photo appears once: the product's resolver hands each id at\n// most once, and a section that runs out shows fewer tiles — never a repeat.\nimport { MediaGallery } from \"@krizaka/ui/media-gallery\";\nimport { Wall, type WallItem } from \"@krizaka/ui/wall\";\nimport * as React from \"react\";\n\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 GalleryVariant = \"mosaic\" | \"filmstrip\" | \"wall\" | \"grid\";\n\nexport type ShopGalleryPhoto = {\n id: string;\n photo: ShopPhoto;\n caption?: string;\n /** `grid`: a muted loop over the still. */\n video?: { webm?: string; mp4?: string };\n};\n\nexport type ShopGalleryNote = { id: string; text: string; signature?: string };\n\nexport type GallerySectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"mosaic\" */\n variant?: GalleryVariant;\n /** The shop's own photos, in order, already unique. */\n photos: readonly ShopGalleryPhoto[];\n title: React.ReactNode;\n lead?: React.ReactNode;\n /** The gallery's accessible name (`Photos of the salon`). */\n label: string;\n /** `wall`: short notes pinned between the photos. */\n notes?: readonly ShopGalleryNote[];\n /** `wall`: the shop's name on its sign. */\n sign?: string;\n /** `wall`: the wall's texture. @default \"plaster\" */\n texture?: \"plaster\" | \"brick\" | \"ridge\" | \"zellige\";\n};\n\n/** A deterministic scatter: the same photos always hang the same way (no random, so no hydration mismatch). */\nexport function wallLayout(count: number): { x: number; y: number; rotation: number }[] {\n const perRow = Math.min(5, Math.max(1, Math.ceil(count / 2)));\n return Array.from({ length: count }, (_, i) => {\n const row = Math.floor(i / perRow);\n const col = i % perRow;\n const inRow = Math.min(perRow, count - row * perRow);\n const x = inRow === 1 ? 50 : (col / (inRow - 1)) * 100;\n let y = 92 - (col % 2) * 6;\n if (row === 0) y = count <= perRow ? 50 : 8 + (col % 2) * 6;\n return { x, y, rotation: [-2.2, 1.6, -1.2, 2.4, -1.8][(i * 3 + 1) % 5]! };\n });\n}\n\nfunction Mosaic({ photos }: Readonly<{ photos: readonly ShopGalleryPhoto[] }>) {\n const [lead, ...rest] = photos;\n if (!lead) return null;\n return (\n <ul className=\"m-0 grid list-none grid-cols-2 gap-2 p-0 sm:grid-cols-[1.6fr_1fr_1fr] sm:gap-3\">\n <li className=\"col-span-2 aspect-[16/11] sm:col-span-1 sm:row-span-2 sm:aspect-auto\">\n <Photo photo={lead.photo} ratio=\"4/5\" sizes=\"(min-width: 40rem) 36rem, 100vw\" className=\"h-full min-h-0 sm:aspect-auto\" />\n </li>\n {rest.slice(0, 4).map((p) => (\n <li key={p.id}>\n <Photo photo={p.photo} ratio=\"1/1\" sizes=\"(min-width: 40rem) 18rem, 50vw\" />\n </li>\n ))}\n </ul>\n );\n}\n\nfunction Filmstrip({ photos, label }: Readonly<{ photos: readonly ShopGalleryPhoto[]; label: string }>) {\n return (\n <div role=\"group\" aria-label={label} tabIndex={0} className=\"-mx-4 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 <ul className=\"m-0 flex w-max snap-x snap-mandatory list-none gap-3 p-0\">\n {photos.map((p) => (\n <li key={p.id} className=\"w-[42vw] max-w-64 shrink-0 snap-start sm:w-64\">\n <Photo photo={p.photo} ratio=\"3/4\" sizes=\"(min-width: 40rem) 16rem, 42vw\" />\n </li>\n ))}\n </ul>\n </div>\n );\n}\n\nfunction ShopWall({ photos, notes, sign, texture, label }: Readonly<{ photos: readonly ShopGalleryPhoto[]; notes: readonly ShopGalleryNote[]; sign?: string; texture: NonNullable<GallerySectionProps[\"texture\"]>; label: string }>) {\n const pieces = [\n ...(sign ? [{ id: \"sign\", kind: \"sign\" as const, children: sign, variant: \"neon\" as const }] : []),\n ...photos.slice(0, SHOP_LIMITS.photos).map((p) => ({\n id: p.id,\n kind: \"polaroid\" as const,\n img: <img src={p.photo.src} srcSet={p.photo.srcSet} sizes=\"220px\" alt={p.photo.alt} loading=\"lazy\" decoding=\"async\" className=\"absolute inset-0 h-full w-full object-cover\" />,\n caption: p.caption,\n })),\n ...notes.map((n) => ({ id: n.id, kind: \"note\" as const, text: n.text, signature: n.signature })),\n ];\n const layout = wallLayout(pieces.length);\n const items = pieces.map((piece, i) => ({ ...piece, ...layout[i]!, z: i })) as WallItem[];\n return <Wall aria-label={label} items={items} texture={texture} itemWidth={220} max={SHOP_LIMITS.photos + 2} />;\n}\n\n/** The photos of a shop: a mosaic, a filmstrip, a wall or a grid. */\nexport function GallerySection({ variant = \"mosaic\", photos, title, lead, label, notes = [], sign, texture = \"plaster\", className, ...props }: GallerySectionProps) {\n const shown = photos.slice(0, SHOP_LIMITS.photos);\n const bodies: Record<GalleryVariant, React.ReactNode> = {\n mosaic: <Mosaic photos={shown} />,\n filmstrip: <Filmstrip photos={shown} label={label} />,\n wall: <ShopWall photos={shown} notes={notes} sign={sign} texture={texture} label={label} />,\n grid: (\n <MediaGallery\n label={label}\n items={shown.map((p) => ({ id: p.id, src: p.photo.src, alt: p.photo.alt, caption: p.caption, video: p.video, shape: \"wide\" as const }))}\n />\n ),\n };\n const body = bodies[variant];\n return (\n <ShopSection title={title} lead={lead} className={cn(className)} data-variant={variant} {...props}>\n {body}\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAIA,SAAS,oBAAoB;AAC7B,SAAS,YAA2B;AAwDhC,SAEI,KAFJ;AAjBG,SAAS,WAAW,OAA6D;AACtF,QAAM,SAAS,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC;AAC5D,SAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC,GAAG,MAAM;AAC7C,UAAM,MAAM,KAAK,MAAM,IAAI,MAAM;AACjC,UAAM,MAAM,IAAI;AAChB,UAAM,QAAQ,KAAK,IAAI,QAAQ,QAAQ,MAAM,MAAM;AACnD,UAAM,IAAI,UAAU,IAAI,KAAM,OAAO,QAAQ,KAAM;AACnD,QAAI,IAAI,KAAM,MAAM,IAAK;AACzB,QAAI,QAAQ,EAAG,KAAI,SAAS,SAAS,KAAK,IAAK,MAAM,IAAK;AAC1D,WAAO,EAAE,GAAG,GAAG,UAAU,CAAC,MAAM,KAAK,MAAM,KAAK,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC,EAAG;AAAA,EAC1E,CAAC;AACH;AAEA,SAAS,OAAO,EAAE,OAAO,GAAsD;AAC7E,QAAM,CAAC,MAAM,GAAG,IAAI,IAAI;AACxB,MAAI,CAAC,KAAM,QAAO;AAClB,SACE,qBAAC,QAAG,WAAU,kFACZ;AAAA,wBAAC,QAAG,WAAU,wEACZ,8BAAC,SAAM,OAAO,KAAK,OAAO,OAAM,OAAM,OAAM,mCAAkC,WAAU,iCAAgC,GAC1H;AAAA,IACC,KAAK,M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O,oBAAC,QAAK,cAAY,OAAO,OAAc,SAAkB,WAAW,KAAK,KAAK,YAAY,SAAS,GAAG;AAC/G;AAGO,SAAS,eAAe,EAAE,UAAU,UAAU,QAAQ,OAAO,MAAM,OAAO,QAAQ,CAAC,GAAG,MAAM,UAAU,WAAW,WAAW,GAAG,MAAM,GAAwB;AAClK,QAAM,QAAQ,OAAO,MAAM,GAAG,YAAY,MAAM;AAChD,QAAM,SAAkD;AAAA,IACtD,QAAQ,oBAAC,UAAO,QAAQ,OAAO;AAAA,IAC/B,WAAW,oBAAC,aAAU,QAAQ,OAAO,OAAc;AAAA,IACnD,MAAM,oBAAC,YAAS,QAAQ,OAAO,OAAc,MAAY,SAAkB,OAAc;AAAA,IACzF,MACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,KAAK,EAAE,MAAM,KAAK,KAAK,EAAE,MAAM,KAAK,SAAS,EAAE,SAAS,OAAO,EAAE,OAAO,OAAO,OAAgB,EAAE;AAAA;AAAA,IACxI;AAAA,EAEJ;AACA,QAAM,OAAO,OAAO,OAAO;AAC3B,SACE,oBAAC,eAAY,OAAc,MAAY,WAAW,GAAG,SAAS,GAAG,gBAAc,SAAU,GAAG,OACzF,gBACH;AAEJ;","names":[]}
|
package/dist/shop/hero.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/hero/hero.tsx"],"sourcesContent":["// Server-safe (the poster's cover and the TV are client islands imported through their own entries). The first section of\n// a shop page (ADR-007 §3): `poster` (the cover, the name over it), `split` (the title in the frame beside a 4:5 photo),\n// `banner` (a 21:9 photo, the name under it), `tv` (the shop's sign and its latest video in the old TV). The name is the\n// page's `h1` in every variant; the first image is the page's LCP (high priority, a fixed box).\nimport { CoverHero } from \"@krizaka/ui/cover-hero\";\nimport { RetroTv, type RetroTvProps } from \"@krizaka/ui/retro-tv\";\nimport { ShopSign } from \"@krizaka/ui/wall\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../cn\";\nimport { Page } from \"../../page/page\";\nimport type { ShopPhoto } from \"../frame\";\nimport { Photo } from \"../photo\";\n\nexport type HeroVariant = \"poster\" | \"split\" | \"banner\" | \"tv\";\n\nexport type HeroSectionProps = Omit<React.ComponentProps<\"header\">, \"title\"> & {\n /** The drawing. @default \"poster\" */\n variant?: HeroVariant;\n /** The shop's name: the page's `h1`. */\n title: string;\n /** A short mono line above the name (`Saint-Henri · Montréal`). */\n eyebrow?: React.ReactNode;\n /** One line: what the shop promises. */\n lead?: React.ReactNode;\n /** Chips: open now, the area, the score — only what is true now. */\n facts?: React.ReactNode;\n /** The one action (`ButtonLink`, « Book »). */\n actions?: React.ReactNode;\n /** The cover: a photo (16:9), an optional 4:5 crop for a phone, an optional muted loop (`poster`). */\n cover?: ShopPhoto & { phone?: string; video?: { webm?: string; mp4?: string } };\n /** Where the photo is cropped to. @default \"center\" */\n focus?: \"center\" | \"top\" | \"bottom\";\n /** `tv`: the shop's latest video in the cabinet (`src`, `poster`, `label`, or an `EmbedFacade` as `children`). */\n tv?: RetroTvProps;\n};\n\nconst lead = \"m-0 max-w-xl text-base leading-relaxed text-fg-secondary sm:text-lg\";\nconst eyebrowClass = \"m-0 font-mono text-[13px] text-fg-accent\";\n// The weight comes from the preset (`--kz-shop-title-weight`: Young Serif has one, Plus Jakarta Sans 650): `blocks.css`.\nconst titleClass = \"kz-shop-title m-0 font-display text-4xl leading-[1.05] tracking-tight text-fg sm:text-5xl\";\n\nfunction Text({ title, eyebrow, lead: leadText, facts, actions }: Pick<HeroSectionProps, \"title\" | \"eyebrow\" | \"lead\" | \"facts\" | \"actions\"
|
|
1
|
+
{"version":3,"sources":["../../src/shop/hero/hero.tsx"],"sourcesContent":["// Server-safe (the poster's cover and the TV are client islands imported through their own entries). The first section of\n// a shop page (ADR-007 §3): `poster` (the cover, the name over it), `split` (the title in the frame beside a 4:5 photo),\n// `banner` (a 21:9 photo, the name under it), `tv` (the shop's sign and its latest video in the old TV). The name is the\n// page's `h1` in every variant; the first image is the page's LCP (high priority, a fixed box).\nimport { CoverHero } from \"@krizaka/ui/cover-hero\";\nimport { RetroTv, type RetroTvProps } from \"@krizaka/ui/retro-tv\";\nimport { ShopSign } from \"@krizaka/ui/wall\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../cn\";\nimport { Page } from \"../../page/page\";\nimport type { ShopPhoto } from \"../frame\";\nimport { Photo } from \"../photo\";\n\nexport type HeroVariant = \"poster\" | \"split\" | \"banner\" | \"tv\";\n\nexport type HeroSectionProps = Omit<React.ComponentProps<\"header\">, \"title\"> & {\n /** The drawing. @default \"poster\" */\n variant?: HeroVariant;\n /** The shop's name: the page's `h1`. */\n title: string;\n /** A short mono line above the name (`Saint-Henri · Montréal`). */\n eyebrow?: React.ReactNode;\n /** One line: what the shop promises. */\n lead?: React.ReactNode;\n /** Chips: open now, the area, the score — only what is true now. */\n facts?: React.ReactNode;\n /** The one action (`ButtonLink`, « Book »). */\n actions?: React.ReactNode;\n /** The cover: a photo (16:9), an optional 4:5 crop for a phone, an optional muted loop (`poster`). */\n cover?: ShopPhoto & { phone?: string; video?: { webm?: string; mp4?: string } };\n /** Where the photo is cropped to. @default \"center\" */\n focus?: \"center\" | \"top\" | \"bottom\";\n /** `tv`: the shop's latest video in the cabinet (`src`, `poster`, `label`, or an `EmbedFacade` as `children`). */\n tv?: RetroTvProps;\n};\n\nconst lead = \"m-0 max-w-xl text-base leading-relaxed text-fg-secondary sm:text-lg\";\nconst eyebrowClass = \"m-0 font-mono text-[13px] text-fg-accent\";\n// The weight comes from the preset (`--kz-shop-title-weight`: Young Serif has one, Plus Jakarta Sans 650): `blocks.css`.\nconst titleClass = \"kz-shop-title m-0 font-display text-4xl leading-[1.05] tracking-tight text-fg sm:text-5xl\";\n\nfunction Text({ title, eyebrow, lead: leadText, facts, actions }: Readonly<Pick<HeroSectionProps, \"title\" | \"eyebrow\" | \"lead\" | \"facts\" | \"actions\">>) {\n return (\n <div className=\"flex min-w-0 flex-col items-start gap-3\">\n {eyebrow && <p className={eyebrowClass}>{eyebrow}</p>}\n <h1 className={titleClass}>{title}</h1>\n {leadText && <p className={lead}>{leadText}</p>}\n {facts && <div className=\"flex flex-wrap items-center gap-2\">{facts}</div>}\n {actions && <div className=\"flex flex-wrap items-center gap-3 pt-1\">{actions}</div>}\n </div>\n );\n}\n\n/** The first section of a shop page: poster, split, banner or tv. */\nexport function HeroSection({ variant = \"poster\", title, eyebrow, lead: leadText, facts, actions, cover, focus = \"center\", tv, className, ...props }: HeroSectionProps) {\n if (variant === \"poster\") {\n return (\n <CoverHero\n data-first=\"\"\n data-variant=\"poster\"\n className={cn(\"kz-shop-section min-h-[24rem] sm:min-h-[28rem] lg:min-h-[31rem]\", className)}\n cover={cover && { src: cover.src, alt: cover.alt, video: cover.video, phone: cover.phone, focus }}\n eyebrow={eyebrow}\n title={title}\n lead={leadText}\n facts={facts}\n actions={actions}\n {...props}\n />\n );\n }\n const text = <Text title={title} eyebrow={eyebrow} lead={leadText} facts={facts} actions={actions} />;\n if (variant === \"split\") {\n return (\n <header data-first=\"\" data-variant=\"split\" className={cn(\"kz-shop-section\", className)} {...props}>\n <Page>\n <div className=\"grid items-center gap-6 py-6 md:grid-cols-[minmax(0,1fr)_minmax(0,32rem)] md:gap-12 md:py-8\">\n <div className=\"order-2 md:order-1\">{text}</div>\n {cover && <Photo photo={cover} ratio=\"4/5\" priority sizes=\"(min-width: 48rem) 32rem, 100vw\" className=\"order-1 max-h-[26rem] md:order-2 md:max-h-none\" />}\n </div>\n </Page>\n </header>\n );\n }\n if (variant === \"banner\") {\n return (\n <header data-first=\"\" data-variant=\"banner\" className={cn(\"kz-shop-section\", className)} {...props}>\n {cover && (\n <div className=\"mx-auto w-full max-w-[90rem]\">\n <Photo photo={cover} ratio=\"21/9\" priority sizes=\"100vw\" className=\"rounded-none aspect-[3/2] sm:aspect-[21/9]\" />\n </div>\n )}\n <Page>\n <div className=\"py-6\">{text}</div>\n </Page>\n </header>\n );\n }\n return (\n <header data-first=\"\" data-variant=\"tv\" className={cn(\"kz-shop-section\", className)} {...props}>\n <Page>\n <div className=\"grid items-center gap-6 py-6 md:grid-cols-[minmax(0,1fr)_17rem] md:gap-12 md:py-8\">\n <div className=\"flex min-w-0 flex-col items-start gap-4\">\n <ShopSign as=\"h1\" variant=\"neon\">{title}</ShopSign>\n {leadText && <p className={lead}>{leadText}</p>}\n {facts && <div className=\"flex flex-wrap items-center gap-2\">{facts}</div>}\n {actions && <div className=\"flex flex-wrap items-center gap-3 pt-1\">{actions}</div>}\n </div>\n {tv && <RetroTv {...tv} className={cn(\"mx-auto w-56 md:w-full\", tv.className)} />}\n </div>\n </Page>\n </header>\n );\n}\n"],"mappings":";;;;;;;;;AAIA,SAAS,iBAAiB;AAC1B,SAAS,eAAkC;AAC3C,SAAS,gBAAgB;AAsCrB,SACc,KADd;AAPJ,IAAM,OAAO;AACb,IAAM,eAAe;AAErB,IAAM,aAAa;AAEnB,SAAS,KAAK,EAAE,OAAO,SAAS,MAAM,UAAU,OAAO,QAAQ,GAAyF;AACtJ,SACE,qBAAC,SAAI,WAAU,2CACZ;AAAA,eAAW,oBAAC,OAAE,WAAW,cAAe,mBAAQ;AAAA,IACjD,oBAAC,QAAG,WAAW,YAAa,iBAAM;AAAA,IACjC,YAAY,oBAAC,OAAE,WAAW,MAAO,oBAAS;AAAA,IAC1C,SAAS,oBAAC,SAAI,WAAU,qCAAqC,iBAAM;AAAA,IACnE,WAAW,oBAAC,SAAI,WAAU,0CAA0C,mBAAQ;AAAA,KAC/E;AAEJ;AAGO,SAAS,YAAY,EAAE,UAAU,UAAU,OAAO,SAAS,MAAM,UAAU,OAAO,SAAS,OAAO,QAAQ,UAAU,IAAI,WAAW,GAAG,MAAM,GAAqB;AACtK,MAAI,YAAY,UAAU;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,gBAAa;AAAA,QACb,WAAW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AAAA,MAC1C,SAAS,oBAAC,SAAI,WAAU,qCAAqC,iBAAM;AAAA,MACnE,WAAW,oBAAC,SAAI,WAAU,0CAA0C,mBAAQ;AAAA,OAC/E;AAAA,IACC,MAAM,oBAAC,WAAS,GAAG,IAAI,WAAW,GAAG,0BAA0B,GAAG,SAAS,GAAG;AAAA,KACjF,GACF,GACF;AAEJ;","names":[]}
|
package/dist/shop/look.d.ts
CHANGED
|
@@ -34,10 +34,10 @@ declare function mascotFor(section: Pick<Section, "type" | "variant">, look: {
|
|
|
34
34
|
mascots?: string;
|
|
35
35
|
} | undefined): MascotBird | undefined;
|
|
36
36
|
/** The bird, small, in the brand's accent: decorative (`aria-hidden`), the words stay beside it. */
|
|
37
|
-
declare function ShopMascot({ bird, size }: {
|
|
37
|
+
declare function ShopMascot({ bird, size }: Readonly<{
|
|
38
38
|
bird: MascotBird;
|
|
39
39
|
size?: number;
|
|
40
|
-
}): React.JSX.Element;
|
|
40
|
+
}>): React.JSX.Element;
|
|
41
41
|
|
|
42
42
|
export { MASCOT_SLOTS, SHOP_LOOKS, ShopMascot, applyLook, mascotFor, shopLookOf };
|
|
43
43
|
export type { ShopLookLike };
|
package/dist/shop/look.js
CHANGED
package/dist/shop/look.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/look/apply-look.ts","../../src/shop/look/mascots.tsx"],"sourcesContent":["// Pure. A look (`look-*` of @krizaka/tokens, folioviv#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 (folioviv#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,WAAW,CAAC,WAAW,QAAQ,IAAI,GAAG,SAAS,OAAO,EAAG,QAAO;AACpG,MAAI,QAAQ,SAAS,aAAa,CAAC,kBAAkB,IAAI,QAAQ,OAAO,EAAG,QAAO;AAClF,SAAO,EAAE,GAAG,SAAS,QAAQ;AAC/B;AAMO,SAAS,UAAU,MAAgB,MAA8B;AACtE,QAAM,WAAW,KAAK,SAAS,IAAI,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC;AAC1D,QAAM,OAAO,KAAK,OAAO,OAAO,KAAK,MAAM,KAAK,OAAO,YAAY,KAAK,WAAW,KAAK,YAAY,UAAa,KAAK,WAAW,UAAa,SAAS,MAAM,CAAC,GAAG,MAAM,MAAM,KAAK,SAAS,CAAC,CAAC;AAC7L,MAAI,KAAM,QAAO;AACjB,SAAO,EAAE,GAAG,MAAM,QAAQ,EAAE,IAAI,KAAK,IAAI,SAAS,KAAK,QAAQ,GAAG,SAAS,QAAW,QAAQ,QAAW,SAAS;AACpH;;;ACtCA,SAAS,cAA+B;AAwB/B;AAlBF,IAAM,eAAe;AAAA,EAC1B,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AAAA,EACL,mBAAmB;AACrB;AAGO,SAAS,UAAU,SAA4C,MAAgE;AACpI,MAAI,MAAM,YAAY,KAAM,QAAO;AACnC,QAAM,QAAQ;AACd,SAAO,MAAM,GAAG,QAAQ,IAAI,IAAI,QAAQ,OAAO,EAAE,MAAM,QAAQ,SAAS,YAAY,SAAY,MAAM,QAAQ,IAAI;AACpH;AAGO,SAAS,WAAW,EAAE,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../src/shop/look/apply-look.ts","../../src/shop/look/mascots.tsx"],"sourcesContent":["// Pure. A look (`look-*` of @krizaka/tokens, folioviv#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 (folioviv#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 }: Readonly<{ 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,WAAW,CAAC,WAAW,QAAQ,IAAI,GAAG,SAAS,OAAO,EAAG,QAAO;AACpG,MAAI,QAAQ,SAAS,aAAa,CAAC,kBAAkB,IAAI,QAAQ,OAAO,EAAG,QAAO;AAClF,SAAO,EAAE,GAAG,SAAS,QAAQ;AAC/B;AAMO,SAAS,UAAU,MAAgB,MAA8B;AACtE,QAAM,WAAW,KAAK,SAAS,IAAI,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC;AAC1D,QAAM,OAAO,KAAK,OAAO,OAAO,KAAK,MAAM,KAAK,OAAO,YAAY,KAAK,WAAW,KAAK,YAAY,UAAa,KAAK,WAAW,UAAa,SAAS,MAAM,CAAC,GAAG,MAAM,MAAM,KAAK,SAAS,CAAC,CAAC;AAC7L,MAAI,KAAM,QAAO;AACjB,SAAO,EAAE,GAAG,MAAM,QAAQ,EAAE,IAAI,KAAK,IAAI,SAAS,KAAK,QAAQ,GAAG,SAAS,QAAW,QAAQ,QAAW,SAAS;AACpH;;;ACtCA,SAAS,cAA+B;AAwB/B;AAlBF,IAAM,eAAe;AAAA,EAC1B,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AAAA,EACL,mBAAmB;AACrB;AAGO,SAAS,UAAU,SAA4C,MAAgE;AACpI,MAAI,MAAM,YAAY,KAAM,QAAO;AACnC,QAAM,QAAQ;AACd,SAAO,MAAM,GAAG,QAAQ,IAAI,IAAI,QAAQ,OAAO,EAAE,MAAM,QAAQ,SAAS,YAAY,SAAY,MAAM,QAAQ,IAAI;AACpH;AAGO,SAAS,WAAW,EAAE,MAAM,OAAO,GAAG,GAAkD;AAC7F,SAAO,oBAAC,UAAO,MAAY,MAAK,SAAQ,MAAY,MAAI,MAAC,eAAW,MAAC;AACvE;","names":[]}
|
package/dist/shop/map-gate.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ type MapGateProps = {
|
|
|
16
16
|
className?: string;
|
|
17
17
|
};
|
|
18
18
|
/** The place as a still, the live map on a click — or at once on a screen that can afford it. */
|
|
19
|
-
declare function MapGate({ label, center, zoom, places, showLabel, map, className }: MapGateProps): React.JSX.Element;
|
|
19
|
+
declare function MapGate({ label, center, zoom, places, showLabel, map, className }: Readonly<MapGateProps>): React.JSX.Element;
|
|
20
20
|
|
|
21
21
|
export { MapGate };
|
|
22
22
|
export type { MapGateProps };
|
package/dist/shop/map-gate.js
CHANGED
|
@@ -6,13 +6,13 @@ import * as React from "react";
|
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
var WIDE = "(min-width: 40rem)";
|
|
8
8
|
function subscribeWide(notify) {
|
|
9
|
-
const q =
|
|
9
|
+
const q = globalThis.matchMedia(WIDE);
|
|
10
10
|
q.addEventListener("change", notify);
|
|
11
11
|
return () => q.removeEventListener("change", notify);
|
|
12
12
|
}
|
|
13
13
|
function MapGate({ label, center, zoom = 14, places, showLabel, map, className }) {
|
|
14
14
|
const [asked, setAsked] = React.useState(false);
|
|
15
|
-
const wide = React.useSyncExternalStore(subscribeWide, () =>
|
|
15
|
+
const wide = React.useSyncExternalStore(subscribeWide, () => globalThis.matchMedia(WIDE).matches, () => false);
|
|
16
16
|
const live = asked || wide;
|
|
17
17
|
const still = /* @__PURE__ */ jsx(StaticMap, { label, center, zoom, places });
|
|
18
18
|
return /* @__PURE__ */ jsx("div", { className, "data-live": live ? "" : void 0, children: /* @__PURE__ */ jsxs("div", { className: "relative aspect-[4/3] w-full overflow-hidden rounded-xl border border-border-default sm:aspect-[16/9]", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/map-gate/map-gate.tsx"],"sourcesContent":["\"use client\";\n\n// A map behind a button on a phone (ADR-007 §3, §7). Until it is asked for, the page holds a still drawing of the place\n// (SVG, nothing requested) and a button: no engine, no tile, no request. From `sm` up the live map shows at once, because a\n// laptop can afford it. The tiles are the Krizaka CDN's: no third party.\nimport { Map as LiveMap, type MapProps, StaticMap, type StaticMapProps } from \"@krizaka/ui/map\";\nimport * as React from \"react\";\n\nexport type MapGateProps = {\n /** The map's accessible name (`Where the salon is`). */\n label: string;\n /** Longitude, latitude. */\n center: StaticMapProps[\"center\"];\n zoom?: number;\n /** Places drawn on the still and listed in its name. */\n places?: StaticMapProps[\"places\"];\n /** The button's words (`Show the map`). */\n showLabel: string;\n /** More props of the live map (`brand`, `lang`, `labels`). Its `className` replaces the default `h-full w-full`: the map fills the gate's frame. */\n map?: Partial<Omit<MapProps, \"label\" | \"center\" | \"zoom\" | \"fallback\">>;\n className?: string;\n};\n\nconst WIDE = \"(min-width: 40rem)\";\nfunction subscribeWide(notify: () => void) {\n const q =
|
|
1
|
+
{"version":3,"sources":["../../src/shop/map-gate/map-gate.tsx"],"sourcesContent":["\"use client\";\n\n// A map behind a button on a phone (ADR-007 §3, §7). Until it is asked for, the page holds a still drawing of the place\n// (SVG, nothing requested) and a button: no engine, no tile, no request. From `sm` up the live map shows at once, because a\n// laptop can afford it. The tiles are the Krizaka CDN's: no third party.\nimport { Map as LiveMap, type MapProps, StaticMap, type StaticMapProps } from \"@krizaka/ui/map\";\nimport * as React from \"react\";\n\nexport type MapGateProps = {\n /** The map's accessible name (`Where the salon is`). */\n label: string;\n /** Longitude, latitude. */\n center: StaticMapProps[\"center\"];\n zoom?: number;\n /** Places drawn on the still and listed in its name. */\n places?: StaticMapProps[\"places\"];\n /** The button's words (`Show the map`). */\n showLabel: string;\n /** More props of the live map (`brand`, `lang`, `labels`). Its `className` replaces the default `h-full w-full`: the map fills the gate's frame. */\n map?: Partial<Omit<MapProps, \"label\" | \"center\" | \"zoom\" | \"fallback\">>;\n className?: string;\n};\n\nconst WIDE = \"(min-width: 40rem)\";\nfunction subscribeWide(notify: () => void) {\n const q = globalThis.matchMedia(WIDE);\n q.addEventListener(\"change\", notify);\n return () => q.removeEventListener(\"change\", notify);\n}\n\n/** The place as a still, the live map on a click — or at once on a screen that can afford it. */\nexport function MapGate({ label, center, zoom = 14, places, showLabel, map, className }: Readonly<MapGateProps>) {\n const [asked, setAsked] = React.useState(false);\n // A screen that can afford it shows the live map at once; the server and a phone start with the still.\n const wide = React.useSyncExternalStore(subscribeWide, () => globalThis.matchMedia(WIDE).matches, () => false);\n const live = asked || wide;\n const still = <StaticMap label={label} center={center} zoom={zoom} places={places} />;\n return (\n <div className={className} data-live={live ? \"\" : undefined}>\n <div className=\"relative aspect-[4/3] w-full overflow-hidden rounded-xl border border-border-default sm:aspect-[16/9]\">\n {live ? <LiveMap label={label} center={center} zoom={zoom} fallback={still} {...map} className={map?.className ?? \"h-full w-full\"} /> : still}\n {!live && (\n <button\n type=\"button\"\n onClick={() => setAsked(true)}\n className=\"absolute bottom-3 left-3 inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-1 px-4 text-sm font-semibold text-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\"\n >\n {showLabel}\n </button>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;AAKA,SAAS,OAAO,SAAwB,iBAAsC;AAC9E,YAAY,WAAW;AA8BP,cAGV,YAHU;AAbhB,IAAM,OAAO;AACb,SAAS,cAAc,QAAoB;AACzC,QAAM,IAAI,WAAW,WAAW,IAAI;AACpC,IAAE,iBAAiB,UAAU,MAAM;AACnC,SAAO,MAAM,EAAE,oBAAoB,UAAU,MAAM;AACrD;AAGO,SAAS,QAAQ,EAAE,OAAO,QAAQ,OAAO,IAAI,QAAQ,WAAW,KAAK,UAAU,GAA2B;AAC/G,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAS,KAAK;AAE9C,QAAM,OAAa,2BAAqB,eAAe,MAAM,WAAW,WAAW,IAAI,EAAE,SAAS,MAAM,KAAK;AAC7G,QAAM,OAAO,SAAS;AACtB,QAAM,QAAQ,oBAAC,aAAU,OAAc,QAAgB,MAAY,QAAgB;AACnF,SACE,oBAAC,SAAI,WAAsB,aAAW,OAAO,KAAK,QAChD,+BAAC,SAAI,WAAU,yGACZ;AAAA,WAAO,oBAAC,WAAQ,OAAc,QAAgB,MAAY,UAAU,OAAQ,GAAG,KAAK,WAAW,KAAK,aAAa,iBAAiB,IAAK;AAAA,IACvI,CAAC,QACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS,MAAM,SAAS,IAAI;AAAA,QAC5B,WAAU;AAAA,QAET;AAAA;AAAA,IACH;AAAA,KAEJ,GACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shop/services/services.tsx"],"sourcesContent":["// 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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UAAU,SAAS,MAAM,GAAG,YAAY,KAAK,IAAI;AAC3E,WAAO,oBAAC,SAAI,WAAU,wDAAwD,gBAAM,IAAI,CAAC,GAAG,MAAM,KAAK,GAAG,GAAG,QAAQ,CAAC,GAAE;AAAA,EAC1H;AACA,SACE,oBAAC,eAAY,OAAc,MAAY,WAAsB,gBAAc,SAAU,GAAG,OACrF,gBACH;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/shop/services/services.tsx"],"sourcesContent":["// 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 }: Readonly<{ 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"],"mappings":";;;;;;;;;;;;;;;;;AAKA,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,YAAY,WAAW;AA+Ef,cAOE,YAPF;AAnBR,IAAM,aAAa;AAEnB,SAAS,SAAS,UAAkC,IAAyB;AAC3E,MAAI,OAAO,OAAQ,QAAO,CAAC,EAAE,MAAM,QAAiC,OAAO,SAAS,CAAC;AACrF,QAAM,SAA+D,CAAC;AACtE,aAAW,KAAK,UAAU;AACxB,UAAM,OAAO,EAAE;AACf,UAAM,QAAQ,OAAO,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI;AAChD,QAAI,MAAO,OAAM,MAAM,KAAK,CAAC;AAAA,QACxB,QAAO,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC;AAAA,EACvC;AACA,SAAO;AACT;AAEA,SAAS,QAAQ,EAAE,SAAS,aAAa,cAAc,OAAO,GAA0G;AACtK,QAAM,QAAQ,CAAC,QAAQ,UAAU,QAAQ,QAAQ,EAAE,OAAO,OAAO,EAAE,KAAK,QAAK;AAC7E,SACE,qBAAC,QAAG,WAAU,gFAA+E,gBAAc,QAAQ,IAChH;AAAA,YAAQ,SACP,oBAAC,SAAM,OAAO,QAAQ,OAAO,OAAM,OAAM,OAAM,QAAO,WAAU,iDAAgD;AAAA,IAElH,qBAAC,SAAI,WAAU,kBACb;AAAA,2BAAC,SAAI,WAAU,6BACb;AAAA,4BAAC,QAAG,WAAU,uEAAuE,kBAAQ,MAAK;AAAA,QACjG,QAAQ,WAAW,oBAAC,SAAM,MAAK,UAAS,MAAK,MAAK,WAAU,8CAA8C,wBAAa;AAAA,QACxH,oBAAC,UAAK,eAAW,MAAC,WAAU,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,sKAChH,mBAAS,IAAI,CAAC,GAAG,MAAM,KAAK,GAAG,GAAG,+CAA+C,CAAC,GACrF;AAAA,EAEJ,OAAO;AACL,UAAM,QAAQ,YAAY,UAAU,SAAS,MAAM,GAAG,YAAY,KAAK,IAAI;AAC3E,WAAO,oBAAC,SAAI,WAAU,wDAAwD,gBAAM,IAAI,CAAC,GAAG,MAAM,KAAK,GAAG,GAAG,QAAQ,CAAC,GAAE;AAAA,EAC1H;AACA,SACE,oBAAC,eAAY,OAAc,MAAY,WAAsB,gBAAc,SAAU,GAAG,OACrF,gBACH;AAEJ;","names":[]}
|
package/dist/shop-composer.d.ts
CHANGED
|
@@ -15,20 +15,20 @@ type ParsedSection<T extends string, V extends string, S extends Shape, B extend
|
|
|
15
15
|
key: string;
|
|
16
16
|
type: T;
|
|
17
17
|
variant: V;
|
|
18
|
-
disabled?: boolean
|
|
18
|
+
disabled?: boolean;
|
|
19
19
|
settings: z.output<S>;
|
|
20
20
|
text?: {
|
|
21
|
-
title?: z.output<typeof localizedText
|
|
22
|
-
lead?: z.output<typeof localizedText
|
|
23
|
-
}
|
|
21
|
+
title?: z.output<typeof localizedText>;
|
|
22
|
+
lead?: z.output<typeof localizedText>;
|
|
23
|
+
};
|
|
24
24
|
blocks?: {
|
|
25
25
|
[K in keyof B & string]: {
|
|
26
26
|
key: string;
|
|
27
27
|
type: K;
|
|
28
28
|
settings: z.output<B[K]>;
|
|
29
|
-
text?: Record<string, z.output<typeof localizedText
|
|
29
|
+
text?: Record<string, z.output<typeof localizedText>>;
|
|
30
30
|
};
|
|
31
|
-
}[keyof B & string][]
|
|
31
|
+
}[keyof B & string][];
|
|
32
32
|
};
|
|
33
33
|
type SectionSpec<T extends string, V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes> = {
|
|
34
34
|
/** The type's name: the `type` of a section. */
|
|
@@ -194,8 +194,8 @@ type Section = z.output<(typeof SECTION_DEFINITIONS)[number]["schema"]>;
|
|
|
194
194
|
type ShopPage = {
|
|
195
195
|
schema: typeof SHOP_SCHEMA_VERSION;
|
|
196
196
|
preset: z.output<typeof presetRef>;
|
|
197
|
-
density?: "compact" | "airy"
|
|
198
|
-
accent?: string
|
|
197
|
+
density?: "compact" | "airy";
|
|
198
|
+
accent?: string;
|
|
199
199
|
sections: Section[];
|
|
200
200
|
};
|
|
201
201
|
|
|
@@ -452,7 +452,7 @@ type ShopComposerProps = {
|
|
|
452
452
|
className?: string;
|
|
453
453
|
};
|
|
454
454
|
/** The shop composer. */
|
|
455
|
-
declare function ShopComposer({ value, resetKey, onChange, onPublish, onDiscard, published, previewUrl, presets, foldedTypes, messages, className }: ShopComposerProps): React.JSX.Element;
|
|
455
|
+
declare function ShopComposer({ value, resetKey, onChange, onPublish, onDiscard, published, previewUrl, presets, foldedTypes, messages, className }: Readonly<ShopComposerProps>): React.JSX.Element;
|
|
456
456
|
|
|
457
457
|
type FieldSpec = {
|
|
458
458
|
name: string;
|
|
@@ -513,7 +513,7 @@ type SectionThumbnailProps = {
|
|
|
513
513
|
density?: "compact" | "airy";
|
|
514
514
|
};
|
|
515
515
|
/** A picture of a section: 160 × 96 px of a 960 px page, inert and hidden from assistive technology. */
|
|
516
|
-
declare function SectionThumbnail({ type, variant, preset, density }: SectionThumbnailProps): React.JSX.Element;
|
|
516
|
+
declare function SectionThumbnail({ type, variant, preset, density }: Readonly<SectionThumbnailProps>): React.JSX.Element;
|
|
517
517
|
|
|
518
518
|
export { AUTOSAVE_MS, HISTORY_LIMIT, SectionThumbnail, ShopComposer, applyCommand, canRedo, canUndo, createHistory, defaultShopComposerMessages, describeSettings, diffPages, fill, moved, newKey, redo, run, undo };
|
|
519
519
|
export type { Command, DiffEntry, FieldSpec, History, SectionThumbnailProps, ShopComposerMessages, ShopComposerPreset, ShopComposerProps };
|