@krizaka/ui 3.64.0 → 3.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-menu.d.ts +7 -3
- package/dist/account-menu.js +14 -10
- package/dist/account-menu.js.map +1 -1
- package/dist/app-frame/server.d.ts +123 -0
- package/dist/app-frame/server.js +109 -0
- package/dist/app-frame/server.js.map +1 -0
- package/dist/app-frame.d.ts +210 -0
- package/dist/app-frame.js +220 -0
- package/dist/app-frame.js.map +1 -0
- 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/desktop-window.d.ts +223 -0
- package/dist/desktop-window.js +261 -0
- package/dist/desktop-window.js.map +1 -0
- package/dist/filter-bar.d.ts +3 -3
- package/dist/frame-D6Xv83t8.d.ts +52 -0
- package/dist/native.d.ts +218 -3
- package/dist/native.js +1638 -1450
- package/dist/native.js.map +1 -1
- 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/dist/theme.d.ts +3 -1
- package/dist/theme.js +4 -0
- package/dist/theme.js.map +1 -1
- package/package.json +305 -5
- package/registry/account-menu.json +22 -8
- 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-frame.json +564 -0
- 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 +3 -3
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +407 -0
- 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/app-frame/admin.d.ts +4 -0
- package/registry/examples/app-frame/admin.js +32 -0
- package/registry/examples/app-frame/admin.tsx +33 -0
- package/registry/examples/app-frame/app.d.ts +4 -0
- package/registry/examples/app-frame/app.js +53 -0
- package/registry/examples/app-frame/app.tsx +56 -0
- package/registry/examples/desktop-window/library.d.ts +4 -0
- package/registry/examples/desktop-window/library.js +49 -0
- package/registry/examples/desktop-window/library.tsx +58 -0
- package/registry/examples/form-flow/native/signup.d.ts +4 -0
- package/registry/examples/form-flow/native/signup.dark.png +0 -0
- package/registry/examples/form-flow/native/signup.js +26 -0
- package/registry/examples/form-flow/native/signup.light.png +0 -0
- package/registry/examples/form-flow/native/signup.tsx +23 -0
- package/registry/examples/grid/native/columns.d.ts +4 -0
- package/registry/examples/grid/native/columns.dark.png +0 -0
- package/registry/examples/grid/native/columns.js +23 -0
- package/registry/examples/grid/native/columns.light.png +0 -0
- package/registry/examples/grid/native/columns.tsx +20 -0
- package/registry/examples/grid/native/photos.d.ts +4 -0
- package/registry/examples/grid/native/photos.dark.png +0 -0
- package/registry/examples/grid/native/photos.js +14 -0
- package/registry/examples/grid/native/photos.light.png +0 -0
- package/registry/examples/grid/native/photos.tsx +18 -0
- package/registry/examples/grid/native/stats.d.ts +4 -0
- package/registry/examples/grid/native/stats.dark.png +0 -0
- package/registry/examples/grid/native/stats.js +22 -0
- package/registry/examples/grid/native/stats.light.png +0 -0
- package/registry/examples/grid/native/stats.tsx +24 -0
- package/registry/examples/list-detail/native/inbox.d.ts +4 -0
- package/registry/examples/list-detail/native/inbox.dark.png +0 -0
- package/registry/examples/list-detail/native/inbox.js +35 -0
- package/registry/examples/list-detail/native/inbox.light.png +0 -0
- package/registry/examples/list-detail/native/inbox.tsx +35 -0
- package/registry/examples/screen/native/dashboard.d.ts +4 -0
- package/registry/examples/screen/native/dashboard.dark.png +0 -0
- package/registry/examples/screen/native/dashboard.js +48 -0
- package/registry/examples/screen/native/dashboard.light.png +0 -0
- package/registry/examples/screen/native/dashboard.tsx +52 -0
- package/registry/examples/screen/native/settings-home.d.ts +4 -0
- package/registry/examples/screen/native/settings-home.dark.png +0 -0
- package/registry/examples/screen/native/settings-home.js +26 -0
- package/registry/examples/screen/native/settings-home.light.png +0 -0
- package/registry/examples/screen/native/settings-home.tsx +25 -0
- 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/examples/state-screen/native/empty.d.ts +4 -0
- package/registry/examples/state-screen/native/empty.dark.png +0 -0
- package/registry/examples/state-screen/native/empty.js +12 -0
- package/registry/examples/state-screen/native/empty.light.png +0 -0
- package/registry/examples/state-screen/native/empty.tsx +11 -0
- package/registry/examples/state-screen/native/error.d.ts +4 -0
- package/registry/examples/state-screen/native/error.dark.png +0 -0
- package/registry/examples/state-screen/native/error.js +21 -0
- package/registry/examples/state-screen/native/error.light.png +0 -0
- package/registry/examples/state-screen/native/error.tsx +17 -0
- package/registry/examples/state-screen/native/offline.d.ts +4 -0
- package/registry/examples/state-screen/native/offline.dark.png +0 -0
- package/registry/examples/state-screen/native/offline.js +15 -0
- package/registry/examples/state-screen/native/offline.light.png +0 -0
- package/registry/examples/state-screen/native/offline.tsx +12 -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-flow.json +152 -0
- 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/grid.json +262 -0
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +403 -11
- 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-detail.json +188 -0
- 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/onboarding.json +3 -0
- 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/screen.json +68 -4
- 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 +5 -2
- 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 +4 -4
- 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/state-screen.json +224 -0
- 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 +3 -3
- 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,776 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "shop",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "Shop page",
|
|
5
|
+
"summary": "A shop's public page as a document, not as code: an ordered list of sections, each a type and a variant with its settings and blocks, drawn inside one frame and one rhythm. `shopPageSchema` validates it, `defineSection` defines a type, one component per type draws the variants. Services come first as a compact price board. First consumer: Akinaza (akinaza#398); demo data only.",
|
|
6
|
+
"description": "A shop's public page as a document, not as code: an ordered list of sections, each a type and a variant with its settings and blocks, drawn inside one frame and one rhythm. `shopPageSchema` validates it, `defineSection` defines a type, one component per type draws the variants. Services come first as a compact price board. First consumer: Akinaza (akinaza#398); demo data only.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"deprecated": null,
|
|
9
|
+
"category": "blocks",
|
|
10
|
+
"platforms": "web",
|
|
11
|
+
"parity": {
|
|
12
|
+
"web": {
|
|
13
|
+
"state": "yes"
|
|
14
|
+
},
|
|
15
|
+
"native": {
|
|
16
|
+
"state": "n/a",
|
|
17
|
+
"reason": "A shop's public page is a web page; the studio that edits it is the product's.",
|
|
18
|
+
"use": "profile-card"
|
|
19
|
+
},
|
|
20
|
+
"desktop": {
|
|
21
|
+
"state": "yes"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"whenToUse": [
|
|
25
|
+
"The public page of a service business — a salon, a dog walker, a coach, a workshop — where the owner chooses which sections appear, in what order and how each one is drawn.",
|
|
26
|
+
"Any product page made of a few repeatable sections that a person arranges, within a catalogue and a bounded number of blocks."
|
|
27
|
+
],
|
|
28
|
+
"whenNotToUse": [
|
|
29
|
+
{
|
|
30
|
+
"when": "A page of the product itself or of a Krizaka site.",
|
|
31
|
+
"use": "landing-page"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"when": "A single list of services with no choice of drawing.",
|
|
35
|
+
"use": "service-card"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"bestPractices": [
|
|
39
|
+
"Store the document, not the HTML: the product keeps `schema`, `preset` and `sections` and parses them on write and on read (`parseShopPage`); an older schema goes through `migrateShopPage` first.",
|
|
40
|
+
"References, not copies: a services section holds a rule (`source`, `groupBy`), never a price; the product resolves the services, photos and times at render, so a changed price changes everywhere.",
|
|
41
|
+
"Resolve each photo once per page and give a service its own photo or none: the menu draws a thumbnail only for a service that has one, and the trade's defaults go to the hero and the gallery.",
|
|
42
|
+
"Give every image its `alt` and let the section choose the `sizes`; the first image is the page's LCP and every box has a fixed ratio.",
|
|
43
|
+
"A section with nothing to show is not drawn: reviews under the host's minimum, an expired flyer, an empty list draw nothing.",
|
|
44
|
+
"The renderer hoists `bulletin · banner` above the hero (the document keeps the hero first); wrap each section in `<div data-shop-key=\"…\">` so the composer's preview can outline it (`connectShopPreview`)."
|
|
45
|
+
],
|
|
46
|
+
"accessibility": {
|
|
47
|
+
"keyboard": [
|
|
48
|
+
{
|
|
49
|
+
"keys": "Tab",
|
|
50
|
+
"action": "Moves through the page in the visual order: the hero's action, the times, each service's « Choose » button, the photos' strip."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"keys": "← →",
|
|
54
|
+
"action": "Scrolls a focused filmstrip or carousel (they are focusable groups)."
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"notes": [
|
|
58
|
+
"The hero's name is the page's only `h1`; every section is a `section` named by its `h2`.",
|
|
59
|
+
"The services are a real list (`ul`/`li`), grouped by category, the price is text, and each button names its service (« Choose Short cut »).",
|
|
60
|
+
"Third-party media sit behind a facade: a platform's reel, the social facade and the map on a phone request nothing before a click. Reduced motion stills the loops, the neon and the wall."
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"related": [
|
|
64
|
+
"cover-hero",
|
|
65
|
+
"service-card",
|
|
66
|
+
"slot-picker",
|
|
67
|
+
"opening-hours",
|
|
68
|
+
"media-gallery",
|
|
69
|
+
"wall",
|
|
70
|
+
"retro-tv",
|
|
71
|
+
"sticky-action",
|
|
72
|
+
"cta-panel"
|
|
73
|
+
],
|
|
74
|
+
"web": {
|
|
75
|
+
"entry": "@krizaka/ui/shop",
|
|
76
|
+
"import": "import { shopPageSchema, parseShopPage, migrateShopPage, defineSection, ShopFrame, ShopSection, shopStarters } from \"@krizaka/ui/shop\";",
|
|
77
|
+
"props": [
|
|
78
|
+
{
|
|
79
|
+
"component": "SECTION_DEFINITIONS",
|
|
80
|
+
"description": "Every section type, in the order the composer lists them.",
|
|
81
|
+
"props": []
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"component": "ShopFrame",
|
|
85
|
+
"description": "The page: sets the look preset, the accent, the paper and the density the sections below read.",
|
|
86
|
+
"props": [
|
|
87
|
+
{
|
|
88
|
+
"name": "accent",
|
|
89
|
+
"type": "string",
|
|
90
|
+
"default": null,
|
|
91
|
+
"description": "One of the accents the preset lists as tested (`krizaka`, `akinaza:accent-2`…): the owner's choice within the look. Without it, the preset's own.\n@see \n@krizaka /tokens `shopPresets`",
|
|
92
|
+
"required": false
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "density",
|
|
96
|
+
"type": "\"compact\" | \"airy\"",
|
|
97
|
+
"default": "compact",
|
|
98
|
+
"description": "The rhythm: `compact` 40 px between sections (24 on a phone), `airy` 64 px (40). The document's, or the preset's.",
|
|
99
|
+
"required": false
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "paper",
|
|
103
|
+
"type": "\"plain\" | \"kraft\" | \"seyes\" | \"washi\"",
|
|
104
|
+
"default": "plain",
|
|
105
|
+
"description": "The paper under the page, from the preset: `seyes` (ruled), `kraft` (brown — mount `PaperGrain` once), `washi` (a tint of the accent) or `plain`.",
|
|
106
|
+
"required": false
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "preset",
|
|
110
|
+
"type": "string",
|
|
111
|
+
"default": null,
|
|
112
|
+
"description": "The look preset (`salon-vitrine`, `@krizaka/tokens`): its tokens apply to everything inside.",
|
|
113
|
+
"required": false
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"component": "ShopSection",
|
|
119
|
+
"description": "A section of a shop page.",
|
|
120
|
+
"props": [
|
|
121
|
+
{
|
|
122
|
+
"name": "actions",
|
|
123
|
+
"type": "ReactNode",
|
|
124
|
+
"default": null,
|
|
125
|
+
"description": "A link or a button on the right of the heading (« All times → »).",
|
|
126
|
+
"required": false
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "bleed",
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"default": null,
|
|
132
|
+
"description": "The content reaches the edges of the screen (a photo, a strip); the heading stays on the frame.",
|
|
133
|
+
"required": false
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "eyebrow",
|
|
137
|
+
"type": "ReactNode",
|
|
138
|
+
"default": null,
|
|
139
|
+
"description": "A short lower-case note above the title.",
|
|
140
|
+
"required": false
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "first",
|
|
144
|
+
"type": "boolean",
|
|
145
|
+
"default": null,
|
|
146
|
+
"description": "The section is the page's first (the hero): no hairline, no padding.",
|
|
147
|
+
"required": false
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "lead",
|
|
151
|
+
"type": "ReactNode",
|
|
152
|
+
"default": null,
|
|
153
|
+
"description": "One sentence under the title.",
|
|
154
|
+
"required": false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "title",
|
|
158
|
+
"type": "ReactNode",
|
|
159
|
+
"default": null,
|
|
160
|
+
"description": "The `h2`. Without one the section is named by `aria-label`.",
|
|
161
|
+
"required": false
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"component": "SHOP_KEY_ATTRIBUTE",
|
|
167
|
+
"description": "The attribute that names a section in the preview page: `<div data-shop-key=\"s_8f2c\">` (a block: the outline is its ring).",
|
|
168
|
+
"props": []
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"component": "SHOP_SCHEMA_VERSION",
|
|
172
|
+
"description": "The version of the document's format; migrations are pure functions schema n → n + 1 (`migrate.ts`).",
|
|
173
|
+
"props": []
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"examples": [
|
|
177
|
+
{
|
|
178
|
+
"name": "menu",
|
|
179
|
+
"title": "Services · menu",
|
|
180
|
+
"description": "The compact price board, the default of every preset: a thumbnail only for a service's own photo, a dotted leader, tabular prices, a button that names its service — beside the hours.",
|
|
181
|
+
"path": "examples/shop/menu.tsx",
|
|
182
|
+
"module": "@krizaka/ui/registry/examples/shop/menu",
|
|
183
|
+
"code": "import { OpeningHours } from \"@krizaka/ui/opening-hours\";\nimport { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { ServicesSection } from \"@krizaka/ui/shop/services\";\n\n// The price board: a thumbnail only for a service's own photo (Short cut has none), a button that names its service.\nexport default function ShopMenu() {\n const { services, hours, status } = demoSalon;\n return (\n <ShopFrame density=\"compact\">\n <ServicesSection\n title=\"Services\"\n lead=\"Prices before taxes. Pick one, then the time.\"\n services={services}\n chooseLabel=\"Choose\"\n popularLabel=\"Popular\"\n aside={<OpeningHours label=\"Hours\" days={hours} today=\"3\" status={status} />}\n />\n </ShopFrame>\n );\n}\n"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "menu-columns",
|
|
187
|
+
"title": "Services · menu in two columns",
|
|
188
|
+
"description": "With nothing beside it, the menu takes two columns from a laptop.",
|
|
189
|
+
"path": "examples/shop/menu-columns.tsx",
|
|
190
|
+
"module": "@krizaka/ui/registry/examples/shop/menu-columns",
|
|
191
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoPets } from \"@krizaka/ui/shop/demo\";\nimport { ServicesSection } from \"@krizaka/ui/shop/services\";\n\n// Nothing beside the list: two columns from a laptop, one on a phone.\nexport default function ShopMenuColumns() {\n return (\n <ShopFrame density=\"compact\">\n <ServicesSection title=\"Walks and visits\" services={demoPets.services} columns={2} chooseLabel=\"Choose\" popularLabel=\"Popular\" />\n </ShopFrame>\n );\n}\n"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "cards",
|
|
195
|
+
"title": "Services · cards",
|
|
196
|
+
"description": "Cards with a 4:3 photo, six at most.",
|
|
197
|
+
"path": "examples/shop/cards.tsx",
|
|
198
|
+
"module": "@krizaka/ui/registry/examples/shop/cards",
|
|
199
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoPets } from \"@krizaka/ui/shop/demo\";\nimport { ServicesSection } from \"@krizaka/ui/shop/services\";\n\n// Services · cards: the same resolved services, another drawing.\nexport default function ShopCards() {\n return (\n <ShopFrame density=\"compact\">\n <ServicesSection variant=\"cards\" title=\"Walks and visits\" services={demoPets.services} chooseLabel=\"Choose\" popularLabel=\"Popular\" />\n </ShopFrame>\n );\n}\n"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "index",
|
|
203
|
+
"title": "Services · index cards",
|
|
204
|
+
"description": "The Cahier's stamped cards, for a shop that wears the notebook.",
|
|
205
|
+
"path": "examples/shop/index.tsx",
|
|
206
|
+
"module": "@krizaka/ui/registry/examples/shop/index",
|
|
207
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoPets } from \"@krizaka/ui/shop/demo\";\nimport { ServicesSection } from \"@krizaka/ui/shop/services\";\n\n// Services · index: the same resolved services, another drawing.\nexport default function ShopIndex() {\n return (\n <ShopFrame density=\"compact\">\n <ServicesSection variant=\"index\" title=\"Walks and visits\" services={demoPets.services} chooseLabel=\"Choose\" popularLabel=\"Popular\" />\n </ShopFrame>\n );\n}\n"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "carousel",
|
|
211
|
+
"title": "Services · carousel",
|
|
212
|
+
"description": "A snap strip, phone first.",
|
|
213
|
+
"path": "examples/shop/carousel.tsx",
|
|
214
|
+
"module": "@krizaka/ui/registry/examples/shop/carousel",
|
|
215
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoPets } from \"@krizaka/ui/shop/demo\";\nimport { ServicesSection } from \"@krizaka/ui/shop/services\";\n\n// Services · carousel: the same resolved services, another drawing.\nexport default function ShopCarousel() {\n return (\n <ShopFrame density=\"compact\">\n <ServicesSection variant=\"carousel\" title=\"Walks and visits\" services={demoPets.services} chooseLabel=\"Choose\" popularLabel=\"Popular\" />\n </ShopFrame>\n );\n}\n"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "hero-poster",
|
|
219
|
+
"title": "Hero · poster",
|
|
220
|
+
"description": "The cover with the name over it, art-directed 16:9 on a laptop and 4:5 on a phone.",
|
|
221
|
+
"path": "examples/shop/hero-poster.tsx",
|
|
222
|
+
"module": "@krizaka/ui/registry/examples/shop/hero-poster",
|
|
223
|
+
"code": "import { Button } from \"@krizaka/ui/button\";\nimport { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { HeroSection } from \"@krizaka/ui/shop/hero\";\n\n// Hero · poster. The shop's name is the page's h1; the first image is the page's LCP.\nexport default function ShopHeroPoster() {\n const { name, eyebrow, promise, cover } = demoSalon;\n return (\n <ShopFrame>\n <HeroSection variant=\"poster\" title={name} eyebrow={eyebrow} lead={promise} cover={cover} actions={<Button variant=\"primary\" size=\"lg\">Book</Button>} />\n </ShopFrame>\n );\n}\n"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "hero-split",
|
|
227
|
+
"title": "Hero · split",
|
|
228
|
+
"description": "The title in the frame beside a 4:5 photo.",
|
|
229
|
+
"path": "examples/shop/hero-split.tsx",
|
|
230
|
+
"module": "@krizaka/ui/registry/examples/shop/hero-split",
|
|
231
|
+
"code": "import { Button } from \"@krizaka/ui/button\";\nimport { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { HeroSection } from \"@krizaka/ui/shop/hero\";\n\n// Hero · split. The shop's name is the page's h1; the first image is the page's LCP.\nexport default function ShopHeroSplit() {\n const { name, eyebrow, promise, cover } = demoSalon;\n return (\n <ShopFrame>\n <HeroSection variant=\"split\" title={name} eyebrow={eyebrow} lead={promise} cover={cover} actions={<Button variant=\"primary\" size=\"lg\">Book</Button>} />\n </ShopFrame>\n );\n}\n"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "hero-banner",
|
|
235
|
+
"title": "Hero · banner",
|
|
236
|
+
"description": "A 21:9 photo and the name under it.",
|
|
237
|
+
"path": "examples/shop/hero-banner.tsx",
|
|
238
|
+
"module": "@krizaka/ui/registry/examples/shop/hero-banner",
|
|
239
|
+
"code": "import { Button } from \"@krizaka/ui/button\";\nimport { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { HeroSection } from \"@krizaka/ui/shop/hero\";\n\n// Hero · banner. The shop's name is the page's h1; the first image is the page's LCP.\nexport default function ShopHeroBanner() {\n const { name, eyebrow, promise, cover } = demoSalon;\n return (\n <ShopFrame>\n <HeroSection variant=\"banner\" title={name} eyebrow={eyebrow} lead={promise} cover={cover} actions={<Button variant=\"primary\" size=\"lg\">Book</Button>} />\n </ShopFrame>\n );\n}\n"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"name": "hero-tv",
|
|
243
|
+
"title": "Hero · tv",
|
|
244
|
+
"description": "The shop's sign and its latest video in the old television.",
|
|
245
|
+
"path": "examples/shop/hero-tv.tsx",
|
|
246
|
+
"module": "@krizaka/ui/registry/examples/shop/hero-tv",
|
|
247
|
+
"code": "import { Button } from \"@krizaka/ui/button\";\nimport { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { HeroSection } from \"@krizaka/ui/shop/hero\";\n\n// Hero · tv: the sign is the h1, the shop's latest video plays in the cabinet (a still here: the demo has no clip).\nexport default function ShopHeroTv() {\n const { name, promise, cover } = demoSalon;\n return (\n <ShopFrame density=\"airy\">\n <HeroSection variant=\"tv\" title={name} lead={promise} actions={<Button variant=\"primary\" size=\"lg\">Book</Button>} tv={{ src: \"https://krizaka-assets.b-cdn.net/site/brand-films/film/le-monde-de-krizaka-16x9-en.9391096007.mp4\", poster: cover.src, title: \"Latest video\", channel: \"CH 3 · Saint-Henri\" }} />\n </ShopFrame>\n );\n}\n"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "booking-strip",
|
|
251
|
+
"title": "Booking · strip",
|
|
252
|
+
"description": "The next free times, one tap each.",
|
|
253
|
+
"path": "examples/shop/booking-strip.tsx",
|
|
254
|
+
"module": "@krizaka/ui/registry/examples/shop/booking-strip",
|
|
255
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { BookingSection } from \"@krizaka/ui/shop/booking\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\n\n// The next free times in one line: one tap each, then the booking page.\nexport default function ShopBookingStrip() {\n return (\n <ShopFrame>\n <BookingSection label=\"Next free times\" times={demoSalon.times} href=\"#book\" actionLabel=\"All times\" />\n </ShopFrame>\n );\n}\n"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "booking-panel",
|
|
259
|
+
"title": "Booking · panel",
|
|
260
|
+
"description": "The closing call.",
|
|
261
|
+
"path": "examples/shop/booking-panel.tsx",
|
|
262
|
+
"module": "@krizaka/ui/registry/examples/shop/booking-panel",
|
|
263
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { BookingSection } from \"@krizaka/ui/shop/booking\";\n\n// The closing call of the page.\nexport default function ShopBookingPanel() {\n return (\n <ShopFrame>\n <BookingSection variant=\"panel\" label=\"Book\" title=\"Ready when you are\" body=\"Choose a time at Salon Cèdre & Ciseaux in a few taps. Pay at the shop.\" href=\"#book\" actionLabel=\"Book\" />\n </ShopFrame>\n );\n}\n"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "booking-sticky",
|
|
267
|
+
"title": "Booking · sticky",
|
|
268
|
+
"description": "The phone bar, held at the bottom edge and never over content.",
|
|
269
|
+
"path": "examples/shop/booking-sticky.tsx",
|
|
270
|
+
"module": "@krizaka/ui/registry/examples/shop/booking-sticky",
|
|
271
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { BookingSection } from \"@krizaka/ui/shop/booking\";\n\n// The phone bar: last child of the page, held at the bottom edge; hidden while the page's own « Book » is on screen.\nexport default function ShopBookingSticky() {\n return (\n <ShopFrame className=\"min-h-60\">\n <p className=\"m-4 text-sm text-fg-secondary\">The page scrolls; on a phone the bar stays at the bottom edge.</p>\n <BookingSection variant=\"sticky\" label=\"Book\" href=\"#book\" actionLabel=\"Book\" />\n </ShopFrame>\n );\n}\n"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"name": "gallery-mosaic",
|
|
275
|
+
"title": "Gallery · mosaic",
|
|
276
|
+
"description": "One 4:5 lead and four squares.",
|
|
277
|
+
"path": "examples/shop/gallery-mosaic.tsx",
|
|
278
|
+
"module": "@krizaka/ui/registry/examples/shop/gallery-mosaic",
|
|
279
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { GallerySection } from \"@krizaka/ui/shop/gallery\";\n\n// Gallery · mosaic: the shop's own photos, each once.\nexport default function ShopGalleryMosaic() {\n return (\n <ShopFrame>\n <GallerySection variant=\"mosaic\" title=\"Inside the salon\" label=\"Photos of the salon\" photos={demoSalon.photos} />\n </ShopFrame>\n );\n}\n"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "gallery-filmstrip",
|
|
283
|
+
"title": "Gallery · filmstrip",
|
|
284
|
+
"description": "A snap strip of 3:4 photos.",
|
|
285
|
+
"path": "examples/shop/gallery-filmstrip.tsx",
|
|
286
|
+
"module": "@krizaka/ui/registry/examples/shop/gallery-filmstrip",
|
|
287
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { GallerySection } from \"@krizaka/ui/shop/gallery\";\n\n// Gallery · filmstrip: the shop's own photos, each once.\nexport default function ShopGalleryFilmstrip() {\n return (\n <ShopFrame>\n <GallerySection variant=\"filmstrip\" title=\"Inside the salon\" label=\"Photos of the salon\" photos={demoSalon.photos} />\n </ShopFrame>\n );\n}\n"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"name": "gallery-wall",
|
|
291
|
+
"title": "Gallery · wall",
|
|
292
|
+
"description": "Polaroids, a note and the shop's sign on a textured wall.",
|
|
293
|
+
"path": "examples/shop/gallery-wall.tsx",
|
|
294
|
+
"module": "@krizaka/ui/registry/examples/shop/gallery-wall",
|
|
295
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoPets } from \"@krizaka/ui/shop/demo\";\nimport { GallerySection } from \"@krizaka/ui/shop/gallery\";\n\n// Gallery · wall: polaroids, a note from a client and the shop's sign, hung the same way every time.\nexport default function ShopGalleryWall() {\n return (\n <ShopFrame density=\"airy\">\n <GallerySection variant=\"wall\" title=\"On the wall\" label=\"The shop's wall\" photos={demoPets.photos.slice(0, 4)} sign={demoPets.name} texture=\"ridge\" notes={[{ id: \"n1\", text: \"Rex waits for Maude at the door every morning.\", signature: \"Chloé\" }]} />\n </ShopFrame>\n );\n}\n"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"name": "gallery-grid",
|
|
299
|
+
"title": "Gallery · grid",
|
|
300
|
+
"description": "The shop's photos in tiles, the first featured.",
|
|
301
|
+
"path": "examples/shop/gallery-grid.tsx",
|
|
302
|
+
"module": "@krizaka/ui/registry/examples/shop/gallery-grid",
|
|
303
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { GallerySection } from \"@krizaka/ui/shop/gallery\";\n\n// Gallery · grid: the shop's own photos, each once.\nexport default function ShopGalleryGrid() {\n return (\n <ShopFrame>\n <GallerySection variant=\"grid\" title=\"Inside the salon\" label=\"Photos of the salon\" photos={demoSalon.photos} />\n </ShopFrame>\n );\n}\n"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "video-tv",
|
|
307
|
+
"title": "Video · tv",
|
|
308
|
+
"description": "The shop's latest reel in the old television; a platform's short is behind a button, nothing is requested before the click.",
|
|
309
|
+
"path": "examples/shop/video-tv.tsx",
|
|
310
|
+
"module": "@krizaka/ui/registry/examples/shop/video-tv",
|
|
311
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoReel } from \"@krizaka/ui/shop/demo\";\nimport { VideoSection } from \"@krizaka/ui/shop/video\";\n\n// The shop's latest reel in the old TV: a platform's short is behind a button, nothing is requested before the click.\nexport default function ShopVideoTv() {\n return (\n <ShopFrame density=\"airy\">\n <VideoSection title=\"Latest from the salon\" reels={[demoReel]} cabinet=\"portable\" channel=\"CH 3 · Saint-Henri\" playLabels={{ tiktok: \"Load TikTok and play\", \"youtube-shorts\": \"Load YouTube and play\", instagram: \"Load Instagram and play\" }} notice=\"TikTok will receive your address when you press play.\" aside={<p className=\"m-0 max-w-sm text-fg-secondary\">Press play to watch. We only load TikTok when you ask.</p>} />\n </ShopFrame>\n );\n}\n"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"name": "video-shorts",
|
|
315
|
+
"title": "Video · shorts",
|
|
316
|
+
"description": "Another channel's reels, each behind its own button.",
|
|
317
|
+
"path": "examples/shop/video-shorts.tsx",
|
|
318
|
+
"module": "@krizaka/ui/registry/examples/shop/video-shorts",
|
|
319
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoReel } from \"@krizaka/ui/shop/demo\";\nimport { VideoSection } from \"@krizaka/ui/shop/video\";\n\n// Another channel's reels, each behind its own button.\nexport default function ShopVideoShorts() {\n const play = { tiktok: \"Load TikTok and play\", \"youtube-shorts\": \"Load YouTube and play\", instagram: \"Load Instagram and play\" };\n return (\n <ShopFrame>\n <VideoSection variant=\"shorts\" title=\"Reels\" reels={[demoReel, { ...demoReel, id: \"r2\", title: \"Colour day\" }, { ...demoReel, id: \"r3\", title: \"Cut and blow-dry\" }]} playLabels={play} />\n </ShopFrame>\n );\n}\n"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"name": "reviews-summary-cards",
|
|
323
|
+
"title": "Reviews · score and cards",
|
|
324
|
+
"description": "The score as a stamp with its distribution, beside two or three reviews. Nothing under the host's minimum.",
|
|
325
|
+
"path": "examples/shop/reviews-summary-cards.tsx",
|
|
326
|
+
"module": "@krizaka/ui/registry/examples/shop/reviews-summary-cards",
|
|
327
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoReviews } from \"@krizaka/ui/shop/demo\";\nimport { ReviewsSection } from \"@krizaka/ui/shop/reviews\";\n\n// Reviews · summary-cards. Nothing is drawn under the host's minimum of verified reviews (5 here, 38 verified).\nexport default function ShopReviewsSummary() {\n return (\n <ShopFrame>\n <ReviewsSection variant=\"summary-cards\" title=\"What clients say\" summary={demoReviews.summary} reviews={demoReviews.reviews} count={2} />\n </ShopFrame>\n );\n}\n"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"name": "reviews-quote",
|
|
331
|
+
"title": "Reviews · quote",
|
|
332
|
+
"description": "One large review.",
|
|
333
|
+
"path": "examples/shop/reviews-quote.tsx",
|
|
334
|
+
"module": "@krizaka/ui/registry/examples/shop/reviews-quote",
|
|
335
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoReviews } from \"@krizaka/ui/shop/demo\";\nimport { ReviewsSection } from \"@krizaka/ui/shop/reviews\";\n\n// Reviews · quote. Nothing is drawn under the host's minimum of verified reviews (5 here, 38 verified).\nexport default function ShopReviewsQuote() {\n return (\n <ShopFrame>\n <ReviewsSection variant=\"quote\" title=\"What clients say\" summary={demoReviews.summary} reviews={demoReviews.reviews} count={2} />\n </ShopFrame>\n );\n}\n"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"name": "reviews-strip",
|
|
339
|
+
"title": "Reviews · strip",
|
|
340
|
+
"description": "The score in one line.",
|
|
341
|
+
"path": "examples/shop/reviews-strip.tsx",
|
|
342
|
+
"module": "@krizaka/ui/registry/examples/shop/reviews-strip",
|
|
343
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoReviews } from \"@krizaka/ui/shop/demo\";\nimport { ReviewsSection } from \"@krizaka/ui/shop/reviews\";\n\n// Reviews · strip. Nothing is drawn under the host's minimum of verified reviews (5 here, 38 verified).\nexport default function ShopReviewsStrip() {\n return (\n <ShopFrame>\n <ReviewsSection variant=\"strip\" title=\"What clients say\" summary={demoReviews.summary} reviews={demoReviews.reviews} count={2} />\n </ShopFrame>\n );\n}\n"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"name": "bulletin-board",
|
|
347
|
+
"title": "Bulletin · board",
|
|
348
|
+
"description": "Pinned notes, newest first, taken down after their last day, three at most.",
|
|
349
|
+
"path": "examples/shop/bulletin-board.tsx",
|
|
350
|
+
"module": "@krizaka/ui/registry/examples/shop/bulletin-board",
|
|
351
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { BulletinSection } from \"@krizaka/ui/shop/bulletin\";\nimport { demoFlyers } from \"@krizaka/ui/shop/demo\";\n\n// Pinned notes, newest first, each taken down after its last day: `today` is the shop's, never read from a clock here.\nexport default function ShopBulletinBoard() {\n return (\n <ShopFrame density=\"airy\">\n <BulletinSection title=\"News\" today=\"2026-11-04\" flyers={demoFlyers} />\n </ShopFrame>\n );\n}\n"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"name": "bulletin-banner",
|
|
355
|
+
"title": "Bulletin · banner",
|
|
356
|
+
"description": "One line of text above the hero; never an image.",
|
|
357
|
+
"path": "examples/shop/bulletin-banner.tsx",
|
|
358
|
+
"module": "@krizaka/ui/registry/examples/shop/bulletin-banner",
|
|
359
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { BulletinSection } from \"@krizaka/ui/shop/bulletin\";\nimport { demoFlyers } from \"@krizaka/ui/shop/demo\";\n\n// One line of text above the hero — never an image, so the first screen's LCP stays the hero's. The renderer hoists it.\nexport default function ShopBulletinBanner() {\n return (\n <ShopFrame>\n <BulletinSection variant=\"banner\" title=\"News\" today=\"2026-10-27\" flyers={demoFlyers} />\n </ShopFrame>\n );\n}\n"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"name": "team-row",
|
|
363
|
+
"title": "Team · row",
|
|
364
|
+
"description": "Avatars and first names in a line.",
|
|
365
|
+
"path": "examples/shop/team-row.tsx",
|
|
366
|
+
"module": "@krizaka/ui/registry/examples/shop/team-row",
|
|
367
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { TeamSection } from \"@krizaka/ui/shop/team\";\n\n// Team · row: first names, and the face the member chose (the default avatar otherwise — never a stock face).\nexport default function ShopTeamRow() {\n return (\n <ShopFrame>\n <TeamSection variant=\"row\" title=\"Your team\" members={demoSalon.team.map((t, i) => ({ id: t.id, name: t.name, role: [\"Colourist\", \"Barber\", \"Stylist\", \"Reception\"][i] }))} />\n </ShopFrame>\n );\n}\n"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"name": "team-cards",
|
|
371
|
+
"title": "Team · cards",
|
|
372
|
+
"description": "A card each with a role.",
|
|
373
|
+
"path": "examples/shop/team-cards.tsx",
|
|
374
|
+
"module": "@krizaka/ui/registry/examples/shop/team-cards",
|
|
375
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { TeamSection } from \"@krizaka/ui/shop/team\";\n\n// Team · cards: first names, and the face the member chose (the default avatar otherwise — never a stock face).\nexport default function ShopTeamCards() {\n return (\n <ShopFrame>\n <TeamSection variant=\"cards\" title=\"Your team\" members={demoSalon.team.map((t, i) => ({ id: t.id, name: t.name, role: [\"Colourist\", \"Barber\", \"Stylist\", \"Reception\"][i] }))} />\n </ShopFrame>\n );\n}\n"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "visit-card",
|
|
379
|
+
"title": "Visit · card",
|
|
380
|
+
"description": "The hours, the address and a call.",
|
|
381
|
+
"path": "examples/shop/visit-card.tsx",
|
|
382
|
+
"module": "@krizaka/ui/registry/examples/shop/visit-card",
|
|
383
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoMap, demoSalon as shop } from \"@krizaka/ui/shop/demo\";\nimport { VisitSection } from \"@krizaka/ui/shop/visit\";\n\n// Visit · card: hours, address and a call; the map shows as a still until it is asked for on a phone.\nexport default function ShopVisitCard() {\n return (\n <ShopFrame>\n <VisitSection variant=\"card\" title=\"Visit\" hours={shop.hours} today=\"3\" status={shop.status} hoursLabel=\"Hours\" address={shop.address} phone={{ href: \"tel:5145550110\", label: shop.phone }} map={demoMap} />\n </ShopFrame>\n );\n}\n"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "visit-map",
|
|
387
|
+
"title": "Visit · map",
|
|
388
|
+
"description": "The place on a map: a still and a button on a phone, the live map from `sm`.",
|
|
389
|
+
"path": "examples/shop/visit-map.tsx",
|
|
390
|
+
"module": "@krizaka/ui/registry/examples/shop/visit-map",
|
|
391
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoMap, demoSalon as shop } from \"@krizaka/ui/shop/demo\";\nimport { VisitSection } from \"@krizaka/ui/shop/visit\";\n\n// Visit · map: hours, address and a call; the map shows as a still until it is asked for on a phone.\nexport default function ShopVisitMap() {\n return (\n <ShopFrame>\n <VisitSection variant=\"map\" title=\"Visit\" hours={shop.hours} today=\"3\" status={shop.status} hoursLabel=\"Hours\" address={shop.address} phone={{ href: \"tel:5145550110\", label: shop.phone }} map={demoMap} />\n </ShopFrame>\n );\n}\n"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "visit-split",
|
|
395
|
+
"title": "Visit · split",
|
|
396
|
+
"description": "The hours beside the map.",
|
|
397
|
+
"path": "examples/shop/visit-split.tsx",
|
|
398
|
+
"module": "@krizaka/ui/registry/examples/shop/visit-split",
|
|
399
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoMap, demoSalon as shop } from \"@krizaka/ui/shop/demo\";\nimport { VisitSection } from \"@krizaka/ui/shop/visit\";\n\n// Visit · split: hours, address and a call; the map shows as a still until it is asked for on a phone.\nexport default function ShopVisitSplit() {\n return (\n <ShopFrame>\n <VisitSection variant=\"split\" title=\"Visit\" hours={shop.hours} today=\"3\" status={shop.status} hoursLabel=\"Hours\" address={shop.address} phone={{ href: \"tel:5145550110\", label: shop.phone }} map={demoMap} />\n </ShopFrame>\n );\n}\n"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "story-quote",
|
|
403
|
+
"title": "Story · quote",
|
|
404
|
+
"description": "A pull quote and a paragraph.",
|
|
405
|
+
"path": "examples/shop/story-quote.tsx",
|
|
406
|
+
"module": "@krizaka/ui/registry/examples/shop/story-quote",
|
|
407
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoStory } from \"@krizaka/ui/shop/demo\";\nimport { StorySection } from \"@krizaka/ui/shop/story\";\n\n// A pull quote and a paragraph: the owner's own words.\nexport default function ShopStoryQuote() {\n return (\n <ShopFrame density=\"airy\">\n <StorySection title=\"Our story\" quote={demoStory.quote} body={demoStory.body} />\n </ShopFrame>\n );\n}\n"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"name": "story-owner",
|
|
411
|
+
"title": "Story · owner",
|
|
412
|
+
"description": "The owner's face, a paragraph, a way to call.",
|
|
413
|
+
"path": "examples/shop/story-owner.tsx",
|
|
414
|
+
"module": "@krizaka/ui/registry/examples/shop/story-owner",
|
|
415
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoStory } from \"@krizaka/ui/shop/demo\";\nimport { StorySection } from \"@krizaka/ui/shop/story\";\n\n// The owner's face, a paragraph, a way to call.\nexport default function ShopStoryOwner() {\n return (\n <ShopFrame>\n <StorySection variant=\"owner\" title=\"Who we are\" body={demoStory.body} owner={demoStory.owner} actions={<a className=\"text-fg-accent underline\" href=\"tel:5145550110\">Call Jade</a>} />\n </ShopFrame>\n );\n}\n"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"name": "social-links",
|
|
419
|
+
"title": "Social · links",
|
|
420
|
+
"description": "Plain links: a new tab, no referrer, `nofollow`.",
|
|
421
|
+
"path": "examples/shop/social-links.tsx",
|
|
422
|
+
"module": "@krizaka/ui/registry/examples/shop/social-links",
|
|
423
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { SocialSection } from \"@krizaka/ui/shop/social\";\n\n// Plain anchors: a new tab, no referrer, `nofollow`, nothing loaded from the platform.\nexport default function ShopSocialLinks() {\n return (\n <ShopFrame>\n <SocialSection title=\"Follow the salon\" links={[{ id: \"i\", platform: \"instagram\", url: \"https://www.instagram.com/salon.cedre\" }, { id: \"t\", platform: \"tiktok\", url: \"https://www.tiktok.com/@salon.cedre\" }]} />\n </ShopFrame>\n );\n}\n"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"name": "social-facade",
|
|
427
|
+
"title": "Social · facade",
|
|
428
|
+
"description": "The latest reel behind a button.",
|
|
429
|
+
"path": "examples/shop/social-facade.tsx",
|
|
430
|
+
"module": "@krizaka/ui/registry/examples/shop/social-facade",
|
|
431
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoReel } from \"@krizaka/ui/shop/demo\";\nimport { SocialSection } from \"@krizaka/ui/shop/social\";\n\n// The latest reel behind a button: the frame is added only after the click.\nexport default function ShopSocialFacade() {\n return (\n <ShopFrame>\n <SocialSection variant=\"facade\" title=\"Latest reel\" links={[{ id: \"t\", platform: demoReel.platform, url: demoReel.url }]} reelTitle={demoReel.title} playLabels={{ tiktok: \"Load TikTok and play\", \"youtube-shorts\": \"Load YouTube and play\", instagram: \"Load Instagram and play\" }} />\n </ShopFrame>\n );\n}\n"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"name": "faq",
|
|
435
|
+
"title": "Questions",
|
|
436
|
+
"description": "Native `details` with the page's FAQPage JSON-LD.",
|
|
437
|
+
"path": "examples/shop/faq.tsx",
|
|
438
|
+
"module": "@krizaka/ui/registry/examples/shop/faq",
|
|
439
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoFaq } from \"@krizaka/ui/shop/demo\";\nimport { FaqSection } from \"@krizaka/ui/shop/faq\";\n\n// Native `details`, and the same answers as FAQPage structured data for search engines.\nexport default function ShopFaq() {\n return (\n <ShopFrame>\n <FaqSection title=\"Questions\" questions={demoFaq} />\n </ShopFrame>\n );\n}\n"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"name": "policies",
|
|
443
|
+
"title": "Policies",
|
|
444
|
+
"description": "Cancellation, prices and the booking window.",
|
|
445
|
+
"path": "examples/shop/policies.tsx",
|
|
446
|
+
"module": "@krizaka/ui/registry/examples/shop/policies",
|
|
447
|
+
"code": "import { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoPolicies } from \"@krizaka/ui/shop/demo\";\nimport { PoliciesSection } from \"@krizaka/ui/shop/policies\";\n\n// Cancellation, prices and the booking window, as term and value.\nexport default function ShopPolicies() {\n return (\n <ShopFrame>\n <PoliciesSection title=\"Good to know\" items={demoPolicies} />\n </ShopFrame>\n );\n}\n"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "page",
|
|
451
|
+
"title": "A compact salon page",
|
|
452
|
+
"description": "The hero, the next free times, the menu beside the hours, a filmstrip and the closing call, inside one frame and one rhythm.",
|
|
453
|
+
"path": "examples/shop/page.tsx",
|
|
454
|
+
"module": "@krizaka/ui/registry/examples/shop/page",
|
|
455
|
+
"code": "import { Button } from \"@krizaka/ui/button\";\nimport { OpeningHours } from \"@krizaka/ui/opening-hours\";\nimport { ShopFrame } from \"@krizaka/ui/shop\";\nimport { BookingSection } from \"@krizaka/ui/shop/booking\";\nimport { demoSalon as shop } from \"@krizaka/ui/shop/demo\";\nimport { GallerySection } from \"@krizaka/ui/shop/gallery\";\nimport { HeroSection } from \"@krizaka/ui/shop/hero\";\nimport { ServicesSection } from \"@krizaka/ui/shop/services\";\n\n// A compact salon page: the poster, the next free times, the menu beside the hours, a filmstrip, the closing call.\nexport default function ShopPage() {\n const hours = (\n <>\n <OpeningHours label=\"Hours\" days={shop.hours} today=\"3\" status={shop.status} />\n <p className=\"m-0 text-[13px] text-fg-secondary\">{shop.address} · <a className=\"text-fg-accent underline\" href=\"tel:5145550110\">{shop.phone}</a></p>\n </>\n );\n return (\n <ShopFrame density=\"compact\">\n <HeroSection title={shop.name} eyebrow={shop.eyebrow} lead={shop.promise} cover={shop.cover} actions={<Button variant=\"primary\" size=\"lg\">Book</Button>} />\n <BookingSection label=\"Next free times\" times={shop.times} href=\"#book\" actionLabel=\"All times\" />\n <ServicesSection title=\"Services\" lead=\"Prices before taxes. Pick one, then the time.\" services={shop.services} chooseLabel=\"Choose\" popularLabel=\"Popular\" aside={hours} />\n <GallerySection variant=\"filmstrip\" title=\"Inside the salon\" label=\"Photos of the salon\" photos={shop.photos} />\n <BookingSection variant=\"panel\" label=\"Book\" title=\"Ready when you are\" body=\"Choose a time in a few taps. Pay at the shop.\" href=\"#book\" actionLabel=\"Book\" />\n </ShopFrame>\n );\n}\n"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "document",
|
|
459
|
+
"title": "The document",
|
|
460
|
+
"description": "What the product stores: `parseShopPage` validates a document and answers every issue with its path.",
|
|
461
|
+
"path": "examples/shop/document.tsx",
|
|
462
|
+
"module": "@krizaka/ui/registry/examples/shop/document",
|
|
463
|
+
"code": "import { parseShopPage, shopStarters } from \"@krizaka/ui/shop\";\n\n// What a product stores: a document. `parseShopPage` validates it and says every issue with its path (a 422 for the route).\nexport default function ShopDocument() {\n const page = parseShopPage(shopStarters.salonCompact);\n const broken = parseShopPage({ ...shopStarters.salonCompact, sections: [{ key: \"s\", type: \"hero\", variant: \"tv2\", settings: {} }] });\n return (\n <div className=\"grid gap-4 p-4 font-mono text-sm text-fg\">\n <ol className=\"m-0 list-decimal pl-6\">{page.ok && page.page.sections.map((s) => <li key={s.key}>{s.type} · {s.variant}</li>)}</ol>\n <p className=\"m-0 text-fg-secondary\">{!broken.ok && broken.issues[0]?.path}</p>\n </div>\n );\n}\n"
|
|
464
|
+
}
|
|
465
|
+
]
|
|
466
|
+
},
|
|
467
|
+
"native": null,
|
|
468
|
+
"files": [
|
|
469
|
+
{
|
|
470
|
+
"path": "block-link.tsx",
|
|
471
|
+
"content": "// The links of the page blocks (PageHero's back link, LinkCard, ArgumentCard, ActionBar): an internal path renders\n// through the app's router link (`linkAs`, e.g. Next's `Link`), anything else is an `<a>` that opens in a new tab.\n// Shared by the block entries; never exported on its own.\nimport type * as React from \"react\";\n\n/** The app's link component (Next's `Link`, React Router's `Link`…): receives `href`, `className` and the children. */\nexport type LinkComponent = React.ElementType<{ href: string; className?: string; children?: React.ReactNode; \"aria-label\"?: string; \"aria-describedby\"?: string }>;\n\n/** An address that leaves the app: an absolute URL or a protocol (`mailto:`). */\nexport const isExternal = (href: string) => /^[a-z][a-z0-9+.-]*:/i.test(href);\n\nexport function BlockLink({\n href,\n linkAs: Link = \"a\",\n external = isExternal(href),\n rel,\n ...props\n}: Omit<React.ComponentProps<\"a\">, \"href\"> & { href: string; linkAs?: LinkComponent; external?: boolean }) {\n if (external) return <a href={href} target=\"_blank\" rel={rel ?? \"noopener noreferrer\"} {...props} />;\n const Comp = Link as React.ElementType;\n return <Comp href={href} rel={rel} {...props} />;\n}\n"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"path": "meta.ts",
|
|
475
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which ui.krizaka.com (apps/site) renders as\n// ui.krizaka.com/components/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"notification-preferences\"\n | \"quota-meter\"\n | \"environment-notice\"\n | \"embed-facade\"\n | \"reviews\"\n | \"margin-layout\"\n | \"analysis-report\"\n | \"status-chip\"\n | \"kind-config-editor\"\n | \"agenda\"\n | \"account-settings\"\n | \"drop-overlay\"\n | \"upload-queue\"\n | \"achievement\"\n | \"anatomy-plate\"\n | \"bird-plate\"\n | \"taped-photo\"\n | \"stuck\"\n | \"doodle\"\n | \"signature\"\n | \"grade-stamp\"\n | \"versus-card\"\n | \"speed-lines\"\n | \"site-cahier\"\n | \"text-style\"\n | \"flock\"\n | \"elephant\"\n | \"footnote\"\n | \"page-index\"\n | \"chapter\"\n | \"specimen-tag\"\n | \"action-bar\"\n | \"action-sheet\"\n | \"activity-feed\"\n | \"alert\"\n | \"app-frame\"\n | \"desktop-window\"\n | \"form-flow\"\n | \"grid\"\n | \"list-detail\"\n | \"state-screen\"\n | \"app-header\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"captcha\"\n | \"card\"\n | \"card-grid\"\n | \"catalogue-page\"\n | \"changelog-page\"\n | \"chat\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"chip-row\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"comparison-table\"\n | \"command\"\n | \"component-page\"\n | \"confirm-button\"\n | \"contact-page\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cover-hero\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"description-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-article-page\"\n | \"docs-hub-page\"\n | \"docs-layout\"\n | \"docs-nav\"\n | \"document-viewer\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"engine-flow\"\n | \"error-page\"\n | \"fab\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"force-update-screen\"\n | \"form\"\n | \"gallery-page\"\n | \"genui\"\n | \"glossary\"\n | \"glossary-term\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"header\"\n | \"how-it-works-page\"\n | \"image-cropper\"\n | \"image-viewer\"\n | \"iso\"\n | \"kanban\"\n | \"kbd\"\n | \"kpi-explained\"\n | \"landing-page\"\n | \"landscape\"\n | \"legal-page\"\n | \"link-card\"\n | \"list\"\n | \"loader\"\n | \"longform-page\"\n | \"maintenance-screen\"\n | \"map\"\n | \"markdown\"\n | \"meta-row\"\n | \"waveform\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"match-dialog\"\n | \"media-capture\"\n | \"media-grid\"\n | \"language-switch\"\n | \"media-gallery\"\n | \"media-picker\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"onboarding\"\n | \"opening-hours\"\n | \"otp-input\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"permission-prompt\"\n | \"photo-grid\"\n | \"pointer-light\"\n | \"popover\"\n | \"pricing-page\"\n | \"product-page\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"pull-to-refresh\"\n | \"retro-tv\"\n | \"radio-group\"\n | \"router\"\n | \"rail-nav\"\n | \"recipes\"\n | \"screen\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"service-card\"\n | \"shop\"\n | \"shop-composer\"\n | \"settings-layout\"\n | \"account-menu\"\n | \"showcase\"\n | \"step-showcase\"\n | \"site-footer\"\n | \"sites\"\n | \"skeleton\"\n | \"skip-link\"\n | \"slider\"\n | \"slot-picker\"\n | \"slot\"\n | \"spinner\"\n | \"sticky-action\"\n | \"splash-handoff\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"usage\"\n | \"status-page\"\n | \"step-progress\"\n | \"stepper\"\n | \"swipe-deck\"\n | \"swipeable-row\"\n | \"switch\"\n | \"tab-bar\"\n | \"tabs\"\n | \"tag-input\"\n | \"tag-selector\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"tree-view\"\n | \"txt\"\n | \"update-prompt\"\n | \"verified-badge\"\n | \"vertical-video\"\n | \"video-player\"\n | \"video-trimmer\"\n | \"virtual\"\n | \"wall\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/**\n * Why a component is not on a platform — a decision, never a silence (the parity matrix of ui.krizaka.com/platforms):\n * - `gap` (✗): it belongs there and is not built yet; `issue` is the issue that tracks it (`krizaka/krizaka-ui#275`);\n * - `n/a`: it is not meant for that platform (a site's page block on a phone, a swipe on a desktop); `use` names the\n * component that answers there, when one does.\n */\nexport type Absence =\n | { readonly status: \"gap\"; readonly issue: string; readonly reason: string; readonly use?: undefined }\n | { readonly status: \"n/a\"; readonly reason: string; readonly use?: ComponentName; readonly issue?: undefined };\n\n/**\n * Desktop is the Orazaka Mac app (Tauri 2: the system WebView renders the web components — ADR-002). `web`: the web\n * component runs there as it is; `desktop`: it also has a desktop form (a window's title bar, a denser layout…), said in\n * its documentation; otherwise the absence and why.\n */\nexport type DesktopSupport = \"web\" | \"desktop\" | Absence;\n\n/**\n * The three platforms of Krizaka UI — web · native (React Native, Expo) · desktop — for one component. The side a\n * component has is `platforms`; the side it lacks says why here: `native` is required for (and only for) a web-only\n * component, `web` for a native-only one; `desktop` always. `scripts/registry.test.mjs` fails on a missing decision.\n */\nexport interface Parity {\n readonly web?: Absence;\n readonly native?: Absence;\n readonly desktop: DesktopSupport;\n}\n\n/**\n * `stable`: its API only changes in a major. `beta`: it may still change in a minor. `deprecated`: no product uses it and\n * no work plans to — it still works, says what replaces it, and goes in the major named by `deprecated.removedIn`.\n */\nexport type Status = \"stable\" | \"beta\" | \"deprecated\";\n\n/** What a deprecated component says (required when `status` is `deprecated`, absent otherwise). */\nexport interface Deprecation {\n /** The version that deprecated it (`3.6.0`). */\n readonly since: string;\n /** The major that removes it (`4.0.0`). */\n readonly removedIn: string;\n /** What replaces it, when a component does. */\n readonly use?: ComponentName;\n /** Why it goes: no product uses it, no planned work needs it. */\n readonly reason: string;\n}\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its screens. `templates`: the page templates — whole pages of a\n * site (a landing, a product, a docs hub, a long read, a changelog, pricing, status, an error…), each a distinct\n * composition of the blocks, words and content as props.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"templates\" | \"layout\" | \"foundations\";\n\n/** Why a reader needs a template: the seven intents the templates are grouped by (sidebar sub-headings, catalogue filter). */\nexport type TemplatePurpose = \"convince\" | \"explain\" | \"show\" | \"act\" | \"operate\" | \"converse\" | \"recover\";\n\n/** The groups of templates, in reading order: the title, and the one line that says when to come to that group. */\nexport const templatePurposes = {\n convince: { title: \"Convince\", useWhen: \"You come here when a visitor must decide: a landing, a product, a price, a comparison, a proof.\" },\n explain: { title: \"Explain\", useWhen: \"You come here when a reader must understand: how it works, a documentation hub or article, a changelog, a FAQ, a policy.\" },\n show: { title: \"Show\", useWhen: \"You come here when the work itself is the argument: a gallery, a story, a case study, an object and its details.\" },\n act: { title: \"Act\", useWhen: \"You come here when a person must do something once: reach the team, sign in or up, set up, pay.\" },\n operate: { title: \"Operate\", useWhen: \"You come here when a person works every day: a dashboard, a console with a table, settings, an app shell.\" },\n converse: { title: \"Converse\", useWhen: \"You come here when people talk: an inbox, a chat, comments, a notifications centre.\" },\n recover: { title: \"Recover\", useWhen: \"You come here when the way is blocked: an empty list, an error, a missing page, maintenance, a product still being built.\" },\n} as const satisfies Record<TemplatePurpose, { readonly title: string; readonly useWhen: string }>;\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\ninterface ExampleBase {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** A plain example, or a template: a whole screen with its intent (`purpose`) and the user goal its layout serves (`why`). */\nexport type Example =\n | (ExampleBase & { readonly template?: false; readonly purpose?: undefined; readonly why?: undefined })\n | (ExampleBase & {\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its\n * phone version thought out), copied as a starting point — at most 160 lines, listed on ui.krizaka.com/templates.\n */\n readonly template: true;\n /** The intent that groups it: why you need this block. */\n readonly purpose: TemplatePurpose;\n /** Why this layout: the user goal it serves, in one sentence. */\n readonly why: string;\n });\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n /** The React Native entry alone is deprecated while the web one stays (ADR-006 §7); a deprecated component says it once, above. */\n readonly deprecated?: Deprecation;\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n /** Required for, and only for, a `deprecated` component. */\n readonly deprecated?: Deprecation;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** The platforms it is not on, and why; and its desktop form (see `Parity`). */\n readonly parity: Parity;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"path": "shop/booking/booking.tsx",
|
|
479
|
+
"content": "// 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; `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 { ShopSection } from \"../frame\";\n\nexport type BookingVariant = \"strip\" | \"panel\" | \"sticky\";\n\nexport type BookingTime = {\n id: string;\n /** In words, formatted by the app (`Today 4:30 pm`). */\n label: string;\n /** The booking page with this time chosen. */\n href: string;\n};\n\nexport type BookingSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"strip\" */\n variant?: BookingVariant;\n /** `strip`: the next free times, in order (the first `count`). */\n times?: readonly BookingTime[];\n /** `strip`: the group's name (`Next free times`). */\n label: string;\n /** `strip`: said when no time is free. */\n emptyLabel?: string;\n /** The booking page (`All times →`, `Book`). */\n href: string;\n /** The words of that link / button. */\n actionLabel: string;\n /** `panel`: the invitation (`Ready when you are`), and why. */\n title?: React.ReactNode;\n body?: React.ReactNode;\n 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\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, 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 === \"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"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"path": "shop/booking/index.ts",
|
|
483
|
+
"content": "/** @krizaka/ui/shop/booking — `BookingSection`: the way to book on a shop page — the next free times (`strip`), the closing call (`panel`) or the phone bar (`sticky`). Server-safe. */\nexport { BookingSection,type BookingSectionProps, type BookingTime, type BookingVariant } from \"./booking\";\n"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"path": "shop/bulletin/bulletin.tsx",
|
|
487
|
+
"content": "// Server-safe (the pinned notes are the wall's, a client island imported through its own entry). The owner's news\n// (ADR-007 §3): `board` — up to three pinned notes, newest first, each taken down after its last day; `banner` — one line of\n// text above the hero (never an image: the first screen's LCP stays the hero's). The clock is the host's: `today` arrives as a\n// day, the section never reads the time.\nimport { PinnedNote } from \"@krizaka/ui/wall\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../cn\";\nimport { ShopSection } from \"../frame\";\nimport { SHOP_LIMITS } from \"../limits\";\n\nexport type BulletinVariant = \"board\" | \"banner\";\n\nexport type ShopFlyer = {\n id: string;\n /** At most 140 characters. */\n text: string;\n signature?: string;\n /** The last day it is shown (`2026-11-03`, inclusive); absent: until the owner takes it down. */\n until?: string;\n};\n\nexport type BulletinSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"board\" */\n variant?: BulletinVariant;\n /** The flyers, newest first. */\n flyers: readonly ShopFlyer[];\n /** Today, in the shop's time zone (`2026-10-27`). */\n today: string;\n /** `board`: the section's title (`News`). `banner`: its accessible name. */\n title: string;\n};\n\n/** The flyers still up on a given day, newest first, at most three. */\nexport function liveFlyers(flyers: readonly ShopFlyer[], today: string): ShopFlyer[] {\n return flyers.filter((f) => !f.until || f.until >= today).slice(0, SHOP_LIMITS.flyers);\n}\n\n/** The owner's news: pinned notes, or one line above the hero. */\nexport function BulletinSection({ variant = \"board\", flyers, today, title, className, ...props }: BulletinSectionProps) {\n const live = liveFlyers(flyers, today);\n if (live.length === 0) return null;\n if (variant === \"banner\") {\n return (\n <aside aria-label={title} data-variant=\"banner\" className={cn(\"border-b border-border-subtle bg-accent-soft\", className)}>\n <p className=\"m-0 mx-auto max-w-6xl px-4 py-2 text-center text-[13px] font-medium text-fg\">{live[0]!.text}</p>\n </aside>\n );\n }\n return (\n <ShopSection title={title} className={className} data-variant=\"board\" {...props}>\n <ul className=\"m-0 grid list-none gap-4 p-0 sm:grid-cols-2 lg:grid-cols-3\">\n {live.map((f, i) => (\n <li key={f.id}>\n <PinnedNote text={f.text} signature={f.signature} rotation={[-1.2, 1, -0.6][i % 3]} hold={i % 2 === 0 ? \"tape\" : \"pin\"} lines={3} />\n </li>\n ))}\n </ul>\n </ShopSection>\n );\n}\n"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"path": "shop/bulletin/index.ts",
|
|
491
|
+
"content": "/** @krizaka/ui/shop/bulletin — `BulletinSection`: the owner's news on a shop page — up to three pinned notes taken down after their last day (`board`), or one line of text above the hero (`banner`); `liveFlyers`. Server-safe. */\nexport { BulletinSection, type BulletinSectionProps, type BulletinVariant, liveFlyers, type ShopFlyer } from \"./bulletin\";\n"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"path": "shop/catalogue.ts",
|
|
495
|
+
"content": "// The catalogue of section types (ADR-007 §3): each with its variants, its settings and the blocks it allows, as zod\n// schemas — the renderer, the validator and the composer's forms read the same definitions. The first variant of a type is\n// its default. Settings hold references and rules (ids, a source, a count), never a price or a text of the shop.\nimport * as z from \"zod/mini\";\n\nimport { defineSection } from \"./define\";\nimport { SHOP_LIMITS } from \"./limits\";\nimport { localizedText } from \"./text\";\n\n/** A reference to something the product holds (a service, a photo, a member): an opaque id. */\nconst ref = z.string().check(z.minLength(1), z.maxLength(80));\nconst short = z.string().check(z.minLength(1), z.maxLength(140));\nconst url = z.string().check(z.maxLength(300), z.regex(/^https:\\/\\//, \"an https address\"));\nconst isoDay = z.string().check(z.regex(/^\\d{4}-\\d{2}-\\d{2}$/, \"a day (YYYY-MM-DD)\"));\nconst source = z.enum([\"all\", \"pick\"]);\n/** One of a few numbers. */\nconst oneOf = <const N extends readonly [number, number, ...number[]]>(...n: N) => z.union(n.map((v) => z.literal(v)) as unknown as [z.ZodMiniLiteral<N[number]>, z.ZodMiniLiteral<N[number]>]);\n\nexport const platforms = [\"tiktok\", \"youtube-shorts\", \"instagram\"] as const;\n\nexport const heroSection = defineSection({\n type: \"hero\",\n variants: [\"poster\", \"split\", \"banner\", \"tv\"],\n settings: z.object({\n /** The cover: a media id. Absent, the product's default for the trade. */\n media: z.optional(ref),\n /** Where the photo is cropped to when the box is not its ratio. */\n focus: z.enum([\"center\", \"top\", \"bottom\"]),\n }),\n settingsDefault: { focus: \"center\" },\n blocks: { fact: z.object({ kind: z.enum([\"open-now\", \"area\", \"score\"]) }) },\n});\n\nexport const servicesSection = defineSection({\n type: \"services\",\n variants: [\"menu\", \"cards\", \"index\", \"carousel\"],\n settings: z.object({\n /** `all` the shop's services, or `pick` the ones the `service` blocks name, in their order. */\n source,\n groupBy: z.enum([\"category\", \"none\"]),\n /** `menu` only: two columns when nothing sits beside it. */\n columns: oneOf(1, 2),\n /** `menu` only: the shop's hours, team and address beside the list (the host draws them from its own data). */\n aside: z.enum([\"hours\", \"none\"]),\n }),\n settingsDefault: { source: \"all\", groupBy: \"category\", columns: 1, aside: \"hours\" },\n blocks: { service: z.object({ serviceId: ref }) },\n refine: (section, issue) => {\n if (section.settings.source === \"pick\" && (section.blocks ?? []).length === 0) issue([\"blocks\"], \"pick at least one service\");\n if (section.variant === \"cards\" && (section.blocks ?? []).length > SHOP_LIMITS.cards) issue([\"blocks\"], `at most ${SHOP_LIMITS.cards} cards`);\n },\n});\n\nexport const bookingSection = defineSection({\n type: \"booking\",\n variants: [\"strip\", \"panel\", \"sticky\"],\n settings: z.object({\n /** A service the times are for; absent, the next free times of any service. */\n serviceId: z.optional(ref),\n /** `strip`: how many times it shows. */\n count: oneOf(3, 4, 6),\n }),\n settingsDefault: { count: 4 },\n});\n\nexport const gallerySection = defineSection({\n type: \"gallery\",\n variants: [\"mosaic\", \"filmstrip\", \"wall\", \"grid\"],\n settings: z.object({\n source,\n /** `wall` only. */\n texture: z.enum([\"plaster\", \"brick\", \"ridge\", \"zellige\"]),\n }),\n settingsDefault: { source: \"all\", texture: \"plaster\" },\n blocks: {\n photo: z.object({ mediaId: ref, caption: z.optional(short) }),\n note: z.object({ text: short, signature: z.optional(z.string().check(z.maxLength(40))) }),\n sign: z.object({}),\n },\n refine: (section, issue) => {\n const photos = (section.blocks ?? []).filter((b) => b.type === \"photo\").length;\n if (photos > SHOP_LIMITS.photos) issue([\"blocks\"], `at most ${SHOP_LIMITS.photos} photos`);\n },\n});\n\nexport const videoSection = defineSection({\n type: \"video\",\n variants: [\"tv\", \"shorts\"],\n settings: z.object({ cabinet: z.enum([\"cabinet\", \"portable\"]), channel: z.optional(z.string().check(z.maxLength(32))) }),\n settingsDefault: { cabinet: \"cabinet\" },\n blocks: { reel: z.object({ platform: z.enum(platforms), url }) },\n});\n\nexport const reviewsSection = defineSection({\n type: \"reviews\",\n variants: [\"summary-cards\", \"quote\", \"strip\"],\n settings: z.object({ rule: z.enum([\"best\", \"latest\"]), count: oneOf(1, 2, 3) }),\n settingsDefault: { rule: \"best\", count: 2 },\n});\n\nexport const bulletinSection = defineSection({\n type: \"bulletin\",\n variants: [\"board\", \"banner\"],\n settings: z.object({}),\n settingsDefault: {},\n blocks: { flyer: z.object({ text: short, signature: z.optional(z.string().check(z.maxLength(40))), until: z.optional(isoDay) }) },\n refine: (section, issue) => {\n if ((section.blocks ?? []).length > SHOP_LIMITS.flyers) issue([\"blocks\"], `at most ${SHOP_LIMITS.flyers} flyers`);\n },\n});\n\nexport const teamSection = defineSection({\n type: \"team\",\n variants: [\"row\", \"cards\"],\n settings: z.object({ source }),\n settingsDefault: { source: \"all\" },\n blocks: { member: z.object({ memberId: ref }) },\n});\n\nexport const visitSection = defineSection({\n type: \"visit\",\n variants: [\"card\", \"map\", \"split\"],\n settings: z.object({ showPhone: z.boolean() }),\n settingsDefault: { showPhone: true },\n});\n\nexport const storySection = defineSection({\n type: \"story\",\n variants: [\"quote\", \"owner\"],\n settings: z.object({ body: localizedText }),\n settingsDefault: { body: {} },\n});\n\nexport const socialSection = defineSection({\n type: \"social\",\n variants: [\"links\", \"facade\"],\n settings: z.object({}),\n settingsDefault: {},\n blocks: { link: z.object({ platform: z.enum(platforms), url }) },\n});\n\nexport const faqSection = defineSection({\n type: \"faq\",\n variants: [\"list\"],\n settings: z.object({}),\n settingsDefault: {},\n blocks: { question: z.object({ question: localizedText, answer: localizedText }) },\n});\n\nexport const policiesSection = defineSection({\n type: \"policies\",\n variants: [\"inline\"],\n settings: z.object({ show: z.array(z.enum([\"cancellation\", \"prices\", \"booking-window\"])).check(z.maxLength(3)) }),\n settingsDefault: { show: [\"cancellation\", \"prices\", \"booking-window\"] },\n});\n\n/** Every section type, in the order the composer lists them. */\nexport const SECTION_DEFINITIONS = [\n heroSection, servicesSection, bookingSection, gallerySection, videoSection, reviewsSection, bulletinSection,\n teamSection, visitSection, storySection, socialSection, faqSection, policiesSection,\n] as const;\n\nexport type SectionDefinition = (typeof SECTION_DEFINITIONS)[number];\nexport type SectionType = SectionDefinition[\"type\"];\nexport const SECTION_TYPES = SECTION_DEFINITIONS.map((d) => d.type) as readonly SectionType[];\n\n/** The definition of a type. */\nexport function sectionDefinition<T extends SectionType>(type: T): Extract<SectionDefinition, { type: T }> {\n return SECTION_DEFINITIONS.find((d) => d.type === type) as Extract<SectionDefinition, { type: T }>;\n}\n"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"path": "shop/define.ts",
|
|
499
|
+
"content": "// `defineSection` (ADR-007 §1): one section type = its variants, the zod schema of its settings, the blocks it allows\n// (each a zod schema) and the checks that need the whole section. It builds the zod schema of a section of this type, so\n// the renderer, the validator and the composer's generated forms agree.\nimport * as z from \"zod/mini\";\n\nimport { SHOP_LIMITS } from \"./limits\";\nimport { localizedText } from \"./text\";\n\ntype Shape = z.ZodMiniObject;\ntype BlockShapes = Record<string, Shape>;\n\n/** What a section of a type is, once parsed. */\nexport type ParsedSection<T extends string, V extends string, S extends Shape, B extends BlockShapes> = {\n key: string;\n type: T;\n variant: V;\n disabled?: boolean | undefined;\n settings: z.output<S>;\n text?: { title?: z.output<typeof localizedText> | undefined; lead?: z.output<typeof localizedText> | undefined } | undefined;\n blocks?: { [K in keyof B & string]: { key: string; type: K; settings: z.output<B[K]>; text?: Record<string, z.output<typeof localizedText>> | undefined } }[keyof B & string][] | undefined;\n};\n\nexport type SectionSpec<T extends string, V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes> = {\n /** The type's name: the `type` of a section. */\n type: T;\n /** Its variants; the first is the default one. */\n variants: V;\n /** The zod schema of its settings. */\n settings: S;\n /** The settings a new section starts with. */\n settingsDefault: z.input<S>;\n /** The block types it allows, each with the zod schema of its settings. None: the section has no blocks. */\n blocks?: B;\n /** The checks that read the whole section (a count, a combination); `issue(path, message)` refuses it. */\n refine?: (section: ParsedSection<T, V[number], S, B>, issue: (path: (string | number)[], message: string) => void) => void;\n};\n\nexport type SectionDefinitionOf<T extends string, V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes> = SectionSpec<T, V, S, B> & {\n readonly defaultVariant: V[number];\n readonly blockTypes: readonly (keyof B & string)[];\n /** The zod schema of a section of this type. */\n readonly schema: z.ZodMiniType<ParsedSection<T, V[number], S, B>>;\n};\n\nconst key = z.string().check(z.minLength(1), z.maxLength(40), z.regex(/^[A-Za-z0-9_-]+$/, \"a key (letters, digits, - and _)\"));\n\n/** Defines a section type. */\nexport function defineSection<const T extends string, const V extends readonly [string, ...string[]], S extends Shape, B extends BlockShapes = Record<never, never>>(\n spec: SectionSpec<T, V, S, B>,\n): SectionDefinitionOf<T, V, S, B> {\n const blockUnion = spec.blocks && Object.keys(spec.blocks).length > 0\n ? z.discriminatedUnion(\n \"type\",\n Object.entries(spec.blocks).map(([type, settings]) =>\n z.object({ key, type: z.literal(type), settings, text: z.optional(z.record(z.string(), localizedText)) }),\n ) as unknown as [z.ZodMiniObject, ...z.ZodMiniObject[]],\n )\n : undefined;\n const blocks = blockUnion\n ? z.optional(z.array(blockUnion).check(z.maxLength(SHOP_LIMITS.blocks)))\n : z.optional(z.array(z.never()).check(z.maxLength(0)));\n const base = z.object({\n key,\n type: z.literal(spec.type),\n variant: z.enum(spec.variants),\n disabled: z.optional(z.boolean()),\n settings: spec.settings,\n text: z.optional(z.object({ title: z.optional(localizedText), lead: z.optional(localizedText) })),\n blocks,\n });\n const schema = base.check(\n z.superRefine((value, ctx) => {\n spec.refine?.(value as never, (path, message) => ctx.issues.push({ code: \"custom\", message, path, input: value }));\n }),\n );\n return Object.freeze({\n ...spec,\n defaultVariant: spec.variants[0],\n blockTypes: Object.keys(spec.blocks ?? {}) as (keyof B & string)[],\n schema: schema as unknown as z.ZodMiniType<ParsedSection<T, V[number], S, B>>,\n });\n}\n"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"path": "shop/demo/index.ts",
|
|
503
|
+
"content": "// Server-safe, data only. Two fictional shops — a salon and a dog walker — resolved the way a product resolves them (ADR-007\n// §6): the services with their OWN photo or none, photos that appear once, the next free times. Used by the examples, the\n// stories, the catalogue tests and the composer's thumbnails. Never a real shop, price or person.\nimport type { ShopPhoto } from \"../frame\";\nimport type { ShopGalleryPhoto } from \"../gallery/gallery\";\nimport type { ShopService } from \"../services/services\";\nimport { DEMO_PHOTOS, type DemoPhoto } from \"./media\";\n\nexport { DEMO_PHOTOS, type DemoPhoto } from \"./media\";\n\n/** A demo photo with its words. */\nexport const demoPhoto = (name: DemoPhoto, alt: string): ShopPhoto => ({ src: DEMO_PHOTOS[name], alt });\n\nexport type DemoShop = {\n id: \"salon\" | \"pets\";\n name: string;\n eyebrow: string;\n promise: string;\n /** The preset the shop wears. */\n preset: string;\n cover: ShopPhoto & { phone?: string };\n services: ShopService[];\n /** The gallery: none of them is a cover or a service's photo. */\n photos: ShopGalleryPhoto[];\n times: { id: string; label: string; href: string }[];\n hours: { id: string; label: string; hours: string }[];\n status: { open: boolean; label: string; detail: string };\n team: { id: string; name: string }[];\n address: string;\n phone: string;\n};\n\nconst week = (hours: string, closed = \"Closed\") =>\n [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"].map((label, i) => ({ id: String(i + 1), label, hours: i === 6 ? closed : hours }));\n\nexport const demoSalon: DemoShop = {\n id: \"salon\",\n name: \"Salon Cèdre & Ciseaux\",\n eyebrow: \"Saint-Henri · Montréal\",\n promise: \"A neighbourhood salon on Notre-Dame West: cuts, colour and beard care, with the person of your choice.\",\n preset: \"salon-vitrine\",\n cover: demoPhoto(\"salon-cover\", \"The salon's window on a winter evening, warm light on the brick street\"),\n services: [\n { id: \"short\", name: \"Short cut\", price: \"$45\", duration: \"30 min\", description: \"Scissor or clipper, razor finish\", category: \"cuts\", href: \"#book-short\" },\n { id: \"blow\", name: \"Cut and blow-dry\", price: \"$75\", duration: \"1 h\", description: \"A tailored cut, a blow-dry that lasts\", category: \"cuts\", popular: true, photo: demoPhoto(\"salon-chair\", \"The leather chair by the window\"), href: \"#book-blow\" },\n { id: \"beard\", name: \"Beard trim\", price: \"$25\", duration: \"20 min\", description: \"Edges and a hot towel\", category: \"beard\", photo: demoPhoto(\"salon-towels\", \"Rolled warm towels on a shelf\"), href: \"#book-beard\" },\n { id: \"colour\", name: \"Full colour\", price: \"$160\", priceFrom: \"from\", duration: \"2 h 30\", description: \"Price confirmed at the consultation\", category: \"colour\", photo: demoPhoto(\"salon-colour\", \"Two copper bowls of colour on marble\"), href: \"#book-colour\" },\n { id: \"balayage\", name: \"Balayage\", price: \"$220\", priceFrom: \"from\", duration: \"3 h\", description: \"Gradual lightening, natural result\", category: \"colour\", photo: demoPhoto(\"salon-shelf\", \"Amber bottles on the window shelf\"), href: \"#book-balayage\" },\n ],\n photos: [\n { id: \"mirror\", photo: demoPhoto(\"salon-mirror\", \"A round mirror with fairy lights on a brick wall\") },\n { id: \"basin\", photo: demoPhoto(\"salon-basin\", \"A basin under a pendant lamp\") },\n { id: \"brushes\", photo: demoPhoto(\"salon-brushes\", \"Brushes and a dryer on a wooden counter\") },\n { id: \"station\", photo: demoPhoto(\"salon-station\", \"A styling station facing the rainy street\") },\n { id: \"tools\", photo: demoPhoto(\"salon-tools\", \"Scissors and a comb under a brass lamp\") },\n ],\n times: [\n { id: \"t1\", label: \"Today 4:30 pm\", href: \"#t1\" },\n { id: \"t2\", label: \"Today 6:00 pm\", href: \"#t2\" },\n { id: \"t3\", label: \"Tue 9:00 am\", href: \"#t3\" },\n { id: \"t4\", label: \"Tue 10:30 am\", href: \"#t4\" },\n ],\n hours: week(\"9 am – 8 pm\"),\n status: { open: true, label: \"Open now\", detail: \"until 8 pm\" },\n team: [{ id: \"e\", name: \"Éric\" }, { id: \"k\", name: \"Karim\" }, { id: \"j\", name: \"Jade\" }, { id: \"c\", name: \"Camille\" }],\n address: \"2400 Notre-Dame St W\",\n phone: \"514-555-0110\",\n};\n\nexport const demoPets: DemoShop = {\n id: \"pets\",\n name: \"Pattes de Saint-Henri\",\n eyebrow: \"Saint-Henri · Montréal\",\n promise: \"Neighbourhood dog walks along the canal, with a photo and a note after each one.\",\n preset: \"pets-canal\",\n cover: demoPhoto(\"pets-cover\", \"A golden dog facing the Lachine canal at sunset\"),\n services: [\n { id: \"walk30\", name: \"Quick walk\", price: \"$22\", duration: \"30 min\", capacity: \"1 dog\", description: \"A loop of the block and a drink of water\", category: \"walks\", href: \"#book-walk30\" },\n { id: \"walk60\", name: \"Canal walk\", price: \"$35\", duration: \"1 h\", capacity: \"Up to 2 dogs\", description: \"The canal path, a photo and a note\", category: \"walks\", popular: true, photo: demoPhoto(\"pets-leash\", \"Leashes hanging by a red-brick doorway\"), href: \"#book-walk60\" },\n { id: \"pack\", name: \"Pack adventure\", price: \"$48\", duration: \"2 h\", capacity: \"Up to 5 dogs\", description: \"The Mont-Royal trails, small friendly group\", category: \"walks\", href: \"#book-pack\" },\n { id: \"visit\", name: \"Home visit\", price: \"$18\", duration: \"20 min\", capacity: \"1 pet\", description: \"Food, water, a cuddle and a report\", category: \"care\", photo: demoPhoto(\"pets-door\", \"A terrier waiting at a red door\"), href: \"#book-visit\" },\n ],\n photos: [\n { id: \"ball\", photo: demoPhoto(\"pets-ball\", \"A dog leaping for a ball in the autumn park\") },\n { id: \"canal\", photo: demoPhoto(\"pets-canal\", \"Two dogs resting on the grass by the canal\") },\n { id: \"leaves\", photo: demoPhoto(\"pets-leaves\", \"A small dog running through fallen leaves\") },\n { id: \"snow\", photo: demoPhoto(\"pets-snow\", \"A dog in a red coat on a snowy street at night\") },\n { id: \"stairs\", photo: demoPhoto(\"pets-stairs\", \"A dog sitting on an outdoor staircase\") },\n ],\n times: [\n { id: \"t1\", label: \"Today 5:00 pm\", href: \"#t1\" },\n { id: \"t2\", label: \"Tomorrow 8:00 am\", href: \"#t2\" },\n { id: \"t3\", label: \"Tomorrow 12:30 pm\", href: \"#t3\" },\n ],\n hours: week(\"7 am – 7 pm\", \"By request\"),\n status: { open: true, label: \"Open now\", detail: \"until 7 pm\" },\n team: [{ id: \"m\", name: \"Maude\" }, { id: \"s\", name: \"Samuel\" }],\n address: \"Saint-Henri, Montréal\",\n phone: \"514-555-0142\",\n};\n\n// The rest of the demo salon's page (U2): what clients say, its news, its questions, its rules, its story, its reels, its map.\nexport const demoReviews = {\n summary: {\n score: 4.7,\n count: 38,\n distribution: [0, 1, 2, 7, 28] as [number, number, number, number, number],\n scoreText: \"4.7 / 5\",\n countText: \"38 verified reviews\",\n summaryText: \"4.7 out of 5 from 38 verified reviews\",\n starText: (stars: number, count: number) => `${stars} stars: ${count} reviews`,\n },\n reviews: [\n { id: \"r1\", author: \"Nadia F.\", date: \"October 2026\", dateTime: \"2026-10\", service: \"Cut and blow-dry\", rating: 5, ratingText: \"5 out of 5\", text: \"The best blow-dry in the neighbourhood, simply. Booked in two taps.\" },\n { id: \"r2\", author: \"Léo P.\", date: \"October 2026\", dateTime: \"2026-10\", service: \"Balayage\", rating: 5, ratingText: \"5 out of 5\", text: \"Jade listened, never pushed. The price was the one announced.\" },\n { id: \"r3\", author: \"Camille L.\", date: \"September 2026\", dateTime: \"2026-09\", service: \"Beard trim\", rating: 4, ratingText: \"4 out of 5\", text: \"Quick, precise, and the hot towel is a treat.\" },\n ],\n};\n\nexport const demoReel = { id: \"reel\", platform: \"tiktok\" as const, url: \"https://www.tiktok.com/@salon.cedre/video/7123456789012345678\", title: \"The salon's latest reel\" };\n\nexport const demoFlyers = [\n { id: \"f1\", text: \"New: hot-towel beard care, every day this week.\", signature: \"Jade\", until: \"2026-11-10\" },\n { id: \"f2\", text: \"Closed Monday November 3 — back Tuesday at 9.\", signature: \"Éric\", until: \"2026-11-03\" },\n { id: \"f3\", text: \"Gift cards at the counter, any amount.\", signature: \"Camille\" },\n];\n\nexport const demoFaq = [\n { id: \"q1\", question: \"Do I need to book?\", answer: \"Booking is the surest way to have the person you want. We also take walk-ins when a chair is free.\" },\n { id: \"q2\", question: \"Can I cancel?\", answer: \"Free up to 24 hours before. After that the first half of the service is kept.\" },\n { id: \"q3\", question: \"Do you do kids' cuts?\", answer: \"Yes, from age 4, with Éric on Saturday mornings.\" },\n];\n\nexport const demoPolicies = [\n { id: \"p1\", term: \"Cancellation\", details: \"Free up to 24 hours before\" },\n { id: \"p2\", term: \"Prices\", details: \"Before taxes; colour is confirmed at the consultation\" },\n { id: \"p3\", term: \"Booking window\", details: \"Up to 60 days ahead\" },\n];\n\nexport const demoStory = {\n quote: \"Cuts that last, and advice that is honest.\",\n body: \"Three friends opened the salon in 2019 on the corner where the old bakery stood. We kept the brick, the big windows and the habit of asking before cutting.\",\n owner: { name: \"Jade\" },\n};\n\nexport const demoMap = { label: \"Where the salon is\", center: [-73.5859, 45.4789] as [number, number], zoom: 15, showLabel: \"Show the map\", places: [{ position: [-73.5859, 45.4789] as [number, number], label: \"Salon Cèdre & Ciseaux\" }] };\n"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"path": "shop/demo/media.ts",
|
|
507
|
+
"content": "// Demo photos of the two fictional shops (ADR-007 §6, ADR-006 §8: demo data only). Generated locally, no face, no text, no\n// logo, in the style of the Krizaka banners; hosted on the CDN under `ui/shop/demo/` (hashed, immutable). Each is used at most\n// once on a page: the salon has ten, the dog walker eight.\nexport const DEMO_PHOTOS = {\n \"pets-ball\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-ball.e03f1ae74d.webp\",\n \"pets-canal\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-canal.4ea735fad7.webp\",\n \"pets-cover\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-cover.9f06b05e7d.webp\",\n \"pets-door\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-door.099a4143b4.webp\",\n \"pets-leash\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-leash.fbdb08ddad.webp\",\n \"pets-leaves\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-leaves.e7ce7dd035.webp\",\n \"pets-snow\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-snow.894afd7929.webp\",\n \"pets-stairs\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-stairs.c218522480.webp\",\n \"salon-basin\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-basin.64dd59cac7.webp\",\n \"salon-brushes\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-brushes.235eebb9a1.webp\",\n \"salon-chair\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-chair.4cdd76afdf.webp\",\n \"salon-colour\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-colour.00c62a6aac.webp\",\n \"salon-cover\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-cover.218332751d.webp\",\n \"salon-mirror\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-mirror.9c2858ccd2.webp\",\n \"salon-shelf\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-shelf.d215d866d2.webp\",\n \"salon-station\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-station.91abe38059.webp\",\n \"salon-tools\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-tools.8ff845df44.webp\",\n \"salon-towels\": \"https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-towels.8a49746a6b.webp\",\n} as const;\nexport type DemoPhoto = keyof typeof DEMO_PHOTOS;\n"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"path": "shop/faq/faq.tsx",
|
|
511
|
+
"content": "// 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"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"path": "shop/faq/index.ts",
|
|
515
|
+
"content": "/** @krizaka/ui/shop/faq — `FaqSection`: the questions clients ask on a shop page, as native `details`, with the page's FAQPage JSON-LD (`faqJsonLd`). Server-safe. */\nexport { faqJsonLd, FaqSection, type FaqSectionProps, type ShopQuestion } from \"./faq\";\n"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"path": "shop/frame.tsx",
|
|
519
|
+
"content": "// Server-safe. The frame and the rhythm of a shop page (ADR-007 §2): every section draws inside the page frame between the\n// gutters (`bleed` for a photo only), one vertical rhythm set by the density, a hairline between sections. No section sets\n// its own margin: it only says what it holds.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Page, SectionHeading } from \"../page/page\";\n\n/** A photo the product resolved: the address, its words, and the widths it has (`srcSet`). */\nexport type ShopPhoto = {\n src: string;\n /** What it shows, in words; empty when it only sets a mood. */\n alt: string;\n /** The widths the product holds (`/a-480.avif 480w, /a-960.avif 960w`); the section brings the `sizes`. */\n srcSet?: string;\n};\n\nexport type ShopFrameProps = React.HTMLAttributes<HTMLDivElement> & {\n /** The look preset (`salon-vitrine`, `@krizaka/tokens`): its tokens apply to everything inside. */\n preset?: string;\n /**\n * The rhythm: `compact` 40 px between sections (24 on a phone), `airy` 64 px (40). The document's, or the preset's.\n * @default \"compact\"\n */\n density?: \"compact\" | \"airy\";\n /**\n * One of the accents the preset lists as tested (`krizaka`, `akinaza:accent-2`…): the owner's choice within the look. Without it, the preset's own.\n * @see @krizaka/tokens `shopPresets`\n */\n accent?: string;\n /**\n * The paper under the page, from the preset: `seyes` (ruled), `kraft` (brown — mount `PaperGrain` once), `washi` (a tint of the accent) or `plain`.\n * @default \"plain\"\n */\n paper?: \"plain\" | \"seyes\" | \"kraft\" | \"washi\";\n};\n\nconst PAPERS = { plain: undefined, seyes: \"ruled\", kraft: \"kraft\", washi: \"washi\" } as const;\n\n/** The page: sets the look preset, the accent, the paper and the density the sections below read. */\nexport function ShopFrame({ preset, density = \"compact\", accent, paper = \"plain\", className, ...props }: ShopFrameProps) {\n return <div data-shop-preset={preset} data-shop-accent={accent} data-paper={PAPERS[paper]} data-density={density} className={cn(\"kz-shop\", className)} {...props} />;\n}\n\nexport type ShopSectionProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The section's id: the anchor, and the heading's id. */\n id?: string;\n /** The `h2`. Without one the section is named by `aria-label`. */\n title?: React.ReactNode;\n /** A short lower-case note above the title. */\n eyebrow?: React.ReactNode;\n /** One sentence under the title. */\n lead?: React.ReactNode;\n /** A link or a button on the right of the heading (« All times → »). */\n actions?: React.ReactNode;\n /** The content reaches the edges of the screen (a photo, a strip); the heading stays on the frame. */\n bleed?: boolean;\n /** The section is the page's first (the hero): no hairline, no padding. */\n first?: boolean;\n};\n\n/** A section of a shop page. */\nexport function ShopSection({ id, title, eyebrow, lead, actions, bleed, first, className, children, ...props }: ShopSectionProps) {\n const auto = React.useId();\n const headingId = title ? `${id ?? auto}-title` : undefined;\n const heading = title ? <SectionHeading id={headingId} size=\"sm\" eyebrow={eyebrow} title={title} lead={lead} actions={actions} /> : null;\n return (\n <section id={id} aria-labelledby={headingId} data-first={first ? \"\" : undefined} data-bleed={bleed ? \"\" : undefined} className={cn(\"kz-shop-section\", className)} {...props}>\n {bleed ? (\n <>\n {heading && <Page>{heading}</Page>}\n {children}\n </>\n ) : (\n <Page>\n {heading}\n {children}\n </Page>\n )}\n </section>\n );\n}\n"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"path": "shop/gallery/gallery.tsx",
|
|
523
|
+
"content": "// 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"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"path": "shop/gallery/index.ts",
|
|
527
|
+
"content": "/** @krizaka/ui/shop/gallery — `GallerySection`: the photos of a shop page as a `mosaic`, a `filmstrip`, a `wall` or a `grid`; `wallLayout`, the deterministic scatter of the wall. Server-safe. */\nexport { GallerySection, type GallerySectionProps, type GalleryVariant, type ShopGalleryNote, type ShopGalleryPhoto, wallLayout } from \"./gallery\";\n"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"path": "shop/hero/hero.tsx",
|
|
531
|
+
"content": "// 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"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"path": "shop/hero/index.ts",
|
|
535
|
+
"content": "/** @krizaka/ui/shop/hero — `HeroSection`: the first section of a shop page, as a `poster`, a `split`, a `banner` or a `tv`. Server-safe. */\nexport { HeroSection, type HeroSectionProps, type HeroVariant } from \"./hero\";\n"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"path": "shop/index.ts",
|
|
539
|
+
"content": "/** @krizaka/ui/shop — the document of a shop page (`shopPageSchema`, `parseShopPage`, `migrateShopPage`, `defineSection`, the catalogue of 13 section types with their variants), the frame and rhythm every section draws in (`ShopPage`, `ShopSection`) and the five starter documents. Server-safe. */\nexport { SECTION_DEFINITIONS, SECTION_TYPES, type SectionDefinition, sectionDefinition, type SectionType } from \"./catalogue\";\nexport { defineSection, type ParsedSection, type SectionSpec } from \"./define\";\nexport { ShopFrame, type ShopFrameProps, type ShopPhoto, ShopSection, type ShopSectionProps } from \"./frame\";\nexport { SHOP_LIMITS } from \"./limits\";\nexport { createMigrator, migrateShopPage, type MigrationResult, SHOP_MIGRATIONS, type ShopMigration } from \"./migrate\";\nexport { connectShopPreview, postToPreview, type PreviewMessage, readPreviewMessage, SHOP_KEY_ATTRIBUTE } from \"./preview\";\nexport { parseShopPage, type Section, type SectionOf, SHOP_SCHEMA_VERSION, type ShopPage, type ShopPageIssue, type ShopPageResult,shopPageSchema } from \"./schema\";\nexport { type ShopStarterId, shopStarters } from \"./starters\";\nexport { type LocalizedText } from \"./text\";\n"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"path": "shop/limits.ts",
|
|
543
|
+
"content": "// The bounds of a shop page (ADR-007 §3): the schema, the database and the composer read the same numbers.\n\n/**\n * The most a page, a section or a card list may hold. A salon page that stays a page that sells: bounded on purpose.\n * @fixed: ADR-007 §3 — product limits of the document, never a business setting.\n */\nexport const SHOP_LIMITS = {\n /** Sections on a page, the hero included. */\n sections: 16,\n /** Blocks in one section. */\n blocks: 24,\n /** Photos in a gallery. */\n photos: 12,\n /** Cards in `services · cards`. */\n cards: 6,\n /** Flyers on a bulletin board. */\n flyers: 3,\n /** Reels in `video · shorts`. */\n reels: 6,\n} as const;\n"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"path": "shop/map-gate/index.ts",
|
|
547
|
+
"content": "/** @krizaka/ui/shop/map-gate — `MapGate`: a place as a still drawing, the live map behind a button on a phone (nothing requested before the click) and at once from `sm`. Client. */\nexport { MapGate, type MapGateProps } from \"./map-gate\";\n"
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"path": "shop/map-gate/map-gate.tsx",
|
|
551
|
+
"content": "\"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"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"path": "shop/meta.ts",
|
|
555
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Shop page\",\n summary: \"A shop's public page as a document, not as code: an ordered list of sections, each a type and a variant with its settings and blocks, drawn inside one frame and one rhythm. `shopPageSchema` validates it, `defineSection` defines a type, one component per type draws the variants. Services come first as a compact price board. First consumer: Akinaza (akinaza#398); demo data only.\",\n status: \"beta\",\n category: \"blocks\",\n platforms: \"web\",\n parity: { native: { status: \"n/a\", reason: \"A shop's public page is a web page; the studio that edits it is the product's.\", use: \"profile-card\" }, desktop: \"web\" },\n whenToUse: [\n \"The public page of a service business — a salon, a dog walker, a coach, a workshop — where the owner chooses which sections appear, in what order and how each one is drawn.\",\n \"Any product page made of a few repeatable sections that a person arranges, within a catalogue and a bounded number of blocks.\",\n ],\n whenNotToUse: [\n { when: \"A page of the product itself or of a Krizaka site.\", use: \"landing-page\" },\n { when: \"A single list of services with no choice of drawing.\", use: \"service-card\" },\n ],\n bestPractices: [\n \"Store the document, not the HTML: the product keeps `schema`, `preset` and `sections` and parses them on write and on read (`parseShopPage`); an older schema goes through `migrateShopPage` first.\",\n \"References, not copies: a services section holds a rule (`source`, `groupBy`), never a price; the product resolves the services, photos and times at render, so a changed price changes everywhere.\",\n \"Resolve each photo once per page and give a service its own photo or none: the menu draws a thumbnail only for a service that has one, and the trade's defaults go to the hero and the gallery.\",\n \"Give every image its `alt` and let the section choose the `sizes`; the first image is the page's LCP and every box has a fixed ratio.\",\n \"A section with nothing to show is not drawn: reviews under the host's minimum, an expired flyer, an empty list draw nothing.\",\n \"The renderer hoists `bulletin · banner` above the hero (the document keeps the hero first); wrap each section in `<div data-shop-key=\\\"…\\\">` so the composer's preview can outline it (`connectShopPreview`).\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Tab\", action: \"Moves through the page in the visual order: the hero's action, the times, each service's « Choose » button, the photos' strip.\" },\n { keys: \"← →\", action: \"Scrolls a focused filmstrip or carousel (they are focusable groups).\" },\n ],\n notes: [\n \"The hero's name is the page's only `h1`; every section is a `section` named by its `h2`.\",\n \"The services are a real list (`ul`/`li`), grouped by category, the price is text, and each button names its service (« Choose Short cut »).\",\n \"Third-party media sit behind a facade: a platform's reel, the social facade and the map on a phone request nothing before a click. Reduced motion stills the loops, the neon and the wall.\",\n ],\n },\n related: [\"cover-hero\", \"service-card\", \"slot-picker\", \"opening-hours\", \"media-gallery\", \"wall\", \"retro-tv\", \"sticky-action\", \"cta-panel\"],\n web: {\n imports: [\"shopPageSchema\", \"parseShopPage\", \"migrateShopPage\", \"defineSection\", \"ShopFrame\", \"ShopSection\", \"shopStarters\"],\n examples: [\n { name: \"menu\", title: \"Services · menu\", description: \"The compact price board, the default of every preset: a thumbnail only for a service's own photo, a dotted leader, tabular prices, a button that names its service — beside the hours.\" },\n { name: \"menu-columns\", title: \"Services · menu in two columns\", description: \"With nothing beside it, the menu takes two columns from a laptop.\" },\n { name: \"cards\", title: \"Services · cards\", description: \"Cards with a 4:3 photo, six at most.\" },\n { name: \"index\", title: \"Services · index cards\", description: \"The Cahier's stamped cards, for a shop that wears the notebook.\" },\n { name: \"carousel\", title: \"Services · carousel\", description: \"A snap strip, phone first.\" },\n { name: \"hero-poster\", title: \"Hero · poster\", description: \"The cover with the name over it, art-directed 16:9 on a laptop and 4:5 on a phone.\" },\n { name: \"hero-split\", title: \"Hero · split\", description: \"The title in the frame beside a 4:5 photo.\" },\n { name: \"hero-banner\", title: \"Hero · banner\", description: \"A 21:9 photo and the name under it.\" },\n { name: \"hero-tv\", title: \"Hero · tv\", description: \"The shop's sign and its latest video in the old television.\" },\n { name: \"booking-strip\", title: \"Booking · strip\", description: \"The next free times, one tap each.\" },\n { name: \"booking-panel\", title: \"Booking · panel\", description: \"The closing call.\" },\n { name: \"booking-sticky\", title: \"Booking · sticky\", description: \"The phone bar, held at the bottom edge and never over content.\" },\n { name: \"gallery-mosaic\", title: \"Gallery · mosaic\", description: \"One 4:5 lead and four squares.\" },\n { name: \"gallery-filmstrip\", title: \"Gallery · filmstrip\", description: \"A snap strip of 3:4 photos.\" },\n { name: \"gallery-wall\", title: \"Gallery · wall\", description: \"Polaroids, a note and the shop's sign on a textured wall.\" },\n { name: \"gallery-grid\", title: \"Gallery · grid\", description: \"The shop's photos in tiles, the first featured.\" },\n { name: \"video-tv\", title: \"Video · tv\", description: \"The shop's latest reel in the old television; a platform's short is behind a button, nothing is requested before the click.\" },\n { name: \"video-shorts\", title: \"Video · shorts\", description: \"Another channel's reels, each behind its own button.\" },\n { name: \"reviews-summary-cards\", title: \"Reviews · score and cards\", description: \"The score as a stamp with its distribution, beside two or three reviews. Nothing under the host's minimum.\" },\n { name: \"reviews-quote\", title: \"Reviews · quote\", description: \"One large review.\" },\n { name: \"reviews-strip\", title: \"Reviews · strip\", description: \"The score in one line.\" },\n { name: \"bulletin-board\", title: \"Bulletin · board\", description: \"Pinned notes, newest first, taken down after their last day, three at most.\" },\n { name: \"bulletin-banner\", title: \"Bulletin · banner\", description: \"One line of text above the hero; never an image.\" },\n { name: \"team-row\", title: \"Team · row\", description: \"Avatars and first names in a line.\" },\n { name: \"team-cards\", title: \"Team · cards\", description: \"A card each with a role.\" },\n { name: \"visit-card\", title: \"Visit · card\", description: \"The hours, the address and a call.\" },\n { name: \"visit-map\", title: \"Visit · map\", description: \"The place on a map: a still and a button on a phone, the live map from `sm`.\" },\n { name: \"visit-split\", title: \"Visit · split\", description: \"The hours beside the map.\" },\n { name: \"story-quote\", title: \"Story · quote\", description: \"A pull quote and a paragraph.\" },\n { name: \"story-owner\", title: \"Story · owner\", description: \"The owner's face, a paragraph, a way to call.\" },\n { name: \"social-links\", title: \"Social · links\", description: \"Plain links: a new tab, no referrer, `nofollow`.\" },\n { name: \"social-facade\", title: \"Social · facade\", description: \"The latest reel behind a button.\" },\n { name: \"faq\", title: \"Questions\", description: \"Native `details` with the page's FAQPage JSON-LD.\" },\n { name: \"policies\", title: \"Policies\", description: \"Cancellation, prices and the booking window.\" },\n { name: \"page\", title: \"A compact salon page\", description: \"The hero, the next free times, the menu beside the hours, a filmstrip and the closing call, inside one frame and one rhythm.\" },\n { name: \"document\", title: \"The document\", description: \"What the product stores: `parseShopPage` validates a document and answers every issue with its path.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"path": "shop/migrate.ts",
|
|
559
|
+
"content": "// Migrations of the document (ADR-007 §1): pure functions schema n → n + 1, applied in memory when an older document is\n// read; the product writes the migrated one back on the next save. A newer document than this code knows is refused.\nimport { SHOP_SCHEMA_VERSION } from \"./schema\";\n\nexport type ShopMigration = {\n /** The schema it reads. */\n from: number;\n /** Pure: returns a new document, never mutates. */\n up: (doc: Record<string, unknown>) => Record<string, unknown>;\n};\n\n/** The migrations of the document, oldest first. Schema 1 is the first format: none yet. */\nexport const SHOP_MIGRATIONS: readonly ShopMigration[] = [];\n\nexport type MigrationResult = { ok: true; doc: Record<string, unknown>; from: number } | { ok: false; reason: string };\n\n/** A migrator over a list of migrations and a current version (the shop's own are `migrateShopPage`). */\nexport function createMigrator(migrations: readonly ShopMigration[], current: number) {\n return (input: unknown): MigrationResult => {\n if (typeof input !== \"object\" || input === null || Array.isArray(input)) return { ok: false, reason: \"a document is an object\" };\n let doc = input as Record<string, unknown>;\n const from = doc.schema;\n if (typeof from !== \"number\" || !Number.isInteger(from) || from < 1) return { ok: false, reason: \"the document has no schema version\" };\n if (from > current) return { ok: false, reason: `schema ${from} is newer than this code knows (${current})` };\n for (let n = from; n < current; n++) {\n const step = migrations.find((m) => m.from === n);\n if (!step) return { ok: false, reason: `no migration from schema ${n}` };\n doc = { ...step.up(doc), schema: n + 1 };\n }\n return { ok: true, doc, from };\n };\n}\n\n/** Brings a stored document to the current schema (then `parseShopPage` it). */\nexport const migrateShopPage = createMigrator(SHOP_MIGRATIONS, SHOP_SCHEMA_VERSION);\n"
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
"path": "shop/photo.tsx",
|
|
563
|
+
"content": "// Server-safe. A photo in a box of one fixed ratio (CLS 0): the box is the ratio, the image fills it (ADR-007 §6).\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport type { ShopPhoto } from \"./frame\";\n\nconst RATIOS = {\n \"1/1\": \"aspect-square\",\n \"4/5\": \"aspect-[4/5]\",\n \"3/4\": \"aspect-[3/4]\",\n \"4/3\": \"aspect-[4/3]\",\n \"3/2\": \"aspect-[3/2]\",\n \"16/9\": \"aspect-video\",\n \"21/9\": \"aspect-[21/9]\",\n} as const;\nexport type ShopRatio = keyof typeof RATIOS;\n\nexport type PhotoProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n photo: ShopPhoto;\n ratio: ShopRatio;\n /** The `sizes` of the image for this variant (ADR-007 §6). */\n sizes?: string;\n /** The first screen's image: high priority, never lazy. */\n priority?: boolean;\n};\n\n/** A photo in a fixed-ratio box; the look preset's grade and radius apply (`data-shop-photo`). */\nexport function Photo({ photo, ratio, sizes, priority, className, ...props }: PhotoProps) {\n return (\n <div data-shop-photo=\"\" data-ratio={ratio} className={cn(\"relative w-full overflow-hidden bg-media\", RATIOS[ratio], className)} {...props}>\n <img\n src={photo.src}\n srcSet={photo.srcSet}\n sizes={photo.srcSet ? sizes : undefined}\n alt={photo.alt}\n loading={priority ? undefined : \"lazy\"}\n fetchPriority={priority ? \"high\" : undefined}\n decoding=\"async\"\n className=\"absolute inset-0 h-full w-full object-cover\"\n />\n </div>\n );\n}\n"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"path": "shop/policies/index.ts",
|
|
567
|
+
"content": "/** @krizaka/ui/shop/policies — `PoliciesSection`: the shop's cancellation, price and booking-window rules, as a description list. Server-safe. */\nexport { PoliciesSection, type PoliciesSectionProps, type ShopPolicy } from \"./policies\";\n"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"path": "shop/policies/policies.tsx",
|
|
571
|
+
"content": "// 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"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"path": "shop/presets-page.tsx",
|
|
575
|
+
"content": "// Story helper (never published): the same three-section page — hero, services, booking — wearing one look preset. Every preset\n// has a story of it, in both themes, so a look that reads badly is seen before a shop wears it.\nimport { shopPresets } from \"@krizaka/tokens/shop-presets\";\n\nimport { Button } from \"../button/button\";\nimport { BookingSection } from \"./booking/booking\";\nimport { demoPets, demoSalon,type DemoShop } from \"./demo\";\nimport { ShopFrame } from \"./frame\";\nimport { HeroSection, type HeroVariant } from \"./hero/hero\";\nimport { ServicesSection, type ServicesVariant } from \"./services/services\";\n\nexport function PresetPage({ id, accent }: { id: string; accent?: string }) {\n const preset = shopPresets.find((p) => p.id === id)!;\n const shop: DemoShop = preset.trades[0] === \"pets\" ? demoPets : demoSalon;\n const hero = (preset.variants.hero ?? \"poster\") as HeroVariant;\n const services = (preset.variants.services ?? \"menu\") as ServicesVariant;\n return (\n <ShopFrame preset={preset.id} density={preset.density} paper={preset.paper} accent={accent}>\n <HeroSection variant={hero === \"tv\" ? \"poster\" : hero} title={shop.name} eyebrow={shop.eyebrow} lead={shop.promise} cover={shop.cover} actions={<Button variant=\"primary\" size=\"lg\">Book</Button>} />\n <ServicesSection variant={services} title=\"Services\" lead=\"Prices before taxes. Pick one, then the time.\" services={shop.services} chooseLabel=\"Choose\" popularLabel=\"Popular\" />\n <BookingSection label=\"Next free times\" times={shop.times} href=\"#book\" actionLabel=\"All times\" />\n </ShopFrame>\n );\n}\n"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"path": "shop/preview.ts",
|
|
579
|
+
"content": "// The preview bridge (ADR-007 §5): the composer shows the product's real public page in an iframe of its own route\n// (`?draft=<id>`) and talks to it by `postMessage` — three messages only, every one origin-checked on both sides: `select` (outline\n// a section), `scroll` (bring it into view), `refresh` (the draft changed: reload the data). Nothing else crosses: no document, no\n// script, no style. Both halves are here, tiny and free of React, because the page side must not import the composer.\n\n/** The only messages: the composer to the page. */\nexport type PreviewMessage = { source: \"krizaka-shop-composer\"; type: \"select\" | \"scroll\"; key: string } | { source: \"krizaka-shop-composer\"; type: \"refresh\" };\n\nconst SOURCE = \"krizaka-shop-composer\";\nconst KEY = /^[A-Za-z0-9_-]{1,40}$/;\n\n/** Reads a message event: only if it comes from `origin`, is one of the three messages and carries a well-formed key. */\nexport function readPreviewMessage(event: Pick<MessageEvent, \"origin\" | \"data\">, origin: string): PreviewMessage | null {\n if (event.origin !== origin) return null;\n const d = event.data as Record<string, unknown> | null;\n if (typeof d !== \"object\" || d === null || d.source !== SOURCE) return null;\n if (d.type === \"refresh\") return { source: SOURCE, type: \"refresh\" };\n if ((d.type === \"select\" || d.type === \"scroll\") && typeof d.key === \"string\" && KEY.test(d.key)) return { source: SOURCE, type: d.type, key: d.key };\n return null;\n}\n\n/** The composer's side: posts to the preview's window, addressed to its origin only. */\nexport function postToPreview(target: Pick<Window, \"postMessage\"> | null | undefined, origin: string, message: PreviewMessage): void {\n target?.postMessage(message, origin);\n}\n\n/** The attribute that names a section in the preview page: `<div data-shop-key=\"s_8f2c\">` (a block: the outline is its ring). */\nexport const SHOP_KEY_ATTRIBUTE = \"data-shop-key\";\n\n/**\n * The page's side: outlines the selected section (`data-shop-selected`, drawn by `blocks.css`), scrolls it into view, and calls\n * `onRefresh` when the draft changed. Returns the function that removes it. Only runs in an iframe of the composer's origin.\n */\nexport function connectShopPreview({ composerOrigin, onRefresh, root = document }: { composerOrigin: string; onRefresh?: () => void; root?: Document }): () => void {\n const find = (key: string) => root.querySelector<HTMLElement>(`[${SHOP_KEY_ATTRIBUTE}=\"${key}\"]`);\n const handler = (event: MessageEvent) => {\n // The origin first, before anything else is read from the message.\n if (event.origin !== composerOrigin) return;\n const m = readPreviewMessage(event, composerOrigin);\n if (!m) return;\n if (m.type === \"refresh\") {\n onRefresh?.();\n return;\n }\n for (const selected of root.querySelectorAll<HTMLElement>(\"[data-shop-selected]\")) delete selected.dataset.shopSelected;\n const el = find(m.key);\n if (!el) return;\n el.dataset.shopSelected = \"\";\n if (m.type === \"scroll\") {\n const reduced = typeof matchMedia === \"function\" && matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n el.scrollIntoView({ block: \"center\", behavior: reduced ? \"auto\" : \"smooth\" });\n }\n };\n window.addEventListener(\"message\", handler);\n return () => window.removeEventListener(\"message\", handler);\n}\n"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"path": "shop/reviews/index.ts",
|
|
583
|
+
"content": "/** @krizaka/ui/shop/reviews — `ReviewsSection`: what clients say on a shop page — the score beside two or three reviews (`summary-cards`), one large review (`quote`) or the score in one line (`strip`); nothing under the host's `minCount`. Server-safe. */\nexport { ReviewsSection, type ReviewsSectionProps, type ReviewsVariant, type ShopReview } from \"./reviews\";\n"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"path": "shop/reviews/reviews.tsx",
|
|
587
|
+
"content": "// 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"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"path": "shop/schema.ts",
|
|
591
|
+
"content": "// The document a shop page is (ADR-007 §1): an ordered list of sections, each a `type` × `variant` with its settings and\n// its blocks. Parsed on write (a route refuses an invalid one, with the path) and on read. The storage is the product's.\nimport * as z from \"zod/mini\";\n\nimport { SECTION_DEFINITIONS, type SectionType } from \"./catalogue\";\nimport { SHOP_LIMITS } from \"./limits\";\n\n/** The version of the document's format; migrations are pure functions schema n → n + 1 (`migrate.ts`). */\n// @fixed: ADR-007 §1 — the format version of the code, bumped with a migration; not a shop setting.\nexport const SHOP_SCHEMA_VERSION = 1;\n\n/** A look preset by id and version (`@krizaka/tokens`): `salon-atelier`. The mode is the visitor's, never stored. */\nexport const presetRef = z.object({\n id: z.string().check(z.regex(/^[a-z]+-[a-z]+$/, \"a preset id (trade-name)\")),\n version: z.int().check(z.minimum(1)),\n});\n\nconst sectionUnion = z.discriminatedUnion(\n \"type\",\n SECTION_DEFINITIONS.map((d) => d.schema) as unknown as [z.ZodMiniObject, ...z.ZodMiniObject[]],\n);\n\nexport const shopPageSchema = z\n .object({\n schema: z.literal(SHOP_SCHEMA_VERSION),\n preset: presetRef,\n /** Overrides the preset's density. */\n density: z.optional(z.enum([\"compact\", \"airy\"])),\n sections: z.array(sectionUnion).check(z.minLength(1), z.maxLength(SHOP_LIMITS.sections)),\n })\n .check(\n z.superRefine((page, ctx) => {\n const add = (path: (string | number)[], message: string) => ctx.issues.push({ code: \"custom\", message, path, input: page });\n const seen = new Set<string>();\n page.sections.forEach((section, i) => {\n const s = section as { key: string; type: string };\n if (seen.has(s.key)) add([\"sections\", i, \"key\"], `the key \"${s.key}\" is used twice`);\n seen.add(s.key);\n if (s.type === \"hero\" && i !== 0) add([\"sections\", i, \"type\"], \"the hero is the first section, and there is only one\");\n });\n }),\n );\n\n/** A section of any type, as parsed: its `settings` and `blocks` are the type's own. */\nexport type Section = z.output<(typeof SECTION_DEFINITIONS)[number][\"schema\"]>;\nexport type ShopPage = {\n schema: typeof SHOP_SCHEMA_VERSION;\n preset: z.output<typeof presetRef>;\n density?: \"compact\" | \"airy\" | undefined;\n sections: Section[];\n};\nexport type SectionOf<T extends SectionType> = Extract<Section, { type: T }>;\n\nexport type ShopPageIssue = { path: string; message: string };\nexport type ShopPageResult = { ok: true; page: ShopPage } | { ok: false; issues: ShopPageIssue[] };\n\n/** Validates a document; an invalid one answers every issue with its path (`sections.2.variant`), for a 422. */\nexport function parseShopPage(input: unknown): ShopPageResult {\n const result = shopPageSchema.safeParse(input);\n if (result.success) return { ok: true, page: result.data as unknown as ShopPage };\n return { ok: false, issues: result.error.issues.map((i) => ({ path: i.path.join(\".\"), message: i.message })) };\n}\n"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"path": "shop/services/index.ts",
|
|
595
|
+
"content": "/** @krizaka/ui/shop/services — `ServicesSection`: the services of a shop page as a compact price board (`menu`, the default), `cards`, stamped `index` cards or a `carousel`, from resolved services. Server-safe. */\nexport { ServicesSection, type ServicesSectionProps, type ServicesVariant, type ShopService } from \"./services\";\n"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"path": "shop/services/services.tsx",
|
|
599
|
+
"content": "// Server-safe: no hook. The services of a shop (ADR-007 §3). `menu` — the compact price board, the default of every preset:\n// one row per service (an optional 56 px square thumbnail of the service's own photo, the name, « Popular », a dotted leader,\n// the price in tabular figures, the duration and one line, a « Choose » button that names the service), grouped by category\n// under a lower-case typewriter note, in one column beside an `aside` or in two. `cards` (4:3, six at most), `index` (the\n// Cahier's stamped cards), `carousel` (a snap strip, phone first). The section receives resolved services; it never fetches.\nimport { Badge } from \"@krizaka/ui/badge\";\nimport { buttonVariants } from \"@krizaka/ui/button\";\nimport { ServiceCard } from \"@krizaka/ui/service-card\";\nimport * as React from \"react\";\n\nimport { BlockLink, type LinkComponent } from \"../../block-link\";\nimport { cn } from \"../../cn\";\nimport type { ShopPhoto } from \"../frame\";\nimport { ShopSection } from \"../frame\";\nimport { SHOP_LIMITS } from \"../limits\";\nimport { Photo } from \"../photo\";\n\nexport type ServicesVariant = \"menu\" | \"cards\" | \"index\" | \"carousel\";\n\n/** A service as the product resolved it: its own photo (or none), its price already formatted. */\nexport type ShopService = {\n id: string;\n name: string;\n /** Formatted by the app (`$45`): the section never formats money. */\n price: string;\n /** The word before a varying price (`from`). */\n priceFrom?: string;\n /** `30 min`. */\n duration?: string;\n /** `Up to 5 dogs`. */\n capacity?: string;\n /** One line: what it is (truncated in the menu). */\n description?: string;\n /** What is included, one short line each (cards and index). */\n included?: readonly string[];\n /** The shop's category (`cuts`): the menu's group. */\n category?: string;\n /** The service's OWN photo. Never a default: without one the menu draws no thumbnail. */\n photo?: ShopPhoto;\n /** Booked most often (a real count): wears « Popular ». */\n popular?: boolean;\n /** The booking page with this service chosen. */\n href?: string;\n};\n\nexport type ServicesSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"menu\" */\n variant?: ServicesVariant;\n services: readonly ShopService[];\n /** The section's `h2` (`Services`). */\n title: React.ReactNode;\n lead?: React.ReactNode;\n /** `menu`: group by the services' `category`. @default \"category\" */\n groupBy?: \"category\" | \"none\";\n /** `menu` with no `aside`: one or two columns. @default 1 */\n columns?: 1 | 2;\n /** `menu`: the hours, the team and the address, beside the list from `lg` (sticky), below it on a phone. */\n aside?: React.ReactNode;\n /** The button's words (`Choose`); its accessible name is « Choose Short cut ». */\n chooseLabel: string;\n /** « Popular ». */\n popularLabel: string;\n /** The list's accessible name when there is no group (`Services`). */\n listLabel?: string;\n /** The app's link component for the booking addresses. */\n linkAs?: LinkComponent;\n};\n\nconst GROUP_NOTE = \"m-0 font-mono text-[13px] lowercase text-fg-secondary\";\n\nfunction groupsOf(services: readonly ShopService[], by: \"category\" | \"none\") {\n if (by === \"none\") return [{ name: undefined as string | undefined, items: services }];\n const groups: { name: string | undefined; items: ShopService[] }[] = [];\n for (const s of services) {\n const name = s.category;\n const group = groups.find((g) => g.name === name);\n if (group) group.items.push(s);\n else groups.push({ name, items: [s] });\n }\n return groups;\n}\n\nfunction MenuRow({ service, chooseLabel, popularLabel, linkAs }: { service: ShopService; chooseLabel: string; popularLabel: string; linkAs?: LinkComponent }) {\n const facts = [service.duration, service.capacity].filter(Boolean).join(\" · \");\n return (\n <li className=\"flex items-center gap-3 border-b border-border-subtle py-2.5 last:border-b-0\" data-service={service.id}>\n {service.photo && (\n <Photo photo={service.photo} ratio=\"1/1\" sizes=\"56px\" className=\"h-12 w-12 shrink-0 rounded-md sm:h-14 sm:w-14\" />\n )}\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline gap-2\">\n <h3 className=\"m-0 shrink truncate text-[15px] font-semibold leading-tight text-fg\">{service.name}</h3>\n {service.popular && <Badge tone=\"accent\" size=\"sm\" className=\"hidden shrink-0 self-center sm:inline-flex\">{popularLabel}</Badge>}\n <span aria-hidden className=\"min-w-4 flex-1 -translate-y-0.5 border-b border-dotted border-border-control\" />\n <span className=\"shrink-0 whitespace-nowrap text-[15px] font-bold tabular-nums text-fg\">\n {service.priceFrom && <span className=\"mr-1 text-xs font-medium text-fg-secondary\">{service.priceFrom}</span>}\n {service.price}\n </span>\n </div>\n <p className=\"m-0 mt-0.5 truncate text-[13px] leading-snug text-fg-secondary\">\n {service.popular && <Badge tone=\"accent\" size=\"sm\" className=\"mr-1.5 sm:hidden\">{popularLabel}</Badge>}\n <span className=\"font-mono tabular-nums\">{facts}</span>\n {facts && service.description && <span aria-hidden> · </span>}\n {service.description}\n </p>\n </div>\n {service.href && (\n <BlockLink\n href={service.href}\n linkAs={linkAs}\n aria-label={`${chooseLabel} ${service.name}`}\n className={cn(buttonVariants({ variant: \"secondary\", size: \"md\" }), \"min-h-11 shrink-0 no-underline\")}\n >\n {chooseLabel}\n </BlockLink>\n )}\n </li>\n );\n}\n\nfunction Menu({ services, groupBy, columns, aside, chooseLabel, popularLabel, listLabel, linkAs }: Required<Pick<ServicesSectionProps, \"services\" | \"groupBy\" | \"columns\" | \"chooseLabel\" | \"popularLabel\">> & Pick<ServicesSectionProps, \"aside\" | \"listLabel\" | \"linkAs\">) {\n const groups = groupsOf(services, groupBy);\n const uid = React.useId();\n const list = (\n <div className={cn(\"grid gap-x-12\", !aside && columns === 2 && \"lg:grid-cols-2\")}>\n {groups.map((g, i) => (\n <div key={g.name ?? i} className=\"mb-3 min-w-0 last:mb-0\">\n {g.name && <p className={GROUP_NOTE} id={`${uid}-grp-${i}`}>{g.name}</p>}\n <ul aria-label={g.name ? undefined : listLabel} aria-labelledby={g.name ? `${uid}-grp-${i}` : undefined} className=\"m-0 list-none p-0\">\n {g.items.map((s) => (\n <MenuRow key={s.id} service={s} chooseLabel={chooseLabel} popularLabel={popularLabel} linkAs={linkAs} />\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n if (!aside) return list;\n return (\n <div className=\"grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_20rem] lg:gap-12\">\n {list}\n <aside className=\"kz-shop-aside flex flex-col gap-4\">{aside}</aside>\n </div>\n );\n}\n\n/** The services of a shop: the price board by default, or cards, index cards, a carousel. */\nexport function ServicesSection({ variant = \"menu\", services, title, lead, groupBy = \"category\", columns = 1, aside, chooseLabel, popularLabel, listLabel, linkAs, className, ...props }: ServicesSectionProps) {\n const card = (s: ShopService, i: number, extra?: string) => (\n <ServiceCard\n key={s.id}\n name={s.name}\n price={s.price}\n priceFrom={s.priceFrom}\n duration={s.duration}\n capacity={s.capacity}\n description={s.description}\n included={s.included}\n tag={s.popular ? popularLabel : undefined}\n media={s.photo ? <img src={s.photo.src} srcSet={s.photo.srcSet} sizes=\"(min-width: 64rem) 18rem, 90vw\" alt={s.photo.alt} loading=\"lazy\" decoding=\"async\" /> : undefined}\n mediaRatio=\"photo\"\n variant={variant === \"index\" ? \"index\" : \"default\"}\n actionLabel={chooseLabel}\n href={s.href}\n linkAs={linkAs}\n className={extra}\n data-index={i}\n />\n );\n let body: React.ReactNode;\n if (variant === \"menu\") {\n body = <Menu services={services} groupBy={groupBy} columns={columns} aside={aside} chooseLabel={chooseLabel} popularLabel={popularLabel} listLabel={listLabel} linkAs={linkAs} />;\n } else if (variant === \"carousel\") {\n body = (\n <div role=\"group\" aria-label={listLabel ?? (typeof title === \"string\" ? title : undefined)} tabIndex={0} className=\"-mx-4 flex snap-x snap-mandatory gap-3 overflow-x-auto px-4 pb-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring sm:mx-0 sm:px-0\">\n {services.map((s, i) => card(s, i, \"w-[78vw] max-w-72 shrink-0 snap-start sm:w-72\"))}\n </div>\n );\n } else {\n const shown = variant === \"cards\" ? services.slice(0, SHOP_LIMITS.cards) : services;\n body = <div className=\"grid items-start gap-4 sm:grid-cols-2 lg:grid-cols-3\">{shown.map((s, i) => card(s, i, \"h-auto\"))}</div>;\n }\n return (\n <ShopSection title={title} lead={lead} className={className} data-variant={variant} {...props}>\n {body}\n </ShopSection>\n );\n}\n"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"path": "shop/social/index.ts",
|
|
603
|
+
"content": "/** @krizaka/ui/shop/social — `SocialSection`: where else to find a shop — plain links that open in a new tab with no referrer (`links`), or its latest reel behind a button (`facade`). Server-safe. */\nexport { type ShopLink, SocialSection, type SocialSectionProps, type SocialVariant } from \"./social\";\n"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"path": "shop/social/social.tsx",
|
|
607
|
+
"content": "// Server-safe (the facade is a client island). The shop's other places (ADR-007 §3): `links` — plain anchors that open in a\n// new tab, `nofollow`, no referrer, nothing loaded from the platform; `facade` — the latest reel behind a button. Third\n// parties load on a click, never before (Law 25).\nimport { EMBED_PLATFORMS,EmbedFacade, type EmbedPlatform } from \"@krizaka/ui/embed-facade\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type SocialVariant = \"links\" | \"facade\";\n\nexport type ShopLink = { id: string; platform: EmbedPlatform; url: string };\n\nexport type SocialSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"links\" */\n variant?: SocialVariant;\n title: React.ReactNode;\n links: readonly ShopLink[];\n /** `links`: the name of each place, passed translated (`TikTok`). Default: the platform's own. */\n labels?: Partial<Record<EmbedPlatform, string>>;\n /** `facade`: the button's words per platform, and the reel's name. */\n playLabels?: Record<EmbedPlatform, string>;\n reelTitle?: string;\n poster?: string;\n notice?: React.ReactNode;\n};\n\n/** Where else to find the shop. */\nexport function SocialSection({ variant = \"links\", title, links, labels = {}, playLabels, reelTitle, poster, notice, className, ...props }: SocialSectionProps) {\n if (links.length === 0) return null;\n const first = links[0]!;\n return (\n <ShopSection title={title} className={className} data-variant={variant} {...props}>\n {variant === \"facade\" && playLabels ? (\n <div className=\"w-44 sm:w-52\">\n <EmbedFacade platform={first.platform} url={first.url} title={reelTitle ?? labels[first.platform] ?? EMBED_PLATFORMS[first.platform]} playLabel={playLabels[first.platform]} poster={poster} notice={notice} />\n </div>\n ) : (\n <ul className=\"m-0 flex list-none flex-wrap gap-2 p-0\">\n {links.map((l) => (\n <li key={l.id}>\n <a\n href={l.url}\n target=\"_blank\"\n rel=\"noopener noreferrer nofollow\"\n referrerPolicy=\"no-referrer\"\n className=\"inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-1 px-4 text-sm font-semibold text-fg no-underline hover:border-accent focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\"\n >\n {labels[l.platform] ?? EMBED_PLATFORMS[l.platform]}\n </a>\n </li>\n ))}\n </ul>\n )}\n </ShopSection>\n );\n}\n"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"path": "shop/starters.ts",
|
|
611
|
+
"content": "// The starter documents (ADR-007 §4, §8): the five compositions of the ADR as data — a section list and a preset. A\n// product's template becomes one of these; the composer's « Start from » lists them. They hold no price, no text of a\n// shop and no photo: references and rules only.\nimport type { SectionOf, ShopPage } from \"./schema\";\n\nconst s = (key: string) => key;\nconst doc = (preset: string, density: \"compact\" | \"airy\", sections: ShopPage[\"sections\"]): ShopPage => ({\n schema: 1,\n preset: { id: preset, version: 1 },\n density,\n sections,\n});\nconst hero = (variant: \"poster\" | \"split\" | \"banner\" | \"tv\"): SectionOf<\"hero\"> => ({\n key: s(\"s_hero\"),\n type: \"hero\",\n variant,\n settings: { focus: \"center\" },\n blocks: [\n { key: \"b_open\", type: \"fact\", settings: { kind: \"open-now\" } },\n { key: \"b_area\", type: \"fact\", settings: { kind: \"area\" } },\n { key: \"b_score\", type: \"fact\", settings: { kind: \"score\" } },\n ],\n});\nconst menu = (columns: 1 | 2, aside: \"hours\" | \"none\"): SectionOf<\"services\"> => ({\n key: s(\"s_services\"),\n type: \"services\",\n variant: \"menu\",\n settings: { source: \"all\", groupBy: \"category\", columns, aside },\n});\nconst booking = (variant: \"strip\" | \"panel\" | \"sticky\", key: string): SectionOf<\"booking\"> => ({ key, type: \"booking\", variant, settings: { count: 4 } });\nconst gallery = (variant: \"mosaic\" | \"filmstrip\" | \"wall\" | \"grid\", key: string, extra: Partial<Pick<SectionOf<\"gallery\">, \"settings\" | \"blocks\">> = {}): SectionOf<\"gallery\"> => ({\n key,\n type: \"gallery\",\n variant,\n settings: { source: \"all\", texture: \"plaster\" },\n ...extra,\n});\n\n/** The salon, compact: the poster, the next free times, the price board beside the hours, a filmstrip, the reviews. */\nexport const salonCompact = doc(\"salon-vitrine\", \"compact\", [\n hero(\"poster\"),\n booking(\"strip\", \"s_times\"),\n menu(1, \"hours\"),\n gallery(\"filmstrip\", \"s_photos\"),\n { key: \"s_reviews\", type: \"reviews\", variant: \"summary-cards\", settings: { rule: \"best\", count: 2 } },\n booking(\"panel\", \"s_book\"),\n]);\n\n/** The salon, editorial: a split hero, the quote, the two-column menu, the mosaic, the visit. */\nexport const salonEditorial = doc(\"salon-atelier\", \"airy\", [\n hero(\"split\"),\n { key: \"s_story\", type: \"story\", variant: \"quote\", settings: { body: {} } },\n menu(2, \"none\"),\n gallery(\"mosaic\", \"s_photos\"),\n { key: \"s_visit\", type: \"visit\", variant: \"split\", settings: { showPhone: true } },\n booking(\"panel\", \"s_book\"),\n]);\n\n/** The salon, gallery first: the sign and the old TV, the mosaic, the menu, the wall. */\nexport const salonGallery = doc(\"salon-atelier\", \"compact\", [\n hero(\"tv\"),\n gallery(\"mosaic\", \"s_photos\"),\n menu(1, \"hours\"),\n gallery(\"wall\", \"s_wall\", { blocks: [{ key: \"b_note\", type: \"note\", settings: { text: \"Merci Jade !\", signature: \"Nadia\" } }] }),\n booking(\"sticky\", \"s_sticky\"),\n]);\n\n/** The dog walker, route: the poster, the areas, the menu, the next free times, a filmstrip. */\nexport const petsRoute = doc(\"pets-canal\", \"compact\", [\n hero(\"poster\"),\n { key: \"s_visit\", type: \"visit\", variant: \"map\", settings: { showPhone: false } },\n menu(1, \"none\"),\n booking(\"strip\", \"s_times\"),\n gallery(\"filmstrip\", \"s_photos\"),\n]);\n\n/** The dog walker, journal: a hero on paper, the notebook wall, the menu, the TV with notes. */\nexport const petsJournal = doc(\"pets-carnet\", \"airy\", [\n hero(\"split\"),\n gallery(\"wall\", \"s_wall\", { settings: { source: \"all\", texture: \"ridge\" } }),\n menu(1, \"none\"),\n { key: \"s_tv\", type: \"video\", variant: \"tv\", settings: { cabinet: \"portable\" } },\n booking(\"panel\", \"s_book\"),\n]);\n\nexport const shopStarters = { salonCompact, salonEditorial, salonGallery, petsRoute, petsJournal } as const;\nexport type ShopStarterId = keyof typeof shopStarters;\n"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"path": "shop/story/index.ts",
|
|
615
|
+
"content": "/** @krizaka/ui/shop/story — `StorySection`: the owner's words on a shop page — a pull quote and a paragraph (`quote`), or the owner's face, a paragraph and a way to call or write (`owner`). Server-safe. */\nexport { StorySection, type StorySectionProps, type StoryVariant } from \"./story\";\n"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"path": "shop/story/story.tsx",
|
|
619
|
+
"content": "// Server-safe. The owner's words (ADR-007 §3): `quote` — a pull quote and a paragraph; `owner` — the owner's face, a\n// paragraph, and a way to call or write. The words are the owner's, in the visitor's language; nothing is invented.\nimport { Avatar } from \"@krizaka/ui/avatar\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type StoryVariant = \"quote\" | \"owner\";\n\nexport type StorySectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"quote\" */\n variant?: StoryVariant;\n title: React.ReactNode;\n /** `quote`: the pull quote. */\n quote?: string;\n /** The paragraph. */\n body: string;\n /** `owner`: who speaks. */\n owner?: { name: string; photo?: string };\n /** `owner`: call or write (`ButtonLink`s). */\n actions?: React.ReactNode;\n};\n\n/** The owner's story, as a pull quote or a face and a paragraph. */\nexport function StorySection({ variant = \"quote\", title, quote, body, owner, actions, className, ...props }: StorySectionProps) {\n if (!body && !quote) return null;\n return (\n <ShopSection title={title} className={className} data-variant={variant} {...props}>\n {variant === \"owner\" ? (\n <div className=\"flex max-w-3xl items-start gap-4\">\n {owner && <Avatar src={owner.photo} alt=\"\" fallback={owner.name.slice(0, 1)} size=\"xl\" />}\n <div className=\"min-w-0\">\n {owner && <p className=\"m-0 font-semibold text-fg\">{owner.name}</p>}\n <p className=\"m-0 mt-1 text-base leading-relaxed text-fg-secondary\">{body}</p>\n {actions && <div className=\"mt-3 flex flex-wrap gap-2\">{actions}</div>}\n </div>\n </div>\n ) : (\n <div className=\"grid max-w-4xl gap-4 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)] md:gap-10\">\n {quote && <blockquote className=\"m-0 border-s-2 border-accent ps-4 font-display text-2xl leading-snug text-fg\">{quote}</blockquote>}\n <p className=\"m-0 text-base leading-relaxed text-fg-secondary\">{body}</p>\n </div>\n )}\n </ShopSection>\n );\n}\n"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"path": "shop/team/index.ts",
|
|
623
|
+
"content": "/** @krizaka/ui/shop/team — `TeamSection`: the people of a shop — avatars and first names in a row, or a card each with a role. Server-safe. */\nexport { type ShopMember, TeamSection, type TeamSectionProps, type TeamVariant } from \"./team\";\n"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"path": "shop/team/team.tsx",
|
|
627
|
+
"content": "// Server-safe. The people of the shop (ADR-007 §3): `row` — avatars and first names in a line; `cards` — a card each with a\n// role. Faces are the members' own photos, or the default avatar of @krizaka/ui: never a stock face.\nimport { Avatar } from \"@krizaka/ui/avatar\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type TeamVariant = \"row\" | \"cards\";\n\nexport type ShopMember = {\n id: string;\n /** The first name. */\n name: string;\n /** What they do (`Colourist`): `cards` only. */\n role?: string;\n /** Their own photo. Without one the default avatar is drawn. */\n photo?: string;\n};\n\nexport type TeamSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"row\" */\n variant?: TeamVariant;\n members: readonly ShopMember[];\n title: React.ReactNode;\n lead?: React.ReactNode;\n};\n\n/** The people of the shop. */\nexport function TeamSection({ variant = \"row\", members, title, lead, className, ...props }: TeamSectionProps) {\n if (members.length === 0) return null;\n const list =\n variant === \"cards\" ? (\n <ul className=\"m-0 grid list-none gap-3 p-0 sm:grid-cols-2 lg:grid-cols-4\">\n {members.map((m) => (\n <li key={m.id} className=\"flex items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3\">\n <Avatar src={m.photo} fallback={m.name.slice(0, 1)} size=\"lg\" />\n <div className=\"min-w-0\">\n <p className=\"m-0 truncate font-semibold text-fg\">{m.name}</p>\n {m.role && <p className=\"m-0 truncate text-[13px] text-fg-secondary\">{m.role}</p>}\n </div>\n </li>\n ))}\n </ul>\n ) : (\n <ul className=\"m-0 flex list-none flex-wrap gap-x-6 gap-y-3 p-0\">\n {members.map((m) => (\n <li key={m.id} className=\"flex items-center gap-2.5\">\n <Avatar src={m.photo} fallback={m.name.slice(0, 1)} size=\"md\" />\n <span className=\"font-semibold text-fg\">{m.name}</span>\n </li>\n ))}\n </ul>\n );\n return (\n <ShopSection title={title} lead={lead} className={className} data-variant={variant} {...props}>\n {list}\n </ShopSection>\n );\n}\n"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"path": "shop/text.ts",
|
|
631
|
+
"content": "import * as z from \"zod/mini\";\n\n/** The owner's words, in each language; the product's message is the fallback when a language is absent. */\nexport const localizedText = z.object({\n fr: z.optional(z.string().check(z.maxLength(600))),\n en: z.optional(z.string().check(z.maxLength(600))),\n});\nexport type LocalizedText = z.output<typeof localizedText>;\n"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"path": "shop/video/index.ts",
|
|
635
|
+
"content": "/** @krizaka/ui/shop/video — `VideoSection`: the shop's videos on its page — the old TV with its latest video (`tv`) or a strip of reels (`shorts`), a platform's short always behind a click. Server-safe. */\nexport { type ShopReel, VideoSection, type VideoSectionProps, type VideoVariant } from \"./video\";\n"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"path": "shop/video/video.tsx",
|
|
639
|
+
"content": "// Server-safe (the TV and the facades are client islands imported through their own entries). The shop's videos (ADR-007\n// §3): `tv` — the old television with the shop's latest video (its own clip, or a platform's short behind its facade);\n// `shorts` — another channel's reels, each behind a facade. Nothing is requested from a platform before the click.\nimport { EmbedFacade, type EmbedPlatform } from \"@krizaka/ui/embed-facade\";\nimport { RetroTv, type RetroTvProps } from \"@krizaka/ui/retro-tv\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\nimport { SHOP_LIMITS } from \"../limits\";\n\nexport type VideoVariant = \"tv\" | \"shorts\";\n\nexport type ShopReel = {\n id: string;\n platform: EmbedPlatform;\n /** The public address of the post (validated by `embedUrl`: anything else draws nothing). */\n url: string;\n /** Its accessible name. */\n title: string;\n /** The host's own copy of the picture. */\n poster?: string;\n};\n\nexport type VideoSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"tv\" */\n variant?: VideoVariant;\n title: React.ReactNode;\n lead?: React.ReactNode;\n /** The reels, newest first. `tv` plays the first one (unless `clip` is set); `shorts` draws up to six. */\n reels?: readonly ShopReel[];\n /** `tv`: the shop's own clip in the cabinet (`src`, `poster`, `title`). */\n clip?: Pick<RetroTvProps, \"src\" | \"poster\" | \"title\">;\n /** The facade's button, per platform (« Load TikTok and play »), passed translated. */\n playLabels: Record<EmbedPlatform, string>;\n /** The line under a facade's button: what the platform will receive on the click. */\n notice?: React.ReactNode;\n /** `tv`: the cabinet. @default \"cabinet\" */\n cabinet?: \"cabinet\" | \"portable\";\n /** `tv`: the channel written on the cabinet (`CH 3 · Saint-Henri`). */\n channel?: string;\n /** `tv`: what sits beside the television (a few pinned notes, a line). */\n aside?: React.ReactNode;\n};\n\n/** The shop's videos: the old TV, or a strip of short reels behind a click. */\nexport function VideoSection({ variant = \"tv\", title, lead, reels = [], clip, playLabels, notice, cabinet = \"cabinet\", channel, aside, className, ...props }: VideoSectionProps) {\n const facade = (r: ShopReel, className?: string) => (\n <EmbedFacade key={r.id} platform={r.platform} url={r.url} title={r.title} playLabel={playLabels[r.platform]} poster={r.poster} notice={notice} className={className} />\n );\n let body: React.ReactNode;\n if (variant === \"shorts\") {\n body = (\n <ul className=\"m-0 flex list-none snap-x snap-mandatory gap-3 overflow-x-auto p-0 pb-2\">\n {reels.slice(0, SHOP_LIMITS.reels).map((r) => (\n <li key={r.id} className=\"w-44 shrink-0 snap-start sm:w-52\">\n {facade(r)}\n </li>\n ))}\n </ul>\n );\n } else {\n const first = reels[0];\n let tv: React.ReactNode = null;\n if (clip) tv = <RetroTv {...clip} variant={cabinet} channel={channel} />;\n else if (first) tv = <RetroTv title={first.title} variant={cabinet} channel={channel}>{facade(first)}</RetroTv>;\n body = (\n <div className=\"grid items-center gap-6 md:grid-cols-[minmax(0,1fr)_17rem] md:gap-12\">\n <div className=\"order-2 md:order-1\">{aside}</div>\n <div className=\"order-1 mx-auto w-56 md:order-2 md:w-full\">{tv}</div>\n </div>\n );\n }\n return (\n <ShopSection title={title} lead={lead} className={className} data-variant={variant} {...props}>\n {body}\n </ShopSection>\n );\n}\n"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"path": "shop/visit/index.ts",
|
|
643
|
+
"content": "/** @krizaka/ui/shop/visit — `VisitSection`: how to come and when — hours, address and a call (`card`), the place on a map that sits behind a button on a phone (`map`), or both side by side (`split`). Server-safe. */\nexport { VisitSection, type VisitSectionProps, type VisitVariant } from \"./visit\";\n"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"path": "shop/visit/visit.tsx",
|
|
647
|
+
"content": "// Server-safe (the map is a client island). How to come and when (ADR-007 §3): `card` — the hours, the address and a call;\n// `map` — the place on a map (on a phone behind a button), the address under it; `split` — the hours beside the map. The\n// hours are the shop's own, the status is its own words: the section draws them, it never reads the clock.\nimport { type OpeningDay, OpeningHours, type OpeningStatus } from \"@krizaka/ui/opening-hours\";\nimport { MapGate, type MapGateProps } from \"@krizaka/ui/shop/map-gate\";\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type VisitVariant = \"card\" | \"map\" | \"split\";\n\nexport type VisitSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"card\" */\n variant?: VisitVariant;\n title: React.ReactNode;\n hours: readonly OpeningDay[];\n /** Today's day id: its row is marked. */\n today?: string;\n status: OpeningStatus;\n /** The name of the hours list (`Hours`). */\n hoursLabel: string;\n address?: string;\n /** `tel:` target and its text; `showPhone: false` of the document leaves both out. */\n phone?: { href: string; label: string };\n /** `map` and `split`: the place. Without it these draw as a `card`. */\n map?: Omit<MapGateProps, \"className\">;\n};\n\n/** Where and when: hours, address, call, and the place on a map. */\nexport function VisitSection({ variant = \"card\", title, hours, today, status, hoursLabel, address, phone, map, className, ...props }: VisitSectionProps) {\n const details = (\n <div className=\"flex flex-col gap-2 text-sm text-fg-secondary\">\n {address && <p className=\"m-0\">{address}</p>}\n {phone && (\n <p className=\"m-0\">\n <a href={phone.href} className=\"font-semibold text-fg-accent underline\">{phone.label}</a>\n </p>\n )}\n </div>\n );\n const opening = <OpeningHours label={hoursLabel} days={hours} today={today} status={status} />;\n const drawn: VisitVariant = map ? variant : \"card\";\n return (\n <ShopSection title={title} className={className} data-variant={drawn} {...props}>\n {drawn === \"card\" && (\n <div className=\"grid max-w-xl gap-3\">\n {opening}\n {details}\n </div>\n )}\n {drawn === \"map\" && (\n <div className=\"grid gap-3\">\n <MapGate {...map!} />\n {details}\n </div>\n )}\n {drawn === \"split\" && (\n <div className=\"grid items-start gap-4 md:grid-cols-[minmax(0,22rem)_minmax(0,1fr)] md:gap-8\">\n <div className=\"grid gap-3\">\n {opening}\n {details}\n </div>\n <MapGate {...map!} />\n </div>\n )}\n </ShopSection>\n );\n}\n"
|
|
648
|
+
}
|
|
649
|
+
],
|
|
650
|
+
"dependencies": [
|
|
651
|
+
"@krizaka/tokens@^3.65.0",
|
|
652
|
+
"zod@^4.6.7"
|
|
653
|
+
],
|
|
654
|
+
"registryDependencies": [
|
|
655
|
+
"avatar",
|
|
656
|
+
"badge",
|
|
657
|
+
"button",
|
|
658
|
+
"cn",
|
|
659
|
+
"cover-hero",
|
|
660
|
+
"cta-panel",
|
|
661
|
+
"description-list",
|
|
662
|
+
"embed-facade",
|
|
663
|
+
"map",
|
|
664
|
+
"media-gallery",
|
|
665
|
+
"opening-hours",
|
|
666
|
+
"page",
|
|
667
|
+
"retro-tv",
|
|
668
|
+
"reviews",
|
|
669
|
+
"service-card",
|
|
670
|
+
"sticky-action",
|
|
671
|
+
"wall"
|
|
672
|
+
],
|
|
673
|
+
"demo": {
|
|
674
|
+
"path": "examples/shop/menu.tsx",
|
|
675
|
+
"content": "import { OpeningHours } from \"@krizaka/ui/opening-hours\";\nimport { ShopFrame } from \"@krizaka/ui/shop\";\nimport { demoSalon } from \"@krizaka/ui/shop/demo\";\nimport { ServicesSection } from \"@krizaka/ui/shop/services\";\n\n// The price board: a thumbnail only for a service's own photo (Short cut has none), a button that names its service.\nexport default function ShopMenu() {\n const { services, hours, status } = demoSalon;\n return (\n <ShopFrame density=\"compact\">\n <ServicesSection\n title=\"Services\"\n lead=\"Prices before taxes. Pick one, then the time.\"\n services={services}\n chooseLabel=\"Choose\"\n popularLabel=\"Popular\"\n aside={<OpeningHours label=\"Hours\" days={hours} today=\"3\" status={status} />}\n />\n </ShopFrame>\n );\n}\n"
|
|
676
|
+
},
|
|
677
|
+
"props": [
|
|
678
|
+
{
|
|
679
|
+
"component": "SECTION_DEFINITIONS",
|
|
680
|
+
"description": "Every section type, in the order the composer lists them.",
|
|
681
|
+
"props": []
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"component": "ShopFrame",
|
|
685
|
+
"description": "The page: sets the look preset, the accent, the paper and the density the sections below read.",
|
|
686
|
+
"props": [
|
|
687
|
+
{
|
|
688
|
+
"name": "accent",
|
|
689
|
+
"type": "string",
|
|
690
|
+
"default": null,
|
|
691
|
+
"description": "One of the accents the preset lists as tested (`krizaka`, `akinaza:accent-2`…): the owner's choice within the look. Without it, the preset's own.\n@see \n@krizaka /tokens `shopPresets`",
|
|
692
|
+
"required": false
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"name": "density",
|
|
696
|
+
"type": "\"compact\" | \"airy\"",
|
|
697
|
+
"default": "compact",
|
|
698
|
+
"description": "The rhythm: `compact` 40 px between sections (24 on a phone), `airy` 64 px (40). The document's, or the preset's.",
|
|
699
|
+
"required": false
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"name": "paper",
|
|
703
|
+
"type": "\"plain\" | \"kraft\" | \"seyes\" | \"washi\"",
|
|
704
|
+
"default": "plain",
|
|
705
|
+
"description": "The paper under the page, from the preset: `seyes` (ruled), `kraft` (brown — mount `PaperGrain` once), `washi` (a tint of the accent) or `plain`.",
|
|
706
|
+
"required": false
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"name": "preset",
|
|
710
|
+
"type": "string",
|
|
711
|
+
"default": null,
|
|
712
|
+
"description": "The look preset (`salon-vitrine`, `@krizaka/tokens`): its tokens apply to everything inside.",
|
|
713
|
+
"required": false
|
|
714
|
+
}
|
|
715
|
+
]
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"component": "ShopSection",
|
|
719
|
+
"description": "A section of a shop page.",
|
|
720
|
+
"props": [
|
|
721
|
+
{
|
|
722
|
+
"name": "actions",
|
|
723
|
+
"type": "ReactNode",
|
|
724
|
+
"default": null,
|
|
725
|
+
"description": "A link or a button on the right of the heading (« All times → »).",
|
|
726
|
+
"required": false
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
"name": "bleed",
|
|
730
|
+
"type": "boolean",
|
|
731
|
+
"default": null,
|
|
732
|
+
"description": "The content reaches the edges of the screen (a photo, a strip); the heading stays on the frame.",
|
|
733
|
+
"required": false
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
"name": "eyebrow",
|
|
737
|
+
"type": "ReactNode",
|
|
738
|
+
"default": null,
|
|
739
|
+
"description": "A short lower-case note above the title.",
|
|
740
|
+
"required": false
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"name": "first",
|
|
744
|
+
"type": "boolean",
|
|
745
|
+
"default": null,
|
|
746
|
+
"description": "The section is the page's first (the hero): no hairline, no padding.",
|
|
747
|
+
"required": false
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"name": "lead",
|
|
751
|
+
"type": "ReactNode",
|
|
752
|
+
"default": null,
|
|
753
|
+
"description": "One sentence under the title.",
|
|
754
|
+
"required": false
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"name": "title",
|
|
758
|
+
"type": "ReactNode",
|
|
759
|
+
"default": null,
|
|
760
|
+
"description": "The `h2`. Without one the section is named by `aria-label`.",
|
|
761
|
+
"required": false
|
|
762
|
+
}
|
|
763
|
+
]
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"component": "SHOP_KEY_ATTRIBUTE",
|
|
767
|
+
"description": "The attribute that names a section in the preview page: `<div data-shop-key=\"s_8f2c\">` (a block: the outline is its ring).",
|
|
768
|
+
"props": []
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"component": "SHOP_SCHEMA_VERSION",
|
|
772
|
+
"description": "The version of the document's format; migrations are pure functions schema n → n + 1 (`migrate.ts`).",
|
|
773
|
+
"props": []
|
|
774
|
+
}
|
|
775
|
+
]
|
|
776
|
+
}
|