@krizaka/ui 3.64.0 → 3.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-header.d.ts +3 -3
- package/dist/blocks.css +41 -0
- package/dist/chunk-5D7NMUF6.js +35 -0
- package/dist/chunk-5D7NMUF6.js.map +1 -0
- package/dist/chunk-A7MQPIEG.js +31 -0
- package/dist/chunk-A7MQPIEG.js.map +1 -0
- package/dist/chunk-B47WSPMP.js +60 -0
- package/dist/chunk-B47WSPMP.js.map +1 -0
- package/dist/chunk-HKEAYSFS.js +19 -0
- package/dist/chunk-HKEAYSFS.js.map +1 -0
- package/dist/chunk-ZYHWJ7U5.js +20 -0
- package/dist/chunk-ZYHWJ7U5.js.map +1 -0
- package/dist/cover-hero.d.ts +4 -0
- package/dist/cover-hero.js +5 -2
- package/dist/cover-hero.js.map +1 -1
- package/dist/file-upload.d.ts +2 -2
- package/dist/frame-D6Xv83t8.d.ts +52 -0
- package/dist/language-switch.d.ts +9 -9
- package/dist/service-card.d.ts +25 -1
- package/dist/service-card.js +7 -3
- package/dist/service-card.js.map +1 -1
- package/dist/shop/booking.d.ts +36 -0
- package/dist/shop/booking.js +37 -0
- package/dist/shop/booking.js.map +1 -0
- package/dist/shop/bulletin.d.ts +28 -0
- package/dist/shop/bulletin.js +29 -0
- package/dist/shop/bulletin.js.map +1 -0
- package/dist/shop/demo.d.ts +135 -0
- package/dist/shop/demo.js +141 -0
- package/dist/shop/demo.js.map +1 -0
- package/dist/shop/faq.d.ts +20 -0
- package/dist/shop/faq.js +33 -0
- package/dist/shop/faq.js.map +1 -0
- package/dist/shop/gallery.d.ts +46 -0
- package/dist/shop/gallery.js +76 -0
- package/dist/shop/gallery.js.map +1 -0
- package/dist/shop/hero.d.ts +36 -0
- package/dist/shop/hero.js +70 -0
- package/dist/shop/hero.js.map +1 -0
- package/dist/shop/map-gate.d.ts +22 -0
- package/dist/shop/map-gate.js +34 -0
- package/dist/shop/map-gate.js.map +1 -0
- package/dist/shop/policies.d.ts +18 -0
- package/dist/shop/policies.js +16 -0
- package/dist/shop/policies.js.map +1 -0
- package/dist/shop/reviews.d.ts +25 -0
- package/dist/shop/reviews.js +47 -0
- package/dist/shop/reviews.js.map +1 -0
- package/dist/shop/services.d.ts +57 -0
- package/dist/shop/services.js +118 -0
- package/dist/shop/services.js.map +1 -0
- package/dist/shop/social.d.ts +27 -0
- package/dist/shop/social.js +27 -0
- package/dist/shop/social.js.map +1 -0
- package/dist/shop/story.d.ts +24 -0
- package/dist/shop/story.js +26 -0
- package/dist/shop/story.js.map +1 -0
- package/dist/shop/team.d.ts +24 -0
- package/dist/shop/team.js +26 -0
- package/dist/shop/team.js.map +1 -0
- package/dist/shop/video.d.ts +40 -0
- package/dist/shop/video.js +33 -0
- package/dist/shop/video.js.map +1 -0
- package/dist/shop/visit.d.ts +29 -0
- package/dist/shop/visit.js +38 -0
- package/dist/shop/visit.js.map +1 -0
- package/dist/shop-composer.d.ts +490 -0
- package/dist/shop-composer.js +2061 -0
- package/dist/shop-composer.js.map +1 -0
- package/dist/shop.d.ts +316 -0
- package/dist/shop.js +389 -0
- package/dist/shop.js.map +1 -0
- package/package.json +261 -3
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +2 -2
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +2 -2
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/shop/booking-panel.d.ts +4 -0
- package/registry/examples/shop/booking-panel.js +12 -0
- package/registry/examples/shop/booking-panel.tsx +11 -0
- package/registry/examples/shop/booking-sticky.d.ts +4 -0
- package/registry/examples/shop/booking-sticky.js +15 -0
- package/registry/examples/shop/booking-sticky.tsx +12 -0
- package/registry/examples/shop/booking-strip.d.ts +4 -0
- package/registry/examples/shop/booking-strip.js +13 -0
- package/registry/examples/shop/booking-strip.tsx +12 -0
- package/registry/examples/shop/bulletin-banner.d.ts +4 -0
- package/registry/examples/shop/bulletin-banner.js +13 -0
- package/registry/examples/shop/bulletin-banner.tsx +12 -0
- package/registry/examples/shop/bulletin-board.d.ts +4 -0
- package/registry/examples/shop/bulletin-board.js +13 -0
- package/registry/examples/shop/bulletin-board.tsx +12 -0
- package/registry/examples/shop/cards.d.ts +4 -0
- package/registry/examples/shop/cards.js +13 -0
- package/registry/examples/shop/cards.tsx +12 -0
- package/registry/examples/shop/carousel.d.ts +4 -0
- package/registry/examples/shop/carousel.js +13 -0
- package/registry/examples/shop/carousel.tsx +12 -0
- package/registry/examples/shop/document.d.ts +4 -0
- package/registry/examples/shop/document.js +20 -0
- package/registry/examples/shop/document.tsx +13 -0
- package/registry/examples/shop/faq.d.ts +4 -0
- package/registry/examples/shop/faq.js +13 -0
- package/registry/examples/shop/faq.tsx +12 -0
- package/registry/examples/shop/gallery-filmstrip.d.ts +4 -0
- package/registry/examples/shop/gallery-filmstrip.js +13 -0
- package/registry/examples/shop/gallery-filmstrip.tsx +12 -0
- package/registry/examples/shop/gallery-grid.d.ts +4 -0
- package/registry/examples/shop/gallery-grid.js +13 -0
- package/registry/examples/shop/gallery-grid.tsx +12 -0
- package/registry/examples/shop/gallery-mosaic.d.ts +4 -0
- package/registry/examples/shop/gallery-mosaic.js +13 -0
- package/registry/examples/shop/gallery-mosaic.tsx +12 -0
- package/registry/examples/shop/gallery-wall.d.ts +4 -0
- package/registry/examples/shop/gallery-wall.js +13 -0
- package/registry/examples/shop/gallery-wall.tsx +12 -0
- package/registry/examples/shop/hero-banner.d.ts +4 -0
- package/registry/examples/shop/hero-banner.js +15 -0
- package/registry/examples/shop/hero-banner.tsx +14 -0
- package/registry/examples/shop/hero-poster.d.ts +4 -0
- package/registry/examples/shop/hero-poster.js +15 -0
- package/registry/examples/shop/hero-poster.tsx +14 -0
- package/registry/examples/shop/hero-split.d.ts +4 -0
- package/registry/examples/shop/hero-split.js +15 -0
- package/registry/examples/shop/hero-split.tsx +14 -0
- package/registry/examples/shop/hero-tv.d.ts +4 -0
- package/registry/examples/shop/hero-tv.js +15 -0
- package/registry/examples/shop/hero-tv.tsx +14 -0
- package/registry/examples/shop/index.d.ts +4 -0
- package/registry/examples/shop/index.js +13 -0
- package/registry/examples/shop/index.tsx +12 -0
- package/registry/examples/shop/menu-columns.d.ts +4 -0
- package/registry/examples/shop/menu-columns.js +13 -0
- package/registry/examples/shop/menu-columns.tsx +12 -0
- package/registry/examples/shop/menu.d.ts +4 -0
- package/registry/examples/shop/menu.js +25 -0
- package/registry/examples/shop/menu.tsx +21 -0
- package/registry/examples/shop/page.d.ts +4 -0
- package/registry/examples/shop/page.js +32 -0
- package/registry/examples/shop/page.tsx +27 -0
- package/registry/examples/shop/policies.d.ts +4 -0
- package/registry/examples/shop/policies.js +13 -0
- package/registry/examples/shop/policies.tsx +12 -0
- package/registry/examples/shop/reviews-quote.d.ts +4 -0
- package/registry/examples/shop/reviews-quote.js +13 -0
- package/registry/examples/shop/reviews-quote.tsx +12 -0
- package/registry/examples/shop/reviews-strip.d.ts +4 -0
- package/registry/examples/shop/reviews-strip.js +13 -0
- package/registry/examples/shop/reviews-strip.tsx +12 -0
- package/registry/examples/shop/reviews-summary-cards.d.ts +4 -0
- package/registry/examples/shop/reviews-summary-cards.js +13 -0
- package/registry/examples/shop/reviews-summary-cards.tsx +12 -0
- package/registry/examples/shop/social-facade.d.ts +4 -0
- package/registry/examples/shop/social-facade.js +13 -0
- package/registry/examples/shop/social-facade.tsx +12 -0
- package/registry/examples/shop/social-links.d.ts +4 -0
- package/registry/examples/shop/social-links.js +12 -0
- package/registry/examples/shop/social-links.tsx +11 -0
- package/registry/examples/shop/story-owner.d.ts +4 -0
- package/registry/examples/shop/story-owner.js +13 -0
- package/registry/examples/shop/story-owner.tsx +12 -0
- package/registry/examples/shop/story-quote.d.ts +4 -0
- package/registry/examples/shop/story-quote.js +13 -0
- package/registry/examples/shop/story-quote.tsx +12 -0
- package/registry/examples/shop/team-cards.d.ts +4 -0
- package/registry/examples/shop/team-cards.js +13 -0
- package/registry/examples/shop/team-cards.tsx +12 -0
- package/registry/examples/shop/team-row.d.ts +4 -0
- package/registry/examples/shop/team-row.js +13 -0
- package/registry/examples/shop/team-row.tsx +12 -0
- package/registry/examples/shop/video-shorts.d.ts +4 -0
- package/registry/examples/shop/video-shorts.js +14 -0
- package/registry/examples/shop/video-shorts.tsx +13 -0
- package/registry/examples/shop/video-tv.d.ts +4 -0
- package/registry/examples/shop/video-tv.js +13 -0
- package/registry/examples/shop/video-tv.tsx +12 -0
- package/registry/examples/shop/visit-card.d.ts +4 -0
- package/registry/examples/shop/visit-card.js +13 -0
- package/registry/examples/shop/visit-card.tsx +12 -0
- package/registry/examples/shop/visit-map.d.ts +4 -0
- package/registry/examples/shop/visit-map.js +13 -0
- package/registry/examples/shop/visit-map.tsx +12 -0
- package/registry/examples/shop/visit-split.d.ts +4 -0
- package/registry/examples/shop/visit-split.js +13 -0
- package/registry/examples/shop/visit-split.tsx +12 -0
- package/registry/examples/shop-composer/composer.d.ts +4 -0
- package/registry/examples/shop-composer/composer.js +17 -0
- package/registry/examples/shop-composer/composer.tsx +21 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +96 -6
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +1 -1
- package/registry/media-grid.json +1 -1
- package/registry/meta-row.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +1 -1
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +24 -6
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +424 -0
- package/registry/shop.json +776 -0
- package/registry/showcase.json +1 -1
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/registry/wall.json +3 -3
- package/registry/waveform.json +1 -1
package/dist/service-card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/service-card/service-card.tsx"],"sourcesContent":["// Server-safe: no hook, no context. A service a shop sells, as a card that argues: icon or photo, name, duration, price\n// (« from » when it varies), what is included, the capacity, a « Popular » tag — and one way in: a link (the booking page\n// with this service chosen) or a button (`onSelect`, from a client parent). The whole card takes the press.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { buttonVariants } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { CheckGlyph } from \"../glyphs\";\nimport { Stamp } from \"../specimen-tag/specimen-tag\";\n\nexport const serviceCard = tv({\n slots: {\n root:\n \"group relative flex h-full min-w-0 flex-col overflow-hidden rounded-xl border border-border-default bg-surface-1 text-fg transition-colors duration-150 hover:border-border-strong hover:bg-surface-2 \" +\n \"hover:border-accent/50 focus-within:ring-2 focus-within:ring-ring data-[selected]:border-accent data-[selected]:bg-accent-soft\",\n media: \"relative aspect-[16/9] w-full overflow-hidden bg-media [&>img]:h-full [&>img]:w-full [&>img]:object-cover\",\n body: \"flex flex-1 flex-col gap-3 p-4 sm:p-5\",\n head: \"flex items-start gap-3\",\n icon: \"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-fg-accent [&>svg]:h-5 [&>svg]:w-5\",\n titles: \"flex min-w-0 flex-1 flex-col gap-1\",\n name: \"m-0 font-display text-lg font-bold leading-tight tracking-tight text-fg\",\n facts: \"m-0 flex list-none flex-wrap gap-x-2 gap-y-0.5 p-0 text-xs text-fg-secondary\",\n tag: \"shrink-0 rounded-sm bg-accent px-2 py-0.5 text-[10px] font-extrabold text-on-accent\",\n description: \"m-0 text-sm leading-relaxed text-fg-secondary\",\n included: \"m-0 flex list-none flex-col gap-1.5 p-0 text-sm text-fg-secondary\",\n includedItem: \"flex items-start gap-2 [&>svg]:mt-0.5 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 [&>svg]:text-fg-accent\",\n foot: \"mt-auto flex items-end justify-between gap-3 border-t border-border-subtle pt-3\",\n priceBlock: \"flex flex-col leading-none\",\n from: \"mb-1 text-[11px] font-semibold text-fg-secondary\",\n price: \"font-display text-2xl font-black tabular-nums text-fg\",\n action:\n \"inline-flex min-h-9 items-center gap-1 rounded-sm text-sm font-bold text-fg-accent no-underline \" +\n \"after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden group-data-[selected]:text-fg\",\n },\n variants: {\n // The Cahier's stamped index card (krizaka-ui#603): ruled, straight, a punched hole, the facts stamped, a secondary Button.\n // Same elements and same accessible output as the default card; only the drawing changes. The card is not the link, so\n // the name stays selectable.\n variant: {\n default: {},\n index: {\n root:\n \"rounded-none border-border-default bg-surface-1 shadow-[4px_5px_0_-2px_var(--kz-border-default)] \" +\n \"transition-[transform,box-shadow,border-color] duration-120 hover:border-border-strong hover:bg-surface-1 hover:-translate-y-0.5 \" +\n \"hover:shadow-[6px_7px_0_-2px_var(--kz-border-default)] focus-within:-translate-y-0.5 focus-within:shadow-[6px_7px_0_-2px_var(--kz-border-default)] \" +\n \"motion-reduce:transition-none motion-reduce:hover:translate-y-0 motion-reduce:focus-within:translate-y-0\",\n body: \"relative pt-8 sm:pt-9\",\n head: \"border-b border-(--kz-paper-rule-major) pb-3\",\n name: \"font-display font-normal\",\n facts: \"gap-2 text-fg\",\n foot: \"border-t-0 pt-1\",\n },\n },\n density: { grid: {}, list: {} },\n },\n compoundVariants: [\n { variant: \"index\", density: \"list\", class: { root: \"sm:flex-row\", media: \"sm:aspect-auto sm:w-1/3 sm:shrink-0\", body: \"sm:flex-1\" } },\n ],\n defaultVariants: { variant: \"default\", density: \"grid\" },\n});\n\nexport type ServiceCardProps = Omit<React.ComponentProps<\"article\">, \"title\" | \"children\"> & {\n /** The service's name (the heading). */\n name: string;\n /** Its price, formatted by the app (`22,00 $`): the card never formats money. */\n price: string;\n /** The words before the price when it varies (`From`, `À partir de`), passed translated. */\n priceFrom?: string;\n /** How long it takes (`30 min`) — the first fact. */\n duration?: string;\n /** How many it takes (`Up to 5 dogs`, `1 person`) — the second fact. */\n capacity?: string;\n /** One or two sentences: what it is. */\n description?: string;\n /** What is included, one short line each (a check precedes it). */\n included?: readonly string[];\n /** A tag on the top right (`Popular`): only from real data, never decoration. */\n tag?: string;\n /** An icon tile before the name (a signature icon): decorative. */\n icon?: React.ReactNode;\n /** A photo or a loop above the card (an `img`, a `video`): fills a 16:9 band. */\n media?: React.ReactNode;\n /** This service is the chosen one (the accent, `data-selected`). */\n selected?: boolean;\n /** The words of the way in (`Book`, `Choose`): the accessible name of the press. */\n actionLabel: string;\n /** The way in, as an address (the booking page with this service preselected). */\n href?: string;\n /** The app's link component for internal addresses (Next's `Link`). */\n linkAs?: LinkComponent;\n /** The way in, as a press (a client parent). Ignored when `href` is set. */\n onSelect?: () => void;\n /**\n * `index` — the Cahier's stamped index card: a ruled card with a punched hole, straight, the duration and the price as\n * stamps, a secondary button. The same props and the same accessible output; only the drawing changes.\n * @default \"default\"\n */\n variant?: \"default\" | \"index\";\n /**\n * `variant=\"index\"`: `list` lays the card out as a row for a single column (the media on the left from `sm`).\n * @default \"grid\"\n */\n density?: \"grid\" | \"list\";\n /**\n * The heading level of the name.\n * @default \"h3\"\n */\n titleAs?: \"h2\" | \"h3\" | \"h4\";\n /** Enters on scroll (MotionObserver): the index in the grid becomes the delay. */\n reveal?: number;\n};\n\n/** A service as a card: icon or photo, duration, price, what is included, the capacity, a tag — one way in. */\nexport function ServiceCard({\n name, price, priceFrom, duration, capacity, description, included, tag, icon, media, selected, actionLabel, href, linkAs, onSelect, titleAs: Title = \"h3\", reveal, variant = \"default\", density = \"grid\", className, style, ...props\n}: ServiceCardProps) {\n const s = serviceCard({ variant, density });\n const index = variant === \"index\";\n const id = React.useId();\n const facts = [duration, capacity].filter(Boolean);\n const actionClass = index ? cn(buttonVariants({ variant: \"secondary\", size: \"md\" }), \"min-h-11 rounded-none no-underline\") : s.action();\n const arrow = <span aria-hidden>→</span>;\n const revealStyle = reveal === undefined ? style : ({ ...style, \"--kz-delay\": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` } as React.CSSProperties);\n return (\n <article\n aria-labelledby={id}\n data-selected={selected ? \"\" : undefined}\n data-variant={variant}\n data-density={index ? density : undefined}\n data-reveal={reveal === undefined ? undefined : \"\"}\n style={revealStyle}\n className={s.root({ className })}\n {...props}\n >\n {media && <div className={s.media()}>{media}</div>}\n <div className={s.body()}>\n {index && (\n <svg data-hole aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 16 16\" className=\"absolute start-3 top-3 h-4 w-4\">\n <circle cx=\"8\" cy=\"8\" r=\"5.5\" fill=\"var(--kz-surface-0)\" stroke=\"var(--kz-border-strong)\" strokeWidth=\"1.5\" />\n </svg>\n )}\n <div className={s.head()}>\n {icon && <span aria-hidden className={s.icon()}>{icon}</span>}\n <div className={s.titles()}>\n <Title id={id} className={s.name()}>{name}</Title>\n {facts.length > 0 && (\n <ul className={s.facts()}>\n {facts.map((fact, i) => (\n <li key={i}>\n {index ? <Stamp tone=\"ink\" size=\"sm\">{fact}</Stamp> : <>{i > 0 && <span aria-hidden>· </span>}{fact}</>}\n </li>\n ))}\n </ul>\n )}\n </div>\n {tag && <span className={s.tag()}>{tag}</span>}\n </div>\n {description && <p className={s.description()}>{description}</p>}\n {included && included.length > 0 && (\n <ul className={s.included()}>\n {included.map((line) => (\n <li key={line} className={s.includedItem()}>\n <CheckGlyph />\n <span>{line}</span>\n </li>\n ))}\n </ul>\n )}\n <div className={s.foot()}>\n <p className={s.priceBlock()}>\n {priceFrom && <span className={s.from()}>{priceFrom}</span>}\n {index ? <Stamp tone=\"ink\" size=\"sm\" data-figure=\"\" className=\"tabular-nums\">{price}</Stamp> : <span className={s.price()}>{price}</span>}\n </p>\n {href ? (\n <BlockLink href={href} linkAs={linkAs} className={actionClass} aria-describedby={id}>\n {actionLabel} {arrow}\n </BlockLink>\n ) : onSelect ? (\n <button type=\"button\" onClick={onSelect} aria-pressed={selected ?? false} aria-describedby={id} className={actionClass}>\n {actionLabel} {arrow}\n </button>\n ) : null}\n </div>\n </div>\n </article>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAuHH,SA4B0D,UA5B1D,KA4B0D,YA5B1D;AA/GT,IAAM,cAAc,GAAG;AAAA,EAC5B,OAAO;AAAA,IACL,MACE;AAAA,IAEF,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,M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oBAAC,UAAK,eAAW,MAAC,mBAAE;AAAA,gBAAS;AAAA,iBAAK,KAD7F,CAET,CACD,GACH;AAAA,eAEJ;AAAA,YACC,OAAO,oBAAC,UAAK,WAAW,EAAE,IAAI,GAAI,eAAI;AAAA,aACzC;AAAA,UACC,eAAe,oBAAC,OAAE,WAAW,EAAE,YAAY,GAAI,uBAAY;AAAA,UAC3D,YAAY,SAAS,SAAS,KAC7B,oBAAC,QAAG,WAAW,EAAE,SAAS,GACvB,mBAAS,IAAI,CAAC,SACb,qBAAC,QAAc,WAAW,EAAE,aAAa,GACvC;AAAA,gCAAC,cAAW;AAAA,YACZ,oBAAC,UAAM,gBAAK;AAAA,eAFL,IAGT,CACD,GACH;AAAA,UAEF,qBAAC,SAAI,WAAW,EAAE,KAAK,GACrB;AAAA,iCAAC,OAAE,WAAW,EAAE,WAAW,GACxB;AAAA,2BAAa,oBAAC,UAAK,WAAW,EAAE,KAAK,GAAI,qBAAU;AAAA,cACnD,QAAQ,oBAAC,SAAM,MAAK,OAAM,MAAK,MAAK,eAAY,IAAG,WAAU,gBAAgB,iBAAM,IAAW,oBAAC,UAAK,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,eACpI;AAAA,YACC,OACC,qBAAC,aAAU,MAAY,QAAgB,WAAW,aAAa,oBAAkB,IAC9E;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE,WACF,qBAAC,YAAO,MAAK,UAAS,SAAS,UAAU,gBAAc,YAAY,OAAO,oBAAkB,IAAI,WAAW,aACxG;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE;AAAA,aACN;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/service-card/service-card.tsx"],"sourcesContent":["// Server-safe: no hook, no context. A service a shop sells, as a card that argues: icon or photo, name, duration, price\n// (« from » when it varies), what is included, the capacity, a « Popular » tag — and one way in: a link (the booking page\n// with this service chosen) or a button (`onSelect`, from a client parent). The whole card takes the press.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { BlockLink, type LinkComponent } from \"../block-link\";\nimport { buttonVariants } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { CheckGlyph } from \"../glyphs\";\nimport { Stamp } from \"../specimen-tag/specimen-tag\";\n\nexport const serviceCard = tv({\n slots: {\n root:\n \"group relative flex h-full min-w-0 flex-col overflow-hidden rounded-xl border border-border-default bg-surface-1 text-fg transition-colors duration-150 hover:border-border-strong hover:bg-surface-2 \" +\n \"hover:border-accent/50 focus-within:ring-2 focus-within:ring-ring data-[selected]:border-accent data-[selected]:bg-accent-soft\",\n media: \"relative aspect-[16/9] w-full overflow-hidden bg-media [&>img]:h-full [&>img]:w-full [&>img]:object-cover\",\n body: \"flex flex-1 flex-col gap-3 p-4 sm:p-5\",\n head: \"flex items-start gap-3\",\n icon: \"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-fg-accent [&>svg]:h-5 [&>svg]:w-5\",\n titles: \"flex min-w-0 flex-1 flex-col gap-1\",\n name: \"m-0 font-display text-lg font-bold leading-tight tracking-tight text-fg\",\n facts: \"m-0 flex list-none flex-wrap gap-x-2 gap-y-0.5 p-0 text-xs text-fg-secondary\",\n tag: \"shrink-0 rounded-sm bg-accent px-2 py-0.5 text-[10px] font-extrabold text-on-accent\",\n description: \"m-0 text-sm leading-relaxed text-fg-secondary\",\n included: \"m-0 flex list-none flex-col gap-1.5 p-0 text-sm text-fg-secondary\",\n includedItem: \"flex items-start gap-2 [&>svg]:mt-0.5 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 [&>svg]:text-fg-accent\",\n foot: \"mt-auto flex items-end justify-between gap-3 border-t border-border-subtle pt-3\",\n priceBlock: \"flex flex-col leading-none\",\n from: \"mb-1 text-[11px] font-semibold text-fg-secondary\",\n price: \"font-display text-2xl font-black tabular-nums text-fg\",\n action:\n \"inline-flex min-h-9 items-center gap-1 rounded-sm text-sm font-bold text-fg-accent no-underline \" +\n \"after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden group-data-[selected]:text-fg\",\n },\n variants: {\n // The Cahier's stamped index card (krizaka-ui#603): ruled, straight, a punched hole, the facts stamped, a secondary Button.\n // Same elements and same accessible output as the default card; only the drawing changes. The card is not the link, so\n // the name stays selectable.\n variant: {\n default: {},\n index: {\n root:\n \"rounded-none border-border-default bg-surface-1 shadow-[4px_5px_0_-2px_var(--kz-border-default)] \" +\n \"transition-[transform,box-shadow,border-color] duration-120 hover:border-border-strong hover:bg-surface-1 hover:-translate-y-0.5 \" +\n \"hover:shadow-[6px_7px_0_-2px_var(--kz-border-default)] focus-within:-translate-y-0.5 focus-within:shadow-[6px_7px_0_-2px_var(--kz-border-default)] \" +\n \"motion-reduce:transition-none motion-reduce:hover:translate-y-0 motion-reduce:focus-within:translate-y-0\",\n body: \"relative pt-8 sm:pt-9\",\n head: \"border-b border-(--kz-paper-rule-major) pb-3\",\n name: \"font-display font-normal\",\n facts: \"gap-2 text-fg\",\n foot: \"border-t-0 pt-1\",\n },\n },\n // `density=\"list\"` is deprecated (ADR-007): a list of services is `ServicesSection variant=\"menu\"` of `@krizaka/ui/shop/services`.\n density: { grid: {}, list: {} },\n // The photo's box: the wide 16:9 band, or the 4:3 of `services · cards` (ADR-007 §6).\n mediaRatio: { wide: {}, photo: { media: \"aspect-[4/3]\" } },\n },\n compoundVariants: [\n { variant: \"index\", density: \"list\", class: { root: \"sm:flex-row\", media: \"sm:aspect-auto sm:w-1/3 sm:shrink-0\", body: \"sm:flex-1\" } },\n ],\n defaultVariants: { variant: \"default\", density: \"grid\", mediaRatio: \"wide\" },\n});\n\nexport type ServiceCardProps = Omit<React.ComponentProps<\"article\">, \"title\" | \"children\"> & {\n /** The service's name (the heading). */\n name: string;\n /** Its price, formatted by the app (`22,00 $`): the card never formats money. */\n price: string;\n /** The words before the price when it varies (`From`, `À partir de`), passed translated. */\n priceFrom?: string;\n /** How long it takes (`30 min`) — the first fact. */\n duration?: string;\n /** How many it takes (`Up to 5 dogs`, `1 person`) — the second fact. */\n capacity?: string;\n /** One or two sentences: what it is. */\n description?: string;\n /** What is included, one short line each (a check precedes it). */\n included?: readonly string[];\n /** A tag on the top right (`Popular`): only from real data, never decoration. */\n tag?: string;\n /** An icon tile before the name (a signature icon): decorative. */\n icon?: React.ReactNode;\n /** A photo or a loop above the card (an `img`, a `video`): fills a 16:9 band. */\n media?: React.ReactNode;\n /** This service is the chosen one (the accent, `data-selected`). */\n selected?: boolean;\n /** The words of the way in (`Book`, `Choose`): the accessible name of the press. */\n actionLabel: string;\n /** The way in, as an address (the booking page with this service preselected). */\n href?: string;\n /** The app's link component for internal addresses (Next's `Link`). */\n linkAs?: LinkComponent;\n /** The way in, as a press (a client parent). Ignored when `href` is set. */\n onSelect?: () => void;\n /**\n * `index` — the Cahier's stamped index card: a ruled card with a punched hole, straight, the duration and the price as\n * stamps, a secondary button. The same props and the same accessible output; only the drawing changes.\n * @default \"default\"\n */\n variant?: \"default\" | \"index\";\n /**\n * `variant=\"index\"`: `list` lays the card out as a row for a single column (the media on the left from `sm`).\n * @deprecated Since 3.64: use `ServicesSection variant=\"menu\"` of `@krizaka/ui/shop/services` (the compact price board). Removed in 4.0.0.\n * @default \"grid\"\n */\n density?: \"grid\" | \"list\";\n /**\n * The photo's box: `wide` (16:9) or `photo` (4:3).\n * @default \"wide\"\n */\n mediaRatio?: \"wide\" | \"photo\";\n /**\n * The heading level of the name.\n * @default \"h3\"\n */\n titleAs?: \"h2\" | \"h3\" | \"h4\";\n /** Enters on scroll (MotionObserver): the index in the grid becomes the delay. */\n reveal?: number;\n};\n\n/** A service as a card: icon or photo, duration, price, what is included, the capacity, a tag — one way in. */\nexport function ServiceCard({\n name, price, priceFrom, duration, capacity, description, included, tag, icon, media, selected, actionLabel, href, linkAs, onSelect, titleAs: Title = \"h3\", reveal, variant = \"default\", density = \"grid\", mediaRatio = \"wide\", className, style, ...props\n}: ServiceCardProps) {\n const s = serviceCard({ variant, density, mediaRatio });\n const index = variant === \"index\";\n const id = React.useId();\n const facts = [duration, capacity].filter(Boolean);\n const actionClass = index ? cn(buttonVariants({ variant: \"secondary\", size: \"md\" }), \"min-h-11 rounded-none no-underline\") : s.action();\n const arrow = <span aria-hidden>→</span>;\n const revealStyle = reveal === undefined ? style : ({ ...style, \"--kz-delay\": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` } as React.CSSProperties);\n return (\n <article\n aria-labelledby={id}\n data-selected={selected ? \"\" : undefined}\n data-variant={variant}\n data-density={index ? density : undefined}\n data-reveal={reveal === undefined ? undefined : \"\"}\n style={revealStyle}\n className={s.root({ className })}\n {...props}\n >\n {media && <div className={s.media()}>{media}</div>}\n <div className={s.body()}>\n {index && (\n <svg data-hole aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 16 16\" className=\"absolute start-3 top-3 h-4 w-4\">\n <circle cx=\"8\" cy=\"8\" r=\"5.5\" fill=\"var(--kz-surface-0)\" stroke=\"var(--kz-border-strong)\" strokeWidth=\"1.5\" />\n </svg>\n )}\n <div className={s.head()}>\n {icon && <span aria-hidden className={s.icon()}>{icon}</span>}\n <div className={s.titles()}>\n <Title id={id} className={s.name()}>{name}</Title>\n {facts.length > 0 && (\n <ul className={s.facts()}>\n {facts.map((fact, i) => (\n <li key={i}>\n {index ? <Stamp tone=\"ink\" size=\"sm\">{fact}</Stamp> : <>{i > 0 && <span aria-hidden>· </span>}{fact}</>}\n </li>\n ))}\n </ul>\n )}\n </div>\n {tag && <span className={s.tag()}>{tag}</span>}\n </div>\n {description && <p className={s.description()}>{description}</p>}\n {included && included.length > 0 && (\n <ul className={s.included()}>\n {included.map((line) => (\n <li key={line} className={s.includedItem()}>\n <CheckGlyph />\n <span>{line}</span>\n </li>\n ))}\n </ul>\n )}\n <div className={s.foot()}>\n <p className={s.priceBlock()}>\n {priceFrom && <span className={s.from()}>{priceFrom}</span>}\n {index ? <Stamp tone=\"ink\" size=\"sm\" data-figure=\"\" className=\"tabular-nums\">{price}</Stamp> : <span className={s.price()}>{price}</span>}\n </p>\n {href ? (\n <BlockLink href={href} linkAs={linkAs} className={actionClass} aria-describedby={id}>\n {actionLabel} {arrow}\n </BlockLink>\n ) : onSelect ? (\n <button type=\"button\" onClick={onSelect} aria-pressed={selected ?? false} aria-describedby={id} className={actionClass}>\n {actionLabel} {arrow}\n </button>\n ) : null}\n </div>\n </div>\n </article>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,YAAY,WAAW;AACvB,SAAS,UAAU;AAgIH,SA4B0D,UA5B1D,KA4B0D,YA5B1D;AAxHT,IAAM,cAAc,GAAG;AAAA,EAC5B,OAAO;AAAA,IACL,MACE;AAAA,IAEF,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,IACb,UAAU;AAAA,IACV,cAAc;AAAA,IACd,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QACE;AAAA,EAEJ;AAAA,EACA,UAAU;AAAA;AAAA;AAAA;AAAA,IAIR,SAAS;AAAA,MACP,SAAS,CAAC;AAAA,MACV,OAAO;AAAA,QACL,MACE;AAAA,QAIF,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA;AAAA,IAEA,SAAS,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE;AAAA;AAAA,IAE9B,YAAY,EAAE,MAAM,CAAC,GAAG,OAAO,EAAE,OAAO,eAAe,EAAE;AAAA,EAC3D;AAAA,EACA,kBAAkB;AAAA,IAChB,EAAE,SAAS,SAAS,SAAS,QAAQ,OAAO,EAAE,MAAM,eAAe,OAAO,uCAAuC,MAAM,YAAY,EAAE;AA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U;AAAA,cACnD,QAAQ,oBAAC,SAAM,MAAK,OAAM,MAAK,MAAK,eAAY,IAAG,WAAU,gBAAgB,iBAAM,IAAW,oBAAC,UAAK,WAAW,EAAE,MAAM,GAAI,iBAAM;AAAA,eACpI;AAAA,YACC,OACC,qBAAC,aAAU,MAAY,QAAgB,WAAW,aAAa,oBAAkB,IAC9E;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE,WACF,qBAAC,YAAO,MAAK,UAAS,SAAS,UAAU,gBAAc,YAAY,OAAO,oBAAkB,IAAI,WAAW,aACxG;AAAA;AAAA,cAAY;AAAA,cAAE;AAAA,eACjB,IACE;AAAA,aACN;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { L as LinkComponent } from '../block-link-BAg4eoZk.js';
|
|
3
|
+
|
|
4
|
+
type BookingVariant = "strip" | "panel" | "sticky";
|
|
5
|
+
type BookingTime = {
|
|
6
|
+
id: string;
|
|
7
|
+
/** In words, formatted by the app (`Today 4:30 pm`). */
|
|
8
|
+
label: string;
|
|
9
|
+
/** The booking page with this time chosen. */
|
|
10
|
+
href: string;
|
|
11
|
+
};
|
|
12
|
+
type BookingSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
13
|
+
/** @default "strip" */
|
|
14
|
+
variant?: BookingVariant;
|
|
15
|
+
/** `strip`: the next free times, in order (the first `count`). */
|
|
16
|
+
times?: readonly BookingTime[];
|
|
17
|
+
/** `strip`: the group's name (`Next free times`). */
|
|
18
|
+
label: string;
|
|
19
|
+
/** `strip`: said when no time is free. */
|
|
20
|
+
emptyLabel?: string;
|
|
21
|
+
/** The booking page (`All times →`, `Book`). */
|
|
22
|
+
href: string;
|
|
23
|
+
/** The words of that link / button. */
|
|
24
|
+
actionLabel: string;
|
|
25
|
+
/** `panel`: the invitation (`Ready when you are`), and why. */
|
|
26
|
+
title?: React.ReactNode;
|
|
27
|
+
body?: React.ReactNode;
|
|
28
|
+
linkAs?: LinkComponent;
|
|
29
|
+
/** `sticky`: the selector of the page's own action (`#hero-book`): while it is on screen the bar hides. */
|
|
30
|
+
hideWhileVisible?: string;
|
|
31
|
+
};
|
|
32
|
+
/** The way to book: the next free times, a closing call, or the phone bar. */
|
|
33
|
+
declare function BookingSection({ variant, times, label, emptyLabel, href, actionLabel, title, body, linkAs, hideWhileVisible, className, ...props }: BookingSectionProps): React.JSX.Element;
|
|
34
|
+
|
|
35
|
+
export { BookingSection };
|
|
36
|
+
export type { BookingSectionProps, BookingTime, BookingVariant };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlockLink
|
|
3
|
+
} from "../chunk-HKEAYSFS.js";
|
|
4
|
+
import {
|
|
5
|
+
ShopSection
|
|
6
|
+
} from "../chunk-A7MQPIEG.js";
|
|
7
|
+
import {
|
|
8
|
+
cn
|
|
9
|
+
} from "../chunk-B47WSPMP.js";
|
|
10
|
+
|
|
11
|
+
// src/shop/booking/booking.tsx
|
|
12
|
+
import { buttonVariants } from "@krizaka/ui/button";
|
|
13
|
+
import { CtaPanel } from "@krizaka/ui/cta-panel";
|
|
14
|
+
import { StickyAction } from "@krizaka/ui/sticky-action";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
function BookingSection({ variant = "strip", times = [], label, emptyLabel, href, actionLabel, title, body, linkAs, hideWhileVisible, className, ...props }) {
|
|
17
|
+
const action = (size) => /* @__PURE__ */ jsx(BlockLink, { href, linkAs, className: cn(buttonVariants({ variant: "primary", size }), "no-underline"), children: actionLabel });
|
|
18
|
+
if (variant === "sticky") {
|
|
19
|
+
return /* @__PURE__ */ jsx(StickyAction, { hideWhileVisible, "data-variant": "sticky", className, ...props, children: /* @__PURE__ */ jsx(BlockLink, { href, linkAs, className: cn(buttonVariants({ variant: "primary", size: "lg" }), "w-full justify-center no-underline"), children: actionLabel }) });
|
|
20
|
+
}
|
|
21
|
+
if (variant === "panel") {
|
|
22
|
+
return /* @__PURE__ */ jsx(ShopSection, { "aria-label": typeof title === "string" ? title : label, "data-variant": "panel", className, ...props, children: /* @__PURE__ */ jsx(CtaPanel, { title: title ?? label, body, children: action("lg") }) });
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ jsx(ShopSection, { "aria-label": label, "data-variant": "strip", className, ...props, children: /* @__PURE__ */ jsxs("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", children: [
|
|
25
|
+
/* @__PURE__ */ jsx("p", { className: "m-0 order-1 text-sm font-semibold text-fg", children: label }),
|
|
26
|
+
times.length > 0 ? /* @__PURE__ */ jsx("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", children: times.map((t) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(BlockLink, { href: t.href, 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", children: t.label }) }, t.id)) }) : /* @__PURE__ */ jsx("p", { className: "m-0 order-3 w-full text-sm text-fg-secondary sm:order-2 sm:w-auto sm:flex-1", children: emptyLabel }),
|
|
27
|
+
/* @__PURE__ */ jsxs(BlockLink, { href, 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", children: [
|
|
28
|
+
actionLabel,
|
|
29
|
+
" ",
|
|
30
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2192" })
|
|
31
|
+
] })
|
|
32
|
+
] }) });
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
BookingSection
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=booking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shop/booking/booking.tsx"],"sourcesContent":["// Server-safe (the phone bar is a client island imported through its own entry). The way to book (ADR-007 §3): `strip` —\n// the next free times, one tap each, in one line; `panel` — the closing call; `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 </Bl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A,MAAY;AAAA,MAAC,oBAAC,UAAK,eAAW,MAAC,oBAAC;AAAA,OACnC;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type BulletinVariant = "board" | "banner";
|
|
4
|
+
type ShopFlyer = {
|
|
5
|
+
id: string;
|
|
6
|
+
/** At most 140 characters. */
|
|
7
|
+
text: string;
|
|
8
|
+
signature?: string;
|
|
9
|
+
/** The last day it is shown (`2026-11-03`, inclusive); absent: until the owner takes it down. */
|
|
10
|
+
until?: string;
|
|
11
|
+
};
|
|
12
|
+
type BulletinSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
13
|
+
/** @default "board" */
|
|
14
|
+
variant?: BulletinVariant;
|
|
15
|
+
/** The flyers, newest first. */
|
|
16
|
+
flyers: readonly ShopFlyer[];
|
|
17
|
+
/** Today, in the shop's time zone (`2026-10-27`). */
|
|
18
|
+
today: string;
|
|
19
|
+
/** `board`: the section's title (`News`). `banner`: its accessible name. */
|
|
20
|
+
title: string;
|
|
21
|
+
};
|
|
22
|
+
/** The flyers still up on a given day, newest first, at most three. */
|
|
23
|
+
declare function liveFlyers(flyers: readonly ShopFlyer[], today: string): ShopFlyer[];
|
|
24
|
+
/** The owner's news: pinned notes, or one line above the hero. */
|
|
25
|
+
declare function BulletinSection({ variant, flyers, today, title, className, ...props }: BulletinSectionProps): React.JSX.Element | null;
|
|
26
|
+
|
|
27
|
+
export { BulletinSection, liveFlyers };
|
|
28
|
+
export type { BulletinSectionProps, BulletinVariant, ShopFlyer };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SHOP_LIMITS
|
|
3
|
+
} from "../chunk-ZYHWJ7U5.js";
|
|
4
|
+
import {
|
|
5
|
+
ShopSection
|
|
6
|
+
} from "../chunk-A7MQPIEG.js";
|
|
7
|
+
import {
|
|
8
|
+
cn
|
|
9
|
+
} from "../chunk-B47WSPMP.js";
|
|
10
|
+
|
|
11
|
+
// src/shop/bulletin/bulletin.tsx
|
|
12
|
+
import { PinnedNote } from "@krizaka/ui/wall";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
function liveFlyers(flyers, today) {
|
|
15
|
+
return flyers.filter((f) => !f.until || f.until >= today).slice(0, SHOP_LIMITS.flyers);
|
|
16
|
+
}
|
|
17
|
+
function BulletinSection({ variant = "board", flyers, today, title, className, ...props }) {
|
|
18
|
+
const live = liveFlyers(flyers, today);
|
|
19
|
+
if (live.length === 0) return null;
|
|
20
|
+
if (variant === "banner") {
|
|
21
|
+
return /* @__PURE__ */ jsx("aside", { "aria-label": title, "data-variant": "banner", className: cn("border-b border-border-subtle bg-accent-soft", className), children: /* @__PURE__ */ jsx("p", { className: "m-0 mx-auto max-w-6xl px-4 py-2 text-center text-[13px] font-medium text-fg", children: live[0].text }) });
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ jsx(ShopSection, { title, className, "data-variant": "board", ...props, children: /* @__PURE__ */ jsx("ul", { className: "m-0 grid list-none gap-4 p-0 sm:grid-cols-2 lg:grid-cols-3", children: live.map((f, i) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(PinnedNote, { text: f.text, signature: f.signature, rotation: [-1.2, 1, -0.6][i % 3], hold: i % 2 === 0 ? "tape" : "pin", lines: 3 }) }, f.id)) }) });
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
BulletinSection,
|
|
27
|
+
liveFlyers
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=bulletin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shop/bulletin/bulletin.tsx"],"sourcesContent":["// 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"],"mappings":";;;;;;;;;;;AAIA,SAAS,kBAAkB;AAyCnB;AAXD,SAAS,WAAW,QAA8B,OAA4B;AACnF,SAAO,OAAO,OAAO,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,SAAS,KAAK,EAAE,MAAM,GAAG,YAAY,MAAM;AACvF;AAGO,SAAS,gBAAgB,EAAE,UAAU,SAAS,QAAQ,OAAO,OAAO,WAAW,GAAG,MAAM,GAAyB;AACtH,QAAM,OAAO,WAAW,QAAQ,KAAK;AACrC,MAAI,KAAK,WAAW,EAAG,QAAO;AAC9B,MAAI,YAAY,UAAU;AACxB,WACE,oBAAC,WAAM,cAAY,OAAO,gBAAa,UAAS,WAAW,GAAG,gDAAgD,SAAS,GACrH,8BAAC,OAAE,WAAU,+EAA+E,eAAK,CAAC,EAAG,MAAK,GAC5G;AAAA,EAEJ;AACA,SACE,oBAAC,eAAY,OAAc,WAAsB,gBAAa,SAAS,GAAG,OACxE,8BAAC,QAAG,WAAU,8DACX,eAAK,IAAI,CAAC,GAAG,MACZ,oBAAC,QACC,8BAAC,cAAW,MAAM,EAAE,MAAM,WAAW,EAAE,WAAW,UAAU,CAAC,MAAM,GAAG,IAAI,EAAE,IAAI,CAAC,GAAG,MAAM,IAAI,MAAM,IAAI,SAAS,OAAO,OAAO,GAAG,KAD3H,EAAE,EAEX,CACD,GACH,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { ShopPhoto } from '../shop.js';
|
|
2
|
+
import { ShopGalleryPhoto } from './gallery.js';
|
|
3
|
+
import { ShopService } from './services.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '../block-link-BAg4eoZk.js';
|
|
6
|
+
|
|
7
|
+
declare const DEMO_PHOTOS: {
|
|
8
|
+
readonly "pets-ball": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-ball.e03f1ae74d.webp";
|
|
9
|
+
readonly "pets-canal": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-canal.4ea735fad7.webp";
|
|
10
|
+
readonly "pets-cover": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-cover.9f06b05e7d.webp";
|
|
11
|
+
readonly "pets-door": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-door.099a4143b4.webp";
|
|
12
|
+
readonly "pets-leash": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-leash.fbdb08ddad.webp";
|
|
13
|
+
readonly "pets-leaves": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-leaves.e7ce7dd035.webp";
|
|
14
|
+
readonly "pets-snow": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-snow.894afd7929.webp";
|
|
15
|
+
readonly "pets-stairs": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-stairs.c218522480.webp";
|
|
16
|
+
readonly "salon-basin": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-basin.64dd59cac7.webp";
|
|
17
|
+
readonly "salon-brushes": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-brushes.235eebb9a1.webp";
|
|
18
|
+
readonly "salon-chair": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-chair.4cdd76afdf.webp";
|
|
19
|
+
readonly "salon-colour": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-colour.00c62a6aac.webp";
|
|
20
|
+
readonly "salon-cover": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-cover.218332751d.webp";
|
|
21
|
+
readonly "salon-mirror": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-mirror.9c2858ccd2.webp";
|
|
22
|
+
readonly "salon-shelf": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-shelf.d215d866d2.webp";
|
|
23
|
+
readonly "salon-station": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-station.91abe38059.webp";
|
|
24
|
+
readonly "salon-tools": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-tools.8ff845df44.webp";
|
|
25
|
+
readonly "salon-towels": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-towels.8a49746a6b.webp";
|
|
26
|
+
};
|
|
27
|
+
type DemoPhoto = keyof typeof DEMO_PHOTOS;
|
|
28
|
+
|
|
29
|
+
/** A demo photo with its words. */
|
|
30
|
+
declare const demoPhoto: (name: DemoPhoto, alt: string) => ShopPhoto;
|
|
31
|
+
type DemoShop = {
|
|
32
|
+
id: "salon" | "pets";
|
|
33
|
+
name: string;
|
|
34
|
+
eyebrow: string;
|
|
35
|
+
promise: string;
|
|
36
|
+
/** The preset the shop wears. */
|
|
37
|
+
preset: string;
|
|
38
|
+
cover: ShopPhoto & {
|
|
39
|
+
phone?: string;
|
|
40
|
+
};
|
|
41
|
+
services: ShopService[];
|
|
42
|
+
/** The gallery: none of them is a cover or a service's photo. */
|
|
43
|
+
photos: ShopGalleryPhoto[];
|
|
44
|
+
times: {
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
href: string;
|
|
48
|
+
}[];
|
|
49
|
+
hours: {
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
hours: string;
|
|
53
|
+
}[];
|
|
54
|
+
status: {
|
|
55
|
+
open: boolean;
|
|
56
|
+
label: string;
|
|
57
|
+
detail: string;
|
|
58
|
+
};
|
|
59
|
+
team: {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
}[];
|
|
63
|
+
address: string;
|
|
64
|
+
phone: string;
|
|
65
|
+
};
|
|
66
|
+
declare const demoSalon: DemoShop;
|
|
67
|
+
declare const demoPets: DemoShop;
|
|
68
|
+
declare const demoReviews: {
|
|
69
|
+
summary: {
|
|
70
|
+
score: number;
|
|
71
|
+
count: number;
|
|
72
|
+
distribution: [number, number, number, number, number];
|
|
73
|
+
scoreText: string;
|
|
74
|
+
countText: string;
|
|
75
|
+
summaryText: string;
|
|
76
|
+
starText: (stars: number, count: number) => string;
|
|
77
|
+
};
|
|
78
|
+
reviews: {
|
|
79
|
+
id: string;
|
|
80
|
+
author: string;
|
|
81
|
+
date: string;
|
|
82
|
+
dateTime: string;
|
|
83
|
+
service: string;
|
|
84
|
+
rating: number;
|
|
85
|
+
ratingText: string;
|
|
86
|
+
text: string;
|
|
87
|
+
}[];
|
|
88
|
+
};
|
|
89
|
+
declare const demoReel: {
|
|
90
|
+
id: string;
|
|
91
|
+
platform: "tiktok";
|
|
92
|
+
url: string;
|
|
93
|
+
title: string;
|
|
94
|
+
};
|
|
95
|
+
declare const demoFlyers: ({
|
|
96
|
+
id: string;
|
|
97
|
+
text: string;
|
|
98
|
+
signature: string;
|
|
99
|
+
until: string;
|
|
100
|
+
} | {
|
|
101
|
+
id: string;
|
|
102
|
+
text: string;
|
|
103
|
+
signature: string;
|
|
104
|
+
until?: undefined;
|
|
105
|
+
})[];
|
|
106
|
+
declare const demoFaq: {
|
|
107
|
+
id: string;
|
|
108
|
+
question: string;
|
|
109
|
+
answer: string;
|
|
110
|
+
}[];
|
|
111
|
+
declare const demoPolicies: {
|
|
112
|
+
id: string;
|
|
113
|
+
term: string;
|
|
114
|
+
details: string;
|
|
115
|
+
}[];
|
|
116
|
+
declare const demoStory: {
|
|
117
|
+
quote: string;
|
|
118
|
+
body: string;
|
|
119
|
+
owner: {
|
|
120
|
+
name: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
declare const demoMap: {
|
|
124
|
+
label: string;
|
|
125
|
+
center: [number, number];
|
|
126
|
+
zoom: number;
|
|
127
|
+
showLabel: string;
|
|
128
|
+
places: {
|
|
129
|
+
position: [number, number];
|
|
130
|
+
label: string;
|
|
131
|
+
}[];
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export { DEMO_PHOTOS, demoFaq, demoFlyers, demoMap, demoPets, demoPhoto, demoPolicies, demoReel, demoReviews, demoSalon, demoStory };
|
|
135
|
+
export type { DemoPhoto, DemoShop };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// src/shop/demo/media.ts
|
|
2
|
+
var DEMO_PHOTOS = {
|
|
3
|
+
"pets-ball": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-ball.e03f1ae74d.webp",
|
|
4
|
+
"pets-canal": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-canal.4ea735fad7.webp",
|
|
5
|
+
"pets-cover": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-cover.9f06b05e7d.webp",
|
|
6
|
+
"pets-door": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-door.099a4143b4.webp",
|
|
7
|
+
"pets-leash": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-leash.fbdb08ddad.webp",
|
|
8
|
+
"pets-leaves": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-leaves.e7ce7dd035.webp",
|
|
9
|
+
"pets-snow": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-snow.894afd7929.webp",
|
|
10
|
+
"pets-stairs": "https://krizaka-assets.b-cdn.net/ui/shop/demo/pets-stairs.c218522480.webp",
|
|
11
|
+
"salon-basin": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-basin.64dd59cac7.webp",
|
|
12
|
+
"salon-brushes": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-brushes.235eebb9a1.webp",
|
|
13
|
+
"salon-chair": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-chair.4cdd76afdf.webp",
|
|
14
|
+
"salon-colour": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-colour.00c62a6aac.webp",
|
|
15
|
+
"salon-cover": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-cover.218332751d.webp",
|
|
16
|
+
"salon-mirror": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-mirror.9c2858ccd2.webp",
|
|
17
|
+
"salon-shelf": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-shelf.d215d866d2.webp",
|
|
18
|
+
"salon-station": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-station.91abe38059.webp",
|
|
19
|
+
"salon-tools": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-tools.8ff845df44.webp",
|
|
20
|
+
"salon-towels": "https://krizaka-assets.b-cdn.net/ui/shop/demo/salon-towels.8a49746a6b.webp"
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// src/shop/demo/index.ts
|
|
24
|
+
var demoPhoto = (name, alt) => ({ src: DEMO_PHOTOS[name], alt });
|
|
25
|
+
var week = (hours, closed = "Closed") => ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"].map((label, i) => ({ id: String(i + 1), label, hours: i === 6 ? closed : hours }));
|
|
26
|
+
var demoSalon = {
|
|
27
|
+
id: "salon",
|
|
28
|
+
name: "Salon C\xE8dre & Ciseaux",
|
|
29
|
+
eyebrow: "Saint-Henri \xB7 Montr\xE9al",
|
|
30
|
+
promise: "A neighbourhood salon on Notre-Dame West: cuts, colour and beard care, with the person of your choice.",
|
|
31
|
+
preset: "salon-vitrine",
|
|
32
|
+
cover: demoPhoto("salon-cover", "The salon's window on a winter evening, warm light on the brick street"),
|
|
33
|
+
services: [
|
|
34
|
+
{ id: "short", name: "Short cut", price: "$45", duration: "30 min", description: "Scissor or clipper, razor finish", category: "cuts", href: "#book-short" },
|
|
35
|
+
{ 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" },
|
|
36
|
+
{ 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" },
|
|
37
|
+
{ 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" },
|
|
38
|
+
{ 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" }
|
|
39
|
+
],
|
|
40
|
+
photos: [
|
|
41
|
+
{ id: "mirror", photo: demoPhoto("salon-mirror", "A round mirror with fairy lights on a brick wall") },
|
|
42
|
+
{ id: "basin", photo: demoPhoto("salon-basin", "A basin under a pendant lamp") },
|
|
43
|
+
{ id: "brushes", photo: demoPhoto("salon-brushes", "Brushes and a dryer on a wooden counter") },
|
|
44
|
+
{ id: "station", photo: demoPhoto("salon-station", "A styling station facing the rainy street") },
|
|
45
|
+
{ id: "tools", photo: demoPhoto("salon-tools", "Scissors and a comb under a brass lamp") }
|
|
46
|
+
],
|
|
47
|
+
times: [
|
|
48
|
+
{ id: "t1", label: "Today 4:30 pm", href: "#t1" },
|
|
49
|
+
{ id: "t2", label: "Today 6:00 pm", href: "#t2" },
|
|
50
|
+
{ id: "t3", label: "Tue 9:00 am", href: "#t3" },
|
|
51
|
+
{ id: "t4", label: "Tue 10:30 am", href: "#t4" }
|
|
52
|
+
],
|
|
53
|
+
hours: week("9 am \u2013 8 pm"),
|
|
54
|
+
status: { open: true, label: "Open now", detail: "until 8 pm" },
|
|
55
|
+
team: [{ id: "e", name: "\xC9ric" }, { id: "k", name: "Karim" }, { id: "j", name: "Jade" }, { id: "c", name: "Camille" }],
|
|
56
|
+
address: "2400 Notre-Dame St W",
|
|
57
|
+
phone: "514-555-0110"
|
|
58
|
+
};
|
|
59
|
+
var demoPets = {
|
|
60
|
+
id: "pets",
|
|
61
|
+
name: "Pattes de Saint-Henri",
|
|
62
|
+
eyebrow: "Saint-Henri \xB7 Montr\xE9al",
|
|
63
|
+
promise: "Neighbourhood dog walks along the canal, with a photo and a note after each one.",
|
|
64
|
+
preset: "pets-canal",
|
|
65
|
+
cover: demoPhoto("pets-cover", "A golden dog facing the Lachine canal at sunset"),
|
|
66
|
+
services: [
|
|
67
|
+
{ 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" },
|
|
68
|
+
{ 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" },
|
|
69
|
+
{ 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" },
|
|
70
|
+
{ 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" }
|
|
71
|
+
],
|
|
72
|
+
photos: [
|
|
73
|
+
{ id: "ball", photo: demoPhoto("pets-ball", "A dog leaping for a ball in the autumn park") },
|
|
74
|
+
{ id: "canal", photo: demoPhoto("pets-canal", "Two dogs resting on the grass by the canal") },
|
|
75
|
+
{ id: "leaves", photo: demoPhoto("pets-leaves", "A small dog running through fallen leaves") },
|
|
76
|
+
{ id: "snow", photo: demoPhoto("pets-snow", "A dog in a red coat on a snowy street at night") },
|
|
77
|
+
{ id: "stairs", photo: demoPhoto("pets-stairs", "A dog sitting on an outdoor staircase") }
|
|
78
|
+
],
|
|
79
|
+
times: [
|
|
80
|
+
{ id: "t1", label: "Today 5:00 pm", href: "#t1" },
|
|
81
|
+
{ id: "t2", label: "Tomorrow 8:00 am", href: "#t2" },
|
|
82
|
+
{ id: "t3", label: "Tomorrow 12:30 pm", href: "#t3" }
|
|
83
|
+
],
|
|
84
|
+
hours: week("7 am \u2013 7 pm", "By request"),
|
|
85
|
+
status: { open: true, label: "Open now", detail: "until 7 pm" },
|
|
86
|
+
team: [{ id: "m", name: "Maude" }, { id: "s", name: "Samuel" }],
|
|
87
|
+
address: "Saint-Henri, Montr\xE9al",
|
|
88
|
+
phone: "514-555-0142"
|
|
89
|
+
};
|
|
90
|
+
var demoReviews = {
|
|
91
|
+
summary: {
|
|
92
|
+
score: 4.7,
|
|
93
|
+
count: 38,
|
|
94
|
+
distribution: [0, 1, 2, 7, 28],
|
|
95
|
+
scoreText: "4.7 / 5",
|
|
96
|
+
countText: "38 verified reviews",
|
|
97
|
+
summaryText: "4.7 out of 5 from 38 verified reviews",
|
|
98
|
+
starText: (stars, count) => `${stars} stars: ${count} reviews`
|
|
99
|
+
},
|
|
100
|
+
reviews: [
|
|
101
|
+
{ 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." },
|
|
102
|
+
{ id: "r2", author: "L\xE9o 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." },
|
|
103
|
+
{ 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." }
|
|
104
|
+
]
|
|
105
|
+
};
|
|
106
|
+
var demoReel = { id: "reel", platform: "tiktok", url: "https://www.tiktok.com/@salon.cedre/video/7123456789012345678", title: "The salon's latest reel" };
|
|
107
|
+
var demoFlyers = [
|
|
108
|
+
{ id: "f1", text: "New: hot-towel beard care, every day this week.", signature: "Jade", until: "2026-11-10" },
|
|
109
|
+
{ id: "f2", text: "Closed Monday November 3 \u2014 back Tuesday at 9.", signature: "\xC9ric", until: "2026-11-03" },
|
|
110
|
+
{ id: "f3", text: "Gift cards at the counter, any amount.", signature: "Camille" }
|
|
111
|
+
];
|
|
112
|
+
var demoFaq = [
|
|
113
|
+
{ 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." },
|
|
114
|
+
{ id: "q2", question: "Can I cancel?", answer: "Free up to 24 hours before. After that the first half of the service is kept." },
|
|
115
|
+
{ id: "q3", question: "Do you do kids' cuts?", answer: "Yes, from age 4, with \xC9ric on Saturday mornings." }
|
|
116
|
+
];
|
|
117
|
+
var demoPolicies = [
|
|
118
|
+
{ id: "p1", term: "Cancellation", details: "Free up to 24 hours before" },
|
|
119
|
+
{ id: "p2", term: "Prices", details: "Before taxes; colour is confirmed at the consultation" },
|
|
120
|
+
{ id: "p3", term: "Booking window", details: "Up to 60 days ahead" }
|
|
121
|
+
];
|
|
122
|
+
var demoStory = {
|
|
123
|
+
quote: "Cuts that last, and advice that is honest.",
|
|
124
|
+
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.",
|
|
125
|
+
owner: { name: "Jade" }
|
|
126
|
+
};
|
|
127
|
+
var demoMap = { label: "Where the salon is", center: [-73.5859, 45.4789], zoom: 15, showLabel: "Show the map", places: [{ position: [-73.5859, 45.4789], label: "Salon C\xE8dre & Ciseaux" }] };
|
|
128
|
+
export {
|
|
129
|
+
DEMO_PHOTOS,
|
|
130
|
+
demoFaq,
|
|
131
|
+
demoFlyers,
|
|
132
|
+
demoMap,
|
|
133
|
+
demoPets,
|
|
134
|
+
demoPhoto,
|
|
135
|
+
demoPolicies,
|
|
136
|
+
demoReel,
|
|
137
|
+
demoReviews,
|
|
138
|
+
demoSalon,
|
|
139
|
+
demoStory
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=demo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shop/demo/media.ts","../../src/shop/demo/index.ts"],"sourcesContent":["// 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","// 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"],"mappings":";AAGO,IAAM,cAAc;AAAA,EACzB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AAAA,EACb,eAAe;AAAA,EACf,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAClB;;;ACXO,IAAM,YAAY,CAAC,MAAiB,SAA4B,EAAE,KAAK,YAAY,IAAI,GAAG,IAAI;AAqBrG,IAAM,OAAO,CAAC,OAAe,SAAS,aACpC,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK,EAAE,IAAI,CAAC,OAAO,OAAO,EAAE,IAAI,OAAO,IAAI,CAAC,GAAG,OAAO,OAAO,MAAM,IAAI,SAAS,MAAM,EAAE;AAE9H,IAAM,YAAsB;AAAA,EACjC,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SA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
+
type ShopQuestion = {
|
|
4
|
+
id: string;
|
|
5
|
+
question: string;
|
|
6
|
+
answer: string;
|
|
7
|
+
};
|
|
8
|
+
type FaqSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
|
|
9
|
+
/** @default "list" */
|
|
10
|
+
variant?: "list";
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
questions: readonly ShopQuestion[];
|
|
13
|
+
};
|
|
14
|
+
/** The FAQPage structured data of a list of questions, as a JSON string safe inside a `script`. */
|
|
15
|
+
declare function faqJsonLd(questions: readonly ShopQuestion[]): string;
|
|
16
|
+
/** The questions and their answers. */
|
|
17
|
+
declare function FaqSection({ title, questions, className, ...props }: FaqSectionProps): React.JSX.Element | null;
|
|
18
|
+
|
|
19
|
+
export { FaqSection, faqJsonLd };
|
|
20
|
+
export type { FaqSectionProps, ShopQuestion };
|
package/dist/shop/faq.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ShopSection
|
|
3
|
+
} from "../chunk-A7MQPIEG.js";
|
|
4
|
+
import "../chunk-B47WSPMP.js";
|
|
5
|
+
|
|
6
|
+
// src/shop/faq/faq.tsx
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function faqJsonLd(questions) {
|
|
9
|
+
const data = {
|
|
10
|
+
"@context": "https://schema.org",
|
|
11
|
+
"@type": "FAQPage",
|
|
12
|
+
mainEntity: questions.map((q) => ({ "@type": "Question", name: q.question, acceptedAnswer: { "@type": "Answer", text: q.answer } }))
|
|
13
|
+
};
|
|
14
|
+
return JSON.stringify(data).replace(/</g, "\\u003c");
|
|
15
|
+
}
|
|
16
|
+
function FaqSection({ title, questions, className, ...props }) {
|
|
17
|
+
if (questions.length === 0) return null;
|
|
18
|
+
return /* @__PURE__ */ jsxs(ShopSection, { title, className, "data-variant": "list", ...props, children: [
|
|
19
|
+
/* @__PURE__ */ jsx("div", { className: "max-w-3xl divide-y divide-border-subtle border-y border-border-subtle", children: questions.map((q) => /* @__PURE__ */ jsxs("details", { className: "group py-3", children: [
|
|
20
|
+
/* @__PURE__ */ jsxs("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", children: [
|
|
21
|
+
q.question,
|
|
22
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "shrink-0 text-fg-secondary transition-transform group-open:rotate-45 motion-reduce:transition-none", children: "+" })
|
|
23
|
+
] }),
|
|
24
|
+
/* @__PURE__ */ jsx("p", { className: "m-0 mt-2 text-[15px] leading-relaxed text-fg-secondary", children: q.answer })
|
|
25
|
+
] }, q.id)) }),
|
|
26
|
+
/* @__PURE__ */ jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: faqJsonLd(questions) } })
|
|
27
|
+
] });
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
FaqSection,
|
|
31
|
+
faqJsonLd
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=faq.js.map
|