@krizaka/ui 4.2.1 → 4.4.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 CHANGED
@@ -1088,6 +1088,10 @@ a.kz-fact:focus-visible { outline: 2px solid var(--kz-ring, var(--kz-accent)); o
1088
1088
  /* A split hero: the words on one side, the product live on the other (a demo, a recording, a schema). */
1089
1089
  .kz-tpl-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
1090
1090
  .kz-tpl-split[data-reverse] > :first-child { order: 2; }
1091
+ /* Without a visual: one column, a reading measure, no empty stage. */
1092
+ .kz-tpl-split[data-single] { grid-template-columns: minmax(0, 1fr); max-width: 46rem; }
1093
+ /* The showcase: full width of the page frame, between the proofs and the features. */
1094
+ .kz-tpl-showcase { padding-block: clamp(24px, 4vw, 48px) 0; }
1091
1095
  @media (max-width: 900px) { .kz-tpl-split { grid-template-columns: minmax(0, 1fr); } .kz-tpl-split[data-reverse] > :first-child { order: 0; } }
1092
1096
  .kz-tpl-stage {
1093
1097
  position: relative; min-width: 0; overflow: hidden; border-radius: var(--kz-card-radius, 0); border: 1px solid var(--kz-border-default); background: var(--kz-surface-1);
@@ -0,0 +1,13 @@
1
+ // src/page/hero-stage.tsx
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ function HeroStage({ visual, label }) {
4
+ return /* @__PURE__ */ jsxs("figure", { className: "kz-tpl-stage", children: [
5
+ /* @__PURE__ */ jsx("div", { className: "kz-tpl-stage-bar", "aria-hidden": true, children: label && /* @__PURE__ */ jsx("span", { children: label }) }),
6
+ visual
7
+ ] });
8
+ }
9
+
10
+ export {
11
+ HeroStage
12
+ };
13
+ //# sourceMappingURL=chunk-VUD4IEVJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/page/hero-stage.tsx"],"sourcesContent":["// Server-safe. The window of a split hero (LandingPage, ProductPage): the product alive, framed as a plate with its caption bar.\nimport type * as React from \"react\";\n\n/** The framed `figure` of a hero's visual; its bar (the caption) is decorative. */\nexport function HeroStage({ visual, label }: { visual: React.ReactNode; label?: React.ReactNode }) {\n return (\n <figure className=\"kz-tpl-stage\">\n <div className=\"kz-tpl-stage-bar\" aria-hidden>\n {label && <span>{label}</span>}\n </div>\n {visual}\n </figure>\n );\n}\n"],"mappings":";AAMI,SAEc,KAFd;AAFG,SAAS,UAAU,EAAE,QAAQ,MAAM,GAAyD;AACjG,SACE,qBAAC,YAAO,WAAU,gBAChB;AAAA,wBAAC,SAAI,WAAU,oBAAmB,eAAW,MAC1C,mBAAS,oBAAC,UAAM,iBAAM,GACzB;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
@@ -82,8 +82,8 @@ declare function SavedViews({ views, current, modified, onSelect, onSave, onRena
82
82
  declare const filterBar: tailwind_variants.TVReturnType<{
83
83
  [key: string]: {
84
84
  [key: string]: tailwind_variants.ClassValue | {
85
- count?: tailwind_variants.ClassValue;
86
85
  root?: tailwind_variants.ClassValue;
86
+ count?: tailwind_variants.ClassValue;
87
87
  controls?: tailwind_variants.ClassValue;
88
88
  active?: tailwind_variants.ClassValue;
89
89
  clear?: tailwind_variants.ClassValue;
@@ -95,8 +95,8 @@ declare const filterBar: tailwind_variants.TVReturnType<{
95
95
  } | {
96
96
  [x: string]: {
97
97
  [x: string]: tailwind_variants.ClassValue | {
98
- count?: tailwind_variants.ClassValue;
99
98
  root?: tailwind_variants.ClassValue;
99
+ count?: tailwind_variants.ClassValue;
100
100
  controls?: tailwind_variants.ClassValue;
101
101
  active?: tailwind_variants.ClassValue;
102
102
  clear?: tailwind_variants.ClassValue;
@@ -117,8 +117,8 @@ declare const filterBar: tailwind_variants.TVReturnType<{
117
117
  }, undefined, {
118
118
  [key: string]: {
119
119
  [key: string]: tailwind_variants.ClassValue | {
120
- count?: tailwind_variants.ClassValue;
121
120
  root?: tailwind_variants.ClassValue;
121
+ count?: tailwind_variants.ClassValue;
122
122
  controls?: tailwind_variants.ClassValue;
123
123
  active?: tailwind_variants.ClassValue;
124
124
  clear?: tailwind_variants.ClassValue;
@@ -26,8 +26,8 @@ type LandingPageProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
26
26
  lead?: React.ReactNode;
27
27
  /** The hero's actions (the main one cut, with shimmer). */
28
28
  actions?: React.ReactNode;
29
- /** The product, alive, beside the words: a recording, a live demo (framed as a window). */
30
- visual: React.ReactNode;
29
+ /** The product, alive, beside the words: a recording, a live demo (framed as a window). Absent: a single-column hero, no empty stage. */
30
+ visual?: React.ReactNode;
31
31
  /** The window's caption (`studio.app — studio`). */
32
32
  visualLabel?: React.ReactNode;
33
33
  /** Figures or facts in a band under the hero: `{ value, label }`. */
@@ -35,6 +35,13 @@ type LandingPageProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
35
35
  value: React.ReactNode;
36
36
  label: React.ReactNode;
37
37
  }[];
38
+ /** Full width, between the proofs and the features: a carousel, a demo, a wide plate. */
39
+ showcase?: React.ReactNode;
40
+ /**
41
+ * The hero's backdrop: `grid` (the dome, the grid and the slow drift) or `quiet` (the still dome only: no grid layer, no drift).
42
+ * @default "grid"
43
+ */
44
+ backdrop?: "grid" | "quiet";
38
45
  /** The features' section: its eyebrow, title and lead. */
39
46
  featuresHeading?: {
40
47
  eyebrow?: React.ReactNode;
@@ -53,7 +60,7 @@ type LandingPageProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
53
60
  };
54
61
  };
55
62
  /** A landing page: split hero with the product alive, proofs, a bento of features, the closing call. */
56
- declare function LandingPage({ eyebrow, title, lead, actions, visual, visualLabel, proofs, featuresHeading, features, closing, children, ...props }: LandingPageProps): React.JSX.Element;
63
+ declare function LandingPage({ eyebrow, title, lead, actions, visual, visualLabel, proofs, showcase, backdrop, featuresHeading, features, closing, children, ...props }: LandingPageProps): React.JSX.Element;
57
64
 
58
65
  export { LandingPage };
59
66
  export type { LandingFeature, LandingPageProps };
@@ -1,26 +1,28 @@
1
+ import {
2
+ HeroStage
3
+ } from "./chunk-VUD4IEVJ.js";
4
+
1
5
  // src/landing-page/landing-page.tsx
2
6
  import { CtaPanel } from "@krizaka/ui/cta-panel";
3
7
  import { Page, Section } from "@krizaka/ui/page";
4
8
  import { SectionBackdrop } from "@krizaka/ui/section-backdrop";
5
9
  import { jsx, jsxs } from "react/jsx-runtime";
6
- function LandingPage({ eyebrow, title, lead, actions, visual, visualLabel, proofs, featuresHeading, features, closing, children, ...props }) {
10
+ function LandingPage({ eyebrow, title, lead, actions, visual, visualLabel, proofs, showcase, backdrop = "grid", featuresHeading, features, closing, children, ...props }) {
7
11
  return /* @__PURE__ */ jsxs("div", { ...props, children: [
8
- /* @__PURE__ */ jsx(SectionBackdrop, { as: "header", grid: true, className: "kz-hero", children: /* @__PURE__ */ jsx(Page, { className: "kz-tpl-hero-frame", children: /* @__PURE__ */ jsxs("div", { className: "kz-tpl-split", children: [
12
+ /* @__PURE__ */ jsx(SectionBackdrop, { as: "header", grid: backdrop === "grid", animated: backdrop === "grid", className: "kz-hero", children: /* @__PURE__ */ jsx(Page, { className: "kz-tpl-hero-frame", children: /* @__PURE__ */ jsxs("div", { className: "kz-tpl-split", "data-single": visual ? void 0 : "", children: [
9
13
  /* @__PURE__ */ jsxs("div", { className: "kz-hero-text", children: [
10
14
  eyebrow && /* @__PURE__ */ jsx("p", { className: "kz-eyebrow", children: eyebrow }),
11
15
  /* @__PURE__ */ jsx("h1", { className: "kz-hero-title", children: title }),
12
16
  lead && /* @__PURE__ */ jsx("p", { className: "kz-hero-lead", children: lead }),
13
17
  actions && /* @__PURE__ */ jsx("div", { className: "kz-tpl-actions kz-hero-extra", children: actions })
14
18
  ] }),
15
- /* @__PURE__ */ jsxs("figure", { className: "kz-tpl-stage", children: [
16
- /* @__PURE__ */ jsx("div", { className: "kz-tpl-stage-bar", "aria-hidden": true, children: visualLabel && /* @__PURE__ */ jsx("span", { children: visualLabel }) }),
17
- visual
18
- ] })
19
+ visual && /* @__PURE__ */ jsx(HeroStage, { visual, label: visualLabel })
19
20
  ] }) }) }),
20
21
  proofs && proofs.length > 0 && /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsx("dl", { className: "kz-tpl-band", children: proofs.map((p, i) => /* @__PURE__ */ jsxs("div", { children: [
21
22
  /* @__PURE__ */ jsx("dt", { children: p.value }),
22
23
  /* @__PURE__ */ jsx("dd", { children: p.label })
23
24
  ] }, i)) }) }),
25
+ showcase && /* @__PURE__ */ jsx(Page, { "data-landing-showcase": "", className: "kz-tpl-showcase", children: showcase }),
24
26
  /* @__PURE__ */ jsx(Section, { id: "features", eyebrow: featuresHeading?.eyebrow, title: featuresHeading?.title, lead: featuresHeading?.lead, reveal: true, "aria-label": featuresHeading ? void 0 : "Features", children: /* @__PURE__ */ jsx("ul", { className: "kz-tpl-bento", children: features.map((f) => /* @__PURE__ */ jsxs("li", { "data-size": f.size === "sm" ? void 0 : f.size, "data-reveal": "", children: [
25
27
  f.icon && /* @__PURE__ */ jsx("span", { className: "kz-block-icon", "aria-hidden": true, children: f.icon }),
26
28
  /* @__PURE__ */ jsx("h3", { children: f.title }),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/landing-page/landing-page.tsx"],"sourcesContent":["// Server-safe. A landing page (blocks.css `.kz-tpl-*`): a split hero — the promise and its actions beside the product\n// alive (a recording, a demo) — a band of proofs, the features as a bento where the main one takes the room, then the\n// closing call. The blocks come through their package entries, so their client parts keep their boundary.\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { Page, Section } from \"@krizaka/ui/page\";\nimport { SectionBackdrop } from \"@krizaka/ui/section-backdrop\";\nimport type * as React from \"react\";\n\nexport interface LandingFeature {\n /** A stable key. */\n id: string;\n /** Its name. */\n title: React.ReactNode;\n /** One or two sentences. */\n text: React.ReactNode;\n /** A signature icon above the title. */\n icon?: React.ReactNode;\n /** A visual at the bottom of the tile (a chart, a screenshot, a code line). */\n visual?: React.ReactNode;\n /**\n * Its weight in the bento: `lg` (four columns, two rows — the main one), `md` (three), `sm` (two).\n * @default \"sm\"\n */\n size?: \"lg\" | \"md\" | \"sm\";\n}\n\nexport type LandingPageProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** A mono line above the title. */\n eyebrow?: React.ReactNode;\n /** The promise: the page's `h1`. */\n title: React.ReactNode;\n /** One or two sentences under it. */\n lead?: React.ReactNode;\n /** The hero's actions (the main one cut, with shimmer). */\n actions?: React.ReactNode;\n /** The product, alive, beside the words: a recording, a live demo (framed as a window). */\n visual: React.ReactNode;\n /** The window's caption (`studio.app — studio`). */\n visualLabel?: React.ReactNode;\n /** Figures or facts in a band under the hero: `{ value, label }`. */\n proofs?: readonly { value: React.ReactNode; label: React.ReactNode }[];\n /** The features' section: its eyebrow, title and lead. */\n featuresHeading?: { eyebrow?: React.ReactNode; title: React.ReactNode; lead?: React.ReactNode };\n /** The features, as a bento. */\n features: readonly LandingFeature[];\n /** Between the features and the closing call: a story, a quote, testimonials. */\n children?: React.ReactNode;\n /** The closing call: its title, body and actions. */\n closing?: { title: React.ReactNode; body?: React.ReactNode; actions: React.ReactNode };\n};\n\n/** A landing page: split hero with the product alive, proofs, a bento of features, the closing call. */\nexport function LandingPage({ eyebrow, title, lead, actions, visual, visualLabel, proofs, featuresHeading, features, closing, children, ...props }: LandingPageProps) {\n return (\n <div {...props}>\n <SectionBackdrop as=\"header\" grid className=\"kz-hero\">\n <Page className=\"kz-tpl-hero-frame\">\n <div className=\"kz-tpl-split\">\n <div className=\"kz-hero-text\">\n {eyebrow && <p className=\"kz-eyebrow\">{eyebrow}</p>}\n <h1 className=\"kz-hero-title\">{title}</h1>\n {lead && <p className=\"kz-hero-lead\">{lead}</p>}\n {actions && <div className=\"kz-tpl-actions kz-hero-extra\">{actions}</div>}\n </div>\n <figure className=\"kz-tpl-stage\">\n <div className=\"kz-tpl-stage-bar\" aria-hidden>\n {visualLabel && <span>{visualLabel}</span>}\n </div>\n {visual}\n </figure>\n </div>\n </Page>\n </SectionBackdrop>\n {proofs && proofs.length > 0 && (\n <Page>\n <dl className=\"kz-tpl-band\">\n {proofs.map((p, i) => (\n <div key={i}>\n <dt>{p.value}</dt>\n <dd>{p.label}</dd>\n </div>\n ))}\n </dl>\n </Page>\n )}\n <Section id=\"features\" eyebrow={featuresHeading?.eyebrow} title={featuresHeading?.title} lead={featuresHeading?.lead} reveal aria-label={featuresHeading ? undefined : \"Features\"}>\n <ul className=\"kz-tpl-bento\">\n {features.map((f) => (\n <li key={f.id} data-size={f.size === \"sm\" ? undefined : f.size} data-reveal=\"\">\n {f.icon && <span className=\"kz-block-icon\" aria-hidden>{f.icon}</span>}\n <h3>{f.title}</h3>\n <p>{f.text}</p>\n {f.visual && <div className=\"kz-tpl-bento-visual\">{f.visual}</div>}\n </li>\n ))}\n </ul>\n </Section>\n {children}\n {closing && (\n <Section spacing=\"sm\" aria-labelledby=\"landing-closing\">\n <CtaPanel id=\"landing-closing\" title={closing.title} body={closing.body} reveal>\n {closing.actions}\n </CtaPanel>\n </Section>\n )}\n </div>\n );\n}\n"],"mappings":";AAGA,SAAS,gBAAgB;AACzB,SAAS,MAAM,eAAe;AAC9B,SAAS,uBAAuB;AAqDpB,SACc,KADd;AANL,SAAS,YAAY,EAAE,SAAS,OAAO,MAAM,SAAS,QAAQ,aAAa,QAAQ,iBAAiB,UAAU,SAAS,UAAU,GAAG,MAAM,GAAqB;AACpK,SACE,qBAAC,SAAK,GAAG,OACP;AAAA,wBAAC,mBAAgB,IAAG,UAAS,MAAI,MAAC,WAAU,WAC1C,8BAAC,QAAK,WAAU,qBACd,+BAAC,SAAI,WAAU,gBACb;AAAA,2BAAC,SAAI,WAAU,gBACZ;AAAA,mBAAW,oBAAC,OAAE,WAAU,cAAc,mBAAQ;AAAA,QAC/C,oBAAC,QAAG,WAAU,iBAAiB,iBAAM;AAAA,QACpC,QAAQ,oBAAC,OAAE,WAAU,gBAAgB,gBAAK;AAAA,QAC1C,WAAW,oBAAC,SAAI,WAAU,gCAAgC,mBAAQ;AAAA,SACrE;AAAA,MACA,qBAAC,YAAO,WAAU,gBAChB;AAAA,4BAAC,SAAI,WAAU,oBAAmB,eAAW,MAC1C,yBAAe,oBAAC,UAAM,uBAAY,GACrC;AAAA,QACC;AAAA,SACH;AAAA,OACF,GACF,GACF;AAAA,IACC,UAAU,OAAO,SAAS,KACzB,oBAAC,QACC,8BAAC,QAAG,WAAU,eACX,iBAAO,IAAI,CAAC,GAAG,MACd,qBAAC,SACC;AAAA,0BAAC,QAAI,YAAE,OAAM;AAAA,MACb,oBAAC,QAAI,YAAE,OAAM;AAAA,SAFL,CAGV,CACD,GACH,GACF;AAAA,IAEF,oBAAC,WAAQ,IAAG,YAAW,SAAS,iBAAiB,SAAS,OAAO,iBAAiB,OAAO,MAAM,iBAAiB,MAAM,QAAM,MAAC,cAAY,kBAAkB,SAAY,YACrK,8BAAC,QAAG,WAAU,gBACX,mBAAS,IAAI,CAAC,MACb,qBAAC,QAAc,aAAW,EAAE,SAAS,OAAO,SAAY,EAAE,MAAM,eAAY,IACzE;AAAA,QAAE,QAAQ,oBAAC,UAAK,WAAU,iBAAgB,eAAW,MAAE,YAAE,MAAK;AAAA,MAC/D,oBAAC,QAAI,YAAE,OAAM;AAAA,MACb,oBAAC,OAAG,YAAE,MAAK;AAAA,MACV,EAAE,UAAU,oBAAC,SAAI,WAAU,uBAAuB,YAAE,QAAO;AAAA,SAJrD,EAAE,EAKX,CACD,GACH,GACF;AAAA,IACC;AAAA,IACA,WACC,oBAAC,WAAQ,SAAQ,MAAK,mBAAgB,mBACpC,8BAAC,YAAS,IAAG,mBAAkB,OAAO,QAAQ,OAAO,MAAM,QAAQ,MAAM,QAAM,MAC5E,kBAAQ,SACX,GACF;AAAA,KAEJ;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/landing-page/landing-page.tsx"],"sourcesContent":["// Server-safe. A landing page (blocks.css `.kz-tpl-*`): a split hero — the promise and its actions beside the product\n// alive (a recording, a demo; without one, a single column) — a band of proofs, the features as a bento where the main one takes the room, then the\n// closing call. The blocks come through their package entries, so their client parts keep their boundary.\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { Page, Section } from \"@krizaka/ui/page\";\nimport { SectionBackdrop } from \"@krizaka/ui/section-backdrop\";\nimport type * as React from \"react\";\n\nimport { HeroStage } from \"../page/hero-stage\";\n\nexport interface LandingFeature {\n /** A stable key. */\n id: string;\n /** Its name. */\n title: React.ReactNode;\n /** One or two sentences. */\n text: React.ReactNode;\n /** A signature icon above the title. */\n icon?: React.ReactNode;\n /** A visual at the bottom of the tile (a chart, a screenshot, a code line). */\n visual?: React.ReactNode;\n /**\n * Its weight in the bento: `lg` (four columns, two rows — the main one), `md` (three), `sm` (two).\n * @default \"sm\"\n */\n size?: \"lg\" | \"md\" | \"sm\";\n}\n\nexport type LandingPageProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** A mono line above the title. */\n eyebrow?: React.ReactNode;\n /** The promise: the page's `h1`. */\n title: React.ReactNode;\n /** One or two sentences under it. */\n lead?: React.ReactNode;\n /** The hero's actions (the main one cut, with shimmer). */\n actions?: React.ReactNode;\n /** The product, alive, beside the words: a recording, a live demo (framed as a window). Absent: a single-column hero, no empty stage. */\n visual?: React.ReactNode;\n /** The window's caption (`studio.app — studio`). */\n visualLabel?: React.ReactNode;\n /** Figures or facts in a band under the hero: `{ value, label }`. */\n proofs?: readonly { value: React.ReactNode; label: React.ReactNode }[];\n /** Full width, between the proofs and the features: a carousel, a demo, a wide plate. */\n showcase?: React.ReactNode;\n /**\n * The hero's backdrop: `grid` (the dome, the grid and the slow drift) or `quiet` (the still dome only: no grid layer, no drift).\n * @default \"grid\"\n */\n backdrop?: \"grid\" | \"quiet\";\n /** The features' section: its eyebrow, title and lead. */\n featuresHeading?: { eyebrow?: React.ReactNode; title: React.ReactNode; lead?: React.ReactNode };\n /** The features, as a bento. */\n features: readonly LandingFeature[];\n /** Between the features and the closing call: a story, a quote, testimonials. */\n children?: React.ReactNode;\n /** The closing call: its title, body and actions. */\n closing?: { title: React.ReactNode; body?: React.ReactNode; actions: React.ReactNode };\n};\n\n/** A landing page: split hero with the product alive, proofs, a bento of features, the closing call. */\nexport function LandingPage({ eyebrow, title, lead, actions, visual, visualLabel, proofs, showcase, backdrop = \"grid\", featuresHeading, features, closing, children, ...props }: LandingPageProps) {\n return (\n <div {...props}>\n <SectionBackdrop as=\"header\" grid={backdrop === \"grid\"} animated={backdrop === \"grid\"} className=\"kz-hero\">\n <Page className=\"kz-tpl-hero-frame\">\n <div className=\"kz-tpl-split\" data-single={visual ? undefined : \"\"}>\n <div className=\"kz-hero-text\">\n {eyebrow && <p className=\"kz-eyebrow\">{eyebrow}</p>}\n <h1 className=\"kz-hero-title\">{title}</h1>\n {lead && <p className=\"kz-hero-lead\">{lead}</p>}\n {actions && <div className=\"kz-tpl-actions kz-hero-extra\">{actions}</div>}\n </div>\n {visual && <HeroStage visual={visual} label={visualLabel} />}\n </div>\n </Page>\n </SectionBackdrop>\n {proofs && proofs.length > 0 && (\n <Page>\n <dl className=\"kz-tpl-band\">\n {proofs.map((p, i) => (\n <div key={i}>\n <dt>{p.value}</dt>\n <dd>{p.label}</dd>\n </div>\n ))}\n </dl>\n </Page>\n )}\n {showcase && (\n <Page data-landing-showcase=\"\" className=\"kz-tpl-showcase\">\n {showcase}\n </Page>\n )}\n <Section id=\"features\" eyebrow={featuresHeading?.eyebrow} title={featuresHeading?.title} lead={featuresHeading?.lead} reveal aria-label={featuresHeading ? undefined : \"Features\"}>\n <ul className=\"kz-tpl-bento\">\n {features.map((f) => (\n <li key={f.id} data-size={f.size === \"sm\" ? undefined : f.size} data-reveal=\"\">\n {f.icon && <span className=\"kz-block-icon\" aria-hidden>{f.icon}</span>}\n <h3>{f.title}</h3>\n <p>{f.text}</p>\n {f.visual && <div className=\"kz-tpl-bento-visual\">{f.visual}</div>}\n </li>\n ))}\n </ul>\n </Section>\n {children}\n {closing && (\n <Section spacing=\"sm\" aria-labelledby=\"landing-closing\">\n <CtaPanel id=\"landing-closing\" title={closing.title} body={closing.body} reveal>\n {closing.actions}\n </CtaPanel>\n </Section>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;AAGA,SAAS,gBAAgB;AACzB,SAAS,MAAM,eAAe;AAC9B,SAAS,uBAAuB;AA8DpB,SACc,KADd;AANL,SAAS,YAAY,EAAE,SAAS,OAAO,MAAM,SAAS,QAAQ,aAAa,QAAQ,UAAU,WAAW,QAAQ,iBAAiB,UAAU,SAAS,UAAU,GAAG,MAAM,GAAqB;AACjM,SACE,qBAAC,SAAK,GAAG,OACP;AAAA,wBAAC,mBAAgB,IAAG,UAAS,MAAM,aAAa,QAAQ,UAAU,aAAa,QAAQ,WAAU,WAC/F,8BAAC,QAAK,WAAU,qBACd,+BAAC,SAAI,WAAU,gBAAe,eAAa,SAAS,SAAY,IAC9D;AAAA,2BAAC,SAAI,WAAU,gBACZ;AAAA,mBAAW,oBAAC,OAAE,WAAU,cAAc,mBAAQ;AAAA,QAC/C,oBAAC,QAAG,WAAU,iBAAiB,iBAAM;AAAA,QACpC,QAAQ,oBAAC,OAAE,WAAU,gBAAgB,gBAAK;AAAA,QAC1C,WAAW,oBAAC,SAAI,WAAU,gCAAgC,mBAAQ;AAAA,SACrE;AAAA,MACC,UAAU,oBAAC,aAAU,QAAgB,OAAO,aAAa;AAAA,OAC5D,GACF,GACF;AAAA,IACC,UAAU,OAAO,SAAS,KACzB,oBAAC,QACC,8BAAC,QAAG,WAAU,eACX,iBAAO,IAAI,CAAC,GAAG,MACd,qBAAC,SACC;AAAA,0BAAC,QAAI,YAAE,OAAM;AAAA,MACb,oBAAC,QAAI,YAAE,OAAM;AAAA,SAFL,CAGV,CACD,GACH,GACF;AAAA,IAED,YACC,oBAAC,QAAK,yBAAsB,IAAG,WAAU,mBACtC,oBACH;AAAA,IAEF,oBAAC,WAAQ,IAAG,YAAW,SAAS,iBAAiB,SAAS,OAAO,iBAAiB,OAAO,MAAM,iBAAiB,MAAM,QAAM,MAAC,cAAY,kBAAkB,SAAY,YACrK,8BAAC,QAAG,WAAU,gBACX,mBAAS,IAAI,CAAC,MACb,qBAAC,QAAc,aAAW,EAAE,SAAS,OAAO,SAAY,EAAE,MAAM,eAAY,IACzE;AAAA,QAAE,QAAQ,oBAAC,UAAK,WAAU,iBAAgB,eAAW,MAAE,YAAE,MAAK;AAAA,MAC/D,oBAAC,QAAI,YAAE,OAAM;AAAA,MACb,oBAAC,OAAG,YAAE,MAAK;AAAA,MACV,EAAE,UAAU,oBAAC,SAAI,WAAU,uBAAuB,YAAE,QAAO;AAAA,SAJrD,EAAE,EAKX,CACD,GACH,GACF;AAAA,IACC;AAAA,IACA,WACC,oBAAC,WAAQ,SAAQ,MAAK,mBAAgB,mBACpC,8BAAC,YAAS,IAAG,mBAAkB,OAAO,QAAQ,OAAO,MAAM,QAAQ,MAAM,QAAM,MAC5E,kBAAQ,SACX,GACF;AAAA,KAEJ;AAEJ;","names":[]}
@@ -156,8 +156,10 @@ type MediaCarouselProps = Omit<React.ComponentProps<"section">, "children"> & {
156
156
  label: string;
157
157
  /** The frame ratio of every slide (width / height). Default `16 / 9`, the house ratio. */
158
158
  ratio?: string;
159
- /** Advances by itself (wrapping), each slide for its `duration` within the bounds (`true`: 5–45 s). Never under reduced motion or Save-Data; held by the pause button, the pointer, the keyboard focus, a hidden tab, off screen. */
159
+ /** Advances by itself (wrapping), each slide for its `duration` within the bounds (`true`: 5–45 s). Never under reduced motion or Save-Data; held by the pause button, a hidden tab, off screen (and, with `holds="pointer-focus"`, the pointer and a keyboard focus). */
160
160
  autoplay?: boolean | CarouselAutoplay;
161
+ /** What holds the autoplay clock besides the visible pause, a hidden tab, off screen, reduced motion and Save-Data. `pause-only` (default, WCAG 2.2.2): nothing else, so a resting pointer or a click on next never freezes it. `pointer-focus`: the pointer (not a touch) and a keyboard focus inside hold it too. */
162
+ holds?: "pause-only" | "pointer-focus";
161
163
  /** Offers « Sound on » when a slide declares `audio`: after the press, hovering or focusing the carousel plays that slide's sound. Never without the press. */
162
164
  sound?: boolean;
163
165
  /** `product` (default): the product register's rounded frame. `cahier`: the company's sites — square, a solid paper shadow, the count in the typewriter face. */
@@ -184,7 +186,7 @@ type MediaCarouselProps = Omit<React.ComponentProps<"section">, "children"> & {
184
186
  }) => React.ReactNode;
185
187
  };
186
188
  /** A sequence of clips, screen demos and stills, one at a time: buttons, arrow keys, swipe, and with `autoplay` it advances at the media's pace. */
187
- declare function MediaCarousel({ slides, label, ratio, autoplay, sound, frame, caption, textVersion, children, labels: given, playerLabels, onSlideChange, renderLoop, className, ...props }: Readonly<MediaCarouselProps>): React.JSX.Element;
189
+ declare function MediaCarousel({ slides, label, ratio, autoplay, holds, sound, frame, caption, textVersion, children, labels: given, playerLabels, onSlideChange, renderLoop, className, ...props }: Readonly<MediaCarouselProps>): React.JSX.Element;
188
190
 
189
191
  export { CAROUSEL_MAX_DWELL, CAROUSEL_MIN_DWELL, MediaCarousel, carouselDwell, chapterAt, mediaCarousel, mediaCarouselLabels };
190
192
  export type { CarouselAutoplay, CarouselChapter, CarouselSlide, CarouselSlideKind, MediaCarouselLabels, MediaCarouselProps };
@@ -251,7 +251,7 @@ function CarouselTicks({ slides, active, calm, dwell, advancing, onEnd, s }) {
251
251
  var CarouselToolbar = React.forwardRef(function CarouselToolbar2({ labels, turns, atStart, atEnd, moving, paused, onPause, sound, onTurn, onKeyDown, className }, ref) {
252
252
  return /* @__PURE__ */ jsxs("div", { ref, role: "toolbar", "aria-orientation": "horizontal", className, onKeyDown, children: [
253
253
  turns && /* @__PURE__ */ jsx(IconButton, { variant: "secondary", label: labels.previous, disabled: atStart, onClick: () => onTurn(-1), children: /* @__PURE__ */ jsx(ChevronGlyph, { direction: "left", className: "h-5 w-5" }) }),
254
- moving && /* @__PURE__ */ jsx(IconButton, { variant: "secondary", label: paused ? labels.play : labels.pause, onClick: onPause, children: paused ? /* @__PURE__ */ jsx(PlayGlyph, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(PauseGlyph, { className: "h-4 w-4" }) }),
254
+ moving && /* @__PURE__ */ jsx(IconButton, { variant: "secondary", label: paused ? labels.play : labels.pause, "aria-pressed": paused, onClick: onPause, children: paused ? /* @__PURE__ */ jsx(PlayGlyph, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(PauseGlyph, { className: "h-4 w-4" }) }),
255
255
  sound.shown && /* @__PURE__ */ jsx(IconButton, { variant: "secondary", label: labels.soundOn, "aria-pressed": sound.on, onClick: sound.toggle, children: /* @__PURE__ */ jsx(VolumeGlyph, { muted: !sound.on, className: "h-4 w-4" }) }),
256
256
  turns && /* @__PURE__ */ jsx(IconButton, { variant: "secondary", label: labels.next, disabled: atEnd, onClick: () => onTurn(1), children: /* @__PURE__ */ jsx(ChevronGlyph, { direction: "right", className: "h-5 w-5" }) })
257
257
  ] });
@@ -277,6 +277,7 @@ function MediaCarousel({
277
277
  label,
278
278
  ratio = "16 / 9",
279
279
  autoplay,
280
+ holds = "pause-only",
280
281
  sound,
281
282
  frame = "product",
282
283
  caption = "overlay",
@@ -311,7 +312,8 @@ function MediaCarousel({
311
312
  const wraps = Boolean(autoplay) && total > 1;
312
313
  const ownClips = !renderLoop && slides.some((slide) => slide.video);
313
314
  const moving = !calm && (wraps || ownClips);
314
- const advancing = wraps && !calm && !paused && !hovered && !keyboardIn && onScreen && !hidden;
315
+ const held = holds === "pointer-focus" && (hovered || keyboardIn);
316
+ const advancing = wraps && !calm && !paused && !held && onScreen && !hidden;
315
317
  const clipPlaying = onScreen && !paused && !hidden;
316
318
  const hasAudio = Boolean(sound) && !calm && ownClips && slides.some((slide) => slide.audio && slide.video);
317
319
  const audible = hasAudio && soundChosen && Boolean(current?.audio) && (hovered || focusIn);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/media-gallery/media-carousel.tsx"],"sourcesContent":["// Client (the slide in view, the clock, the reader's motion, data and sound choices). Carousel v2 (ADR-010): a sequence of\n// clips, screen demos and stills given as data, one at a time in one frame. The slides cross-fade in place (nothing\n// travels); previous / next sit in a toolbar that also takes ← → Home End, a swipe turns one slide, a « n / N » count.\n// With `autoplay` it advances by itself at the media's pace — the clock IS the CSS animation of the current progress\n// tick, so holding it (the pause button, the pointer, the keyboard focus, a hidden tab, off screen) keeps it where it\n// stood. Under reduced motion or Save-Data nothing advances and no clip is mounted: the posters and the buttons.\n// Posters first, one clip (the slide in view) after the page's `load`; a clip that cannot play leaves its poster. Sound is\n// an option: after a press on « Sound on », hovering or focusing the carousel plays the slide's audio.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { IconButton } from \"../button/button\";\nimport { ChevronGlyph, PauseGlyph, PlayGlyph, VolumeGlyph } from \"../glyphs\";\nimport { clamp, playSafely, useCalm, useInView, usePageHidden, usePageLoaded } from \"../media\";\nimport { MediaPlayer, type MediaPlayerProps } from \"./media-player\";\n\nexport const mediaCarousel = tv({\n slots: {\n root: \"relative isolate w-full min-w-0\",\n stage: \"relative isolate w-full overflow-hidden bg-media\",\n track: \"m-0 grid list-none p-0 touch-pan-y\",\n slide: \"relative col-start-1 row-start-1 m-0 w-full overflow-hidden opacity-0 transition-opacity duration-500 motion-reduce:transition-none data-[active]:opacity-100\",\n media: \"absolute inset-0 h-full w-full object-cover\",\n caption: \"absolute inset-x-0 bottom-0 bg-linear-to-t from-scrim-strong to-transparent p-3 pt-8 text-xs font-semibold text-fg-on-media\",\n ticks: \"pointer-events-none absolute inset-x-3 bottom-2.5 z-10 flex gap-1.5\",\n tick: \"relative h-0.5 flex-1 overflow-hidden bg-fg-on-media/30 data-[state=done]:bg-fg-on-media data-[state=full]:bg-[var(--kz-hue,var(--kz-accent))]\",\n fill: \"kz-media-carousel-fill absolute inset-0 bg-[var(--kz-hue,var(--kz-accent))]\",\n mark: \"absolute top-0 h-full w-px bg-media\",\n bar: \"mt-3 flex items-start justify-between gap-3\",\n barCaption: \"m-0 min-w-0 font-mono text-[13px] leading-[19px] text-fg-secondary [overflow-wrap:anywhere]\",\n count: \"text-xs tabular-nums text-fg-secondary\",\n buttons: \"flex flex-none gap-2\",\n text: \"mt-2.5 text-sm text-fg-secondary [&_li]:my-1\",\n },\n variants: {\n frame: {\n product: { stage: \"rounded-xl border border-border-default\" },\n cahier: { stage: \"rounded-none border border-border-strong shadow-[4px_4px_0_var(--kz-border-strong)]\", count: \"mr-2.5 font-mono text-fg-primary\" },\n },\n },\n defaultVariants: { frame: \"product\" },\n});\n\n/** What a slide is: a clip (a short generated or filmed shot), a screen demo (a product journey, often with chapters), a still. */\nexport type CarouselSlideKind = \"clip\" | \"screen-demo\" | \"still\";\n/** A step of a screen demo: where it starts, in seconds, and its name. */\nexport type CarouselChapter = { at: number; label: string };\n\nexport type CarouselSlide = {\n /** A stable id. */\n id: string;\n /** What it is. Default: `clip` with a `video`, `still` without. */\n kind?: CarouselSlideKind;\n /** The poster of a clip or a film, or the still: 16:9, drawn first. */\n src: string;\n /** What it shows, in words. */\n alt: string;\n /** « Fig. 1a — … »: over the foot of the slide, or in the bar with `caption=\"bar\"`. */\n caption?: string;\n /** The slide's line in the text version; `alt` when absent. */\n text?: string;\n /** The clip: one rendition, two encodes (VP9 `webm` first, H.264 `mp4` for Safari). Muted; plays while the slide is in view, on screen, after the page's `load`; never under reduced motion or Save-Data. */\n video?: { webm?: string; mp4?: string };\n /** The clip's length in seconds, as measured on the file (`krizaka-media-guard` reports it): with `autoplay`, the slide's time on screen. */\n duration?: number;\n /** The clip's file has an audio track (the guard checks it says the truth): « Sound on » can then play it. */\n audio?: boolean;\n /** A screen demo's steps: marks on the progress tick, the caption follows the step under the playhead, listed in the text version. */\n chapters?: readonly CarouselChapter[];\n /** A film opened by a press, with sound, in the lightbox of the MediaPlayer. */\n film?: Pick<MediaPlayerProps, \"src\" | \"title\" | \"tracks\" | \"loadHls\" | \"labels\" | \"ratio\"> & { playLabel: string; vertical?: boolean };\n};\n\nexport type MediaCarouselLabels = {\n previous: string;\n next: string;\n close: string;\n /** A slide's name, with `{n}` and `{total}`. */\n slide: string;\n /** The pause button while something moves. */\n pause: string;\n /** The same button once paused. */\n play: string;\n /** The sound toggle (pressed or not). */\n soundOn: string;\n /** The summary of the text version. */\n textVersion: string;\n /** The carousel's role description (`aria-roledescription`). */\n carousel: string;\n /** A slide's role description. */\n slideRole: string;\n};\nexport const mediaCarouselLabels: MediaCarouselLabels = {\n previous: \"Previous\",\n next: \"Next\",\n close: \"Close\",\n slide: \"{n} of {total}\",\n pause: \"Pause the carousel\",\n play: \"Play the carousel\",\n soundOn: \"Sound on\",\n textVersion: \"Text version\",\n carousel: \"carousel\",\n slideRole: \"slide\",\n};\n\n/** The bounds of a slide's time on screen, in seconds. */\nexport type CarouselAutoplay = { minDwell?: number; maxDwell?: number };\n\n// @fixed: the shortest time a slide stays, in seconds: reading a caption (ADR-010 §3), not a setting.\nexport const CAROUSEL_MIN_DWELL = 5;\n// @fixed: the longest, in seconds: the longest screen journey of a product demo (krizaka-internal#2655).\nexport const CAROUSEL_MAX_DWELL = 45;\n// @fixed: a still (or a clip of unknown length) stays a reading time and a breath, in seconds.\nconst STILL_EXTRA = 1.5;\n\n/** How long a slide stays with `autoplay`, in milliseconds: its media's duration within the bounds, or a reading time for a still. */\nexport function carouselDwell(slide: Pick<CarouselSlide, \"duration\" | \"video\">, bounds: CarouselAutoplay = {}): number {\n const min = bounds.minDwell ?? CAROUSEL_MIN_DWELL;\n const max = Math.max(min, bounds.maxDwell ?? CAROUSEL_MAX_DWELL);\n const seconds = slide.video && slide.duration && slide.duration > 0 ? clamp(slide.duration, min, max) : clamp(min + STILL_EXTRA, min, max);\n return Math.round(seconds * 1000);\n}\n\n/** The chapter under the playhead: the last one that has started. */\nexport function chapterAt(chapters: readonly CarouselChapter[] | undefined, seconds: number): number {\n if (!chapters?.length) return -1;\n let found = -1;\n chapters.forEach((c, i) => {\n if (seconds >= c.at) found = i;\n });\n return found;\n}\n\nexport type MediaCarouselProps = Omit<React.ComponentProps<\"section\">, \"children\"> & {\n /** The slides, in order. */\n slides: readonly CarouselSlide[];\n /** The carousel's accessible name, passed translated. */\n label: string;\n /** The frame ratio of every slide (width / height). Default `16 / 9`, the house ratio. */\n ratio?: string;\n /** Advances by itself (wrapping), each slide for its `duration` within the bounds (`true`: 5–45 s). Never under reduced motion or Save-Data; held by the pause button, the pointer, the keyboard focus, a hidden tab, off screen. */\n autoplay?: boolean | CarouselAutoplay;\n /** Offers « Sound on » when a slide declares `audio`: after the press, hovering or focusing the carousel plays that slide's sound. Never without the press. */\n sound?: boolean;\n /** `product` (default): the product register's rounded frame. `cahier`: the company's sites — square, a solid paper shadow, the count in the typewriter face. */\n frame?: \"product\" | \"cahier\";\n /** Where a slide's caption sits: over its foot (`overlay`, default) or in the bar under the frame (`bar`). */\n caption?: \"overlay\" | \"bar\";\n /** Renders the text version under the carousel: every slide's caption and text (and chapters), in a native `<details>`. */\n textVersion?: boolean;\n /** Rendered inside the text version (the host's sources, a link to the film); after the carousel without one. */\n children?: React.ReactNode;\n /** The words, passed translated; English by default. `slide` takes `{n}` and `{total}`. */\n labels?: Partial<MediaCarouselLabels>;\n /** The words of the lightbox player of every film (speed, captions, time…), passed translated; a slide's own `film.labels` wins. */\n playerLabels?: MediaPlayerProps[\"labels\"];\n /** Called with the index of the slide in view when it changes. */\n onSlideChange?: (index: number) => void;\n /**\n * Draws a slide's `video` in place of the carousel's own clip.\n * @deprecated Since carousel v2 (ADR-010) the carousel draws its clips itself, with its pause in the toolbar. Removed in 4.0.\n */\n renderLoop?: (video: NonNullable<CarouselSlide[\"video\"]>, context: { poster: string; inView: boolean }) => React.ReactNode;\n};\n\nconst CLOCK_CSS =\n \".kz-media-carousel-fill{transform-origin:left;transform:scaleX(0);animation-name:kz-media-carousel-fill;animation-timing-function:linear;animation-fill-mode:forwards}\" +\n \"@keyframes kz-media-carousel-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}\";\n\n/** How far a swipe travels, in CSS pixels, before it turns the slide. */\nconst SWIPE_DISTANCE = 40;\nconst SOUND_KEY = \"kz-media-carousel-sound\";\nconst SOUND_EVENT = \"kz-media-carousel-sound\";\n\n/** A horizontal swipe turns one slide; a vertical one stays the page's scroll (`touch-action: pan-y`). */\nfunction useSwipe(turn: (delta: 1 | -1) => void) {\n const from = React.useRef<number | null>(null);\n return {\n onPointerDown: (event: React.PointerEvent) => {\n from.current = event.clientX;\n },\n onPointerUp: (event: React.PointerEvent) => {\n const start = from.current;\n from.current = null;\n if (start === null) return;\n const distance = event.clientX - start;\n if (Math.abs(distance) >= SWIPE_DISTANCE) turn(distance < 0 ? 1 : -1);\n },\n onPointerCancel: () => {\n from.current = null;\n },\n };\n}\n\nconst subscribeSound = (notify: () => void) => {\n globalThis.addEventListener(SOUND_EVENT, notify);\n return () => globalThis.removeEventListener(SOUND_EVENT, notify);\n};\nconst readSound = () => {\n try {\n return globalThis.sessionStorage.getItem(SOUND_KEY) === \"1\";\n } catch {\n return false;\n }\n};\n/** The visitor's choice of sound, for this session (off on the server and before any press). */\nfunction useSoundChoice(): [boolean, () => void] {\n const on = React.useSyncExternalStore(subscribeSound, readSound, () => false);\n const toggle = () => {\n try {\n globalThis.sessionStorage.setItem(SOUND_KEY, on ? \"0\" : \"1\");\n } catch {\n // No storage (a private window): the choice holds until the next render only.\n }\n globalThis.dispatchEvent(new Event(SOUND_EVENT));\n };\n return [on, toggle];\n}\n\n/** The keyboard put the focus there (`:focus-visible`): only then does a focus hold the clock; a click does not. */\nfunction keyboardFocus(target: EventTarget | null): boolean {\n try {\n return target instanceof Element && target.matches(\":focus-visible\");\n } catch {\n return true;\n }\n}\n\n/** At an end the button just used is disabled: the focus moves to the other one, never to the page. */\nfunction keepFocus(toolbar: HTMLElement | null, at: number, count: number) {\n if (!toolbar?.contains(document.activeElement)) return;\n const buttons = toolbar.querySelectorAll(\"button\");\n const previous = buttons[0];\n const next = buttons[buttons.length - 1];\n if (at === 0) next?.focus();\n if (at === count - 1) previous?.focus();\n}\n\ntype ClipProps = Readonly<{\n video: NonNullable<CarouselSlide[\"video\"]>;\n poster: string;\n playing: boolean;\n muted: boolean;\n onBroken: () => void;\n onTime?: (seconds: number) => void;\n}>;\n\n/** The slide's clip: muted until the sound is chosen, looping while its slide stays (never a held last frame), gone if no source plays. */\nfunction SlideClip({ video, poster, playing, muted, onBroken, onTime }: ClipProps) {\n const ref = React.useRef<HTMLVideoElement>(null);\n React.useEffect(() => {\n if (ref.current) ref.current.muted = muted;\n }, [muted]);\n React.useEffect(() => {\n if (!ref.current) return;\n if (playing) playSafely(ref.current);\n else ref.current.pause?.();\n }, [playing]);\n const last = video.mp4 ? \"mp4\" : \"webm\";\n return (\n <video\n ref={ref}\n className={mediaCarousel().media()}\n poster={poster}\n muted\n loop\n playsInline\n preload=\"auto\"\n aria-hidden\n tabIndex={-1}\n onTimeUpdate={onTime ? (e) => onTime(e.currentTarget.currentTime) : undefined}\n >\n {video.webm && <source src={video.webm} type=\"video/webm\" onError={last === \"webm\" ? onBroken : undefined} />}\n {video.mp4 && <source src={video.mp4} type=\"video/mp4\" onError={onBroken} />}\n </video>\n );\n}\n\ntype SlideMediaProps = Readonly<{ slide: CarouselSlide; first: boolean; drawn: boolean; clip: React.ReactNode; ratio: string; closeLabel: string; overlay: boolean; playerLabels?: MediaPlayerProps[\"labels\"] }>;\n\n/** A poster that opens its film, or a still; its clip plays over it while the slide is the one in view. */\nfunction SlideMedia({ slide, first, drawn, clip, ratio, closeLabel, overlay, playerLabels }: SlideMediaProps) {\n const s = mediaCarousel();\n if (slide.film) {\n return (\n <MediaPlayer\n {...slide.film}\n labels={slide.film.labels ?? playerLabels}\n mode=\"lightbox\"\n poster={slide.src}\n posterAlt={slide.alt}\n caption={overlay ? slide.caption : undefined}\n closeLabel={closeLabel}\n preview={clip}\n className=\"h-full rounded-none border-0\"\n />\n );\n }\n return (\n <>\n {drawn && <img src={slide.src} alt={slide.alt} loading={first ? undefined : \"lazy\"} decoding=\"async\" draggable={false} className={s.media()} style={{ aspectRatio: ratio }} />}\n {clip}\n {overlay && slide.caption && <figcaption className={s.caption()}>{slide.caption}</figcaption>}\n </>\n );\n}\n\n/** A tick's state: before the current one, the current one (filling, or full when nothing advances), still to come. */\nfunction tickState(i: number, active: number, filling: boolean): \"done\" | \"now\" | \"full\" | undefined {\n if (i < active) return \"done\";\n if (i !== active) return undefined;\n return filling ? \"now\" : \"full\";\n}\n\n/** A screen demo's steps, as marks on its progress tick (where each starts, over the clip's length). */\nfunction ChapterMarks({ slide, className }: Readonly<{ slide: CarouselSlide; className: string }>) {\n const length = slide.duration ?? 0;\n if (!slide.chapters?.length || length <= 0) return null;\n return slide.chapters.map((c) => <i key={c.at} className={className} style={{ left: `${(c.at / length) * 100}%` }} />);\n}\n\n/** The step of the current slide under the playhead, followed only for a slide with chapters. */\nfunction useChapter(slide: CarouselSlide | undefined) {\n const [chapter, setChapter] = React.useState(-1);\n const [shown, setShown] = React.useState(slide?.id);\n if (shown !== slide?.id) {\n setShown(slide?.id);\n setChapter(-1);\n }\n const onTime = slide?.chapters?.length ? (seconds: number) => setChapter(chapterAt(slide.chapters, seconds)) : undefined;\n return { chapter: slide?.chapters?.[chapter], onTime };\n}\n\n/** What holds the clock and what lets the sound play: the pointer (not a touch), any focus inside, a keyboard focus inside. */\nfunction useHolds() {\n const [hovered, setHovered] = React.useState(false);\n const [focusIn, setFocusIn] = React.useState(false);\n const [keyboardIn, setKeyboardIn] = React.useState(false);\n const handlers = {\n onPointerEnter: (e: React.PointerEvent) => setHovered(e.pointerType !== \"touch\"),\n onPointerLeave: () => setHovered(false),\n onFocus: (e: React.FocusEvent) => {\n setFocusIn(true);\n setKeyboardIn(keyboardFocus(e.target));\n },\n onBlur: (e: React.FocusEvent) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n setFocusIn(false);\n setKeyboardIn(false);\n },\n };\n return { hovered, focusIn, keyboardIn, handlers };\n}\n\ntype TicksProps = Readonly<{ slides: readonly CarouselSlide[]; active: number; calm: boolean; dwell: number; advancing: boolean; onEnd: () => void; s: ReturnType<typeof mediaCarousel> }>;\n\n/** One hairline per slide; the current one fills over its dwell — the clock — and holds with the carousel. */\nfunction CarouselTicks({ slides, active, calm, dwell, advancing, onEnd, s }: TicksProps) {\n return (\n <div className={s.ticks()} aria-hidden>\n {slides.map((slide, i) => (\n <span key={slide.id} className={s.tick()} data-state={tickState(i, active, !calm)}>\n {i === active && !calm && (\n <span\n key={`${active}`}\n className={s.fill()}\n style={{ animationDuration: `${dwell}ms`, animationPlayState: advancing ? \"running\" : \"paused\" }}\n onAnimationEnd={() => advancing && onEnd()}\n />\n )}\n {i === active && <ChapterMarks slide={slide} className={s.mark()} />}\n </span>\n ))}\n </div>\n );\n}\n\ntype ToolbarProps = Readonly<{\n labels: MediaCarouselLabels;\n turns: boolean;\n atStart: boolean;\n atEnd: boolean;\n moving: boolean;\n paused: boolean;\n onPause: () => void;\n sound: { shown: boolean; on: boolean; toggle: () => void };\n onTurn: (delta: number) => void;\n onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;\n className: string;\n}>;\n\n/** Previous, pause / play, « Sound on », next: one toolbar that also takes ← → Home End. */\nconst CarouselToolbar = React.forwardRef<HTMLDivElement, ToolbarProps>(function CarouselToolbar(\n { labels, turns, atStart, atEnd, moving, paused, onPause, sound, onTurn, onKeyDown, className },\n ref,\n) {\n return (\n <div ref={ref} role=\"toolbar\" aria-orientation=\"horizontal\" className={className} onKeyDown={onKeyDown}>\n {turns && (\n <IconButton variant=\"secondary\" label={labels.previous} disabled={atStart} onClick={() => onTurn(-1)}>\n <ChevronGlyph direction=\"left\" className=\"h-5 w-5\" />\n </IconButton>\n )}\n {moving && (\n <IconButton variant=\"secondary\" label={paused ? labels.play : labels.pause} onClick={onPause}>\n {paused ? <PlayGlyph className=\"h-4 w-4\" /> : <PauseGlyph className=\"h-4 w-4\" />}\n </IconButton>\n )}\n {sound.shown && (\n <IconButton variant=\"secondary\" label={labels.soundOn} aria-pressed={sound.on} onClick={sound.toggle}>\n <VolumeGlyph muted={!sound.on} className=\"h-4 w-4\" />\n </IconButton>\n )}\n {turns && (\n <IconButton variant=\"secondary\" label={labels.next} disabled={atEnd} onClick={() => onTurn(1)}>\n <ChevronGlyph direction=\"right\" className=\"h-5 w-5\" />\n </IconButton>\n )}\n </div>\n );\n});\n\n/** Every slide's caption and text, and a screen demo's chapters, in a native `<details>`; the host's `children` inside. */\nfunction TextVersion({ slides, summary, className, children }: Readonly<{ slides: readonly CarouselSlide[]; summary: string; className: string; children?: React.ReactNode }>) {\n return (\n <details className={className}>\n <summary>{summary}</summary>\n <ol>\n {slides.map((slide) => (\n <li key={slide.id}>\n {slide.caption && <b>{slide.caption}</b>} {slide.text ?? slide.alt}\n {slide.chapters?.length ? (\n <ol>\n {slide.chapters.map((c) => (\n <li key={c.at}>{c.label}</li>\n ))}\n </ol>\n ) : null}\n </li>\n ))}\n </ol>\n {children}\n </details>\n );\n}\n\n/** The caption shown in the bar: the slide's, with the chapter under the playhead. */\nfunction barCaptionOf(placement: \"overlay\" | \"bar\", slide: CarouselSlide | undefined, chapter: CarouselChapter | undefined) {\n if (placement !== \"bar\" || !slide?.caption) return undefined;\n return chapter ? [slide.caption, chapter.label].join(\" · \") : slide.caption;\n}\n\n/** A sequence of clips, screen demos and stills, one at a time: buttons, arrow keys, swipe, and with `autoplay` it advances at the media's pace. */\nexport function MediaCarousel({\n slides,\n label,\n ratio = \"16 / 9\",\n autoplay,\n sound,\n frame = \"product\",\n caption = \"overlay\",\n textVersion,\n children,\n labels: given,\n playerLabels,\n onSlideChange,\n renderLoop,\n className,\n ...props\n}: Readonly<MediaCarouselProps>) {\n const labels = { ...mediaCarouselLabels, ...given };\n const s = mediaCarousel({ frame });\n const total = slides.length;\n const root = React.useRef<HTMLElement>(null);\n const toolbar = React.useRef<HTMLDivElement>(null);\n const calm = useCalm();\n const loaded = usePageLoaded();\n const hidden = usePageHidden();\n const [soundChosen, toggleSound] = useSoundChoice();\n const [active, setActive] = React.useState(0);\n const [seen, setSeen] = React.useState<ReadonlySet<number>>(() => new Set([0]));\n const [broken, setBroken] = React.useState<ReadonlySet<string>>(() => new Set());\n const [paused, setPaused] = React.useState(false);\n const { hovered, focusIn, keyboardIn, handlers } = useHolds();\n const [onScreen, setOnScreen] = React.useState(() => typeof IntersectionObserver === \"undefined\");\n useInView(root, setOnScreen);\n\n const current = slides[active];\n const { chapter, onTime } = useChapter(current);\n const bounds = typeof autoplay === \"object\" ? autoplay : {};\n const wraps = Boolean(autoplay) && total > 1;\n const ownClips = !renderLoop && slides.some((slide) => slide.video);\n const moving = !calm && (wraps || ownClips);\n const advancing = wraps && !calm && !paused && !hovered && !keyboardIn && onScreen && !hidden;\n const clipPlaying = onScreen && !paused && !hidden;\n const hasAudio = Boolean(sound) && !calm && ownClips && slides.some((slide) => slide.audio && slide.video);\n const audible = hasAudio && soundChosen && Boolean(current?.audio) && (hovered || focusIn);\n\n const show = (to: number) => {\n setActive(to);\n setSeen((before) => new Set(before).add(to));\n onSlideChange?.(to);\n };\n const turn = (delta: number) => {\n const to = wraps ? (active + delta + total) % total : clamp(active + delta, 0, total - 1);\n if (to === active) return;\n show(to);\n if (!wraps) keepFocus(toolbar.current, to, total);\n };\n const swipe = useSwipe(turn);\n const keys = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const moves: Partial<Record<string, () => void>> = {\n ArrowRight: () => turn(1),\n ArrowLeft: () => turn(-1),\n Home: () => turn(-active),\n End: () => turn(total - 1 - active),\n };\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n move();\n };\n const name = (i: number) => labels.slide.replace(\"{n}\", String(i + 1)).replace(\"{total}\", String(total));\n const clipOf = (slide: CarouselSlide, i: number): React.ReactNode => {\n if (!slide.video) return null;\n if (renderLoop) return renderLoop(slide.video, { poster: slide.src, inView: i === active });\n if (i !== active || calm || !loaded || broken.has(slide.id)) return null;\n return (\n <SlideClip\n key={slide.id}\n video={slide.video}\n poster={slide.src}\n playing={clipPlaying}\n muted={!audible}\n onTime={onTime}\n onBroken={() => setBroken((before) => new Set(before).add(slide.id))}\n />\n );\n };\n const dwell = current ? carouselDwell(current, bounds) : 0;\n const barCaption = barCaptionOf(caption, current, chapter);\n const showBar = total > 1 || moving || Boolean(barCaption);\n\n return (\n <section\n ref={root}\n aria-roledescription={labels.carousel}\n aria-label={label}\n data-frame={frame}\n data-advancing={advancing ? \"\" : undefined}\n className={s.root({ className })}\n {...handlers}\n {...props}\n >\n {wraps && (\n <style href=\"kz-media-carousel\" precedence=\"medium\">\n {CLOCK_CSS}\n </style>\n )}\n <div className={s.stage()} style={{ aspectRatio: ratio }}>\n <ul className={s.track()} {...swipe}>\n {slides.map((slide, i) => {\n const here = i === active;\n return (\n <li\n key={slide.id}\n aria-roledescription={labels.slideRole}\n aria-label={name(i)}\n data-kind={slide.kind ?? (slide.video ? \"clip\" : \"still\")}\n data-active={here ? \"\" : undefined}\n className={s.slide()}\n style={{ aspectRatio: ratio }}\n aria-hidden={here ? undefined : true}\n inert={here ? undefined : true}\n >\n <figure className=\"m-0 h-full w-full\">\n <SlideMedia\n slide={slide}\n first={i === 0}\n drawn={seen.has(i) || i === (active + 1) % total}\n clip={clipOf(slide, i)}\n ratio={ratio}\n closeLabel={labels.close}\n overlay={caption === \"overlay\"}\n playerLabels={playerLabels}\n />\n </figure>\n </li>\n );\n })}\n </ul>\n {wraps && <CarouselTicks slides={slides} active={active} calm={calm} dwell={dwell} advancing={advancing} onEnd={() => turn(1)} s={s} />}\n </div>\n {showBar && (\n <div className={s.bar()}>\n <p className={s.barCaption()} aria-live={advancing ? \"off\" : \"polite\"}>\n {total > 1 && (\n <span className={s.count()}>\n {active + 1} / {total}\n </span>\n )}\n {barCaption && <> {barCaption}</>}\n </p>\n <CarouselToolbar\n ref={toolbar}\n labels={labels}\n turns={total > 1}\n atStart={!wraps && active === 0}\n atEnd={!wraps && active === total - 1}\n moving={moving}\n paused={paused}\n onPause={() => setPaused((p) => !p)}\n sound={{ shown: hasAudio, on: soundChosen, toggle: toggleSound }}\n onTurn={turn}\n onKeyDown={keys}\n className={s.buttons()}\n />\n </div>\n )}\n {textVersion ? (\n <TextVersion slides={slides} summary={labels.textVersion} className={s.text()}>\n {children}\n </TextVersion>\n ) : (\n children\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAQA,YAAY,WAAW;AACvB,SAAS,UAAU;AA2Pf,SAuCA,UA3BiB,KAZjB;AApPG,IAAM,gBAAgB,GAAG;AAAA,EAC9B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,MACL,SAAS,EAAE,OAAO,0CAA0C;AAAA,MAC5D,QAAQ,EAAE,OAAO,uFAAuF,OAAO,mCAAmC;AAAA,IACpJ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,OAAO,UAAU;AACtC,CAAC;AAmDM,IAAM,sBAA2C;AAAA,EACtD,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,EACV,WAAW;AACb;AAMO,IAAM,qBAAqB;AAE3B,IAAM,qBAAqB;AAElC,IAAM,cAAc;AAGb,SAAS,cAAc,OAAkD,SAA2B,CAAC,GAAW;AACrH,QAAM,MAAM,OAAO,YAAY;AAC/B,QAAM,MAAM,KAAK,IAAI,KAAK,OAAO,YAAY,kBAAkB;AAC/D,QAAM,UAAU,MAAM,SAAS,MAAM,YAAY,MAAM,WAAW,IAAI,MAAM,MAAM,UAAU,KAA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G,aAAW,YAAY,QAAQ,UAC1D;AAAA,oBAAQ,KACP,qBAAC,UAAK,WAAW,EAAE,MAAM,GACtB;AAAA,uBAAS;AAAA,cAAE;AAAA,cAAI;AAAA,eAClB;AAAA,YAED,cAAc,iCAAE;AAAA;AAAA,cAAE;AAAA,eAAW;AAAA,aAChC;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL;AAAA,cACA,OAAO,QAAQ;AAAA,cACf,SAAS,CAAC,SAAS,WAAW;AAAA,cAC9B,OAAO,CAAC,SAAS,WAAW,QAAQ;AAAA,cACpC;AAAA,cACA;AAAA,cACA,SAAS,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;AAAA,cAClC,OAAO,EAAE,OAAO,UAAU,IAAI,aAAa,QAAQ,YAAY;AAAA,cAC/D,QAAQ;AAAA,cACR,WAAW;AAAA,cACX,WAAW,EAAE,QAAQ;AAAA;AAAA,UACvB;AAAA,WACF;AAAA,QAED,cACC,oBAAC,eAAY,QAAgB,SAAS,OAAO,aAAa,WAAW,EAAE,KAAK,GACzE,UACH,IAEA;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["CarouselToolbar"]}
1
+ {"version":3,"sources":["../src/media-gallery/media-carousel.tsx"],"sourcesContent":["// Client (the slide in view, the clock, the reader's motion, data and sound choices). Carousel v2 (ADR-010): a sequence of\n// clips, screen demos and stills given as data, one at a time in one frame. The slides cross-fade in place (nothing\n// travels); previous / next sit in a toolbar that also takes ← → Home End, a swipe turns one slide, a « n / N » count.\n// With `autoplay` it advances by itself at the media's pace — the clock IS the CSS animation of the current progress\n// tick, so holding it (the pause button, the pointer, the keyboard focus, a hidden tab, off screen) keeps it where it\n// stood. Under reduced motion or Save-Data nothing advances and no clip is mounted: the posters and the buttons.\n// Posters first, one clip (the slide in view) after the page's `load`; a clip that cannot play leaves its poster. Sound is\n// an option: after a press on « Sound on », hovering or focusing the carousel plays the slide's audio.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { IconButton } from \"../button/button\";\nimport { ChevronGlyph, PauseGlyph, PlayGlyph, VolumeGlyph } from \"../glyphs\";\nimport { clamp, playSafely, useCalm, useInView, usePageHidden, usePageLoaded } from \"../media\";\nimport { MediaPlayer, type MediaPlayerProps } from \"./media-player\";\n\nexport const mediaCarousel = tv({\n slots: {\n root: \"relative isolate w-full min-w-0\",\n stage: \"relative isolate w-full overflow-hidden bg-media\",\n track: \"m-0 grid list-none p-0 touch-pan-y\",\n slide: \"relative col-start-1 row-start-1 m-0 w-full overflow-hidden opacity-0 transition-opacity duration-500 motion-reduce:transition-none data-[active]:opacity-100\",\n media: \"absolute inset-0 h-full w-full object-cover\",\n caption: \"absolute inset-x-0 bottom-0 bg-linear-to-t from-scrim-strong to-transparent p-3 pt-8 text-xs font-semibold text-fg-on-media\",\n ticks: \"pointer-events-none absolute inset-x-3 bottom-2.5 z-10 flex gap-1.5\",\n tick: \"relative h-0.5 flex-1 overflow-hidden bg-fg-on-media/30 data-[state=done]:bg-fg-on-media data-[state=full]:bg-[var(--kz-hue,var(--kz-accent))]\",\n fill: \"kz-media-carousel-fill absolute inset-0 bg-[var(--kz-hue,var(--kz-accent))]\",\n mark: \"absolute top-0 h-full w-px bg-media\",\n bar: \"mt-3 flex items-start justify-between gap-3\",\n barCaption: \"m-0 min-w-0 font-mono text-[13px] leading-[19px] text-fg-secondary [overflow-wrap:anywhere]\",\n count: \"text-xs tabular-nums text-fg-secondary\",\n buttons: \"flex flex-none gap-2\",\n text: \"mt-2.5 text-sm text-fg-secondary [&_li]:my-1\",\n },\n variants: {\n frame: {\n product: { stage: \"rounded-xl border border-border-default\" },\n cahier: { stage: \"rounded-none border border-border-strong shadow-[4px_4px_0_var(--kz-border-strong)]\", count: \"mr-2.5 font-mono text-fg-primary\" },\n },\n },\n defaultVariants: { frame: \"product\" },\n});\n\n/** What a slide is: a clip (a short generated or filmed shot), a screen demo (a product journey, often with chapters), a still. */\nexport type CarouselSlideKind = \"clip\" | \"screen-demo\" | \"still\";\n/** A step of a screen demo: where it starts, in seconds, and its name. */\nexport type CarouselChapter = { at: number; label: string };\n\nexport type CarouselSlide = {\n /** A stable id. */\n id: string;\n /** What it is. Default: `clip` with a `video`, `still` without. */\n kind?: CarouselSlideKind;\n /** The poster of a clip or a film, or the still: 16:9, drawn first. */\n src: string;\n /** What it shows, in words. */\n alt: string;\n /** « Fig. 1a — … »: over the foot of the slide, or in the bar with `caption=\"bar\"`. */\n caption?: string;\n /** The slide's line in the text version; `alt` when absent. */\n text?: string;\n /** The clip: one rendition, two encodes (VP9 `webm` first, H.264 `mp4` for Safari). Muted; plays while the slide is in view, on screen, after the page's `load`; never under reduced motion or Save-Data. */\n video?: { webm?: string; mp4?: string };\n /** The clip's length in seconds, as measured on the file (`krizaka-media-guard` reports it): with `autoplay`, the slide's time on screen. */\n duration?: number;\n /** The clip's file has an audio track (the guard checks it says the truth): « Sound on » can then play it. */\n audio?: boolean;\n /** A screen demo's steps: marks on the progress tick, the caption follows the step under the playhead, listed in the text version. */\n chapters?: readonly CarouselChapter[];\n /** A film opened by a press, with sound, in the lightbox of the MediaPlayer. */\n film?: Pick<MediaPlayerProps, \"src\" | \"title\" | \"tracks\" | \"loadHls\" | \"labels\" | \"ratio\"> & { playLabel: string; vertical?: boolean };\n};\n\nexport type MediaCarouselLabels = {\n previous: string;\n next: string;\n close: string;\n /** A slide's name, with `{n}` and `{total}`. */\n slide: string;\n /** The pause button while something moves. */\n pause: string;\n /** The same button once paused. */\n play: string;\n /** The sound toggle (pressed or not). */\n soundOn: string;\n /** The summary of the text version. */\n textVersion: string;\n /** The carousel's role description (`aria-roledescription`). */\n carousel: string;\n /** A slide's role description. */\n slideRole: string;\n};\nexport const mediaCarouselLabels: MediaCarouselLabels = {\n previous: \"Previous\",\n next: \"Next\",\n close: \"Close\",\n slide: \"{n} of {total}\",\n pause: \"Pause the carousel\",\n play: \"Play the carousel\",\n soundOn: \"Sound on\",\n textVersion: \"Text version\",\n carousel: \"carousel\",\n slideRole: \"slide\",\n};\n\n/** The bounds of a slide's time on screen, in seconds. */\nexport type CarouselAutoplay = { minDwell?: number; maxDwell?: number };\n\n// @fixed: the shortest time a slide stays, in seconds: reading a caption (ADR-010 §3), not a setting.\nexport const CAROUSEL_MIN_DWELL = 5;\n// @fixed: the longest, in seconds: the longest screen journey of a product demo (krizaka-internal#2655).\nexport const CAROUSEL_MAX_DWELL = 45;\n// @fixed: a still (or a clip of unknown length) stays a reading time and a breath, in seconds.\nconst STILL_EXTRA = 1.5;\n\n/** How long a slide stays with `autoplay`, in milliseconds: its media's duration within the bounds, or a reading time for a still. */\nexport function carouselDwell(slide: Pick<CarouselSlide, \"duration\" | \"video\">, bounds: CarouselAutoplay = {}): number {\n const min = bounds.minDwell ?? CAROUSEL_MIN_DWELL;\n const max = Math.max(min, bounds.maxDwell ?? CAROUSEL_MAX_DWELL);\n const seconds = slide.video && slide.duration && slide.duration > 0 ? clamp(slide.duration, min, max) : clamp(min + STILL_EXTRA, min, max);\n return Math.round(seconds * 1000);\n}\n\n/** The chapter under the playhead: the last one that has started. */\nexport function chapterAt(chapters: readonly CarouselChapter[] | undefined, seconds: number): number {\n if (!chapters?.length) return -1;\n let found = -1;\n chapters.forEach((c, i) => {\n if (seconds >= c.at) found = i;\n });\n return found;\n}\n\nexport type MediaCarouselProps = Omit<React.ComponentProps<\"section\">, \"children\"> & {\n /** The slides, in order. */\n slides: readonly CarouselSlide[];\n /** The carousel's accessible name, passed translated. */\n label: string;\n /** The frame ratio of every slide (width / height). Default `16 / 9`, the house ratio. */\n ratio?: string;\n /** Advances by itself (wrapping), each slide for its `duration` within the bounds (`true`: 5–45 s). Never under reduced motion or Save-Data; held by the pause button, a hidden tab, off screen (and, with `holds=\"pointer-focus\"`, the pointer and a keyboard focus). */\n autoplay?: boolean | CarouselAutoplay;\n /** What holds the autoplay clock besides the visible pause, a hidden tab, off screen, reduced motion and Save-Data. `pause-only` (default, WCAG 2.2.2): nothing else, so a resting pointer or a click on next never freezes it. `pointer-focus`: the pointer (not a touch) and a keyboard focus inside hold it too. */\n holds?: \"pause-only\" | \"pointer-focus\";\n /** Offers « Sound on » when a slide declares `audio`: after the press, hovering or focusing the carousel plays that slide's sound. Never without the press. */\n sound?: boolean;\n /** `product` (default): the product register's rounded frame. `cahier`: the company's sites — square, a solid paper shadow, the count in the typewriter face. */\n frame?: \"product\" | \"cahier\";\n /** Where a slide's caption sits: over its foot (`overlay`, default) or in the bar under the frame (`bar`). */\n caption?: \"overlay\" | \"bar\";\n /** Renders the text version under the carousel: every slide's caption and text (and chapters), in a native `<details>`. */\n textVersion?: boolean;\n /** Rendered inside the text version (the host's sources, a link to the film); after the carousel without one. */\n children?: React.ReactNode;\n /** The words, passed translated; English by default. `slide` takes `{n}` and `{total}`. */\n labels?: Partial<MediaCarouselLabels>;\n /** The words of the lightbox player of every film (speed, captions, time…), passed translated; a slide's own `film.labels` wins. */\n playerLabels?: MediaPlayerProps[\"labels\"];\n /** Called with the index of the slide in view when it changes. */\n onSlideChange?: (index: number) => void;\n /**\n * Draws a slide's `video` in place of the carousel's own clip.\n * @deprecated Since carousel v2 (ADR-010) the carousel draws its clips itself, with its pause in the toolbar. Removed in 4.0.\n */\n renderLoop?: (video: NonNullable<CarouselSlide[\"video\"]>, context: { poster: string; inView: boolean }) => React.ReactNode;\n};\n\nconst CLOCK_CSS =\n \".kz-media-carousel-fill{transform-origin:left;transform:scaleX(0);animation-name:kz-media-carousel-fill;animation-timing-function:linear;animation-fill-mode:forwards}\" +\n \"@keyframes kz-media-carousel-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}\";\n\n/** How far a swipe travels, in CSS pixels, before it turns the slide. */\nconst SWIPE_DISTANCE = 40;\nconst SOUND_KEY = \"kz-media-carousel-sound\";\nconst SOUND_EVENT = \"kz-media-carousel-sound\";\n\n/** A horizontal swipe turns one slide; a vertical one stays the page's scroll (`touch-action: pan-y`). */\nfunction useSwipe(turn: (delta: 1 | -1) => void) {\n const from = React.useRef<number | null>(null);\n return {\n onPointerDown: (event: React.PointerEvent) => {\n from.current = event.clientX;\n },\n onPointerUp: (event: React.PointerEvent) => {\n const start = from.current;\n from.current = null;\n if (start === null) return;\n const distance = event.clientX - start;\n if (Math.abs(distance) >= SWIPE_DISTANCE) turn(distance < 0 ? 1 : -1);\n },\n onPointerCancel: () => {\n from.current = null;\n },\n };\n}\n\nconst subscribeSound = (notify: () => void) => {\n globalThis.addEventListener(SOUND_EVENT, notify);\n return () => globalThis.removeEventListener(SOUND_EVENT, notify);\n};\nconst readSound = () => {\n try {\n return globalThis.sessionStorage.getItem(SOUND_KEY) === \"1\";\n } catch {\n return false;\n }\n};\n/** The visitor's choice of sound, for this session (off on the server and before any press). */\nfunction useSoundChoice(): [boolean, () => void] {\n const on = React.useSyncExternalStore(subscribeSound, readSound, () => false);\n const toggle = () => {\n try {\n globalThis.sessionStorage.setItem(SOUND_KEY, on ? \"0\" : \"1\");\n } catch {\n // No storage (a private window): the choice holds until the next render only.\n }\n globalThis.dispatchEvent(new Event(SOUND_EVENT));\n };\n return [on, toggle];\n}\n\n/** The keyboard put the focus there (`:focus-visible`): only then does a focus hold the clock; a click does not. */\nfunction keyboardFocus(target: EventTarget | null): boolean {\n try {\n return target instanceof Element && target.matches(\":focus-visible\");\n } catch {\n return true;\n }\n}\n\n/** At an end the button just used is disabled: the focus moves to the other one, never to the page. */\nfunction keepFocus(toolbar: HTMLElement | null, at: number, count: number) {\n if (!toolbar?.contains(document.activeElement)) return;\n const buttons = toolbar.querySelectorAll(\"button\");\n const previous = buttons[0];\n const next = buttons[buttons.length - 1];\n if (at === 0) next?.focus();\n if (at === count - 1) previous?.focus();\n}\n\ntype ClipProps = Readonly<{\n video: NonNullable<CarouselSlide[\"video\"]>;\n poster: string;\n playing: boolean;\n muted: boolean;\n onBroken: () => void;\n onTime?: (seconds: number) => void;\n}>;\n\n/** The slide's clip: muted until the sound is chosen, looping while its slide stays (never a held last frame), gone if no source plays. */\nfunction SlideClip({ video, poster, playing, muted, onBroken, onTime }: ClipProps) {\n const ref = React.useRef<HTMLVideoElement>(null);\n React.useEffect(() => {\n if (ref.current) ref.current.muted = muted;\n }, [muted]);\n React.useEffect(() => {\n if (!ref.current) return;\n if (playing) playSafely(ref.current);\n else ref.current.pause?.();\n }, [playing]);\n const last = video.mp4 ? \"mp4\" : \"webm\";\n return (\n <video\n ref={ref}\n className={mediaCarousel().media()}\n poster={poster}\n muted\n loop\n playsInline\n preload=\"auto\"\n aria-hidden\n tabIndex={-1}\n onTimeUpdate={onTime ? (e) => onTime(e.currentTarget.currentTime) : undefined}\n >\n {video.webm && <source src={video.webm} type=\"video/webm\" onError={last === \"webm\" ? onBroken : undefined} />}\n {video.mp4 && <source src={video.mp4} type=\"video/mp4\" onError={onBroken} />}\n </video>\n );\n}\n\ntype SlideMediaProps = Readonly<{ slide: CarouselSlide; first: boolean; drawn: boolean; clip: React.ReactNode; ratio: string; closeLabel: string; overlay: boolean; playerLabels?: MediaPlayerProps[\"labels\"] }>;\n\n/** A poster that opens its film, or a still; its clip plays over it while the slide is the one in view. */\nfunction SlideMedia({ slide, first, drawn, clip, ratio, closeLabel, overlay, playerLabels }: SlideMediaProps) {\n const s = mediaCarousel();\n if (slide.film) {\n return (\n <MediaPlayer\n {...slide.film}\n labels={slide.film.labels ?? playerLabels}\n mode=\"lightbox\"\n poster={slide.src}\n posterAlt={slide.alt}\n caption={overlay ? slide.caption : undefined}\n closeLabel={closeLabel}\n preview={clip}\n className=\"h-full rounded-none border-0\"\n />\n );\n }\n return (\n <>\n {drawn && <img src={slide.src} alt={slide.alt} loading={first ? undefined : \"lazy\"} decoding=\"async\" draggable={false} className={s.media()} style={{ aspectRatio: ratio }} />}\n {clip}\n {overlay && slide.caption && <figcaption className={s.caption()}>{slide.caption}</figcaption>}\n </>\n );\n}\n\n/** A tick's state: before the current one, the current one (filling, or full when nothing advances), still to come. */\nfunction tickState(i: number, active: number, filling: boolean): \"done\" | \"now\" | \"full\" | undefined {\n if (i < active) return \"done\";\n if (i !== active) return undefined;\n return filling ? \"now\" : \"full\";\n}\n\n/** A screen demo's steps, as marks on its progress tick (where each starts, over the clip's length). */\nfunction ChapterMarks({ slide, className }: Readonly<{ slide: CarouselSlide; className: string }>) {\n const length = slide.duration ?? 0;\n if (!slide.chapters?.length || length <= 0) return null;\n return slide.chapters.map((c) => <i key={c.at} className={className} style={{ left: `${(c.at / length) * 100}%` }} />);\n}\n\n/** The step of the current slide under the playhead, followed only for a slide with chapters. */\nfunction useChapter(slide: CarouselSlide | undefined) {\n const [chapter, setChapter] = React.useState(-1);\n const [shown, setShown] = React.useState(slide?.id);\n if (shown !== slide?.id) {\n setShown(slide?.id);\n setChapter(-1);\n }\n const onTime = slide?.chapters?.length ? (seconds: number) => setChapter(chapterAt(slide.chapters, seconds)) : undefined;\n return { chapter: slide?.chapters?.[chapter], onTime };\n}\n\n/** What holds the clock and what lets the sound play: the pointer (not a touch), any focus inside, a keyboard focus inside. */\nfunction useHolds() {\n const [hovered, setHovered] = React.useState(false);\n const [focusIn, setFocusIn] = React.useState(false);\n const [keyboardIn, setKeyboardIn] = React.useState(false);\n const handlers = {\n onPointerEnter: (e: React.PointerEvent) => setHovered(e.pointerType !== \"touch\"),\n onPointerLeave: () => setHovered(false),\n onFocus: (e: React.FocusEvent) => {\n setFocusIn(true);\n setKeyboardIn(keyboardFocus(e.target));\n },\n onBlur: (e: React.FocusEvent) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n setFocusIn(false);\n setKeyboardIn(false);\n },\n };\n return { hovered, focusIn, keyboardIn, handlers };\n}\n\ntype TicksProps = Readonly<{ slides: readonly CarouselSlide[]; active: number; calm: boolean; dwell: number; advancing: boolean; onEnd: () => void; s: ReturnType<typeof mediaCarousel> }>;\n\n/** One hairline per slide; the current one fills over its dwell — the clock — and holds with the carousel. */\nfunction CarouselTicks({ slides, active, calm, dwell, advancing, onEnd, s }: TicksProps) {\n return (\n <div className={s.ticks()} aria-hidden>\n {slides.map((slide, i) => (\n <span key={slide.id} className={s.tick()} data-state={tickState(i, active, !calm)}>\n {i === active && !calm && (\n <span\n key={`${active}`}\n className={s.fill()}\n style={{ animationDuration: `${dwell}ms`, animationPlayState: advancing ? \"running\" : \"paused\" }}\n onAnimationEnd={() => advancing && onEnd()}\n />\n )}\n {i === active && <ChapterMarks slide={slide} className={s.mark()} />}\n </span>\n ))}\n </div>\n );\n}\n\ntype ToolbarProps = Readonly<{\n labels: MediaCarouselLabels;\n turns: boolean;\n atStart: boolean;\n atEnd: boolean;\n moving: boolean;\n paused: boolean;\n onPause: () => void;\n sound: { shown: boolean; on: boolean; toggle: () => void };\n onTurn: (delta: number) => void;\n onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => void;\n className: string;\n}>;\n\n/** Previous, pause / play, « Sound on », next: one toolbar that also takes ← → Home End. */\nconst CarouselToolbar = React.forwardRef<HTMLDivElement, ToolbarProps>(function CarouselToolbar(\n { labels, turns, atStart, atEnd, moving, paused, onPause, sound, onTurn, onKeyDown, className },\n ref,\n) {\n return (\n <div ref={ref} role=\"toolbar\" aria-orientation=\"horizontal\" className={className} onKeyDown={onKeyDown}>\n {turns && (\n <IconButton variant=\"secondary\" label={labels.previous} disabled={atStart} onClick={() => onTurn(-1)}>\n <ChevronGlyph direction=\"left\" className=\"h-5 w-5\" />\n </IconButton>\n )}\n {moving && (\n <IconButton variant=\"secondary\" label={paused ? labels.play : labels.pause} aria-pressed={paused} onClick={onPause}>\n {paused ? <PlayGlyph className=\"h-4 w-4\" /> : <PauseGlyph className=\"h-4 w-4\" />}\n </IconButton>\n )}\n {sound.shown && (\n <IconButton variant=\"secondary\" label={labels.soundOn} aria-pressed={sound.on} onClick={sound.toggle}>\n <VolumeGlyph muted={!sound.on} className=\"h-4 w-4\" />\n </IconButton>\n )}\n {turns && (\n <IconButton variant=\"secondary\" label={labels.next} disabled={atEnd} onClick={() => onTurn(1)}>\n <ChevronGlyph direction=\"right\" className=\"h-5 w-5\" />\n </IconButton>\n )}\n </div>\n );\n});\n\n/** Every slide's caption and text, and a screen demo's chapters, in a native `<details>`; the host's `children` inside. */\nfunction TextVersion({ slides, summary, className, children }: Readonly<{ slides: readonly CarouselSlide[]; summary: string; className: string; children?: React.ReactNode }>) {\n return (\n <details className={className}>\n <summary>{summary}</summary>\n <ol>\n {slides.map((slide) => (\n <li key={slide.id}>\n {slide.caption && <b>{slide.caption}</b>} {slide.text ?? slide.alt}\n {slide.chapters?.length ? (\n <ol>\n {slide.chapters.map((c) => (\n <li key={c.at}>{c.label}</li>\n ))}\n </ol>\n ) : null}\n </li>\n ))}\n </ol>\n {children}\n </details>\n );\n}\n\n/** The caption shown in the bar: the slide's, with the chapter under the playhead. */\nfunction barCaptionOf(placement: \"overlay\" | \"bar\", slide: CarouselSlide | undefined, chapter: CarouselChapter | undefined) {\n if (placement !== \"bar\" || !slide?.caption) return undefined;\n return chapter ? [slide.caption, chapter.label].join(\" · \") : slide.caption;\n}\n\n/** A sequence of clips, screen demos and stills, one at a time: buttons, arrow keys, swipe, and with `autoplay` it advances at the media's pace. */\nexport function MediaCarousel({\n slides,\n label,\n ratio = \"16 / 9\",\n autoplay,\n holds = \"pause-only\",\n sound,\n frame = \"product\",\n caption = \"overlay\",\n textVersion,\n children,\n labels: given,\n playerLabels,\n onSlideChange,\n renderLoop,\n className,\n ...props\n}: Readonly<MediaCarouselProps>) {\n const labels = { ...mediaCarouselLabels, ...given };\n const s = mediaCarousel({ frame });\n const total = slides.length;\n const root = React.useRef<HTMLElement>(null);\n const toolbar = React.useRef<HTMLDivElement>(null);\n const calm = useCalm();\n const loaded = usePageLoaded();\n const hidden = usePageHidden();\n const [soundChosen, toggleSound] = useSoundChoice();\n const [active, setActive] = React.useState(0);\n const [seen, setSeen] = React.useState<ReadonlySet<number>>(() => new Set([0]));\n const [broken, setBroken] = React.useState<ReadonlySet<string>>(() => new Set());\n const [paused, setPaused] = React.useState(false);\n const { hovered, focusIn, keyboardIn, handlers } = useHolds();\n const [onScreen, setOnScreen] = React.useState(() => typeof IntersectionObserver === \"undefined\");\n useInView(root, setOnScreen);\n\n const current = slides[active];\n const { chapter, onTime } = useChapter(current);\n const bounds = typeof autoplay === \"object\" ? autoplay : {};\n const wraps = Boolean(autoplay) && total > 1;\n const ownClips = !renderLoop && slides.some((slide) => slide.video);\n const moving = !calm && (wraps || ownClips);\n const held = holds === \"pointer-focus\" && (hovered || keyboardIn);\n const advancing = wraps && !calm && !paused && !held && onScreen && !hidden;\n const clipPlaying = onScreen && !paused && !hidden;\n const hasAudio = Boolean(sound) && !calm && ownClips && slides.some((slide) => slide.audio && slide.video);\n const audible = hasAudio && soundChosen && Boolean(current?.audio) && (hovered || focusIn);\n\n const show = (to: number) => {\n setActive(to);\n setSeen((before) => new Set(before).add(to));\n onSlideChange?.(to);\n };\n const turn = (delta: number) => {\n const to = wraps ? (active + delta + total) % total : clamp(active + delta, 0, total - 1);\n if (to === active) return;\n show(to);\n if (!wraps) keepFocus(toolbar.current, to, total);\n };\n const swipe = useSwipe(turn);\n const keys = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const moves: Partial<Record<string, () => void>> = {\n ArrowRight: () => turn(1),\n ArrowLeft: () => turn(-1),\n Home: () => turn(-active),\n End: () => turn(total - 1 - active),\n };\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n move();\n };\n const name = (i: number) => labels.slide.replace(\"{n}\", String(i + 1)).replace(\"{total}\", String(total));\n const clipOf = (slide: CarouselSlide, i: number): React.ReactNode => {\n if (!slide.video) return null;\n if (renderLoop) return renderLoop(slide.video, { poster: slide.src, inView: i === active });\n if (i !== active || calm || !loaded || broken.has(slide.id)) return null;\n return (\n <SlideClip\n key={slide.id}\n video={slide.video}\n poster={slide.src}\n playing={clipPlaying}\n muted={!audible}\n onTime={onTime}\n onBroken={() => setBroken((before) => new Set(before).add(slide.id))}\n />\n );\n };\n const dwell = current ? carouselDwell(current, bounds) : 0;\n const barCaption = barCaptionOf(caption, current, chapter);\n const showBar = total > 1 || moving || Boolean(barCaption);\n\n return (\n <section\n ref={root}\n aria-roledescription={labels.carousel}\n aria-label={label}\n data-frame={frame}\n data-advancing={advancing ? \"\" : undefined}\n className={s.root({ className })}\n {...handlers}\n {...props}\n >\n {wraps && (\n <style href=\"kz-media-carousel\" precedence=\"medium\">\n {CLOCK_CSS}\n </style>\n )}\n <div className={s.stage()} style={{ aspectRatio: ratio }}>\n <ul className={s.track()} {...swipe}>\n {slides.map((slide, i) => {\n const here = i === active;\n return (\n <li\n key={slide.id}\n aria-roledescription={labels.slideRole}\n aria-label={name(i)}\n data-kind={slide.kind ?? (slide.video ? \"clip\" : \"still\")}\n data-active={here ? \"\" : undefined}\n className={s.slide()}\n style={{ aspectRatio: ratio }}\n aria-hidden={here ? undefined : true}\n inert={here ? undefined : true}\n >\n <figure className=\"m-0 h-full w-full\">\n <SlideMedia\n slide={slide}\n first={i === 0}\n drawn={seen.has(i) || i === (active + 1) % total}\n clip={clipOf(slide, i)}\n ratio={ratio}\n closeLabel={labels.close}\n overlay={caption === \"overlay\"}\n playerLabels={playerLabels}\n />\n </figure>\n </li>\n );\n })}\n </ul>\n {wraps && <CarouselTicks slides={slides} active={active} calm={calm} dwell={dwell} advancing={advancing} onEnd={() => turn(1)} s={s} />}\n </div>\n {showBar && (\n <div className={s.bar()}>\n <p className={s.barCaption()} aria-live={advancing ? \"off\" : \"polite\"}>\n {total > 1 && (\n <span className={s.count()}>\n {active + 1} / {total}\n </span>\n )}\n {barCaption && <> {barCaption}</>}\n </p>\n <CarouselToolbar\n ref={toolbar}\n labels={labels}\n turns={total > 1}\n atStart={!wraps && active === 0}\n atEnd={!wraps && active === total - 1}\n moving={moving}\n paused={paused}\n onPause={() => setPaused((p) => !p)}\n sound={{ shown: hasAudio, on: soundChosen, toggle: toggleSound }}\n onTurn={turn}\n onKeyDown={keys}\n className={s.buttons()}\n />\n </div>\n )}\n {textVersion ? (\n <TextVersion slides={slides} summary={labels.textVersion} className={s.text()}>\n {children}\n </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ACP,qBAAC,UAAK,WAAW,EAAE,MAAM,GACtB;AAAA,uBAAS;AAAA,cAAE;AAAA,cAAI;AAAA,eAClB;AAAA,YAED,cAAc,iCAAE;AAAA;AAAA,cAAE;AAAA,eAAW;AAAA,aAChC;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,KAAK;AAAA,cACL;AAAA,cACA,OAAO,QAAQ;AAAA,cACf,SAAS,CAAC,SAAS,WAAW;AAAA,cAC9B,OAAO,CAAC,SAAS,WAAW,QAAQ;AAAA,cACpC;AAAA,cACA;AAAA,cACA,SAAS,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;AAAA,cAClC,OAAO,EAAE,OAAO,UAAU,IAAI,aAAa,QAAQ,YAAY;AAAA,cAC/D,QAAQ;AAAA,cACR,WAAW;AAAA,cACX,WAAW,EAAE,QAAQ;AAAA;AAAA,UACvB;AAAA,WACF;AAAA,QAED,cACC,oBAAC,eAAY,QAAgB,SAAS,OAAO,aAAa,WAAW,EAAE,KAAK,GACzE,UACH,IAEA;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["CarouselToolbar"]}
@@ -1,3 +1,6 @@
1
+ import {
2
+ HeroStage
3
+ } from "./chunk-VUD4IEVJ.js";
1
4
  import {
2
5
  warnDeprecated
3
6
  } from "./chunk-KGLRZMCY.js";
@@ -27,10 +30,7 @@ function ProductPage({ brand, mark, title, lead, facts, actions, visual, visualL
27
30
  actions && /* @__PURE__ */ jsx("div", { className: "kz-tpl-actions", children: actions })
28
31
  ] })
29
32
  ] }),
30
- visual && /* @__PURE__ */ jsxs("figure", { className: "kz-tpl-stage", children: [
31
- /* @__PURE__ */ jsx("div", { className: "kz-tpl-stage-bar", "aria-hidden": true, children: visualLabel && /* @__PURE__ */ jsx("span", { children: visualLabel }) }),
32
- visual
33
- ] })
33
+ visual && /* @__PURE__ */ jsx(HeroStage, { visual, label: visualLabel })
34
34
  ] }) }) }),
35
35
  /* @__PURE__ */ jsx(Section, { id: "why", eyebrow: reasonsHeading.eyebrow, title: reasonsHeading.title, lead: reasonsHeading.lead, reveal: true, children: /* @__PURE__ */ jsx(CardGrid, { min: 260, fit: "fit", children: reasons.map((r) => /* @__PURE__ */ jsx(
36
36
  ArgumentCard,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/product-page/product-page.tsx"],"sourcesContent":["// Server-safe. A product's overview: the hero with the product's mark, its promise, facts and main action beside a live\n// window of the product; the traps it removes as compact argument cards; its decisions with their cost; the promise a\n// bird keeps; the closing call. Under the product's brand (`brand` → `.brand-<id>`).\nimport { ArgumentCard } from \"@krizaka/ui/argument-card\";\nimport { CardGrid } from \"@krizaka/ui/card-grid\";\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { type Decision, DecisionList } from \"@krizaka/ui/decision-list\";\nimport { MascotQuote } from \"@krizaka/ui/mascot-quote\";\nimport type { MascotBird } from \"@krizaka/ui/mascots\";\nimport { type Fact, Facts, Page, Section } from \"@krizaka/ui/page\";\nimport type { LinkComponent } from \"@krizaka/ui/page-hero\";\nimport { SectionBackdrop } from \"@krizaka/ui/section-backdrop\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { warnDeprecated } from \"../deprecated\";\n\nexport interface ProductReason {\n /** A stable key (the card's anchor). */\n id: string;\n /** Its name. */\n title: React.ReactNode;\n /** The trap elsewhere, in one line. */\n trap: React.ReactNode;\n /** The signature icon. */\n icon?: React.ReactNode;\n /** The bird in the corner (whose rule it is). */\n mark?: React.ReactNode;\n /** Where the long version lives (a page) — or nothing, and the card stays its face. */\n href?: string;\n}\n\nexport type ProductPageProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The product's brand (`sovkora`, `verikora`…): the page wears `.brand-<id>`. */\n brand?: string;\n /** The product's mark and name, above the title. */\n mark?: React.ReactNode;\n /** The promise: the page's `h1`. */\n title: React.ReactNode;\n /** One or two sentences under it. */\n lead?: React.ReactNode;\n /** Facts under the lead (open source, a law it keeps). */\n facts?: readonly Fact[];\n /** The hero's actions. */\n actions?: React.ReactNode;\n /** The product alive, in a window beside the words. */\n visual?: React.ReactNode;\n /** The window's caption. */\n visualLabel?: React.ReactNode;\n /** The reasons' section heading. */\n reasonsHeading: { eyebrow?: React.ReactNode; title: React.ReactNode; lead?: React.ReactNode };\n /** The words of the cards: the trap's label (read, not shown) and the way in. */\n reasonLabels: { trap: string; more: React.ReactNode };\n /** The traps it removes. */\n reasons: readonly ProductReason[];\n /** The decisions' section: heading, decisions and their four labels. */\n decisions?: { eyebrow?: React.ReactNode; title: React.ReactNode; items: readonly Decision[]; labels: { chose: React.ReactNode; refused: React.ReactNode; because: React.ReactNode; cost: React.ReactNode } };\n /** The promise a bird keeps, under the decisions. */\n promise?: { bird: MascotBird; label: React.ReactNode; text: React.ReactNode };\n /** More sections between the decisions and the closing call (the tour, the platform, a comparison). */\n children?: React.ReactNode;\n /** The closing call. */\n closing?: { title: React.ReactNode; body?: React.ReactNode; actions: React.ReactNode };\n /** The app's link component (Next's `Link`). */\n linkAs?: LinkComponent;\n};\n\n/**\n * A product's overview: split hero, traps as compact cards, decisions with their cost, the bird's promise, closing call.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function ProductPage({ brand, mark, title, lead, facts, actions, visual, visualLabel, reasonsHeading, reasonLabels, reasons, decisions, promise, closing, linkAs, className, children, ...props }: ProductPageProps) {\n warnDeprecated(\"product-page\");\n return (\n <div className={cn(brand && \"brand-\" + brand, className)} {...props}>\n <SectionBackdrop as=\"header\" grid className=\"kz-hero\">\n <Page>\n <div className={visual ? \"kz-tpl-split\" : undefined}>\n <div className=\"kz-hero-text\">\n {mark && <p className=\"kz-eyebrow\">{mark}</p>}\n <h1 className=\"kz-hero-title\">{title}</h1>\n {lead && <p className=\"kz-hero-lead\">{lead}</p>}\n {(facts || actions) && (\n <div className=\"kz-hero-extra\">\n {facts && <Facts items={facts} />}\n {actions && <div className=\"kz-tpl-actions\">{actions}</div>}\n </div>\n )}\n </div>\n {visual && (\n <figure className=\"kz-tpl-stage\">\n <div className=\"kz-tpl-stage-bar\" aria-hidden>\n {visualLabel && <span>{visualLabel}</span>}\n </div>\n {visual}\n </figure>\n )}\n </div>\n </Page>\n </SectionBackdrop>\n <Section id=\"why\" eyebrow={reasonsHeading.eyebrow} title={reasonsHeading.title} lead={reasonsHeading.lead} reveal>\n <CardGrid min={260} fit=\"fit\">\n {reasons.map((r) => (\n <ArgumentCard\n key={r.id}\n id={`why-${r.id}`}\n icon={r.icon}\n title={r.title}\n mark={r.mark}\n hook={{ label: reasonLabels.trap, text: r.trap }}\n more={r.href ? { href: r.href, label: reasonLabels.more } : undefined}\n linkAs={linkAs}\n />\n ))}\n </CardGrid>\n </Section>\n {decisions && (\n <Section id=\"decisions\" eyebrow={decisions.eyebrow} title={decisions.title} divider reveal>\n <DecisionList decisions={decisions.items} labels={decisions.labels} />\n {promise && (\n <div className=\"kz-tpl-promise\">\n <MascotQuote variant=\"callout\" bird={promise.bird} mood=\"welcome\" label={promise.label}>\n {promise.text}\n </MascotQuote>\n </div>\n )}\n </Section>\n )}\n {children}\n {closing && (\n <Section spacing=\"sm\" aria-labelledby=\"product-closing\">\n <CtaPanel id=\"product-closing\" title={closing.title} body={closing.body} reveal>\n {closing.actions}\n </CtaPanel>\n </Section>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAGA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAwB,oBAAoB;AAC5C,SAAS,mBAAmB;AAE5B,SAAoB,OAAO,MAAM,eAAe;AAEhD,SAAS,uBAAuB;AAoET,cAIP,YAJO;AARhB,SAAS,YAAY,EAAE,OAAO,MAAM,OAAO,MAAM,OAAO,SAAS,QAAQ,aAAa,gBAAgB,cAAc,SAAS,WAAW,SAAS,SAAS,QAAQ,WAAW,UAAU,GAAG,MAAM,GAAqB;AAC1N,iBAAe,cAAc;AAC7B,SACE,qBAAC,SAAI,WAAW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AAO,UAAU,OAAO,SAAO,MAAC,QAAM,MACxF;AAAA,0BAAC,gBAAa,WAAW,UAAU,OAAO,QAAQ,UAAU,QAAQ;AAAA,MACnE,WACC,oBAAC,SAAI,WAAU,kBACb,8BAAC,eAAY,SAAQ,WAAU,MAAM,QAAQ,MAAM,MAAK,WAAU,OAAO,QAAQ,OAC9E,kBAAQ,MACX,GACF;AAAA,OAEJ;AAAA,IAED;AAAA,IACA,WACC,oBAAC,WAAQ,SAAQ,MAAK,mBAAgB,mBACpC,8BAAC,YAAS,IAAG,mBAAkB,OAAO,QAAQ,OAAO,MAAM,QAAQ,MAAM,QAAM,MAC5E,kBAAQ,SACX,GACF;AAAA,KAEJ;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/product-page/product-page.tsx"],"sourcesContent":["// Server-safe. A product's overview: the hero with the product's mark, its promise, facts and main action beside a live\n// window of the product; the traps it removes as compact argument cards; its decisions with their cost; the promise a\n// bird keeps; the closing call. Under the product's brand (`brand` → `.brand-<id>`).\nimport { ArgumentCard } from \"@krizaka/ui/argument-card\";\nimport { CardGrid } from \"@krizaka/ui/card-grid\";\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { type Decision, DecisionList } from \"@krizaka/ui/decision-list\";\nimport { MascotQuote } from \"@krizaka/ui/mascot-quote\";\nimport type { MascotBird } from \"@krizaka/ui/mascots\";\nimport { type Fact, Facts, Page, Section } from \"@krizaka/ui/page\";\nimport type { LinkComponent } from \"@krizaka/ui/page-hero\";\nimport { SectionBackdrop } from \"@krizaka/ui/section-backdrop\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { warnDeprecated } from \"../deprecated\";\nimport { HeroStage } from \"../page/hero-stage\";\n\nexport interface ProductReason {\n /** A stable key (the card's anchor). */\n id: string;\n /** Its name. */\n title: React.ReactNode;\n /** The trap elsewhere, in one line. */\n trap: React.ReactNode;\n /** The signature icon. */\n icon?: React.ReactNode;\n /** The bird in the corner (whose rule it is). */\n mark?: React.ReactNode;\n /** Where the long version lives (a page) — or nothing, and the card stays its face. */\n href?: string;\n}\n\nexport type ProductPageProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The product's brand (`sovkora`, `verikora`…): the page wears `.brand-<id>`. */\n brand?: string;\n /** The product's mark and name, above the title. */\n mark?: React.ReactNode;\n /** The promise: the page's `h1`. */\n title: React.ReactNode;\n /** One or two sentences under it. */\n lead?: React.ReactNode;\n /** Facts under the lead (open source, a law it keeps). */\n facts?: readonly Fact[];\n /** The hero's actions. */\n actions?: React.ReactNode;\n /** The product alive, in a window beside the words. */\n visual?: React.ReactNode;\n /** The window's caption. */\n visualLabel?: React.ReactNode;\n /** The reasons' section heading. */\n reasonsHeading: { eyebrow?: React.ReactNode; title: React.ReactNode; lead?: React.ReactNode };\n /** The words of the cards: the trap's label (read, not shown) and the way in. */\n reasonLabels: { trap: string; more: React.ReactNode };\n /** The traps it removes. */\n reasons: readonly ProductReason[];\n /** The decisions' section: heading, decisions and their four labels. */\n decisions?: { eyebrow?: React.ReactNode; title: React.ReactNode; items: readonly Decision[]; labels: { chose: React.ReactNode; refused: React.ReactNode; because: React.ReactNode; cost: React.ReactNode } };\n /** The promise a bird keeps, under the decisions. */\n promise?: { bird: MascotBird; label: React.ReactNode; text: React.ReactNode };\n /** More sections between the decisions and the closing call (the tour, the platform, a comparison). */\n children?: React.ReactNode;\n /** The closing call. */\n closing?: { title: React.ReactNode; body?: React.ReactNode; actions: React.ReactNode };\n /** The app's link component (Next's `Link`). */\n linkAs?: LinkComponent;\n};\n\n/**\n * A product's overview: split hero, traps as compact cards, decisions with their cost, the bird's promise, closing call.\n * @deprecated Since 3.55 (ADR-006, krizaka-ui#674): no product uses it. Removed in 4.0.\n */\nexport function ProductPage({ brand, mark, title, lead, facts, actions, visual, visualLabel, reasonsHeading, reasonLabels, reasons, decisions, promise, closing, linkAs, className, children, ...props }: ProductPageProps) {\n warnDeprecated(\"product-page\");\n return (\n <div className={cn(brand && \"brand-\" + brand, className)} {...props}>\n <SectionBackdrop as=\"header\" grid className=\"kz-hero\">\n <Page>\n <div className={visual ? \"kz-tpl-split\" : undefined}>\n <div className=\"kz-hero-text\">\n {mark && <p className=\"kz-eyebrow\">{mark}</p>}\n <h1 className=\"kz-hero-title\">{title}</h1>\n {lead && <p className=\"kz-hero-lead\">{lead}</p>}\n {(facts || actions) && (\n <div className=\"kz-hero-extra\">\n {facts && <Facts items={facts} />}\n {actions && <div className=\"kz-tpl-actions\">{actions}</div>}\n </div>\n )}\n </div>\n {visual && <HeroStage visual={visual} label={visualLabel} />}\n </div>\n </Page>\n </SectionBackdrop>\n <Section id=\"why\" eyebrow={reasonsHeading.eyebrow} title={reasonsHeading.title} lead={reasonsHeading.lead} reveal>\n <CardGrid min={260} fit=\"fit\">\n {reasons.map((r) => (\n <ArgumentCard\n key={r.id}\n id={`why-${r.id}`}\n icon={r.icon}\n title={r.title}\n mark={r.mark}\n hook={{ label: reasonLabels.trap, text: r.trap }}\n more={r.href ? { href: r.href, label: reasonLabels.more } : undefined}\n linkAs={linkAs}\n />\n ))}\n </CardGrid>\n </Section>\n {decisions && (\n <Section id=\"decisions\" eyebrow={decisions.eyebrow} title={decisions.title} divider reveal>\n <DecisionList decisions={decisions.items} labels={decisions.labels} />\n {promise && (\n <div className=\"kz-tpl-promise\">\n <MascotQuote variant=\"callout\" bird={promise.bird} mood=\"welcome\" label={promise.label}>\n {promise.text}\n </MascotQuote>\n </div>\n )}\n </Section>\n )}\n {children}\n {closing && (\n <Section spacing=\"sm\" aria-labelledby=\"product-closing\">\n <CtaPanel id=\"product-closing\" title={closing.title} body={closing.body} reveal>\n {closing.actions}\n </CtaPanel>\n </Section>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAGA,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAwB,oBAAoB;AAC5C,SAAS,mBAAmB;AAE5B,SAAoB,OAAO,MAAM,eAAe;AAEh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Aa,KAAK,IAAI;AAAA,QAC5D;AAAA;AAAA,MAPK,EAAE;AAAA,IAQT,CACD,GACH,GACF;AAAA,IACC,aACC,qBAAC,WAAQ,IAAG,aAAY,SAAS,UAAU,SAAS,OAAO,UAAU,OAAO,SAAO,MAAC,QAAM,MACxF;AAAA,0BAAC,gBAAa,WAAW,UAAU,OAAO,QAAQ,UAAU,QAAQ;AAAA,MACnE,WACC,oBAAC,SAAI,WAAU,kBACb,8BAAC,eAAY,SAAQ,WAAU,MAAM,QAAQ,MAAM,MAAK,WAAU,OAAO,QAAQ,OAC9E,kBAAQ,MACX,GACF;AAAA,OAEJ;AAAA,IAED;AAAA,IACA,WACC,oBAAC,WAAQ,SAAQ,MAAK,mBAAgB,mBACpC,8BAAC,YAAS,IAAG,mBAAkB,OAAO,QAAQ,OAAO,MAAM,QAAQ,MAAM,QAAM,MAC5E,kBAAQ,SACX,GACF;AAAA,KAEJ;AAEJ;","names":[]}
@@ -88,7 +88,7 @@ declare const SECTION_DEFINITIONS: readonly [SectionDefinitionOf<"hero", readonl
88
88
  }, z.core.$strip>;
89
89
  }>, SectionDefinitionOf<"booking", readonly ["strip", "panel", "closing", "sticky"], z.ZodMiniObject<{
90
90
  serviceId: z.ZodMiniOptional<z.ZodMiniString<string>>;
91
- count: z.ZodMiniUnion<[z.ZodMiniLiteral<3 | 4 | 6>, z.ZodMiniLiteral<3 | 4 | 6>]>;
91
+ count: z.ZodMiniUnion<[z.ZodMiniLiteral<6 | 3 | 4>, z.ZodMiniLiteral<6 | 3 | 4>]>;
92
92
  }, z.core.$strip>, Record<never, never>>, SectionDefinitionOf<"gallery", readonly ["mosaic", "filmstrip", "wall", "grid"], z.ZodMiniObject<{
93
93
  source: z.ZodMiniEnum<{
94
94
  all: "all";
@@ -87,7 +87,7 @@ declare const SECTION_DEFINITIONS: readonly [SectionDefinitionOf<"hero", readonl
87
87
  }, z.core.$strip>;
88
88
  }>, SectionDefinitionOf<"booking", readonly ["strip", "panel", "closing", "sticky"], z.ZodMiniObject<{
89
89
  serviceId: z.ZodMiniOptional<z.ZodMiniString<string>>;
90
- count: z.ZodMiniUnion<[z.ZodMiniLiteral<3 | 4 | 6>, z.ZodMiniLiteral<3 | 4 | 6>]>;
90
+ count: z.ZodMiniUnion<[z.ZodMiniLiteral<4 | 6 | 3>, z.ZodMiniLiteral<4 | 6 | 3>]>;
91
91
  }, z.core.$strip>, Record<never, never>>, SectionDefinitionOf<"gallery", readonly ["mosaic", "filmstrip", "wall", "grid"], z.ZodMiniObject<{
92
92
  source: z.ZodMiniEnum<{
93
93
  all: "all";
@@ -129,7 +129,7 @@ declare const SECTION_DEFINITIONS: readonly [SectionDefinitionOf<"hero", readonl
129
129
  best: "best";
130
130
  latest: "latest";
131
131
  }>;
132
- count: z.ZodMiniUnion<[z.ZodMiniLiteral<3 | 1 | 2>, z.ZodMiniLiteral<3 | 1 | 2>]>;
132
+ count: z.ZodMiniUnion<[z.ZodMiniLiteral<1 | 2 | 3>, z.ZodMiniLiteral<1 | 2 | 3>]>;
133
133
  }, z.core.$strip>, Record<never, never>>, SectionDefinitionOf<"bulletin", readonly ["board", "banner"], z.ZodMiniObject<{}, z.core.$strip>, {
134
134
  flyer: z.ZodMiniObject<{
135
135
  text: z.ZodMiniString<string>;
package/dist/shop.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as ShopPage } from './schema-DgjBz7-8.js';
2
- export { L as LocalizedText, P as ParsedSection, b as SECTION_DEFINITIONS, c as SECTION_TYPES, d as SHOP_SCHEMA_VERSION, a as Section, e as SectionDefinition, f as SectionOf, g as SectionSpec, h as SectionType, i as ShopPageIssue, j as ShopPageResult, k as defineSection, p as parseShopPage, s as sectionDefinition, l as shopPageSchema } from './schema-DgjBz7-8.js';
1
+ import { S as ShopPage } from './schema-CL7t7xqb.js';
2
+ export { L as LocalizedText, P as ParsedSection, b as SECTION_DEFINITIONS, c as SECTION_TYPES, d as SHOP_SCHEMA_VERSION, a as Section, e as SectionDefinition, f as SectionOf, g as SectionSpec, h as SectionType, i as ShopPageIssue, j as ShopPageResult, k as defineSection, p as parseShopPage, s as sectionDefinition, l as shopPageSchema } from './schema-CL7t7xqb.js';
3
3
  export { b as ShopFrame, c as ShopFrameProps, a as ShopPhoto, d as ShopSection, S as ShopSectionProps } from './frame-CmDztC_y.js';
4
4
  import 'zod/mini';
5
5
  import 'react';
package/dist/virtual.d.ts CHANGED
@@ -6,8 +6,8 @@ import * as React from 'react';
6
6
  declare const virtual: tailwind_variants.TVReturnType<{
7
7
  [key: string]: {
8
8
  [key: string]: tailwind_variants.ClassValue | {
9
- viewport?: tailwind_variants.ClassValue;
10
9
  list?: tailwind_variants.ClassValue;
10
+ viewport?: tailwind_variants.ClassValue;
11
11
  item?: tailwind_variants.ClassValue;
12
12
  row?: tailwind_variants.ClassValue;
13
13
  empty?: tailwind_variants.ClassValue;
@@ -16,8 +16,8 @@ declare const virtual: tailwind_variants.TVReturnType<{
16
16
  } | {
17
17
  [x: string]: {
18
18
  [x: string]: tailwind_variants.ClassValue | {
19
- viewport?: tailwind_variants.ClassValue;
20
19
  list?: tailwind_variants.ClassValue;
20
+ viewport?: tailwind_variants.ClassValue;
21
21
  item?: tailwind_variants.ClassValue;
22
22
  row?: tailwind_variants.ClassValue;
23
23
  empty?: tailwind_variants.ClassValue;
@@ -32,8 +32,8 @@ declare const virtual: tailwind_variants.TVReturnType<{
32
32
  }, undefined, {
33
33
  [key: string]: {
34
34
  [key: string]: tailwind_variants.ClassValue | {
35
- viewport?: tailwind_variants.ClassValue;
36
35
  list?: tailwind_variants.ClassValue;
36
+ viewport?: tailwind_variants.ClassValue;
37
37
  item?: tailwind_variants.ClassValue;
38
38
  row?: tailwind_variants.ClassValue;
39
39
  empty?: tailwind_variants.ClassValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krizaka/ui",
3
- "version": "4.2.1",
3
+ "version": "4.4.0",
4
4
  "description": "The Krizaka front-end platform's components: the primitives (button, card, dialog, toast, menu, field, tabs, chip, switch, slider, command palette, theme, countdown…) on the semantic --kz-* tokens, the animated marks (Krizaka, Sovkora, Verikora, Folioviv) and the motion signature — web and /native.",
5
5
  "keywords": [
6
6
  "krizaka",
@@ -1012,7 +1012,7 @@
1012
1012
  ],
1013
1013
  "peerDependencies": {
1014
1014
  "@krizaka/query": ">=0.3.0",
1015
- "@krizaka/tailwind": ">=4.2.1",
1015
+ "@krizaka/tailwind": ">=4.4.0",
1016
1016
  "@maplibre/maplibre-react-native": ">=11",
1017
1017
  "@shopify/flash-list": ">=2",
1018
1018
  "expo-camera": ">=16",
@@ -3480,10 +3480,10 @@
3480
3480
  "sonner": "^2.0.8",
3481
3481
  "tailwind-variants": "^3.3.1",
3482
3482
  "zod": "^4.6.7",
3483
- "@krizaka/pacer": "^0.2.0",
3484
- "@krizaka/tokens": "^4.2.1",
3483
+ "@krizaka/icons": "^0.10.0",
3485
3484
  "@krizaka/intl": "^0.4.1",
3486
- "@krizaka/icons": "^0.10.0"
3485
+ "@krizaka/pacer": "^0.2.0",
3486
+ "@krizaka/tokens": "^4.4.0"
3487
3487
  },
3488
3488
  "scripts": {
3489
3489
  "build": "node -e \"const fs=require('node:fs');fs.rmSync('dist',{recursive:true,force:true});for(const f of fs.readdirSync('registry/examples',{recursive:true}))if(/\\.(js|d\\.ts)$/.test(f))fs.rmSync('registry/examples/'+f)\" && tsup && node -e \"require('node:fs').copyFileSync('src/motion.css','dist/motion.css');require('node:fs').copyFileSync('src/blocks.css','dist/blocks.css');require('node:fs').copyFileSync('src/story.css','dist/story.css')\" && node scripts/build-registry.mjs",