@krizaka/ui 3.71.0 → 3.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks.css +26 -0
- package/dist/chunk-M3T5RQYV.js +34 -0
- package/dist/chunk-M3T5RQYV.js.map +1 -0
- package/dist/chunk-ZFR6ZNXD.js +203 -0
- package/dist/chunk-ZFR6ZNXD.js.map +1 -0
- package/dist/filter-bar.d.ts +3 -3
- package/dist/{frame-D6Xv83t8.d.ts → frame-CNZ5VgDD.d.ts} +11 -4
- package/dist/retro-tv-playlist.d.ts +148 -0
- package/dist/retro-tv-playlist.js +234 -0
- package/dist/retro-tv-playlist.js.map +1 -0
- package/dist/retro-tv.js +4 -160
- package/dist/retro-tv.js.map +1 -1
- package/dist/schema-DgjBz7-8.d.ts +242 -0
- package/dist/shop/booking.d.ts +2 -2
- package/dist/shop/booking.js +1 -1
- package/dist/shop/booking.js.map +1 -1
- package/dist/shop/bulletin.js +1 -1
- package/dist/shop/faq.d.ts +2 -1
- package/dist/shop/faq.js +1 -1
- package/dist/shop/faq.js.map +1 -1
- package/dist/shop/gallery.js +1 -1
- package/dist/shop/look.d.ts +43 -0
- package/dist/shop/look.js +52 -0
- package/dist/shop/look.js.map +1 -0
- package/dist/shop/policies.d.ts +2 -1
- package/dist/shop/policies.js +1 -1
- package/dist/shop/policies.js.map +1 -1
- package/dist/shop/reviews.d.ts +2 -1
- package/dist/shop/reviews.js +1 -1
- package/dist/shop/reviews.js.map +1 -1
- package/dist/shop/services.js +1 -1
- package/dist/shop/social.js +1 -1
- package/dist/shop/story.d.ts +2 -1
- package/dist/shop/story.js +1 -1
- package/dist/shop/story.js.map +1 -1
- package/dist/shop/team.js +1 -1
- package/dist/shop/video.js +1 -1
- package/dist/shop/visit.js +1 -1
- package/dist/shop-composer.d.ts +29 -0
- package/dist/shop-composer.js +156 -89
- package/dist/shop-composer.js.map +1 -1
- package/dist/shop.d.ts +6 -240
- package/dist/shop.js +24 -212
- package/dist/shop.js.map +1 -1
- package/package.json +37 -7
- package/registry/account-menu.json +4 -2
- package/registry/account-settings.json +4 -2
- package/registry/achievement.json +4 -2
- package/registry/action-bar.json +4 -2
- package/registry/action-sheet.json +2 -0
- package/registry/activity-feed.json +4 -2
- package/registry/agenda.json +4 -2
- package/registry/alert.json +4 -2
- package/registry/analysis-report.json +4 -2
- package/registry/anatomy-plate.json +4 -2
- package/registry/app-frame.json +5 -3
- package/registry/app-header.json +4 -2
- package/registry/app-shell.json +4 -2
- package/registry/argument-card.json +4 -2
- package/registry/audio-player.json +4 -2
- package/registry/auth-layout.json +4 -2
- package/registry/avatar.json +4 -2
- package/registry/badge.json +4 -2
- package/registry/bird-plate.json +4 -2
- package/registry/button.json +4 -2
- package/registry/captcha.json +4 -2
- package/registry/card-grid.json +4 -2
- package/registry/card.json +4 -2
- package/registry/catalogue-page.json +4 -2
- package/registry/changelog-page.json +4 -2
- package/registry/chapter.json +4 -2
- package/registry/chat.json +4 -2
- package/registry/checkbox.json +4 -2
- package/registry/chip-link.json +4 -2
- package/registry/chip-row.json +4 -2
- package/registry/chip.json +4 -2
- package/registry/choice-grid.json +4 -2
- package/registry/cn.json +2 -0
- package/registry/code-block.json +4 -2
- package/registry/collection-switcher.json +4 -2
- package/registry/combobox.json +4 -2
- package/registry/command.json +4 -2
- package/registry/comparison-table.json +4 -2
- package/registry/component-page.json +4 -2
- package/registry/confirm-button.json +4 -2
- package/registry/contact-page.json +4 -2
- package/registry/continue-prompt.json +4 -2
- package/registry/copy-button.json +4 -2
- package/registry/countdown.json +4 -2
- package/registry/cover-hero.json +4 -2
- package/registry/cta-panel.json +4 -2
- package/registry/dashboard-layout.json +4 -2
- package/registry/data-table.json +4 -2
- package/registry/date-picker.json +4 -2
- package/registry/decision-list.json +4 -2
- package/registry/description-list.json +4 -2
- package/registry/desktop-window.json +5 -3
- package/registry/detail-layout.json +4 -2
- package/registry/dialog.json +4 -2
- package/registry/docs-article-page.json +4 -2
- package/registry/docs-hub-page.json +4 -2
- package/registry/docs-layout.json +4 -2
- package/registry/docs-nav.json +4 -2
- package/registry/document-viewer.json +4 -2
- package/registry/doodle.json +4 -2
- package/registry/drop-overlay.json +4 -2
- package/registry/dropdown-menu.json +4 -2
- package/registry/elephant.json +5 -3
- package/registry/embed-facade.json +4 -2
- package/registry/empty-state.json +4 -2
- package/registry/engine-flow.json +4 -2
- package/registry/entity-header.json +4 -2
- package/registry/environment-notice.json +4 -2
- package/registry/error-page.json +4 -2
- package/registry/fab.json +2 -0
- package/registry/field.json +4 -2
- package/registry/file-upload.json +4 -2
- package/registry/filter-bar.json +4 -2
- package/registry/flock.json +4 -2
- package/registry/footnote.json +4 -2
- package/registry/force-update-screen.json +4 -2
- package/registry/form-flow.json +3 -1
- package/registry/form.json +4 -2
- package/registry/gallery-page.json +4 -2
- package/registry/genui.json +4 -2
- package/registry/glossary-term.json +4 -2
- package/registry/glossary.json +4 -2
- package/registry/glow-card.json +4 -2
- package/registry/goal-gauge.json +4 -2
- package/registry/grade-stamp.json +4 -2
- package/registry/grid.json +2 -0
- package/registry/header.json +2 -0
- package/registry/how-it-works-page.json +4 -2
- package/registry/image-cropper.json +4 -2
- package/registry/image-viewer.json +2 -0
- package/registry/index.json +19 -18
- package/registry/iso.json +4 -2
- package/registry/kanban.json +4 -2
- package/registry/kbd.json +4 -2
- package/registry/kind-config-editor.json +4 -2
- package/registry/kpi-explained.json +4 -2
- package/registry/landing-page.json +4 -2
- package/registry/landscape.json +4 -2
- package/registry/language-switch.json +4 -2
- package/registry/legal-page.json +4 -2
- package/registry/link-card.json +4 -2
- package/registry/list-detail.json +2 -0
- package/registry/list.json +4 -2
- package/registry/loader.json +4 -2
- package/registry/longform-page.json +4 -2
- package/registry/maintenance-screen.json +4 -2
- package/registry/map.json +5 -3
- package/registry/margin-layout.json +4 -2
- package/registry/markdown.json +4 -2
- package/registry/marketing-layout.json +4 -2
- package/registry/marquee.json +4 -2
- package/registry/mascot-quote.json +4 -2
- package/registry/mascot-state.json +4 -2
- package/registry/mascots.json +4 -2
- package/registry/match-dialog.json +4 -2
- package/registry/media-capture.json +4 -2
- package/registry/media-gallery.json +4 -2
- package/registry/media-grid.json +4 -2
- package/registry/media-picker.json +2 -0
- package/registry/meta-row.json +4 -2
- package/registry/meter.json +4 -2
- package/registry/money-input.json +5 -3
- package/registry/nav-bar.json +5 -3
- package/registry/next-actions.json +4 -2
- package/registry/notification-preferences.json +4 -2
- package/registry/number-ticker.json +4 -2
- package/registry/onboarding.json +2 -0
- package/registry/opening-hours.json +4 -2
- package/registry/otp-input.json +2 -0
- package/registry/page-header.json +4 -2
- package/registry/page-hero.json +4 -2
- package/registry/page-index.json +4 -2
- package/registry/page.json +4 -2
- package/registry/pagination.json +4 -2
- package/registry/permission-prompt.json +2 -0
- package/registry/photo-grid.json +4 -2
- package/registry/pointer-light.json +4 -2
- package/registry/popover.json +4 -2
- package/registry/price-catalogue-editor.json +5 -3
- package/registry/pricing-page.json +4 -2
- package/registry/product-page.json +4 -2
- package/registry/profile-card.json +4 -2
- package/registry/progress.json +4 -2
- package/registry/promise-card.json +4 -2
- package/registry/promo-code-field.json +5 -3
- package/registry/proposal.json +5 -3
- package/registry/pull-to-refresh.json +2 -0
- package/registry/qr-code.json +4 -2
- package/registry/quota-meter.json +4 -2
- package/registry/radio-group.json +4 -2
- package/registry/rail-nav.json +5 -3
- package/registry/recipes.json +4 -2
- package/registry/retro-tv.json +9 -3
- package/registry/reviews.json +4 -2
- package/registry/router.json +4 -2
- package/registry/schema-form.json +5 -3
- package/registry/screen.json +2 -0
- package/registry/scroll-stage.json +4 -2
- package/registry/search-field.json +4 -2
- package/registry/section-backdrop.json +4 -2
- package/registry/segmented.json +2 -0
- package/registry/separator.json +4 -2
- package/registry/service-card.json +4 -2
- package/registry/settings-layout.json +4 -2
- package/registry/shop-composer.json +13 -7
- package/registry/shop-gallery.json +5 -3
- package/registry/shop.json +54 -11
- package/registry/showcase.json +4 -2
- package/registry/signature.json +4 -2
- package/registry/site-cahier.json +4 -2
- package/registry/site-footer.json +5 -3
- package/registry/sites.json +4 -2
- package/registry/skeleton.json +4 -2
- package/registry/skip-link.json +4 -2
- package/registry/slider.json +4 -2
- package/registry/slot-picker.json +4 -2
- package/registry/slot.json +4 -2
- package/registry/specimen-tag.json +4 -2
- package/registry/speed-lines.json +4 -2
- package/registry/spinner.json +4 -2
- package/registry/splash-handoff.json +2 -0
- package/registry/split-view.json +4 -2
- package/registry/stage-banner.json +4 -2
- package/registry/stat.json +4 -2
- package/registry/state-screen.json +3 -1
- package/registry/status-chip.json +4 -2
- package/registry/status-page.json +4 -2
- package/registry/step-progress.json +4 -2
- package/registry/step-showcase.json +4 -2
- package/registry/stepper.json +4 -2
- package/registry/sticky-action.json +4 -2
- package/registry/stuck.json +4 -2
- package/registry/swipe-deck.json +4 -2
- package/registry/swipeable-row.json +2 -0
- package/registry/switch.json +4 -2
- package/registry/tab-bar.json +2 -0
- package/registry/tabs.json +4 -2
- package/registry/tag-input.json +4 -2
- package/registry/tag-selector.json +4 -2
- package/registry/taped-photo.json +4 -2
- package/registry/terminal-replay.json +4 -2
- package/registry/text-style.json +4 -2
- package/registry/theme.json +4 -2
- package/registry/toast.json +4 -2
- package/registry/toc.json +4 -2
- package/registry/tooltip.json +4 -2
- package/registry/tree-view.json +4 -2
- package/registry/txt.json +2 -0
- package/registry/update-prompt.json +4 -2
- package/registry/upload-queue.json +4 -2
- package/registry/usage.json +5 -3
- package/registry/verified-badge.json +4 -2
- package/registry/versus-card.json +4 -2
- package/registry/vertical-video.json +4 -2
- package/registry/video-player.json +4 -2
- package/registry/video-trimmer.json +4 -2
- package/registry/virtual.json +4 -2
- package/registry/wall.json +4 -2
- package/registry/waveform.json +4 -2
- package/dist/chunk-A7MQPIEG.js +0 -31
- package/dist/chunk-A7MQPIEG.js.map +0 -1
package/dist/blocks.css
CHANGED
|
@@ -1912,6 +1912,11 @@ svg[data-bird="beaver"]{--kzb-pivot:60px 56px;--kzb-head-a:kzb-beaver-head 10s e
|
|
|
1912
1912
|
.kz-shop-section .kz-heading-lead { font-size: 14.5px; line-height: 1.55; }
|
|
1913
1913
|
/* The look preset's photo treatment (a CSS filter on the media box: no re-encoded image) — see @krizaka/tokens presets/shop. */
|
|
1914
1914
|
.kz-shop [data-shop-photo] { filter: var(--kz-shop-photo-filter, none); border-radius: var(--kz-shop-photo-radius, var(--kz-radius-md, 8px)); }
|
|
1915
|
+
/* A look (`look-*`, @krizaka/tokens): the surface under the page, the print frame of a photo, the poster title's tracking. Without a look
|
|
1916
|
+
these variables are unset and the page is unchanged. */
|
|
1917
|
+
.kz-shop { background: var(--kz-shop-surface, transparent); }
|
|
1918
|
+
.kz-shop [data-shop-photo] { box-shadow: var(--kz-shop-photo-frame, none); }
|
|
1919
|
+
.kz-shop-section .kz-heading-title { letter-spacing: var(--kz-shop-title-tracking, inherit); }
|
|
1915
1920
|
@media (min-width: 64rem) { .kz-shop-aside { position: sticky; top: var(--kz-anchor-offset, 96px); } }
|
|
1916
1921
|
|
|
1917
1922
|
/* The look presets' typography and photo treatment (@krizaka/tokens `shop-presets.css`, krizaka-ui#745): the title weight and the
|
|
@@ -1930,3 +1935,24 @@ svg[data-bird="beaver"]{--kzb-pivot:60px 56px;--kzb-head-a:kzb-beaver-head 10s e
|
|
|
1930
1935
|
.kz-shop-thumb-inner { position: absolute; top: 0; left: 0; width: 960px; transform-origin: top left; transform: scale(0.16667); }
|
|
1931
1936
|
/* The section the composer outlines in the preview page (the bridge sets `data-shop-selected` on the block wrapped around it): a ring, never a layout change. */
|
|
1932
1937
|
[data-shop-key][data-shop-selected] { outline: 2px solid var(--kz-accent); outline-offset: -2px; }
|
|
1938
|
+
|
|
1939
|
+
/* A look's motion mode (`ShopFrame motion`, akinaza#478): CSS only, no animation frame; every mode is still under reduced motion. */
|
|
1940
|
+
.kz-shop[data-shop-motion="still"] [data-reveal] { opacity: 1; transform: none; transition: none; }
|
|
1941
|
+
.kz-shop[data-shop-motion="soft"] { --kz-shop-ms: 180ms; }
|
|
1942
|
+
.kz-shop[data-shop-motion="paper"] { --kz-shop-ms: 260ms; }
|
|
1943
|
+
.kz-shop[data-shop-motion="lively"] { --kz-shop-ms: 320ms; }
|
|
1944
|
+
.kz-shop[data-shop-motion] [data-reveal] { transition-duration: var(--kz-shop-ms, 180ms); }
|
|
1945
|
+
@keyframes kz-shop-settle { from { transform: rotate(1.2deg) translateY(-3px); } to { transform: none; } }
|
|
1946
|
+
.kz-shop[data-shop-motion="paper"] [data-shop-photo] { animation: kz-shop-settle var(--kz-shop-ms) ease-out 1 both; }
|
|
1947
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1948
|
+
.kz-shop[data-shop-motion] [data-reveal] { transition: none; }
|
|
1949
|
+
.kz-shop[data-shop-motion="paper"] [data-shop-photo] { animation: none; }
|
|
1950
|
+
}
|
|
1951
|
+
/* The Krizaka look's bird sits in the corner of its section, beside the words, never over them. */
|
|
1952
|
+
.kz-shop-section { position: relative; }
|
|
1953
|
+
.kz-shop-mascot { position: absolute; inset-block-start: 0; inset-inline-end: var(--kz-shop-g, 16px); width: 56px; height: 56px; pointer-events: none; }
|
|
1954
|
+
@media (max-width: 40rem) { .kz-shop-mascot { width: 40px; height: 40px; } .kz-shop-mascot svg { width: 100%; height: 100%; } }
|
|
1955
|
+
/* The look picker's swatch (shop-composer): the look's own surface and accent, drawn by its tokens. */
|
|
1956
|
+
.kz-look-swatch { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px; border-radius: 8px; background: var(--kz-shop-surface, var(--kz-surface-0)); color: var(--kz-text-primary, inherit); border: 1px solid var(--kz-border-default); }
|
|
1957
|
+
.kz-look-swatch i { width: 14px; height: 14px; border-radius: 50%; background: var(--kz-accent); display: inline-block; }
|
|
1958
|
+
.kz-look-chip { display: inline-flex; }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Page,
|
|
3
|
+
SectionHeading,
|
|
4
|
+
cn
|
|
5
|
+
} from "./chunk-B47WSPMP.js";
|
|
6
|
+
|
|
7
|
+
// src/shop/frame.tsx
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var PAPERS = { plain: void 0, seyes: "ruled", kraft: "kraft", washi: "washi" };
|
|
11
|
+
function ShopFrame({ preset, density = "compact", accent, paper = "plain", motion, className, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx("div", { "data-shop-preset": preset, "data-shop-accent": accent, "data-paper": PAPERS[paper], "data-density": density, "data-shop-motion": motion, className: cn("kz-shop", className), ...props });
|
|
13
|
+
}
|
|
14
|
+
function ShopSection({ id, title, eyebrow, lead, actions, bleed, first, mascot, className, children, ...props }) {
|
|
15
|
+
const auto = React.useId();
|
|
16
|
+
const headingId = title ? `${id ?? auto}-title` : void 0;
|
|
17
|
+
const heading = title ? /* @__PURE__ */ jsx(SectionHeading, { id: headingId, size: "sm", eyebrow, title, lead, actions }) : null;
|
|
18
|
+
return /* @__PURE__ */ jsxs("section", { id, "aria-labelledby": headingId, "data-first": first ? "" : void 0, "data-bleed": bleed ? "" : void 0, className: cn("kz-shop-section", className), ...props, children: [
|
|
19
|
+
mascot ? /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "kz-shop-mascot", children: mascot }) : null,
|
|
20
|
+
bleed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
|
+
heading && /* @__PURE__ */ jsx(Page, { children: heading }),
|
|
22
|
+
children
|
|
23
|
+
] }) : /* @__PURE__ */ jsxs(Page, { children: [
|
|
24
|
+
heading,
|
|
25
|
+
children
|
|
26
|
+
] })
|
|
27
|
+
] });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
ShopFrame,
|
|
32
|
+
ShopSection
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=chunk-M3T5RQYV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shop/frame.tsx"],"sourcesContent":["// 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 * The look's motion mode, CSS only (`still` · `soft` · `paper` · `lively`): the arrival of blocks and the settling of photos. Under `prefers-reduced-motion` every mode is still.\n * @see @krizaka/tokens `shopPresets`\n */\n motion?: \"still\" | \"soft\" | \"paper\" | \"lively\";\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\", motion, className, ...props }: ShopFrameProps) {\n return <div data-shop-preset={preset} data-shop-accent={accent} data-paper={PAPERS[paper]} data-density={density} data-shop-motion={motion} 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 /** A bird of the Krizaka look (`mascotFor`, `ShopMascot` of `@krizaka/ui/shop/look`), decorative, in the corner of the heading. Never on the first screen. */\n mascot?: React.ReactNode;\n};\n\n/** A section of a shop page. */\nexport function ShopSection({ id, title, eyebrow, lead, actions, bleed, first, mascot, 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 {mascot ? <div aria-hidden className=\"kz-shop-mascot\">{mascot}</div> : null}\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"],"mappings":";;;;;;;AAGA,YAAY,WAAW;AA2Cd,SA+BD,UA/BC,KA+BD,YA/BC;AAJT,IAAM,SAAS,EAAE,OAAO,QAAW,OAAO,SAAS,OAAO,SAAS,OAAO,QAAQ;AAG3E,SAAS,UAAU,EAAE,QAAQ,UAAU,WAAW,QAAQ,QAAQ,SAAS,QAAQ,WAAW,GAAG,MAAM,GAAmB;AAC/H,SAAO,oBAAC,SAAI,oBAAkB,QAAQ,oBAAkB,QAAQ,cAAY,OAAO,KAAK,GAAG,gBAAc,SAAS,oBAAkB,QAAQ,WAAW,GAAG,WAAW,SAAS,GAAI,GAAG,OAAO;AAC9L;AAsBO,SAAS,YAAY,EAAE,IAAI,OAAO,SAAS,MAAM,SAAS,OAAO,OAAO,QAAQ,WAAW,UAAU,GAAG,MAAM,GAAqB;AACxI,QAAM,OAAa,YAAM;AACzB,QAAM,YAAY,QAAQ,GAAG,MAAM,IAAI,WAAW;AAClD,QAAM,UAAU,QAAQ,oBAAC,kBAAe,IAAI,WAAW,MAAK,MAAK,SAAkB,OAAc,MAAY,SAAkB,IAAK;AACpI,SACE,qBAAC,aAAQ,IAAQ,mBAAiB,WAAW,cAAY,QAAQ,KAAK,QAAW,cAAY,QAAQ,KAAK,QAAW,WAAW,GAAG,mBAAmB,SAAS,GAAI,GAAG,OACnK;AAAA,aAAS,oBAAC,SAAI,eAAW,MAAC,WAAU,kBAAkB,kBAAO,IAAS;AAAA,IACtE,QACC,iCACG;AAAA,iBAAW,oBAAC,QAAM,mBAAQ;AAAA,MAC1B;AAAA,OACH,IAEA,qBAAC,QACE;AAAA;AAAA,MACA;AAAA,OACH;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SHOP_LIMITS
|
|
3
|
+
} from "./chunk-ZYHWJ7U5.js";
|
|
4
|
+
|
|
5
|
+
// src/shop/text.ts
|
|
6
|
+
import * as z from "zod/mini";
|
|
7
|
+
var localizedText = z.object({
|
|
8
|
+
fr: z.optional(z.string().check(z.maxLength(600))),
|
|
9
|
+
en: z.optional(z.string().check(z.maxLength(600)))
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
// src/shop/define.ts
|
|
13
|
+
import * as z2 from "zod/mini";
|
|
14
|
+
var key = z2.string().check(z2.minLength(1), z2.maxLength(40), z2.regex(/^[A-Za-z0-9_-]+$/, "a key (letters, digits, - and _)"));
|
|
15
|
+
function defineSection(spec) {
|
|
16
|
+
const blockUnion = spec.blocks && Object.keys(spec.blocks).length > 0 ? z2.discriminatedUnion(
|
|
17
|
+
"type",
|
|
18
|
+
Object.entries(spec.blocks).map(
|
|
19
|
+
([type, settings]) => z2.object({ key, type: z2.literal(type), settings, text: z2.optional(z2.record(z2.string(), localizedText)) })
|
|
20
|
+
)
|
|
21
|
+
) : void 0;
|
|
22
|
+
const blocks = blockUnion ? z2.optional(z2.array(blockUnion).check(z2.maxLength(SHOP_LIMITS.blocks))) : z2.optional(z2.array(z2.never()).check(z2.maxLength(0)));
|
|
23
|
+
const base = z2.object({
|
|
24
|
+
key,
|
|
25
|
+
type: z2.literal(spec.type),
|
|
26
|
+
variant: z2.enum(spec.variants),
|
|
27
|
+
disabled: z2.optional(z2.boolean()),
|
|
28
|
+
settings: spec.settings,
|
|
29
|
+
text: z2.optional(z2.object({ title: z2.optional(localizedText), lead: z2.optional(localizedText) })),
|
|
30
|
+
blocks
|
|
31
|
+
});
|
|
32
|
+
const schema = base.check(
|
|
33
|
+
z2.superRefine((value, ctx) => {
|
|
34
|
+
spec.refine?.(value, (path, message) => ctx.issues.push({ code: "custom", message, path, input: value }));
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
return Object.freeze({
|
|
38
|
+
...spec,
|
|
39
|
+
defaultVariant: spec.variants[0],
|
|
40
|
+
blockTypes: Object.keys(spec.blocks ?? {}),
|
|
41
|
+
schema
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/shop/catalogue.ts
|
|
46
|
+
import * as z3 from "zod/mini";
|
|
47
|
+
var ref = z3.string().check(z3.minLength(1), z3.maxLength(80));
|
|
48
|
+
var short = z3.string().check(z3.minLength(1), z3.maxLength(140));
|
|
49
|
+
var url = z3.string().check(z3.maxLength(300), z3.regex(/^https:\/\//, "an https address"));
|
|
50
|
+
var isoDay = z3.string().check(z3.regex(/^\d{4}-\d{2}-\d{2}$/, "a day (YYYY-MM-DD)"));
|
|
51
|
+
var source = z3.enum(["all", "pick"]);
|
|
52
|
+
var oneOf = (...n) => z3.union(n.map((v) => z3.literal(v)));
|
|
53
|
+
var platforms = ["tiktok", "youtube-shorts", "instagram"];
|
|
54
|
+
var heroSection = defineSection({
|
|
55
|
+
type: "hero",
|
|
56
|
+
variants: ["poster", "split", "banner", "tv"],
|
|
57
|
+
settings: z3.object({
|
|
58
|
+
/** The cover: a media id. Absent, the product's default for the trade. */
|
|
59
|
+
media: z3.optional(ref),
|
|
60
|
+
/** Where the photo is cropped to when the box is not its ratio. */
|
|
61
|
+
focus: z3.enum(["center", "top", "bottom"])
|
|
62
|
+
}),
|
|
63
|
+
settingsDefault: { focus: "center" },
|
|
64
|
+
blocks: { fact: z3.object({ kind: z3.enum(["open-now", "area", "score"]) }) }
|
|
65
|
+
});
|
|
66
|
+
var servicesSection = defineSection({
|
|
67
|
+
type: "services",
|
|
68
|
+
variants: ["menu", "cards", "index", "carousel"],
|
|
69
|
+
settings: z3.object({
|
|
70
|
+
/** `all` the shop's services, or `pick` the ones the `service` blocks name, in their order. */
|
|
71
|
+
source,
|
|
72
|
+
groupBy: z3.enum(["category", "none"]),
|
|
73
|
+
/** `menu` only: two columns when nothing sits beside it. */
|
|
74
|
+
columns: oneOf(1, 2),
|
|
75
|
+
/** `menu` only: the shop's hours, team and address beside the list (the host draws them from its own data). */
|
|
76
|
+
aside: z3.enum(["hours", "none"])
|
|
77
|
+
}),
|
|
78
|
+
settingsDefault: { source: "all", groupBy: "category", columns: 1, aside: "hours" },
|
|
79
|
+
blocks: { service: z3.object({ serviceId: ref }) },
|
|
80
|
+
refine: (section, issue) => {
|
|
81
|
+
if (section.settings.source === "pick" && (section.blocks ?? []).length === 0) issue(["blocks"], "pick at least one service");
|
|
82
|
+
if (section.variant === "cards" && (section.blocks ?? []).length > SHOP_LIMITS.cards) issue(["blocks"], `at most ${SHOP_LIMITS.cards} cards`);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
var bookingSection = defineSection({
|
|
86
|
+
type: "booking",
|
|
87
|
+
variants: ["strip", "panel", "closing", "sticky"],
|
|
88
|
+
settings: z3.object({
|
|
89
|
+
/** A service the times are for; absent, the next free times of any service. */
|
|
90
|
+
serviceId: z3.optional(ref),
|
|
91
|
+
/** `strip`: how many times it shows. */
|
|
92
|
+
count: oneOf(3, 4, 6)
|
|
93
|
+
}),
|
|
94
|
+
settingsDefault: { count: 4 }
|
|
95
|
+
});
|
|
96
|
+
var gallerySection = defineSection({
|
|
97
|
+
type: "gallery",
|
|
98
|
+
variants: ["mosaic", "filmstrip", "wall", "grid"],
|
|
99
|
+
settings: z3.object({
|
|
100
|
+
source,
|
|
101
|
+
/** `wall` only. */
|
|
102
|
+
texture: z3.enum(["plaster", "brick", "ridge", "zellige"])
|
|
103
|
+
}),
|
|
104
|
+
settingsDefault: { source: "all", texture: "plaster" },
|
|
105
|
+
blocks: {
|
|
106
|
+
photo: z3.object({ mediaId: ref, caption: z3.optional(short) }),
|
|
107
|
+
note: z3.object({ text: short, signature: z3.optional(z3.string().check(z3.maxLength(40))) }),
|
|
108
|
+
sign: z3.object({})
|
|
109
|
+
},
|
|
110
|
+
refine: (section, issue) => {
|
|
111
|
+
const photos = (section.blocks ?? []).filter((b) => b.type === "photo").length;
|
|
112
|
+
if (photos > SHOP_LIMITS.photos) issue(["blocks"], `at most ${SHOP_LIMITS.photos} photos`);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
var videoSection = defineSection({
|
|
116
|
+
type: "video",
|
|
117
|
+
variants: ["tv", "shorts"],
|
|
118
|
+
settings: z3.object({ cabinet: z3.enum(["cabinet", "portable"]), channel: z3.optional(z3.string().check(z3.maxLength(32))) }),
|
|
119
|
+
settingsDefault: { cabinet: "cabinet" },
|
|
120
|
+
blocks: { reel: z3.object({ platform: z3.enum(platforms), url }) }
|
|
121
|
+
});
|
|
122
|
+
var reviewsSection = defineSection({
|
|
123
|
+
type: "reviews",
|
|
124
|
+
variants: ["summary-cards", "quote", "strip"],
|
|
125
|
+
settings: z3.object({ rule: z3.enum(["best", "latest"]), count: oneOf(1, 2, 3) }),
|
|
126
|
+
settingsDefault: { rule: "best", count: 2 }
|
|
127
|
+
});
|
|
128
|
+
var bulletinSection = defineSection({
|
|
129
|
+
type: "bulletin",
|
|
130
|
+
variants: ["board", "banner"],
|
|
131
|
+
settings: z3.object({}),
|
|
132
|
+
settingsDefault: {},
|
|
133
|
+
blocks: { flyer: z3.object({ text: short, signature: z3.optional(z3.string().check(z3.maxLength(40))), until: z3.optional(isoDay) }) },
|
|
134
|
+
refine: (section, issue) => {
|
|
135
|
+
if ((section.blocks ?? []).length > SHOP_LIMITS.flyers) issue(["blocks"], `at most ${SHOP_LIMITS.flyers} flyers`);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
var teamSection = defineSection({
|
|
139
|
+
type: "team",
|
|
140
|
+
variants: ["row", "cards"],
|
|
141
|
+
settings: z3.object({ source }),
|
|
142
|
+
settingsDefault: { source: "all" },
|
|
143
|
+
blocks: { member: z3.object({ memberId: ref }) }
|
|
144
|
+
});
|
|
145
|
+
var visitSection = defineSection({
|
|
146
|
+
type: "visit",
|
|
147
|
+
variants: ["card", "map", "split"],
|
|
148
|
+
settings: z3.object({ showPhone: z3.boolean() }),
|
|
149
|
+
settingsDefault: { showPhone: true }
|
|
150
|
+
});
|
|
151
|
+
var storySection = defineSection({
|
|
152
|
+
type: "story",
|
|
153
|
+
variants: ["quote", "owner"],
|
|
154
|
+
settings: z3.object({ body: localizedText }),
|
|
155
|
+
settingsDefault: { body: {} }
|
|
156
|
+
});
|
|
157
|
+
var socialSection = defineSection({
|
|
158
|
+
type: "social",
|
|
159
|
+
variants: ["links", "facade"],
|
|
160
|
+
settings: z3.object({}),
|
|
161
|
+
settingsDefault: {},
|
|
162
|
+
blocks: { link: z3.object({ platform: z3.enum(platforms), url }) }
|
|
163
|
+
});
|
|
164
|
+
var faqSection = defineSection({
|
|
165
|
+
type: "faq",
|
|
166
|
+
variants: ["list"],
|
|
167
|
+
settings: z3.object({}),
|
|
168
|
+
settingsDefault: {},
|
|
169
|
+
blocks: { question: z3.object({ question: localizedText, answer: localizedText }) }
|
|
170
|
+
});
|
|
171
|
+
var policiesSection = defineSection({
|
|
172
|
+
type: "policies",
|
|
173
|
+
variants: ["inline"],
|
|
174
|
+
settings: z3.object({ show: z3.array(z3.enum(["cancellation", "prices", "booking-window"])).check(z3.maxLength(3)) }),
|
|
175
|
+
settingsDefault: { show: ["cancellation", "prices", "booking-window"] }
|
|
176
|
+
});
|
|
177
|
+
var SECTION_DEFINITIONS = [
|
|
178
|
+
heroSection,
|
|
179
|
+
servicesSection,
|
|
180
|
+
bookingSection,
|
|
181
|
+
gallerySection,
|
|
182
|
+
videoSection,
|
|
183
|
+
reviewsSection,
|
|
184
|
+
bulletinSection,
|
|
185
|
+
teamSection,
|
|
186
|
+
visitSection,
|
|
187
|
+
storySection,
|
|
188
|
+
socialSection,
|
|
189
|
+
faqSection,
|
|
190
|
+
policiesSection
|
|
191
|
+
];
|
|
192
|
+
var SECTION_TYPES = SECTION_DEFINITIONS.map((d) => d.type);
|
|
193
|
+
function sectionDefinition(type) {
|
|
194
|
+
return SECTION_DEFINITIONS.find((d) => d.type === type);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export {
|
|
198
|
+
defineSection,
|
|
199
|
+
SECTION_DEFINITIONS,
|
|
200
|
+
SECTION_TYPES,
|
|
201
|
+
sectionDefinition
|
|
202
|
+
};
|
|
203
|
+
//# sourceMappingURL=chunk-ZFR6ZNXD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shop/text.ts","../src/shop/define.ts","../src/shop/catalogue.ts"],"sourcesContent":["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","// `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","// 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\", \"closing\", \"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"],"mappings":";;;;;AAAA,YAAY,OAAO;AAGZ,IAAM,gBAAkB,SAAO;AAAA,EACpC,IAAM,WAAW,SAAO,EAAE,MAAQ,YAAU,GAAG,CAAC,CAAC;AAAA,EACjD,IAAM,WAAW,SAAO,EAAE,MAAQ,YAAU,GAAG,CAAC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,cAAc;AAAA,EAC3C,MAAM;AAAA,EACN,UAAU,CAAC,QAAQ;AAAA,EACnB,UAAY,UAAO,EAAE,MAAQ,SAAQ,QAAK,CAAC,gBAAgB,UAAU,gBAAgB,CAAC,CAAC,EAAE,MAAQ,aAAU,CAAC,CAAC,EAAE,CAAC;AAAA,EAChH,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,UAAU,gBAAgB,EAAE;AACxE,CAAC;AAGM,IAAM,sBAAsB;AAAA,EACjC;AAAA,EAAa;AAAA,EAAiB;AAAA,EAAgB;AAAA,EAAgB;AAAA,EAAc;AAAA,EAAgB;AAAA,EAC5F;AAAA,EAAa;AAAA,EAAc;AAAA,EAAc;AAAA,EAAe;AAAA,EAAY;AACtE;AAIO,IAAM,gBAAgB,oBAAoB,IAAI,CAAC,MAAM,EAAE,IAAI;AAG3D,SAAS,kBAAyC,MAAkD;AACzG,SAAO,oBAAoB,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI;AACxD;","names":["z","z"]}
|
package/dist/filter-bar.d.ts
CHANGED
|
@@ -75,11 +75,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
|
|
|
75
75
|
[key: string]: {
|
|
76
76
|
[key: string]: tailwind_variants.ClassValue | {
|
|
77
77
|
root?: tailwind_variants.ClassValue;
|
|
78
|
-
count?: tailwind_variants.ClassValue;
|
|
79
78
|
controls?: tailwind_variants.ClassValue;
|
|
80
79
|
active?: tailwind_variants.ClassValue;
|
|
81
80
|
clear?: tailwind_variants.ClassValue;
|
|
82
81
|
results?: tailwind_variants.ClassValue;
|
|
82
|
+
count?: tailwind_variants.ClassValue;
|
|
83
83
|
optionCount?: tailwind_variants.ClassValue;
|
|
84
84
|
trigger?: tailwind_variants.ClassValue;
|
|
85
85
|
};
|
|
@@ -88,11 +88,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
|
|
|
88
88
|
[x: string]: {
|
|
89
89
|
[x: string]: tailwind_variants.ClassValue | {
|
|
90
90
|
root?: tailwind_variants.ClassValue;
|
|
91
|
-
count?: tailwind_variants.ClassValue;
|
|
92
91
|
controls?: tailwind_variants.ClassValue;
|
|
93
92
|
active?: tailwind_variants.ClassValue;
|
|
94
93
|
clear?: tailwind_variants.ClassValue;
|
|
95
94
|
results?: tailwind_variants.ClassValue;
|
|
95
|
+
count?: tailwind_variants.ClassValue;
|
|
96
96
|
optionCount?: tailwind_variants.ClassValue;
|
|
97
97
|
trigger?: tailwind_variants.ClassValue;
|
|
98
98
|
};
|
|
@@ -110,11 +110,11 @@ declare const filterBar: tailwind_variants.TVReturnType<{
|
|
|
110
110
|
[key: string]: {
|
|
111
111
|
[key: string]: tailwind_variants.ClassValue | {
|
|
112
112
|
root?: tailwind_variants.ClassValue;
|
|
113
|
-
count?: tailwind_variants.ClassValue;
|
|
114
113
|
controls?: tailwind_variants.ClassValue;
|
|
115
114
|
active?: tailwind_variants.ClassValue;
|
|
116
115
|
clear?: tailwind_variants.ClassValue;
|
|
117
116
|
results?: tailwind_variants.ClassValue;
|
|
117
|
+
count?: tailwind_variants.ClassValue;
|
|
118
118
|
optionCount?: tailwind_variants.ClassValue;
|
|
119
119
|
trigger?: tailwind_variants.ClassValue;
|
|
120
120
|
};
|
|
@@ -26,9 +26,14 @@ type ShopFrameProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
26
26
|
* @default "plain"
|
|
27
27
|
*/
|
|
28
28
|
paper?: "plain" | "seyes" | "kraft" | "washi";
|
|
29
|
+
/**
|
|
30
|
+
* The look's motion mode, CSS only (`still` · `soft` · `paper` · `lively`): the arrival of blocks and the settling of photos. Under `prefers-reduced-motion` every mode is still.
|
|
31
|
+
* @see @krizaka/tokens `shopPresets`
|
|
32
|
+
*/
|
|
33
|
+
motion?: "still" | "soft" | "paper" | "lively";
|
|
29
34
|
};
|
|
30
35
|
/** The page: sets the look preset, the accent, the paper and the density the sections below read. */
|
|
31
|
-
declare function ShopFrame({ preset, density, accent, paper, className, ...props }: ShopFrameProps): React.JSX.Element;
|
|
36
|
+
declare function ShopFrame({ preset, density, accent, paper, motion, className, ...props }: ShopFrameProps): React.JSX.Element;
|
|
32
37
|
type ShopSectionProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
33
38
|
/** The section's id: the anchor, and the heading's id. */
|
|
34
39
|
id?: string;
|
|
@@ -44,9 +49,11 @@ type ShopSectionProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
|
44
49
|
bleed?: boolean;
|
|
45
50
|
/** The section is the page's first (the hero): no hairline, no padding. */
|
|
46
51
|
first?: boolean;
|
|
52
|
+
/** A bird of the Krizaka look (`mascotFor`, `ShopMascot` of `@krizaka/ui/shop/look`), decorative, in the corner of the heading. Never on the first screen. */
|
|
53
|
+
mascot?: React.ReactNode;
|
|
47
54
|
};
|
|
48
55
|
/** A section of a shop page. */
|
|
49
|
-
declare function ShopSection({ id, title, eyebrow, lead, actions, bleed, first, className, children, ...props }: ShopSectionProps): React.JSX.Element;
|
|
56
|
+
declare function ShopSection({ id, title, eyebrow, lead, actions, bleed, first, mascot, className, children, ...props }: ShopSectionProps): React.JSX.Element;
|
|
50
57
|
|
|
51
|
-
export { ShopFrame as
|
|
52
|
-
export type {
|
|
58
|
+
export { ShopFrame as b, ShopSection as d };
|
|
59
|
+
export type { ShopSectionProps as S, ShopPhoto as a, ShopFrameProps as c };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/** What `loadHls` resolves to: the module of hls.js (only the members the player uses are typed). */
|
|
4
|
+
type HlsModule = {
|
|
5
|
+
default: {
|
|
6
|
+
new (config?: Record<string, unknown>): {
|
|
7
|
+
loadSource(url: string): void;
|
|
8
|
+
attachMedia(media: HTMLMediaElement): void;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
startLoad(): void;
|
|
11
|
+
recoverMediaError(): void;
|
|
12
|
+
on(event: string, listener: (event: string, data: {
|
|
13
|
+
fatal?: boolean;
|
|
14
|
+
type?: string;
|
|
15
|
+
}) => void): void;
|
|
16
|
+
};
|
|
17
|
+
isSupported(): boolean;
|
|
18
|
+
Events: {
|
|
19
|
+
ERROR: string;
|
|
20
|
+
};
|
|
21
|
+
ErrorTypes: {
|
|
22
|
+
NETWORK_ERROR: string;
|
|
23
|
+
MEDIA_ERROR: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type VideoTrack = {
|
|
28
|
+
/** The WebVTT file. */
|
|
29
|
+
src: string;
|
|
30
|
+
/** Its language, BCP 47 (`"fr"`). */
|
|
31
|
+
srcLang: string;
|
|
32
|
+
/** Its name in the menu ("Français"), passed translated. */
|
|
33
|
+
label: string;
|
|
34
|
+
/** `subtitles` (default) or `captions` (with the sounds, for deaf viewers). */
|
|
35
|
+
kind?: "subtitles" | "captions";
|
|
36
|
+
/** Shown from the start. */
|
|
37
|
+
default?: boolean;
|
|
38
|
+
};
|
|
39
|
+
type VideoPlayerLabels = {
|
|
40
|
+
play: string;
|
|
41
|
+
pause: string;
|
|
42
|
+
mute: string;
|
|
43
|
+
unmute: string;
|
|
44
|
+
volume: string;
|
|
45
|
+
seek: string;
|
|
46
|
+
/** The speed button: `(rate) => "Speed " + rate + "×"`. */
|
|
47
|
+
speed: (rate: number) => string;
|
|
48
|
+
/** The captions button: `(track) => "Subtitles: " + (track ?? "off")`, the track's label or `null` when off. */
|
|
49
|
+
captions: (track: string | null) => string;
|
|
50
|
+
fullscreen: string;
|
|
51
|
+
exitFullscreen: string;
|
|
52
|
+
pictureInPicture: string;
|
|
53
|
+
/** Read while the video waits for data. */
|
|
54
|
+
loading: string;
|
|
55
|
+
/** The video cannot play. */
|
|
56
|
+
error: string;
|
|
57
|
+
/** Tries again (resolves a signed `src` again). */
|
|
58
|
+
retry: string;
|
|
59
|
+
/** The seek slider's value: `(time, duration) => "1:05 of 3:20"`. */
|
|
60
|
+
time: (time: string, duration: string) => string;
|
|
61
|
+
};
|
|
62
|
+
type VideoPlayerProps = {
|
|
63
|
+
/** The address of the video (MP4, WebM, or an HLS `.m3u8`), or a function that resolves a signed one when needed. */
|
|
64
|
+
src: string | (() => Promise<string>);
|
|
65
|
+
/** `auto` (default): HLS when the address ends in `.m3u8`. */
|
|
66
|
+
type?: "auto" | "hls" | "file";
|
|
67
|
+
/** Loads hls.js when the browser cannot play HLS itself: `() => import("hls.js")`. Without it, HLS needs Safari. */
|
|
68
|
+
loadHls?: () => Promise<HlsModule>;
|
|
69
|
+
/** The accessible name of the player ("Video: Sunset over Montréal"), passed translated. */
|
|
70
|
+
title: string;
|
|
71
|
+
/** The picture shown before playback. */
|
|
72
|
+
poster?: string;
|
|
73
|
+
/** Starts playing, muted (browsers refuse sound without a gesture), once on screen and again each time it comes back — not under reduced motion. */
|
|
74
|
+
autoPlay?: boolean;
|
|
75
|
+
/** Starts muted. */
|
|
76
|
+
muted?: boolean;
|
|
77
|
+
/** Plays again from the start at the end. */
|
|
78
|
+
loop?: boolean;
|
|
79
|
+
/** How much to fetch before playback: `none` (a list of many videos), `metadata` (default), `auto`. */
|
|
80
|
+
preload?: "none" | "metadata" | "auto";
|
|
81
|
+
/** Subtitles or captions (WebVTT): the C key and a button cycle through them. */
|
|
82
|
+
tracks?: readonly VideoTrack[];
|
|
83
|
+
/** The speeds offered by the speed button. Default `[0.5, 1, 1.25, 1.5, 2]`. */
|
|
84
|
+
playbackRates?: readonly number[];
|
|
85
|
+
/** Pauses when less than a quarter of the player is on screen. Default `true`. */
|
|
86
|
+
pauseWhenHidden?: boolean;
|
|
87
|
+
/** Shows the controls (default). `false`: a bare video (a background loop) — give it no sound. */
|
|
88
|
+
controls?: boolean;
|
|
89
|
+
/** Covers the video and hides the controls: a gate (sign in, unlock, age check) drawn by the app. */
|
|
90
|
+
overlay?: React.ReactNode;
|
|
91
|
+
/** The width / height ratio of the frame. Default `"16 / 9"`; `"9 / 16"` for a vertical video. */
|
|
92
|
+
aspectRatio?: string;
|
|
93
|
+
/** Called when playback starts. */
|
|
94
|
+
onPlay?: () => void;
|
|
95
|
+
/** Called when playback pauses. */
|
|
96
|
+
onPause?: () => void;
|
|
97
|
+
/** Called at the end. */
|
|
98
|
+
onEnded?: () => void;
|
|
99
|
+
/** Called as the time moves, in seconds (a few times a second). */
|
|
100
|
+
onTimeUpdate?: (time: number) => void;
|
|
101
|
+
/** Called when the video cannot play (a network failure, an expired address). */
|
|
102
|
+
onError?: (error: unknown) => void;
|
|
103
|
+
/** The words, passed translated; English by default. */
|
|
104
|
+
labels?: Partial<VideoPlayerLabels>;
|
|
105
|
+
/** Classes merged on the root. */
|
|
106
|
+
className?: string;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** One programme of the playlist: an uploaded video (`src`) or, without `src`, a slot the host fills with `renderEmbed`. */
|
|
110
|
+
interface RetroTvSource {
|
|
111
|
+
id: string;
|
|
112
|
+
title: string;
|
|
113
|
+
src?: string;
|
|
114
|
+
poster?: string;
|
|
115
|
+
/** WebVTT captions of this video. */
|
|
116
|
+
tracks?: VideoPlayerProps["tracks"];
|
|
117
|
+
}
|
|
118
|
+
type RetroTvTransition = "channel" | "crossfade" | "slide";
|
|
119
|
+
interface RetroTvLabels {
|
|
120
|
+
play: string;
|
|
121
|
+
pause: string;
|
|
122
|
+
next: string;
|
|
123
|
+
previous: string;
|
|
124
|
+
soundOff: string;
|
|
125
|
+
soundOn: string;
|
|
126
|
+
captions: string;
|
|
127
|
+
seek: string;
|
|
128
|
+
nowPlaying: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
type PlaylistProps = {
|
|
132
|
+
playlist: readonly RetroTvSource[];
|
|
133
|
+
transition: RetroTvTransition;
|
|
134
|
+
labels: RetroTvLabels;
|
|
135
|
+
muted: boolean;
|
|
136
|
+
autoPlay: boolean;
|
|
137
|
+
renderEmbed?: (source: RetroTvSource) => React.ReactNode;
|
|
138
|
+
onMutedChange?: (muted: boolean) => void;
|
|
139
|
+
onIndexChange?: (index: number) => void;
|
|
140
|
+
title?: string;
|
|
141
|
+
reduced: boolean;
|
|
142
|
+
setMutedState: (m: boolean) => void;
|
|
143
|
+
setIndex: (i: number) => void;
|
|
144
|
+
index: number;
|
|
145
|
+
};
|
|
146
|
+
declare function PlaylistScreen({ playlist, transition, labels, muted, autoPlay, renderEmbed, onMutedChange, onIndexChange, title, reduced, setMutedState, setIndex, index }: PlaylistProps): React.JSX.Element;
|
|
147
|
+
|
|
148
|
+
export { PlaylistScreen };
|