@krizaka/ui 3.64.0 → 3.64.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/app-header.d.ts +3 -3
- package/dist/blocks.css +41 -0
- package/dist/chunk-5D7NMUF6.js +35 -0
- package/dist/chunk-5D7NMUF6.js.map +1 -0
- package/dist/chunk-A7MQPIEG.js +31 -0
- package/dist/chunk-A7MQPIEG.js.map +1 -0
- package/dist/chunk-B47WSPMP.js +60 -0
- package/dist/chunk-B47WSPMP.js.map +1 -0
- package/dist/chunk-HKEAYSFS.js +19 -0
- package/dist/chunk-HKEAYSFS.js.map +1 -0
- package/dist/chunk-ZYHWJ7U5.js +20 -0
- package/dist/chunk-ZYHWJ7U5.js.map +1 -0
- package/dist/cover-hero.d.ts +4 -0
- package/dist/cover-hero.js +5 -2
- package/dist/cover-hero.js.map +1 -1
- package/dist/file-upload.d.ts +2 -2
- package/dist/frame-D6Xv83t8.d.ts +52 -0
- package/dist/language-switch.d.ts +9 -9
- package/dist/service-card.d.ts +25 -1
- package/dist/service-card.js +7 -3
- package/dist/service-card.js.map +1 -1
- package/dist/shop/booking.d.ts +36 -0
- package/dist/shop/booking.js +37 -0
- package/dist/shop/booking.js.map +1 -0
- package/dist/shop/bulletin.d.ts +28 -0
- package/dist/shop/bulletin.js +29 -0
- package/dist/shop/bulletin.js.map +1 -0
- package/dist/shop/demo.d.ts +135 -0
- package/dist/shop/demo.js +141 -0
- package/dist/shop/demo.js.map +1 -0
- package/dist/shop/faq.d.ts +20 -0
- package/dist/shop/faq.js +33 -0
- package/dist/shop/faq.js.map +1 -0
- package/dist/shop/gallery.d.ts +46 -0
- package/dist/shop/gallery.js +76 -0
- package/dist/shop/gallery.js.map +1 -0
- package/dist/shop/hero.d.ts +36 -0
- package/dist/shop/hero.js +70 -0
- package/dist/shop/hero.js.map +1 -0
- package/dist/shop/map-gate.d.ts +22 -0
- package/dist/shop/map-gate.js +34 -0
- package/dist/shop/map-gate.js.map +1 -0
- package/dist/shop/policies.d.ts +18 -0
- package/dist/shop/policies.js +16 -0
- package/dist/shop/policies.js.map +1 -0
- package/dist/shop/reviews.d.ts +25 -0
- package/dist/shop/reviews.js +47 -0
- package/dist/shop/reviews.js.map +1 -0
- package/dist/shop/services.d.ts +57 -0
- package/dist/shop/services.js +118 -0
- package/dist/shop/services.js.map +1 -0
- package/dist/shop/social.d.ts +27 -0
- package/dist/shop/social.js +27 -0
- package/dist/shop/social.js.map +1 -0
- package/dist/shop/story.d.ts +24 -0
- package/dist/shop/story.js +26 -0
- package/dist/shop/story.js.map +1 -0
- package/dist/shop/team.d.ts +24 -0
- package/dist/shop/team.js +26 -0
- package/dist/shop/team.js.map +1 -0
- package/dist/shop/video.d.ts +40 -0
- package/dist/shop/video.js +33 -0
- package/dist/shop/video.js.map +1 -0
- package/dist/shop/visit.d.ts +29 -0
- package/dist/shop/visit.js +38 -0
- package/dist/shop/visit.js.map +1 -0
- package/dist/shop-composer.d.ts +490 -0
- package/dist/shop-composer.js +2061 -0
- package/dist/shop-composer.js.map +1 -0
- package/dist/shop.d.ts +316 -0
- package/dist/shop.js +389 -0
- package/dist/shop.js.map +1 -0
- package/package.json +261 -3
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +2 -2
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/shop/booking-panel.d.ts +4 -0
- package/registry/examples/shop/booking-panel.js +12 -0
- package/registry/examples/shop/booking-panel.tsx +11 -0
- package/registry/examples/shop/booking-sticky.d.ts +4 -0
- package/registry/examples/shop/booking-sticky.js +15 -0
- package/registry/examples/shop/booking-sticky.tsx +12 -0
- package/registry/examples/shop/booking-strip.d.ts +4 -0
- package/registry/examples/shop/booking-strip.js +13 -0
- package/registry/examples/shop/booking-strip.tsx +12 -0
- package/registry/examples/shop/bulletin-banner.d.ts +4 -0
- package/registry/examples/shop/bulletin-banner.js +13 -0
- package/registry/examples/shop/bulletin-banner.tsx +12 -0
- package/registry/examples/shop/bulletin-board.d.ts +4 -0
- package/registry/examples/shop/bulletin-board.js +13 -0
- package/registry/examples/shop/bulletin-board.tsx +12 -0
- package/registry/examples/shop/cards.d.ts +4 -0
- package/registry/examples/shop/cards.js +13 -0
- package/registry/examples/shop/cards.tsx +12 -0
- package/registry/examples/shop/carousel.d.ts +4 -0
- package/registry/examples/shop/carousel.js +13 -0
- package/registry/examples/shop/carousel.tsx +12 -0
- package/registry/examples/shop/document.d.ts +4 -0
- package/registry/examples/shop/document.js +20 -0
- package/registry/examples/shop/document.tsx +13 -0
- package/registry/examples/shop/faq.d.ts +4 -0
- package/registry/examples/shop/faq.js +13 -0
- package/registry/examples/shop/faq.tsx +12 -0
- package/registry/examples/shop/gallery-filmstrip.d.ts +4 -0
- package/registry/examples/shop/gallery-filmstrip.js +13 -0
- package/registry/examples/shop/gallery-filmstrip.tsx +12 -0
- package/registry/examples/shop/gallery-grid.d.ts +4 -0
- package/registry/examples/shop/gallery-grid.js +13 -0
- package/registry/examples/shop/gallery-grid.tsx +12 -0
- package/registry/examples/shop/gallery-mosaic.d.ts +4 -0
- package/registry/examples/shop/gallery-mosaic.js +13 -0
- package/registry/examples/shop/gallery-mosaic.tsx +12 -0
- package/registry/examples/shop/gallery-wall.d.ts +4 -0
- package/registry/examples/shop/gallery-wall.js +13 -0
- package/registry/examples/shop/gallery-wall.tsx +12 -0
- package/registry/examples/shop/hero-banner.d.ts +4 -0
- package/registry/examples/shop/hero-banner.js +15 -0
- package/registry/examples/shop/hero-banner.tsx +14 -0
- package/registry/examples/shop/hero-poster.d.ts +4 -0
- package/registry/examples/shop/hero-poster.js +15 -0
- package/registry/examples/shop/hero-poster.tsx +14 -0
- package/registry/examples/shop/hero-split.d.ts +4 -0
- package/registry/examples/shop/hero-split.js +15 -0
- package/registry/examples/shop/hero-split.tsx +14 -0
- package/registry/examples/shop/hero-tv.d.ts +4 -0
- package/registry/examples/shop/hero-tv.js +15 -0
- package/registry/examples/shop/hero-tv.tsx +14 -0
- package/registry/examples/shop/index.d.ts +4 -0
- package/registry/examples/shop/index.js +13 -0
- package/registry/examples/shop/index.tsx +12 -0
- package/registry/examples/shop/menu-columns.d.ts +4 -0
- package/registry/examples/shop/menu-columns.js +13 -0
- package/registry/examples/shop/menu-columns.tsx +12 -0
- package/registry/examples/shop/menu.d.ts +4 -0
- package/registry/examples/shop/menu.js +25 -0
- package/registry/examples/shop/menu.tsx +21 -0
- package/registry/examples/shop/page.d.ts +4 -0
- package/registry/examples/shop/page.js +32 -0
- package/registry/examples/shop/page.tsx +27 -0
- package/registry/examples/shop/policies.d.ts +4 -0
- package/registry/examples/shop/policies.js +13 -0
- package/registry/examples/shop/policies.tsx +12 -0
- package/registry/examples/shop/reviews-quote.d.ts +4 -0
- package/registry/examples/shop/reviews-quote.js +13 -0
- package/registry/examples/shop/reviews-quote.tsx +12 -0
- package/registry/examples/shop/reviews-strip.d.ts +4 -0
- package/registry/examples/shop/reviews-strip.js +13 -0
- package/registry/examples/shop/reviews-strip.tsx +12 -0
- package/registry/examples/shop/reviews-summary-cards.d.ts +4 -0
- package/registry/examples/shop/reviews-summary-cards.js +13 -0
- package/registry/examples/shop/reviews-summary-cards.tsx +12 -0
- package/registry/examples/shop/social-facade.d.ts +4 -0
- package/registry/examples/shop/social-facade.js +13 -0
- package/registry/examples/shop/social-facade.tsx +12 -0
- package/registry/examples/shop/social-links.d.ts +4 -0
- package/registry/examples/shop/social-links.js +12 -0
- package/registry/examples/shop/social-links.tsx +11 -0
- package/registry/examples/shop/story-owner.d.ts +4 -0
- package/registry/examples/shop/story-owner.js +13 -0
- package/registry/examples/shop/story-owner.tsx +12 -0
- package/registry/examples/shop/story-quote.d.ts +4 -0
- package/registry/examples/shop/story-quote.js +13 -0
- package/registry/examples/shop/story-quote.tsx +12 -0
- package/registry/examples/shop/team-cards.d.ts +4 -0
- package/registry/examples/shop/team-cards.js +13 -0
- package/registry/examples/shop/team-cards.tsx +12 -0
- package/registry/examples/shop/team-row.d.ts +4 -0
- package/registry/examples/shop/team-row.js +13 -0
- package/registry/examples/shop/team-row.tsx +12 -0
- package/registry/examples/shop/video-shorts.d.ts +4 -0
- package/registry/examples/shop/video-shorts.js +14 -0
- package/registry/examples/shop/video-shorts.tsx +13 -0
- package/registry/examples/shop/video-tv.d.ts +4 -0
- package/registry/examples/shop/video-tv.js +13 -0
- package/registry/examples/shop/video-tv.tsx +12 -0
- package/registry/examples/shop/visit-card.d.ts +4 -0
- package/registry/examples/shop/visit-card.js +13 -0
- package/registry/examples/shop/visit-card.tsx +12 -0
- package/registry/examples/shop/visit-map.d.ts +4 -0
- package/registry/examples/shop/visit-map.js +13 -0
- package/registry/examples/shop/visit-map.tsx +12 -0
- package/registry/examples/shop/visit-split.d.ts +4 -0
- package/registry/examples/shop/visit-split.js +13 -0
- package/registry/examples/shop/visit-split.tsx +12 -0
- package/registry/examples/shop-composer/composer.d.ts +4 -0
- package/registry/examples/shop-composer/composer.js +17 -0
- package/registry/examples/shop-composer/composer.tsx +21 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +96 -6
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +24 -6
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +424 -0
- package/registry/shop.json +776 -0
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/wall.json +3 -3
- package/registry/waveform.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shop/faq/faq.tsx"],"sourcesContent":["// Server-safe. The questions clients ask (ADR-007 §3): a native `details` each — no script — and the page's FAQPage\n// JSON-LD, so a search engine reads the same answers.\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type ShopQuestion = { id: string; question: string; answer: string };\n\nexport type FaqSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"list\" */\n variant?: \"list\";\n title: React.ReactNode;\n questions: readonly ShopQuestion[];\n};\n\n/** The FAQPage structured data of a list of questions, as a JSON string safe inside a `script`. */\nexport function faqJsonLd(questions: readonly ShopQuestion[]): string {\n const data = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"FAQPage\",\n mainEntity: questions.map((q) => ({ \"@type\": \"Question\", name: q.question, acceptedAnswer: { \"@type\": \"Answer\", text: q.answer } })),\n };\n return JSON.stringify(data).replace(/</g, \"\\\\u003c\");\n}\n\n/** The questions and their answers. */\nexport function FaqSection({ title, questions, className, ...props }: FaqSectionProps) {\n if (questions.length === 0) return null;\n return (\n <ShopSection title={title} className={className} data-variant=\"list\" {...props}>\n <div className=\"max-w-3xl divide-y divide-border-subtle border-y border-border-subtle\">\n {questions.map((q) => (\n <details key={q.id} className=\"group py-3\">\n <summary className=\"flex min-h-11 cursor-pointer list-none items-center justify-between gap-4 font-semibold text-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden\">\n {q.question}\n <span aria-hidden className=\"shrink-0 text-fg-secondary transition-transform group-open:rotate-45 motion-reduce:transition-none\">+</span>\n </summary>\n <p className=\"m-0 mt-2 text-[15px] leading-relaxed text-fg-secondary\">{q.answer}</p>\n </details>\n ))}\n </div>\n <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: faqJsonLd(questions) }} />\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAiCY,SAEE,KAFF;AAjBL,SAAS,UAAU,WAA4C;AACpE,QAAM,OAAO;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,YAAY,UAAU,IAAI,CAAC,OAAO,EAAE,SAAS,YAAY,MAAM,EAAE,UAAU,gBAAgB,EAAE,SAAS,UAAU,MAAM,EAAE,OAAO,EAAE,EAAE;AAAA,EACrI;AACA,SAAO,KAAK,UAAU,IAAI,EAAE,QAAQ,MAAM,SAAS;AACrD;AAGO,SAAS,WAAW,EAAE,OAAO,WAAW,WAAW,GAAG,MAAM,GAAoB;AACrF,MAAI,UAAU,WAAW,EAAG,QAAO;AACnC,SACE,qBAAC,eAAY,OAAc,WAAsB,gBAAa,QAAQ,GAAG,OACvE;AAAA,wBAAC,SAAI,WAAU,yEACZ,oBAAU,IAAI,CAAC,MACd,qBAAC,aAAmB,WAAU,cAC5B;AAAA,2BAAC,aAAQ,WAAU,wNAChB;AAAA,UAAE;AAAA,QACH,oBAAC,UAAK,eAAW,MAAC,WAAU,sGAAqG,eAAC;AAAA,SACpI;AAAA,MACA,oBAAC,OAAE,WAAU,0DAA0D,YAAE,QAAO;AAAA,SALpE,EAAE,EAMhB,CACD,GACH;AAAA,IACA,oBAAC,YAAO,MAAK,uBAAsB,yBAAyB,EAAE,QAAQ,UAAU,SAAS,EAAE,GAAG;AAAA,KAChG;AAEJ;","names":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ShopPhoto } from '../shop.js';
|
|
3
|
+
|
|
4
|
+
type GalleryVariant = "mosaic" | "filmstrip" | "wall" | "grid";
|
|
5
|
+
type ShopGalleryPhoto = {
|
|
6
|
+
id: string;
|
|
7
|
+
photo: ShopPhoto;
|
|
8
|
+
caption?: string;
|
|
9
|
+
/** `grid`: a muted loop over the still. */
|
|
10
|
+
video?: {
|
|
11
|
+
webm?: string;
|
|
12
|
+
mp4?: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
type ShopGalleryNote = {
|
|
16
|
+
id: string;
|
|
17
|
+
text: string;
|
|
18
|
+
signature?: string;
|
|
19
|
+
};
|
|
20
|
+
type GallerySectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
21
|
+
/** @default "mosaic" */
|
|
22
|
+
variant?: GalleryVariant;
|
|
23
|
+
/** The shop's own photos, in order, already unique. */
|
|
24
|
+
photos: readonly ShopGalleryPhoto[];
|
|
25
|
+
title: React.ReactNode;
|
|
26
|
+
lead?: React.ReactNode;
|
|
27
|
+
/** The gallery's accessible name (`Photos of the salon`). */
|
|
28
|
+
label: string;
|
|
29
|
+
/** `wall`: short notes pinned between the photos. */
|
|
30
|
+
notes?: readonly ShopGalleryNote[];
|
|
31
|
+
/** `wall`: the shop's name on its sign. */
|
|
32
|
+
sign?: string;
|
|
33
|
+
/** `wall`: the wall's texture. @default "plaster" */
|
|
34
|
+
texture?: "plaster" | "brick" | "ridge" | "zellige";
|
|
35
|
+
};
|
|
36
|
+
/** A deterministic scatter: the same photos always hang the same way (no random, so no hydration mismatch). */
|
|
37
|
+
declare function wallLayout(count: number): {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
rotation: number;
|
|
41
|
+
}[];
|
|
42
|
+
/** The photos of a shop: a mosaic, a filmstrip, a wall or a grid. */
|
|
43
|
+
declare function GallerySection({ variant, photos, title, lead, label, notes, sign, texture, className, ...props }: GallerySectionProps): React.JSX.Element;
|
|
44
|
+
|
|
45
|
+
export { GallerySection, wallLayout };
|
|
46
|
+
export type { GallerySectionProps, GalleryVariant, ShopGalleryNote, ShopGalleryPhoto };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Photo
|
|
3
|
+
} from "../chunk-5D7NMUF6.js";
|
|
4
|
+
import {
|
|
5
|
+
SHOP_LIMITS
|
|
6
|
+
} from "../chunk-ZYHWJ7U5.js";
|
|
7
|
+
import {
|
|
8
|
+
ShopSection
|
|
9
|
+
} from "../chunk-A7MQPIEG.js";
|
|
10
|
+
import {
|
|
11
|
+
cn
|
|
12
|
+
} from "../chunk-B47WSPMP.js";
|
|
13
|
+
|
|
14
|
+
// src/shop/gallery/gallery.tsx
|
|
15
|
+
import { MediaGallery } from "@krizaka/ui/media-gallery";
|
|
16
|
+
import { Wall } from "@krizaka/ui/wall";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
function wallLayout(count) {
|
|
19
|
+
const perRow = Math.min(5, Math.max(1, Math.ceil(count / 2)));
|
|
20
|
+
return Array.from({ length: count }, (_, i) => {
|
|
21
|
+
const row = Math.floor(i / perRow);
|
|
22
|
+
const col = i % perRow;
|
|
23
|
+
const inRow = Math.min(perRow, count - row * perRow);
|
|
24
|
+
const x = inRow === 1 ? 50 : col / (inRow - 1) * 100;
|
|
25
|
+
const y = row === 0 ? count <= perRow ? 50 : 8 + col % 2 * 6 : 92 - col % 2 * 6;
|
|
26
|
+
return { x, y, rotation: [-2.2, 1.6, -1.2, 2.4, -1.8][(i * 3 + 1) % 5] };
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function Mosaic({ photos }) {
|
|
30
|
+
const [lead, ...rest] = photos;
|
|
31
|
+
if (!lead) return null;
|
|
32
|
+
return /* @__PURE__ */ jsxs("ul", { className: "m-0 grid list-none grid-cols-2 gap-2 p-0 sm:grid-cols-[1.6fr_1fr_1fr] sm:gap-3", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("li", { className: "col-span-2 aspect-[16/11] sm:col-span-1 sm:row-span-2 sm:aspect-auto", children: /* @__PURE__ */ jsx(Photo, { photo: lead.photo, ratio: "4/5", sizes: "(min-width: 40rem) 36rem, 100vw", className: "h-full min-h-0 sm:aspect-auto" }) }),
|
|
34
|
+
rest.slice(0, 4).map((p) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Photo, { photo: p.photo, ratio: "1/1", sizes: "(min-width: 40rem) 18rem, 50vw" }) }, p.id))
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
function Filmstrip({ photos, label }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("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", children: /* @__PURE__ */ jsx("ul", { className: "m-0 flex w-max snap-x snap-mandatory list-none gap-3 p-0", children: photos.map((p) => /* @__PURE__ */ jsx("li", { className: "w-[42vw] max-w-64 shrink-0 snap-start sm:w-64", children: /* @__PURE__ */ jsx(Photo, { photo: p.photo, ratio: "3/4", sizes: "(min-width: 40rem) 16rem, 42vw" }) }, p.id)) }) });
|
|
39
|
+
}
|
|
40
|
+
function ShopWall({ photos, notes, sign, texture, label }) {
|
|
41
|
+
const pieces = [
|
|
42
|
+
...sign ? [{ id: "sign", kind: "sign", children: sign, variant: "neon" }] : [],
|
|
43
|
+
...photos.slice(0, SHOP_LIMITS.photos).map((p) => ({
|
|
44
|
+
id: p.id,
|
|
45
|
+
kind: "polaroid",
|
|
46
|
+
img: /* @__PURE__ */ jsx("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" }),
|
|
47
|
+
caption: p.caption
|
|
48
|
+
})),
|
|
49
|
+
...notes.map((n) => ({ id: n.id, kind: "note", text: n.text, signature: n.signature }))
|
|
50
|
+
];
|
|
51
|
+
const layout = wallLayout(pieces.length);
|
|
52
|
+
const items = pieces.map((piece, i) => ({ ...piece, ...layout[i], z: i }));
|
|
53
|
+
return /* @__PURE__ */ jsx(Wall, { "aria-label": label, items, texture, itemWidth: 220, max: SHOP_LIMITS.photos + 2 });
|
|
54
|
+
}
|
|
55
|
+
function GallerySection({ variant = "mosaic", photos, title, lead, label, notes = [], sign, texture = "plaster", className, ...props }) {
|
|
56
|
+
const shown = photos.slice(0, SHOP_LIMITS.photos);
|
|
57
|
+
const bodies = {
|
|
58
|
+
mosaic: () => /* @__PURE__ */ jsx(Mosaic, { photos: shown }),
|
|
59
|
+
filmstrip: () => /* @__PURE__ */ jsx(Filmstrip, { photos: shown, label }),
|
|
60
|
+
wall: () => /* @__PURE__ */ jsx(ShopWall, { photos: shown, notes, sign, texture, label }),
|
|
61
|
+
grid: () => /* @__PURE__ */ jsx(
|
|
62
|
+
MediaGallery,
|
|
63
|
+
{
|
|
64
|
+
label,
|
|
65
|
+
items: shown.map((p) => ({ id: p.id, src: p.photo.src, alt: p.photo.alt, caption: p.caption, video: p.video, shape: "wide" }))
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
};
|
|
69
|
+
const body = bodies[variant]();
|
|
70
|
+
return /* @__PURE__ */ jsx(ShopSection, { title, lead, className: cn(className), "data-variant": variant, ...props, children: body });
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
GallerySection,
|
|
74
|
+
wallLayout
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=gallery.js.map
|
|
@@ -0,0 +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 const y = row === 0 ? (count <= perRow ? 50 : 8 + (col % 2) * 6) : 92 - (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 }: { 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 }: { 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 }: { 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;AAuDhC,SAEI,KAFJ;AAhBG,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,UAAM,IAAI,QAAQ,IAAK,SAAS,SAAS,KAAK,IAAK,MAAM,IAAK,IAAK,KAAM,MAAM,IAAK;AACpF,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,GAA4C;AACnE,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,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,MACrB,oBAAC,QACC,8BAAC,SAAM,OAAO,EAAE,OAAO,OAAM,OAAM,OAAM,kCAAiC,KADnE,EAAE,EAEX,CACD;AAAA,KACH;AAEJ;AAEA,SAAS,UAAU,EAAE,QAAQ,MAAM,GAA2D;AAC5F,SACE,oBAAC,SAAI,MAAK,SAAQ,cAAY,OAAO,UAAU,GAAG,WAAU,qIAC1D,8BAAC,QAAG,WAAU,4DACX,iBAAO,IAAI,CAAC,MACX,oBAAC,QAAc,WAAU,iDACvB,8BAAC,SAAM,OAAO,EAAE,OAAO,OAAM,OAAM,OAAM,kCAAiC,KADnE,EAAE,EAEX,CACD,GACH,GACF;AAEJ;AAEA,SAAS,SAAS,EAAE,QAAQ,OAAO,MAAM,SAAS,MAAM,GAAmK;AACzN,QAAM,SAAS;AAAA,IACb,GAAI,OAAO,CAAC,EAAE,IAAI,QAAQ,MAAM,QAAiB,UAAU,MAAM,SAAS,OAAgB,CAAC,IAAI,CAAC;AAAA,IAChG,GAAG,OAAO,MAAM,GAAG,YAAY,MAAM,EAAE,IAAI,CAAC,OAAO;AAAA,MACjD,IAAI,EAAE;AAAA,MACN,MAAM;AAAA,MACN,KAAK,oBAAC,SAAI,KAAK,EAAE,MAAM,KAAK,QAAQ,EAAE,MAAM,QAAQ,OAAM,SAAQ,KAAK,EAAE,MAAM,KAAK,SAAQ,QAAO,UAAS,SAAQ,WAAU,+CAA8C;AAAA,MAC5K,SAAS,EAAE;AAAA,IACb,EAAE;AAAA,IACF,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,MAAM,QAAiB,MAAM,EAAE,MAAM,WAAW,EAAE,UAAU,EAAE;AAAA,EACjG;AACA,QAAM,SAAS,WAAW,OAAO,MAAM;AACvC,QAAM,QAAQ,OAAO,IAAI,CAAC,OAAO,OAAO,EAAE,GAAG,OAAO,GAAG,OAAO,CAAC,GAAI,GAAG,EAAE,EAAE;AAC1E,SAAO,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,SAAwD;AAAA,IAC5D,QAAQ,MAAM,oBAAC,UAAO,QAAQ,OAAO;AAAA,IACrC,WAAW,MAAM,oBAAC,aAAU,QAAQ,OAAO,OAAc;AAAA,IACzD,MAAM,MAAM,oBAAC,YAAS,QAAQ,OAAO,OAAc,MAAY,SAAkB,OAAc;AAAA,IAC/F,MAAM,MACJ;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,EAAE;AAC7B,SACE,oBAAC,eAAY,OAAc,MAAY,WAAW,GAAG,SAAS,GAAG,gBAAc,SAAU,GAAG,OACzF,gBACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { RetroTvProps } from '@krizaka/ui/retro-tv';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ShopPhoto } from '../shop.js';
|
|
4
|
+
|
|
5
|
+
type HeroVariant = "poster" | "split" | "banner" | "tv";
|
|
6
|
+
type HeroSectionProps = Omit<React.ComponentProps<"header">, "title"> & {
|
|
7
|
+
/** The drawing. @default "poster" */
|
|
8
|
+
variant?: HeroVariant;
|
|
9
|
+
/** The shop's name: the page's `h1`. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** A short mono line above the name (`Saint-Henri · Montréal`). */
|
|
12
|
+
eyebrow?: React.ReactNode;
|
|
13
|
+
/** One line: what the shop promises. */
|
|
14
|
+
lead?: React.ReactNode;
|
|
15
|
+
/** Chips: open now, the area, the score — only what is true now. */
|
|
16
|
+
facts?: React.ReactNode;
|
|
17
|
+
/** The one action (`ButtonLink`, « Book »). */
|
|
18
|
+
actions?: React.ReactNode;
|
|
19
|
+
/** The cover: a photo (16:9), an optional 4:5 crop for a phone, an optional muted loop (`poster`). */
|
|
20
|
+
cover?: ShopPhoto & {
|
|
21
|
+
phone?: string;
|
|
22
|
+
video?: {
|
|
23
|
+
webm?: string;
|
|
24
|
+
mp4?: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/** Where the photo is cropped to. @default "center" */
|
|
28
|
+
focus?: "center" | "top" | "bottom";
|
|
29
|
+
/** `tv`: the shop's latest video in the cabinet (`src`, `poster`, `label`, or an `EmbedFacade` as `children`). */
|
|
30
|
+
tv?: RetroTvProps;
|
|
31
|
+
};
|
|
32
|
+
/** The first section of a shop page: poster, split, banner or tv. */
|
|
33
|
+
declare function HeroSection({ variant, title, eyebrow, lead: leadText, facts, actions, cover, focus, tv, className, ...props }: HeroSectionProps): React.JSX.Element;
|
|
34
|
+
|
|
35
|
+
export { HeroSection };
|
|
36
|
+
export type { HeroSectionProps, HeroVariant };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Photo
|
|
3
|
+
} from "../chunk-5D7NMUF6.js";
|
|
4
|
+
import {
|
|
5
|
+
Page,
|
|
6
|
+
cn
|
|
7
|
+
} from "../chunk-B47WSPMP.js";
|
|
8
|
+
|
|
9
|
+
// src/shop/hero/hero.tsx
|
|
10
|
+
import { CoverHero } from "@krizaka/ui/cover-hero";
|
|
11
|
+
import { RetroTv } from "@krizaka/ui/retro-tv";
|
|
12
|
+
import { ShopSign } from "@krizaka/ui/wall";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
var lead = "m-0 max-w-xl text-base leading-relaxed text-fg-secondary sm:text-lg";
|
|
15
|
+
var eyebrowClass = "m-0 font-mono text-[13px] text-fg-accent";
|
|
16
|
+
var titleClass = "kz-shop-title m-0 font-display text-4xl leading-[1.05] tracking-tight text-fg sm:text-5xl";
|
|
17
|
+
function Text({ title, eyebrow, lead: leadText, facts, actions }) {
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col items-start gap-3", children: [
|
|
19
|
+
eyebrow && /* @__PURE__ */ jsx("p", { className: eyebrowClass, children: eyebrow }),
|
|
20
|
+
/* @__PURE__ */ jsx("h1", { className: titleClass, children: title }),
|
|
21
|
+
leadText && /* @__PURE__ */ jsx("p", { className: lead, children: leadText }),
|
|
22
|
+
facts && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2", children: facts }),
|
|
23
|
+
actions && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-3 pt-1", children: actions })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
function HeroSection({ variant = "poster", title, eyebrow, lead: leadText, facts, actions, cover, focus = "center", tv, className, ...props }) {
|
|
27
|
+
if (variant === "poster") {
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
CoverHero,
|
|
30
|
+
{
|
|
31
|
+
"data-first": "",
|
|
32
|
+
"data-variant": "poster",
|
|
33
|
+
className: cn("kz-shop-section min-h-[24rem] sm:min-h-[28rem] lg:min-h-[31rem]", className),
|
|
34
|
+
cover: cover && { src: cover.src, alt: cover.alt, video: cover.video, phone: cover.phone, focus },
|
|
35
|
+
eyebrow,
|
|
36
|
+
title,
|
|
37
|
+
lead: leadText,
|
|
38
|
+
facts,
|
|
39
|
+
actions,
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const text = /* @__PURE__ */ jsx(Text, { title, eyebrow, lead: leadText, facts, actions });
|
|
45
|
+
if (variant === "split") {
|
|
46
|
+
return /* @__PURE__ */ jsx("header", { "data-first": "", "data-variant": "split", className: cn("kz-shop-section", className), ...props, children: /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsxs("div", { className: "grid items-center gap-6 py-6 md:grid-cols-[minmax(0,1fr)_minmax(0,32rem)] md:gap-12 md:py-8", children: [
|
|
47
|
+
/* @__PURE__ */ jsx("div", { className: "order-2 md:order-1", children: text }),
|
|
48
|
+
cover && /* @__PURE__ */ jsx(Photo, { photo: cover, ratio: "4/5", priority: true, sizes: "(min-width: 48rem) 32rem, 100vw", className: "order-1 max-h-[26rem] md:order-2 md:max-h-none" })
|
|
49
|
+
] }) }) });
|
|
50
|
+
}
|
|
51
|
+
if (variant === "banner") {
|
|
52
|
+
return /* @__PURE__ */ jsxs("header", { "data-first": "", "data-variant": "banner", className: cn("kz-shop-section", className), ...props, children: [
|
|
53
|
+
cover && /* @__PURE__ */ jsx("div", { className: "mx-auto w-full max-w-[90rem]", children: /* @__PURE__ */ jsx(Photo, { photo: cover, ratio: "21/9", priority: true, sizes: "100vw", className: "rounded-none aspect-[3/2] sm:aspect-[21/9]" }) }),
|
|
54
|
+
/* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsx("div", { className: "py-6", children: text }) })
|
|
55
|
+
] });
|
|
56
|
+
}
|
|
57
|
+
return /* @__PURE__ */ jsx("header", { "data-first": "", "data-variant": "tv", className: cn("kz-shop-section", className), ...props, children: /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsxs("div", { className: "grid items-center gap-6 py-6 md:grid-cols-[minmax(0,1fr)_17rem] md:gap-12 md:py-8", children: [
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col items-start gap-4", children: [
|
|
59
|
+
/* @__PURE__ */ jsx(ShopSign, { as: "h1", variant: "neon", children: title }),
|
|
60
|
+
leadText && /* @__PURE__ */ jsx("p", { className: lead, children: leadText }),
|
|
61
|
+
facts && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2", children: facts }),
|
|
62
|
+
actions && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-3 pt-1", children: actions })
|
|
63
|
+
] }),
|
|
64
|
+
tv && /* @__PURE__ */ jsx(RetroTv, { ...tv, className: cn("mx-auto w-56 md:w-full", tv.className) })
|
|
65
|
+
] }) }) });
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
HeroSection
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=hero.js.map
|
|
@@ -0,0 +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\">) {\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,GAA+E;AAC5I,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,GAAG,mEAAmE,SAAS;AAAA,QAC1F,OAAO,SAAS,EAAE,KAAK,MAAM,KAAK,KAAK,MAAM,KAAK,OAAO,MAAM,OAAO,OAAO,MAAM,OAAO,MAAM;AAAA,QAChG;AAAA,QACA;AAAA,QACA,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACA,QAAM,OAAO,oBAAC,QAAK,OAAc,SAAkB,MAAM,UAAU,OAAc,SAAkB;AACnG,MAAI,YAAY,SAAS;AACvB,WACE,oBAAC,YAAO,cAAW,IAAG,gBAAa,SAAQ,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OAC1F,8BAAC,QACC,+BAAC,SAAI,WAAU,+FACb;AAAA,0BAAC,SAAI,WAAU,sBAAsB,gBAAK;AAAA,MACzC,SAAS,oBAAC,SAAM,OAAO,OAAO,OAAM,OAAM,UAAQ,MAAC,OAAM,mCAAkC,WAAU,kDAAiD;AAAA,OACzJ,GACF,GACF;AAAA,EAEJ;AACA,MAAI,YAAY,UAAU;AACxB,WACE,qBAAC,YAAO,cAAW,IAAG,gBAAa,UAAS,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OAC1F;AAAA,eACC,oBAAC,SAAI,WAAU,gCACb,8BAAC,SAAM,OAAO,OAAO,OAAM,QAAO,UAAQ,MAAC,OAAM,SAAQ,WAAU,8CAA6C,GAClH;AAAA,MAEF,oBAAC,QACC,8BAAC,SAAI,WAAU,QAAQ,gBAAK,GAC9B;AAAA,OACF;AAAA,EAEJ;AACA,SACE,oBAAC,YAAO,cAAW,IAAG,gBAAa,MAAK,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OACvF,8BAAC,QACC,+BAAC,SAAI,WAAU,qFACb;AAAA,yBAAC,SAAI,WAAU,2CACb;AAAA,0BAAC,YAAS,IAAG,MAAK,SAAQ,QAAQ,iBAAM;AAAA,MACvC,YAAY,oBAAC,OAAE,WAAW,MAAO,oBAAS;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":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StaticMapProps, MapProps } from '@krizaka/ui/map';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type MapGateProps = {
|
|
5
|
+
/** The map's accessible name (`Where the salon is`). */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Longitude, latitude. */
|
|
8
|
+
center: StaticMapProps["center"];
|
|
9
|
+
zoom?: number;
|
|
10
|
+
/** Places drawn on the still and listed in its name. */
|
|
11
|
+
places?: StaticMapProps["places"];
|
|
12
|
+
/** The button's words (`Show the map`). */
|
|
13
|
+
showLabel: string;
|
|
14
|
+
/** More props of the live map (`brand`, `lang`, `labels`). */
|
|
15
|
+
map?: Partial<Omit<MapProps, "label" | "center" | "zoom" | "fallback">>;
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
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;
|
|
20
|
+
|
|
21
|
+
export { MapGate };
|
|
22
|
+
export type { MapGateProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/shop/map-gate/map-gate.tsx
|
|
4
|
+
import { Map as LiveMap, StaticMap } from "@krizaka/ui/map";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var WIDE = "(min-width: 40rem)";
|
|
8
|
+
function subscribeWide(notify) {
|
|
9
|
+
const q = window.matchMedia(WIDE);
|
|
10
|
+
q.addEventListener("change", notify);
|
|
11
|
+
return () => q.removeEventListener("change", notify);
|
|
12
|
+
}
|
|
13
|
+
function MapGate({ label, center, zoom = 14, places, showLabel, map, className }) {
|
|
14
|
+
const [asked, setAsked] = React.useState(false);
|
|
15
|
+
const wide = React.useSyncExternalStore(subscribeWide, () => window.matchMedia(WIDE).matches, () => false);
|
|
16
|
+
const live = asked || wide;
|
|
17
|
+
const still = /* @__PURE__ */ jsx(StaticMap, { label, center, zoom, places });
|
|
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: [
|
|
19
|
+
live ? /* @__PURE__ */ jsx(LiveMap, { label, center, zoom, fallback: still, ...map }) : still,
|
|
20
|
+
!live && /* @__PURE__ */ jsx(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
type: "button",
|
|
24
|
+
onClick: () => setAsked(true),
|
|
25
|
+
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",
|
|
26
|
+
children: showLabel
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
] }) });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
MapGate
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=map-gate.js.map
|
|
@@ -0,0 +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`). */\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 = window.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 }: 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, () => window.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} /> : 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,OAAO,WAAW,IAAI;AAChC,IAAE,iBAAiB,UAAU,MAAM;AACnC,SAAO,MAAM,EAAE,oBAAoB,UAAU,MAAM;AACrD;AAGO,SAAS,QAAQ,EAAE,OAAO,QAAQ,OAAO,IAAI,QAAQ,WAAW,KAAK,UAAU,GAAiB;AACrG,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAS,KAAK;AAE9C,QAAM,OAAa,2BAAqB,eAAe,MAAM,OAAO,WAAW,IAAI,EAAE,SAAS,MAAM,KAAK;AACzG,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,IAAK;AAAA,IACzF,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":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type ShopPolicy = {
|
|
4
|
+
id: string;
|
|
5
|
+
term: string;
|
|
6
|
+
details: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
type PoliciesSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
9
|
+
/** @default "inline" */
|
|
10
|
+
variant?: "inline";
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
items: readonly ShopPolicy[];
|
|
13
|
+
};
|
|
14
|
+
/** Cancellation, prices and the booking window, as term and value. */
|
|
15
|
+
declare function PoliciesSection({ title, items, className, ...props }: PoliciesSectionProps): React.JSX.Element | null;
|
|
16
|
+
|
|
17
|
+
export { PoliciesSection };
|
|
18
|
+
export type { PoliciesSectionProps, ShopPolicy };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ShopSection
|
|
3
|
+
} from "../chunk-A7MQPIEG.js";
|
|
4
|
+
import "../chunk-B47WSPMP.js";
|
|
5
|
+
|
|
6
|
+
// src/shop/policies/policies.tsx
|
|
7
|
+
import { DescriptionList } from "@krizaka/ui/description-list";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function PoliciesSection({ title, items, className, ...props }) {
|
|
10
|
+
if (items.length === 0) return null;
|
|
11
|
+
return /* @__PURE__ */ jsx(ShopSection, { title, className, "data-variant": "inline", ...props, children: /* @__PURE__ */ jsx(DescriptionList, { layout: "inline", className: "max-w-3xl", items: items.map((p) => ({ id: p.id, term: p.term, details: p.details })) }) });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
PoliciesSection
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=policies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shop/policies/policies.tsx"],"sourcesContent":["// Server-safe. The rules of the shop, in the open (ADR-007 §3): cancellation, prices, the booking window — a real\n// description list, the owner's own words.\nimport { DescriptionList } from \"@krizaka/ui/description-list\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type ShopPolicy = { id: string; term: string; details: React.ReactNode };\n\nexport type PoliciesSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"inline\" */\n variant?: \"inline\";\n title: React.ReactNode;\n items: readonly ShopPolicy[];\n};\n\n/** Cancellation, prices and the booking window, as term and value. */\nexport function PoliciesSection({ title, items, className, ...props }: PoliciesSectionProps) {\n if (items.length === 0) return null;\n return (\n <ShopSection title={title} className={className} data-variant=\"inline\" {...props}>\n <DescriptionList layout=\"inline\" className=\"max-w-3xl\" items={items.map((p) => ({ id: p.id, term: p.term, details: p.details }))} />\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAEA,SAAS,uBAAuB;AAmB1B;AAJC,SAAS,gBAAgB,EAAE,OAAO,OAAO,WAAW,GAAG,MAAM,GAAyB;AAC3F,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SACE,oBAAC,eAAY,OAAc,WAAsB,gBAAa,UAAU,GAAG,OACzE,8BAAC,mBAAgB,QAAO,UAAS,WAAU,aAAY,OAAO,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,MAAM,EAAE,MAAM,SAAS,EAAE,QAAQ,EAAE,GAAG,GACpI;AAEJ;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReviewSummaryProps, ReviewCardProps } from '@krizaka/ui/reviews';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type ReviewsVariant = "summary-cards" | "quote" | "strip";
|
|
5
|
+
type ShopReview = Omit<ReviewCardProps, "className" | "style"> & {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
type ReviewsSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
9
|
+
/** @default "summary-cards" */
|
|
10
|
+
variant?: ReviewsVariant;
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
/** The score and its distribution, with the words that name them (the stamp's, the count's, the meters'). */
|
|
13
|
+
summary: Omit<ReviewSummaryProps, "minCount" | "className" | "style">;
|
|
14
|
+
/** The reviews the host chose (`best` or `latest`), in order: two or three are drawn. */
|
|
15
|
+
reviews: readonly ShopReview[];
|
|
16
|
+
/** How many reviews are drawn beside the stamp. @default 2 */
|
|
17
|
+
count?: 1 | 2 | 3;
|
|
18
|
+
/** The fewest verified reviews that may be shown at all. @default 5 */
|
|
19
|
+
minCount?: number;
|
|
20
|
+
};
|
|
21
|
+
/** The score of the shop and what its clients wrote. */
|
|
22
|
+
declare function ReviewsSection({ variant, title, summary, reviews, count, minCount, className, ...props }: ReviewsSectionProps): React.JSX.Element | null;
|
|
23
|
+
|
|
24
|
+
export { ReviewsSection };
|
|
25
|
+
export type { ReviewsSectionProps, ReviewsVariant, ShopReview };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ShopSection
|
|
3
|
+
} from "../chunk-A7MQPIEG.js";
|
|
4
|
+
import "../chunk-B47WSPMP.js";
|
|
5
|
+
|
|
6
|
+
// src/shop/reviews/reviews.tsx
|
|
7
|
+
import { ReviewCard, ReviewSummary } from "@krizaka/ui/reviews";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function ReviewsSection({ variant = "summary-cards", title, summary, reviews, count = 2, minCount = 5, className, ...props }) {
|
|
10
|
+
if (summary.count < Math.max(1, minCount) || reviews.length === 0) return null;
|
|
11
|
+
const shown = reviews.slice(0, count);
|
|
12
|
+
if (variant === "strip") {
|
|
13
|
+
return /* @__PURE__ */ jsx(ShopSection, { "aria-label": typeof title === "string" ? title : summary.summaryText, "data-variant": "strip", className, ...props, children: /* @__PURE__ */ jsxs("p", { className: "m-0 flex flex-wrap items-baseline gap-x-3 gap-y-1 text-sm text-fg-secondary", children: [
|
|
14
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-sm border-2 border-border-strong px-2 py-0.5 font-mono text-base font-bold text-fg tabular-nums", children: summary.scoreText }),
|
|
15
|
+
/* @__PURE__ */ jsx("span", { children: summary.countText }),
|
|
16
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: summary.summaryText })
|
|
17
|
+
] }) });
|
|
18
|
+
}
|
|
19
|
+
if (variant === "quote") {
|
|
20
|
+
const r = shown[0];
|
|
21
|
+
const { text, author, date, dateTime, service, ratingText } = r;
|
|
22
|
+
return /* @__PURE__ */ jsx(ShopSection, { title, className, "data-variant": "quote", ...props, children: /* @__PURE__ */ jsxs("figure", { className: "m-0 max-w-3xl", children: [
|
|
23
|
+
/* @__PURE__ */ jsxs("blockquote", { className: "m-0 font-display text-2xl leading-snug text-fg sm:text-3xl", children: [
|
|
24
|
+
"\u201C",
|
|
25
|
+
text,
|
|
26
|
+
"\u201D"
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsxs("figcaption", { className: "mt-3 flex flex-wrap items-baseline gap-x-2 text-sm text-fg-secondary", children: [
|
|
29
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-fg", children: author }),
|
|
30
|
+
/* @__PURE__ */ jsx("time", { dateTime, children: date }),
|
|
31
|
+
service && /* @__PURE__ */ jsxs("span", { children: [
|
|
32
|
+
"\xB7 ",
|
|
33
|
+
service
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: ratingText })
|
|
36
|
+
] })
|
|
37
|
+
] }) });
|
|
38
|
+
}
|
|
39
|
+
return /* @__PURE__ */ jsx(ShopSection, { title, className, "data-variant": "summary-cards", ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid items-start gap-4 lg:grid-cols-[18rem_minmax(0,1fr)] lg:gap-8", children: [
|
|
40
|
+
/* @__PURE__ */ jsx(ReviewSummary, { ...summary, minCount }),
|
|
41
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-[repeat(auto-fit,minmax(14rem,1fr))]", children: shown.map(({ id, ...review }) => /* @__PURE__ */ jsx(ReviewCard, { ...review }, id)) })
|
|
42
|
+
] }) });
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
ReviewsSection
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=reviews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shop/reviews/reviews.tsx"],"sourcesContent":["// Server-safe. What clients say (ADR-007 §3): `summary-cards` — the score stamp with its distribution beside two or three\n// reviews; `quote` — one large review; `strip` — the score as one line (a hero's fact). Nothing is drawn under the host's\n// `minCount` of verified reviews: a shop with two reviews shows none (the composer says why).\nimport { ReviewCard, type ReviewCardProps, ReviewSummary, type ReviewSummaryProps } from \"@krizaka/ui/reviews\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type ReviewsVariant = \"summary-cards\" | \"quote\" | \"strip\";\n\nexport type ShopReview = Omit<ReviewCardProps, \"className\" | \"style\"> & { id: string };\n\nexport type ReviewsSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"summary-cards\" */\n variant?: ReviewsVariant;\n title: React.ReactNode;\n /** The score and its distribution, with the words that name them (the stamp's, the count's, the meters'). */\n summary: Omit<ReviewSummaryProps, \"minCount\" | \"className\" | \"style\">;\n /** The reviews the host chose (`best` or `latest`), in order: two or three are drawn. */\n reviews: readonly ShopReview[];\n /** How many reviews are drawn beside the stamp. @default 2 */\n count?: 1 | 2 | 3;\n /** The fewest verified reviews that may be shown at all. @default 5 */\n minCount?: number;\n};\n\n/** The score of the shop and what its clients wrote. */\nexport function ReviewsSection({ variant = \"summary-cards\", title, summary, reviews, count = 2, minCount = 5, className, ...props }: ReviewsSectionProps) {\n if (summary.count < Math.max(1, minCount) || reviews.length === 0) return null;\n const shown = reviews.slice(0, count);\n if (variant === \"strip\") {\n return (\n <ShopSection aria-label={typeof title === \"string\" ? title : summary.summaryText} data-variant=\"strip\" className={className} {...props}>\n <p className=\"m-0 flex flex-wrap items-baseline gap-x-3 gap-y-1 text-sm text-fg-secondary\">\n <span className=\"rounded-sm border-2 border-border-strong px-2 py-0.5 font-mono text-base font-bold text-fg tabular-nums\">{summary.scoreText}</span>\n <span>{summary.countText}</span>\n <span className=\"sr-only\">{summary.summaryText}</span>\n </p>\n </ShopSection>\n );\n }\n if (variant === \"quote\") {\n const r = shown[0]!;\n const { text, author, date, dateTime, service, ratingText } = r;\n return (\n <ShopSection title={title} className={className} data-variant=\"quote\" {...props}>\n <figure className=\"m-0 max-w-3xl\">\n <blockquote className=\"m-0 font-display text-2xl leading-snug text-fg sm:text-3xl\">“{text}”</blockquote>\n <figcaption className=\"mt-3 flex flex-wrap items-baseline gap-x-2 text-sm text-fg-secondary\">\n <span className=\"font-semibold text-fg\">{author}</span>\n <time dateTime={dateTime}>{date}</time>\n {service && <span>· {service}</span>}\n <span className=\"sr-only\">{ratingText}</span>\n </figcaption>\n </figure>\n </ShopSection>\n );\n }\n return (\n <ShopSection title={title} className={className} data-variant=\"summary-cards\" {...props}>\n <div className=\"grid items-start gap-4 lg:grid-cols-[18rem_minmax(0,1fr)] lg:gap-8\">\n <ReviewSummary {...summary} minCount={minCount} />\n <div className=\"grid gap-3 sm:grid-cols-2 lg:grid-cols-[repeat(auto-fit,minmax(14rem,1fr))]\">\n {shown.map(({ id, ...review }) => (\n <ReviewCard key={id} {...review} />\n ))}\n </div>\n </div>\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAGA,SAAS,YAAkC,qBAA8C;AA8BjF,SACE,KADF;AAND,SAAS,eAAe,EAAE,UAAU,iBAAiB,OAAO,SAAS,SAAS,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,GAAwB;AACxJ,MAAI,QAAQ,QAAQ,KAAK,IAAI,GAAG,QAAQ,KAAK,QAAQ,WAAW,EAAG,QAAO;AAC1E,QAAM,QAAQ,QAAQ,MAAM,GAAG,KAAK;AACpC,MAAI,YAAY,SAAS;AACvB,WACE,oBAAC,eAAY,cAAY,OAAO,UAAU,WAAW,QAAQ,QAAQ,aAAa,gBAAa,SAAQ,WAAuB,GAAG,OAC/H,+BAAC,OAAE,WAAU,+EACX;AAAA,0BAAC,UAAK,WAAU,2GAA2G,kBAAQ,WAAU;AAAA,MAC7I,oBAAC,UAAM,kBAAQ,WAAU;AAAA,MACzB,oBAAC,UAAK,WAAU,WAAW,kBAAQ,aAAY;AAAA,OACjD,GACF;AAAA,EAEJ;AACA,MAAI,YAAY,SAAS;AACvB,UAAM,IAAI,MAAM,CAAC;AACjB,UAAM,EAAE,MAAM,QAAQ,MAAM,UAAU,SAAS,WAAW,IAAI;AAC9D,WACE,oBAAC,eAAY,OAAc,WAAsB,gBAAa,SAAS,GAAG,OACxE,+BAAC,YAAO,WAAU,iBAChB;AAAA,2BAAC,gBAAW,WAAU,8DAA6D;AAAA;AAAA,QAAE;AAAA,QAAK;AAAA,SAAC;AAAA,MAC3F,qBAAC,gBAAW,WAAU,wEACpB;AAAA,4BAAC,UAAK,WAAU,yBAAyB,kBAAO;AAAA,QAChD,oBAAC,UAAK,UAAqB,gBAAK;AAAA,QAC/B,WAAW,qBAAC,UAAK;AAAA;AAAA,UAAG;AAAA,WAAQ;AAAA,QAC7B,oBAAC,UAAK,WAAU,WAAW,sBAAW;AAAA,SACxC;AAAA,OACF,GACF;AAAA,EAEJ;AACA,SACE,oBAAC,eAAY,OAAc,WAAsB,gBAAa,iBAAiB,GAAG,OAChF,+BAAC,SAAI,WAAU,sEACb;AAAA,wBAAC,iBAAe,GAAG,SAAS,UAAoB;AAAA,IAChD,oBAAC,SAAI,WAAU,+EACZ,gBAAM,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,MAC1B,oBAAC,cAAqB,GAAG,UAAR,EAAgB,CAClC,GACH;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { L as LinkComponent } from '../block-link-BAg4eoZk.js';
|
|
3
|
+
import { ShopPhoto } from '../shop.js';
|
|
4
|
+
|
|
5
|
+
type ServicesVariant = "menu" | "cards" | "index" | "carousel";
|
|
6
|
+
/** A service as the product resolved it: its own photo (or none), its price already formatted. */
|
|
7
|
+
type ShopService = {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
/** Formatted by the app (`$45`): the section never formats money. */
|
|
11
|
+
price: string;
|
|
12
|
+
/** The word before a varying price (`from`). */
|
|
13
|
+
priceFrom?: string;
|
|
14
|
+
/** `30 min`. */
|
|
15
|
+
duration?: string;
|
|
16
|
+
/** `Up to 5 dogs`. */
|
|
17
|
+
capacity?: string;
|
|
18
|
+
/** One line: what it is (truncated in the menu). */
|
|
19
|
+
description?: string;
|
|
20
|
+
/** What is included, one short line each (cards and index). */
|
|
21
|
+
included?: readonly string[];
|
|
22
|
+
/** The shop's category (`cuts`): the menu's group. */
|
|
23
|
+
category?: string;
|
|
24
|
+
/** The service's OWN photo. Never a default: without one the menu draws no thumbnail. */
|
|
25
|
+
photo?: ShopPhoto;
|
|
26
|
+
/** Booked most often (a real count): wears « Popular ». */
|
|
27
|
+
popular?: boolean;
|
|
28
|
+
/** The booking page with this service chosen. */
|
|
29
|
+
href?: string;
|
|
30
|
+
};
|
|
31
|
+
type ServicesSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
32
|
+
/** @default "menu" */
|
|
33
|
+
variant?: ServicesVariant;
|
|
34
|
+
services: readonly ShopService[];
|
|
35
|
+
/** The section's `h2` (`Services`). */
|
|
36
|
+
title: React.ReactNode;
|
|
37
|
+
lead?: React.ReactNode;
|
|
38
|
+
/** `menu`: group by the services' `category`. @default "category" */
|
|
39
|
+
groupBy?: "category" | "none";
|
|
40
|
+
/** `menu` with no `aside`: one or two columns. @default 1 */
|
|
41
|
+
columns?: 1 | 2;
|
|
42
|
+
/** `menu`: the hours, the team and the address, beside the list from `lg` (sticky), below it on a phone. */
|
|
43
|
+
aside?: React.ReactNode;
|
|
44
|
+
/** The button's words (`Choose`); its accessible name is « Choose Short cut ». */
|
|
45
|
+
chooseLabel: string;
|
|
46
|
+
/** « Popular ». */
|
|
47
|
+
popularLabel: string;
|
|
48
|
+
/** The list's accessible name when there is no group (`Services`). */
|
|
49
|
+
listLabel?: string;
|
|
50
|
+
/** The app's link component for the booking addresses. */
|
|
51
|
+
linkAs?: LinkComponent;
|
|
52
|
+
};
|
|
53
|
+
/** The services of a shop: the price board by default, or cards, index cards, a carousel. */
|
|
54
|
+
declare function ServicesSection({ variant, services, title, lead, groupBy, columns, aside, chooseLabel, popularLabel, listLabel, linkAs, className, ...props }: ServicesSectionProps): React.JSX.Element;
|
|
55
|
+
|
|
56
|
+
export { ServicesSection };
|
|
57
|
+
export type { ServicesSectionProps, ServicesVariant, ShopService };
|