@krizaka/ui 3.70.0 → 3.72.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.
Files changed (306) hide show
  1. package/dist/account-menu.d.ts +1 -1
  2. package/dist/account-menu.js +1 -1
  3. package/dist/account-settings.d.ts +1 -1
  4. package/dist/account-settings.js +1 -1
  5. package/dist/avatar/defaults.d.ts +22 -2
  6. package/dist/avatar/defaults.js +20 -7
  7. package/dist/avatar/defaults.js.map +1 -1
  8. package/dist/{avatar-BdZcfkWR.d.ts → avatar-B_na7r1U.d.ts} +16 -0
  9. package/dist/avatar.d.ts +22 -2
  10. package/dist/avatar.js +20 -7
  11. package/dist/avatar.js.map +1 -1
  12. package/dist/blocks.css +37 -0
  13. package/dist/chat.js +1 -1
  14. package/dist/chunk-3PRYL2LS.js +2 -0
  15. package/dist/chunk-3PRYL2LS.js.map +1 -0
  16. package/dist/{chunk-HK525THY.js → chunk-5MPPIGCB.js} +18 -7
  17. package/dist/chunk-5MPPIGCB.js.map +1 -0
  18. package/dist/{chunk-CSRKYZ53.js → chunk-CZHPWLNW.js} +1 -1
  19. package/dist/{chunk-PZ4FJOD5.js → chunk-HLEBSAGC.js} +5 -1
  20. package/dist/{chunk-PZ4FJOD5.js.map → chunk-HLEBSAGC.js.map} +1 -1
  21. package/dist/chunk-M3T5RQYV.js +34 -0
  22. package/dist/chunk-M3T5RQYV.js.map +1 -0
  23. package/dist/{chunk-EUJ7337V.js → chunk-TISDOZH3.js} +18 -7
  24. package/dist/chunk-TISDOZH3.js.map +1 -0
  25. package/dist/chunk-W64RAX4N.js +79 -0
  26. package/dist/chunk-W64RAX4N.js.map +1 -0
  27. package/dist/chunk-ZFR6ZNXD.js +203 -0
  28. package/dist/chunk-ZFR6ZNXD.js.map +1 -0
  29. package/dist/collection-switcher.d.ts +1 -1
  30. package/dist/{default-avatar-D9kiSFNB.d.ts → default-avatar-BL0nJFti.d.ts} +16 -0
  31. package/dist/entity-header.d.ts +1 -1
  32. package/dist/{frame-D6Xv83t8.d.ts → frame-CNZ5VgDD.d.ts} +11 -4
  33. package/dist/index.js +7 -7
  34. package/dist/kind-config-editor.js +3 -2
  35. package/dist/kind-config-editor.js.map +1 -1
  36. package/dist/map.d.ts +6 -6
  37. package/dist/match-dialog.js +1 -1
  38. package/dist/media-grid.d.ts +16 -0
  39. package/dist/media-grid.js +1 -1
  40. package/dist/money-input.js +6 -70
  41. package/dist/money-input.js.map +1 -1
  42. package/dist/native.d.ts +16 -0
  43. package/dist/native.js +17 -6
  44. package/dist/native.js.map +1 -1
  45. package/dist/nav-bar.d.ts +13 -2
  46. package/dist/nav-bar.js +71 -54
  47. package/dist/nav-bar.js.map +1 -1
  48. package/dist/notification-preferences.js +2 -1
  49. package/dist/notification-preferences.js.map +1 -1
  50. package/dist/price-catalogue-editor.d.ts +117 -0
  51. package/dist/price-catalogue-editor.js +194 -0
  52. package/dist/price-catalogue-editor.js.map +1 -0
  53. package/dist/promo-code-field.js +1 -1
  54. package/dist/schema-DgjBz7-8.d.ts +242 -0
  55. package/dist/schema-form.d.ts +106 -0
  56. package/dist/schema-form.js +268 -0
  57. package/dist/schema-form.js.map +1 -0
  58. package/dist/shop/booking.d.ts +2 -2
  59. package/dist/shop/booking.js +1 -1
  60. package/dist/shop/booking.js.map +1 -1
  61. package/dist/shop/bulletin.js +1 -1
  62. package/dist/shop/faq.d.ts +2 -1
  63. package/dist/shop/faq.js +1 -1
  64. package/dist/shop/faq.js.map +1 -1
  65. package/dist/shop/gallery.js +1 -1
  66. package/dist/shop/look.d.ts +43 -0
  67. package/dist/shop/look.js +52 -0
  68. package/dist/shop/look.js.map +1 -0
  69. package/dist/shop/policies.d.ts +2 -1
  70. package/dist/shop/policies.js +1 -1
  71. package/dist/shop/policies.js.map +1 -1
  72. package/dist/shop/reviews.d.ts +2 -1
  73. package/dist/shop/reviews.js +1 -1
  74. package/dist/shop/reviews.js.map +1 -1
  75. package/dist/shop/services.js +1 -1
  76. package/dist/shop/social.js +1 -1
  77. package/dist/shop/story.d.ts +2 -1
  78. package/dist/shop/story.js +1 -1
  79. package/dist/shop/story.js.map +1 -1
  80. package/dist/shop/team.js +1 -1
  81. package/dist/shop/video.js +1 -1
  82. package/dist/shop/visit.js +1 -1
  83. package/dist/shop-composer.d.ts +29 -0
  84. package/dist/shop-composer.js +156 -89
  85. package/dist/shop-composer.js.map +1 -1
  86. package/dist/shop.d.ts +6 -240
  87. package/dist/shop.js +24 -212
  88. package/dist/shop.js.map +1 -1
  89. package/dist/switch.js +2 -1
  90. package/dist/vertical-video.js +1 -1
  91. package/dist/wall.d.ts +7 -1
  92. package/dist/wall.js +5 -4
  93. package/dist/wall.js.map +1 -1
  94. package/package.json +59 -9
  95. package/registry/account-menu.json +1 -1
  96. package/registry/account-settings.json +1 -1
  97. package/registry/achievement.json +1 -1
  98. package/registry/action-bar.json +1 -1
  99. package/registry/activity-feed.json +1 -1
  100. package/registry/agenda.json +1 -1
  101. package/registry/alert.json +1 -1
  102. package/registry/analysis-report.json +1 -1
  103. package/registry/anatomy-plate.json +1 -1
  104. package/registry/app-frame.json +2 -2
  105. package/registry/app-header.json +1 -1
  106. package/registry/app-shell.json +1 -1
  107. package/registry/argument-card.json +1 -1
  108. package/registry/audio-player.json +1 -1
  109. package/registry/auth-layout.json +1 -1
  110. package/registry/avatar.json +4 -4
  111. package/registry/badge.json +1 -1
  112. package/registry/bird-plate.json +1 -1
  113. package/registry/button.json +1 -1
  114. package/registry/captcha.json +1 -1
  115. package/registry/card-grid.json +1 -1
  116. package/registry/card.json +1 -1
  117. package/registry/catalogue-page.json +1 -1
  118. package/registry/changelog-page.json +1 -1
  119. package/registry/chapter.json +1 -1
  120. package/registry/chat.json +1 -1
  121. package/registry/checkbox.json +1 -1
  122. package/registry/chip-link.json +1 -1
  123. package/registry/chip-row.json +1 -1
  124. package/registry/chip.json +1 -1
  125. package/registry/choice-grid.json +1 -1
  126. package/registry/code-block.json +1 -1
  127. package/registry/collection-switcher.json +1 -1
  128. package/registry/combobox.json +1 -1
  129. package/registry/command.json +1 -1
  130. package/registry/comparison-table.json +1 -1
  131. package/registry/component-page.json +1 -1
  132. package/registry/confirm-button.json +1 -1
  133. package/registry/contact-page.json +1 -1
  134. package/registry/continue-prompt.json +1 -1
  135. package/registry/copy-button.json +1 -1
  136. package/registry/countdown.json +1 -1
  137. package/registry/cover-hero.json +1 -1
  138. package/registry/cta-panel.json +1 -1
  139. package/registry/dashboard-layout.json +1 -1
  140. package/registry/data-table.json +1 -1
  141. package/registry/date-picker.json +1 -1
  142. package/registry/decision-list.json +1 -1
  143. package/registry/description-list.json +1 -1
  144. package/registry/desktop-window.json +1 -1
  145. package/registry/detail-layout.json +1 -1
  146. package/registry/dialog.json +1 -1
  147. package/registry/docs-article-page.json +1 -1
  148. package/registry/docs-hub-page.json +1 -1
  149. package/registry/docs-layout.json +1 -1
  150. package/registry/docs-nav.json +1 -1
  151. package/registry/document-viewer.json +1 -1
  152. package/registry/doodle.json +1 -1
  153. package/registry/drop-overlay.json +1 -1
  154. package/registry/dropdown-menu.json +1 -1
  155. package/registry/elephant.json +2 -2
  156. package/registry/embed-facade.json +1 -1
  157. package/registry/empty-state.json +1 -1
  158. package/registry/engine-flow.json +1 -1
  159. package/registry/entity-header.json +1 -1
  160. package/registry/environment-notice.json +1 -1
  161. package/registry/error-page.json +1 -1
  162. package/registry/examples/price-catalogue-editor/default.d.ts +4 -0
  163. package/registry/examples/price-catalogue-editor/default.js +47 -0
  164. package/registry/examples/price-catalogue-editor/default.tsx +25 -0
  165. package/registry/examples/schema-form/default.d.ts +4 -0
  166. package/registry/examples/schema-form/default.js +29 -0
  167. package/registry/examples/schema-form/default.tsx +27 -0
  168. package/registry/examples/wall/pinned-note.js +2 -1
  169. package/registry/examples/wall/pinned-note.tsx +2 -1
  170. package/registry/field.json +1 -1
  171. package/registry/file-upload.json +1 -1
  172. package/registry/filter-bar.json +1 -1
  173. package/registry/flock.json +1 -1
  174. package/registry/footnote.json +1 -1
  175. package/registry/force-update-screen.json +1 -1
  176. package/registry/form.json +1 -1
  177. package/registry/gallery-page.json +1 -1
  178. package/registry/genui.json +1 -1
  179. package/registry/glossary-term.json +1 -1
  180. package/registry/glossary.json +1 -1
  181. package/registry/glow-card.json +1 -1
  182. package/registry/goal-gauge.json +1 -1
  183. package/registry/grade-stamp.json +1 -1
  184. package/registry/how-it-works-page.json +1 -1
  185. package/registry/image-cropper.json +1 -1
  186. package/registry/index.json +81 -8
  187. package/registry/iso.json +1 -1
  188. package/registry/kanban.json +1 -1
  189. package/registry/kbd.json +1 -1
  190. package/registry/kind-config-editor.json +1 -1
  191. package/registry/kpi-explained.json +1 -1
  192. package/registry/landing-page.json +1 -1
  193. package/registry/landscape.json +1 -1
  194. package/registry/language-switch.json +1 -1
  195. package/registry/legal-page.json +1 -1
  196. package/registry/link-card.json +1 -1
  197. package/registry/list.json +1 -1
  198. package/registry/loader.json +1 -1
  199. package/registry/longform-page.json +1 -1
  200. package/registry/maintenance-screen.json +1 -1
  201. package/registry/map.json +2 -2
  202. package/registry/margin-layout.json +1 -1
  203. package/registry/markdown.json +1 -1
  204. package/registry/marketing-layout.json +1 -1
  205. package/registry/marquee.json +1 -1
  206. package/registry/mascot-quote.json +1 -1
  207. package/registry/mascot-state.json +1 -1
  208. package/registry/mascots.json +1 -1
  209. package/registry/match-dialog.json +1 -1
  210. package/registry/media-capture.json +1 -1
  211. package/registry/media-gallery.json +1 -1
  212. package/registry/media-grid.json +1 -1
  213. package/registry/meta-row.json +1 -1
  214. package/registry/meter.json +1 -1
  215. package/registry/money-input.json +1 -1
  216. package/registry/nav-bar.json +30 -6
  217. package/registry/next-actions.json +1 -1
  218. package/registry/notification-preferences.json +1 -1
  219. package/registry/number-ticker.json +1 -1
  220. package/registry/opening-hours.json +1 -1
  221. package/registry/page-header.json +1 -1
  222. package/registry/page-hero.json +1 -1
  223. package/registry/page-index.json +1 -1
  224. package/registry/page.json +1 -1
  225. package/registry/pagination.json +1 -1
  226. package/registry/photo-grid.json +1 -1
  227. package/registry/pointer-light.json +1 -1
  228. package/registry/popover.json +1 -1
  229. package/registry/price-catalogue-editor.json +228 -0
  230. package/registry/pricing-page.json +1 -1
  231. package/registry/product-page.json +1 -1
  232. package/registry/profile-card.json +1 -1
  233. package/registry/progress.json +1 -1
  234. package/registry/promise-card.json +1 -1
  235. package/registry/promo-code-field.json +1 -1
  236. package/registry/proposal.json +1 -1
  237. package/registry/qr-code.json +1 -1
  238. package/registry/quota-meter.json +1 -1
  239. package/registry/radio-group.json +1 -1
  240. package/registry/rail-nav.json +2 -2
  241. package/registry/recipes.json +1 -1
  242. package/registry/retro-tv.json +1 -1
  243. package/registry/reviews.json +1 -1
  244. package/registry/router.json +1 -1
  245. package/registry/schema-form.json +253 -0
  246. package/registry/scroll-stage.json +1 -1
  247. package/registry/search-field.json +1 -1
  248. package/registry/section-backdrop.json +1 -1
  249. package/registry/separator.json +1 -1
  250. package/registry/service-card.json +1 -1
  251. package/registry/settings-layout.json +1 -1
  252. package/registry/shop-composer.json +10 -6
  253. package/registry/shop-gallery.json +1 -1
  254. package/registry/shop.json +51 -10
  255. package/registry/showcase.json +1 -1
  256. package/registry/signature.json +1 -1
  257. package/registry/site-cahier.json +1 -1
  258. package/registry/site-footer.json +2 -2
  259. package/registry/sites.json +1 -1
  260. package/registry/skeleton.json +1 -1
  261. package/registry/skip-link.json +1 -1
  262. package/registry/slider.json +1 -1
  263. package/registry/slot-picker.json +1 -1
  264. package/registry/slot.json +1 -1
  265. package/registry/specimen-tag.json +1 -1
  266. package/registry/speed-lines.json +1 -1
  267. package/registry/spinner.json +1 -1
  268. package/registry/split-view.json +1 -1
  269. package/registry/stage-banner.json +1 -1
  270. package/registry/stat.json +1 -1
  271. package/registry/status-chip.json +1 -1
  272. package/registry/status-page.json +1 -1
  273. package/registry/step-progress.json +1 -1
  274. package/registry/step-showcase.json +1 -1
  275. package/registry/stepper.json +1 -1
  276. package/registry/sticky-action.json +1 -1
  277. package/registry/stuck.json +1 -1
  278. package/registry/swipe-deck.json +1 -1
  279. package/registry/switch.json +1 -1
  280. package/registry/tabs.json +1 -1
  281. package/registry/tag-input.json +1 -1
  282. package/registry/tag-selector.json +1 -1
  283. package/registry/taped-photo.json +1 -1
  284. package/registry/terminal-replay.json +1 -1
  285. package/registry/text-style.json +1 -1
  286. package/registry/theme.json +1 -1
  287. package/registry/toast.json +1 -1
  288. package/registry/toc.json +1 -1
  289. package/registry/tooltip.json +1 -1
  290. package/registry/tree-view.json +1 -1
  291. package/registry/update-prompt.json +1 -1
  292. package/registry/upload-queue.json +1 -1
  293. package/registry/usage.json +1 -1
  294. package/registry/verified-badge.json +1 -1
  295. package/registry/versus-card.json +1 -1
  296. package/registry/vertical-video.json +1 -1
  297. package/registry/video-player.json +1 -1
  298. package/registry/video-trimmer.json +1 -1
  299. package/registry/virtual.json +1 -1
  300. package/registry/wall.json +47 -4
  301. package/registry/waveform.json +1 -1
  302. package/dist/chunk-A7MQPIEG.js +0 -31
  303. package/dist/chunk-A7MQPIEG.js.map +0 -1
  304. package/dist/chunk-EUJ7337V.js.map +0 -1
  305. package/dist/chunk-HK525THY.js.map +0 -1
  306. /package/dist/{chunk-CSRKYZ53.js.map → chunk-CZHPWLNW.js.map} +0 -0
@@ -0,0 +1,268 @@
1
+ "use client";
2
+ import {
3
+ MoneyInput
4
+ } from "./chunk-W64RAX4N.js";
5
+ import {
6
+ Field,
7
+ Input,
8
+ Select,
9
+ Textarea
10
+ } from "./chunk-HLEBSAGC.js";
11
+ import {
12
+ Switch
13
+ } from "./chunk-CZHPWLNW.js";
14
+ import {
15
+ Button
16
+ } from "./chunk-V7W4RLRW.js";
17
+ import "./chunk-D3T54RSL.js";
18
+ import "./chunk-WEVYKZIF.js";
19
+ import {
20
+ cn
21
+ } from "./chunk-NSLXEDIS.js";
22
+
23
+ // src/schema-form/schema.ts
24
+ var MULTILINE_OVER = 500;
25
+ var obj = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : null;
26
+ var str = (v) => typeof v === "string" && v.trim() !== "" ? v : null;
27
+ var num = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
28
+ function wordsFor(i18n, locale) {
29
+ const by = obj(i18n);
30
+ if (!by) return null;
31
+ return obj(by[locale]) ?? obj(by[locale.split("-")[0] ?? ""]) ?? obj(by.en);
32
+ }
33
+ function optionsOf(spec, words) {
34
+ const label = (value) => {
35
+ const w = words?.options?.[value];
36
+ return typeof w === "string" ? w : w?.label ?? null;
37
+ };
38
+ if (Array.isArray(spec.enum)) return spec.enum.map(String).map((value) => ({ value, label: label(value) ?? value }));
39
+ const one = spec.oneOf;
40
+ if (Array.isArray(one) && one.length > 0 && one.every((e) => obj(e) && "const" in e)) {
41
+ return one.map((e) => ({ value: String(e.const), label: label(String(e.const)) ?? str(e.title) ?? String(e.const) }));
42
+ }
43
+ return null;
44
+ }
45
+ function kindOf(spec, options) {
46
+ const items = obj(spec.items);
47
+ if (options) return "select";
48
+ if (spec["x-money"] || spec.format === "money") return "money";
49
+ switch (spec.type) {
50
+ case "boolean":
51
+ return "boolean";
52
+ case "integer":
53
+ return "integer";
54
+ case "number":
55
+ return "number";
56
+ case "array":
57
+ return items && (items.type === void 0 || items.type === "string") ? "list" : null;
58
+ case "string":
59
+ case void 0:
60
+ if (spec.format === "date") return "date";
61
+ return (num(spec.maxLength) ?? 0) > MULTILINE_OVER ? "textarea" : "text";
62
+ default:
63
+ return null;
64
+ }
65
+ }
66
+ function fieldsFromSchema(schema, locale) {
67
+ let root = obj(schema);
68
+ if (typeof schema === "string") {
69
+ try {
70
+ root = obj(JSON.parse(schema));
71
+ } catch {
72
+ root = null;
73
+ }
74
+ }
75
+ const properties = obj(root?.properties);
76
+ if (!properties) return [];
77
+ const required = new Set(Array.isArray(root?.required) ? root.required.map(String) : []);
78
+ const fields = [];
79
+ for (const [key, raw] of Object.entries(properties)) {
80
+ const spec = obj(raw);
81
+ if (!spec) continue;
82
+ const words = wordsFor(spec["x-i18n"], locale);
83
+ const options = optionsOf(spec, words);
84
+ const kind = kindOf(spec, options);
85
+ if (!kind) continue;
86
+ fields.push({
87
+ key,
88
+ kind,
89
+ title: words?.title ?? str(spec.title) ?? key,
90
+ description: words?.description ?? str(spec.description),
91
+ placeholder: words?.placeholder ?? null,
92
+ required: required.has(key),
93
+ advanced: spec["x-advanced"] === true,
94
+ options,
95
+ min: num(spec.minimum),
96
+ max: num(spec.maximum),
97
+ minLength: num(spec.minLength),
98
+ maxLength: num(spec.maxLength),
99
+ maxItems: num(spec.maxItems),
100
+ pattern: str(spec.pattern),
101
+ currency: str(obj(spec["x-money"])?.currency) ?? "CAD",
102
+ defaultValue: spec.default ?? null
103
+ });
104
+ }
105
+ return fields;
106
+ }
107
+ var fill = (template, vars) => template.replace(/\{(\w+)\}/g, (_, k) => String(vars[k] ?? ""));
108
+ var listItems = (text) => text.split(",").map((s) => s.trim()).filter(Boolean);
109
+ var asNumber = (text) => Number(text.replace(",", "."));
110
+ function checkNumber(field, text, m) {
111
+ const n = asNumber(text);
112
+ if (!Number.isFinite(n) || field.kind === "integer" && !Number.isInteger(n)) return m.notANumber;
113
+ if (field.min !== null && n < field.min) return fill(m.belowMin, { min: field.min });
114
+ if (field.max !== null && n > field.max) return fill(m.aboveMax, { max: field.max });
115
+ return null;
116
+ }
117
+ function checkText(field, text, m) {
118
+ if (field.minLength !== null && text.length < field.minLength) return fill(m.tooShort, { min: field.minLength });
119
+ if (field.maxLength !== null && text.length > field.maxLength) return fill(m.tooLong, { max: field.maxLength });
120
+ if (field.pattern !== null && !new RegExp(field.pattern, "u").test(text)) return m.badPattern;
121
+ return null;
122
+ }
123
+ function checkField(field, value, m) {
124
+ if (field.kind === "boolean") return null;
125
+ const empty = field.kind === "money" ? value === null || value === void 0 : textOf(value) === "";
126
+ if (empty) return field.required ? m.required : null;
127
+ if (field.kind === "money") return null;
128
+ const text = textOf(value);
129
+ if (field.kind === "number" || field.kind === "integer") return checkNumber(field, text, m);
130
+ if (field.kind === "list") return field.maxItems !== null && listItems(text).length > field.maxItems ? fill(m.tooMany, { max: field.maxItems }) : null;
131
+ return checkText(field, text, m);
132
+ }
133
+ function checkValues(fields, values, m) {
134
+ const errors = {};
135
+ for (const field of fields) {
136
+ const message = checkField(field, values[field.key], m);
137
+ if (message) errors[field.key] = message;
138
+ }
139
+ return errors;
140
+ }
141
+ var textOf = (v) => typeof v === "string" ? v.trim() : "";
142
+ function startOf(f, v) {
143
+ if (f.kind === "boolean") return v === true;
144
+ if (f.kind === "money") return typeof v === "number" ? v : null;
145
+ if (f.kind === "list" && Array.isArray(v)) return v.join(", ");
146
+ if (typeof v === "string" || typeof v === "number" || typeof v === "boolean") return String(v);
147
+ return "";
148
+ }
149
+ function initialValues(fields, given = {}) {
150
+ return Object.fromEntries(fields.map((f) => [f.key, startOf(f, given[f.key] ?? f.defaultValue)]));
151
+ }
152
+ function typed(f, text) {
153
+ if (f.kind === "number" || f.kind === "integer") return asNumber(text);
154
+ return f.kind === "list" ? listItems(text) : text;
155
+ }
156
+ function payloadOf(fields, values) {
157
+ const out = {};
158
+ for (const f of fields) {
159
+ const v = values[f.key];
160
+ if (f.kind === "boolean") out[f.key] = v === true;
161
+ else if (f.kind === "money") {
162
+ if (typeof v === "number") out[f.key] = v;
163
+ } else if (textOf(v) !== "") out[f.key] = typed(f, textOf(v));
164
+ }
165
+ return out;
166
+ }
167
+
168
+ // src/schema-form/schema-form.tsx
169
+ import * as React from "react";
170
+ import { jsx, jsxs } from "react/jsx-runtime";
171
+ function FieldControl({ field, ctx, locale }) {
172
+ const { id, value, setValue, error, disabled } = ctx;
173
+ const describedBy = [field.description ? `${id}-help` : null, error ? `${id}-error` : null].filter(Boolean).join(" ") || void 0;
174
+ const common = { id, disabled, "aria-describedby": describedBy, "aria-required": field.required || void 0 };
175
+ const text = typeof value === "string" ? value : "";
176
+ switch (field.kind) {
177
+ case "boolean":
178
+ return /* @__PURE__ */ jsx(Switch, { id, disabled, "aria-describedby": describedBy, checked: value === true, onCheckedChange: setValue });
179
+ case "select":
180
+ return /* @__PURE__ */ jsxs(Select, { ...common, invalid: !!error, value: text, onChange: (e) => setValue(e.target.value), children: [
181
+ !field.required && /* @__PURE__ */ jsx("option", { value: "" }),
182
+ field.options?.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, children: o.label }, o.value))
183
+ ] });
184
+ case "textarea":
185
+ return /* @__PURE__ */ jsx(Textarea, { ...common, invalid: !!error, value: text, maxLength: field.maxLength ?? void 0, placeholder: field.placeholder ?? void 0, onChange: (e) => setValue(e.target.value) });
186
+ case "money":
187
+ return /* @__PURE__ */ jsx(MoneyInput, { ...common, invalid: !!error, value: typeof value === "number" ? value : null, onValueChange: setValue, currency: field.currency, locale });
188
+ case "number":
189
+ case "integer":
190
+ return /* @__PURE__ */ jsx(Input, { ...common, invalid: !!error, type: "text", inputMode: field.kind === "integer" ? "numeric" : "decimal", value: text, placeholder: field.placeholder ?? void 0, onChange: (e) => setValue(e.target.value) });
191
+ case "date":
192
+ return /* @__PURE__ */ jsx(Input, { ...common, invalid: !!error, type: "date", value: text, onChange: (e) => setValue(e.target.value) });
193
+ default:
194
+ return /* @__PURE__ */ jsx(Input, { ...common, invalid: !!error, type: "text", value: text, maxLength: field.maxLength ?? void 0, placeholder: field.placeholder ?? void 0, onChange: (e) => setValue(e.target.value) });
195
+ }
196
+ }
197
+ function SchemaForm({ schema, locale, words, messages, values: given, onSubmit, submitting = false, renderField, footer, className, ...props }) {
198
+ const base = React.useId();
199
+ const fields = React.useMemo(() => fieldsFromSchema(schema, locale), [schema, locale]);
200
+ const [answers, setAnswers] = React.useState(() => initialValues(fields, given));
201
+ const [shown, setShown] = React.useState(() => /* @__PURE__ */ new Set());
202
+ const errors = React.useMemo(() => checkValues(fields, answers, messages), [fields, answers, messages]);
203
+ const formRef = React.useRef(null);
204
+ const draw = (field) => {
205
+ const id = `${base}-${field.key}`;
206
+ const error = shown.has(field.key) ? errors[field.key] ?? null : null;
207
+ const ctx = { id, value: answers[field.key], setValue: (v) => setAnswers((a) => ({ ...a, [field.key]: v })), error, disabled: submitting };
208
+ const custom = renderField?.(field, ctx);
209
+ const inline = field.kind === "boolean";
210
+ return /* @__PURE__ */ jsxs(Field.Root, { "data-field": field.key, "data-kind": field.kind, onBlur: () => setShown((s) => s.has(field.key) ? s : new Set(s).add(field.key)), children: [
211
+ /* @__PURE__ */ jsxs("div", { className: cn(inline && "flex items-center justify-between gap-3"), children: [
212
+ /* @__PURE__ */ jsxs(Field.Label, { htmlFor: id, children: [
213
+ field.title,
214
+ field.required && /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: " *" })
215
+ ] }),
216
+ inline && (custom ?? /* @__PURE__ */ jsx(FieldControl, { field, ctx, locale }))
217
+ ] }),
218
+ !inline && (custom ?? /* @__PURE__ */ jsx(FieldControl, { field, ctx, locale })),
219
+ field.description && /* @__PURE__ */ jsx(Field.Hint, { id: `${id}-help`, children: field.description }),
220
+ error && /* @__PURE__ */ jsx(Field.Error, { id: `${id}-error`, children: error })
221
+ ] }, field.key);
222
+ };
223
+ const main = fields.filter((f) => !f.advanced);
224
+ const more = fields.filter((f) => f.advanced);
225
+ return /* @__PURE__ */ jsxs(
226
+ "form",
227
+ {
228
+ ref: formRef,
229
+ noValidate: true,
230
+ "data-schema-form": "",
231
+ className: cn("flex flex-col gap-4", className),
232
+ onSubmit: (event) => {
233
+ event.preventDefault();
234
+ if (submitting) return;
235
+ const failing = Object.keys(errors);
236
+ if (failing.length > 0) {
237
+ setShown(new Set(fields.map((f) => f.key)));
238
+ const first = fields.find((f) => errors[f.key]);
239
+ if (first) formRef.current?.querySelector(`[data-field="${first.key}"] :is(input,select,textarea,button[role=switch])`)?.focus();
240
+ return;
241
+ }
242
+ onSubmit(payloadOf(fields, answers));
243
+ },
244
+ ...props,
245
+ children: [
246
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: main.map(draw) }),
247
+ more.length > 0 && /* @__PURE__ */ jsxs("details", { className: "rounded-lg border border-border px-3 py-2", open: more.some((f) => shown.has(f.key) && errors[f.key]) || void 0, children: [
248
+ /* @__PURE__ */ jsx("summary", { className: "cursor-pointer select-none text-sm font-medium text-fg-secondary", children: words.advanced }),
249
+ /* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-col gap-3", children: more.map(draw) })
250
+ ] }),
251
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
252
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 text-xs text-fg-secondary", children: footer }),
253
+ /* @__PURE__ */ jsx(Button, { type: "submit", variant: "primary", size: "md", loading: submitting, children: words.submit })
254
+ ] })
255
+ ]
256
+ }
257
+ );
258
+ }
259
+ export {
260
+ SchemaForm,
261
+ checkField,
262
+ checkValues,
263
+ fieldsFromSchema,
264
+ initialValues,
265
+ listItems,
266
+ payloadOf
267
+ };
268
+ //# sourceMappingURL=schema-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema-form/schema.ts","../src/schema-form/schema-form.tsx"],"sourcesContent":["// Pure: no React, no clock. A JSON Schema (an object of properties) read into the fields a form draws, and the checks that\n// the schema states. Extracted from Orazaka's run form (`useInputSchema`): the same vocabulary — `required`, `enum` and\n// `oneOf` of `const`, `x-i18n` words by language, `x-advanced` folded — without the studio's own parts.\n\n/** What a field is drawn as. */\nexport type SchemaFieldKind = \"text\" | \"textarea\" | \"number\" | \"integer\" | \"boolean\" | \"select\" | \"date\" | \"money\" | \"list\";\n\n/** One field of the form, derived from a property of the schema. */\nexport interface SchemaField {\n key: string;\n kind: SchemaFieldKind;\n /** The title in the page's language (`x-i18n`), else the schema's `title`, else the key. */\n title: string;\n /** A line of help under the field. */\n description: string | null;\n /** An example of what to type. */\n placeholder: string | null;\n required: boolean;\n /** `x-advanced`: folded under « more options ». */\n advanced: boolean;\n /** A closed list: `enum` or `oneOf` of `const`, with the labels of the language. */\n options: { value: string; label: string }[] | null;\n min: number | null;\n max: number | null;\n minLength: number | null;\n maxLength: number | null;\n maxItems: number | null;\n pattern: string | null;\n /** The ISO 4217 code of a `money` field (`x-money.currency`, default CAD). */\n currency: string;\n /** The value the form starts on, when the schema states one. */\n defaultValue: unknown;\n}\n\ninterface Words {\n title?: string;\n description?: string;\n placeholder?: string;\n options?: Record<string, string | { label?: string }>;\n}\ntype Raw = Record<string, unknown>;\n\n// @fixed: the schema's own threshold between a line and a text area (Orazaka's studio form: over 500 characters)\nconst MULTILINE_OVER = 500;\n\nconst obj = (v: unknown): Raw | null => (v && typeof v === \"object\" && !Array.isArray(v) ? (v as Raw) : null);\nconst str = (v: unknown) => (typeof v === \"string\" && v.trim() !== \"\" ? v : null);\nconst num = (v: unknown) => (typeof v === \"number\" && Number.isFinite(v) ? v : null);\n\n/** The words of a language: that language (`fr-CA` → `fr`), else English, else nothing. */\nfunction wordsFor(i18n: unknown, locale: string): Words | null {\n const by = obj(i18n);\n if (!by) return null;\n return (obj(by[locale]) ?? obj(by[locale.split(\"-\")[0] ?? \"\"]) ?? obj(by.en)) as Words | null;\n}\n\nfunction optionsOf(spec: Raw, words: Words | null): SchemaField[\"options\"] {\n const label = (value: string) => {\n const w = words?.options?.[value];\n return typeof w === \"string\" ? w : (w?.label ?? null);\n };\n if (Array.isArray(spec.enum)) return spec.enum.map(String).map((value) => ({ value, label: label(value) ?? value }));\n const one = spec.oneOf;\n if (Array.isArray(one) && one.length > 0 && one.every((e) => obj(e) && \"const\" in (e as Raw))) {\n return (one as Raw[]).map((e) => ({ value: String(e.const), label: label(String(e.const)) ?? str(e.title) ?? String(e.const) }));\n }\n return null;\n}\n\nfunction kindOf(spec: Raw, options: SchemaField[\"options\"]): SchemaFieldKind | null {\n const items = obj(spec.items);\n if (options) return \"select\";\n if (spec[\"x-money\"] || spec.format === \"money\") return \"money\";\n switch (spec.type) {\n case \"boolean\":\n return \"boolean\";\n case \"integer\":\n return \"integer\";\n case \"number\":\n return \"number\";\n case \"array\":\n return items && (items.type === undefined || items.type === \"string\") ? \"list\" : null;\n case \"string\":\n case undefined:\n if (spec.format === \"date\") return \"date\";\n return (num(spec.maxLength) ?? 0) > MULTILINE_OVER ? \"textarea\" : \"text\";\n default:\n return null;\n }\n}\n\n/** The fields of a JSON Schema object, in the schema's order. A property the form cannot draw (a nested object…) is left out. */\nexport function fieldsFromSchema(schema: unknown, locale: string): SchemaField[] {\n let root = obj(schema);\n if (typeof schema === \"string\") {\n try {\n root = obj(JSON.parse(schema));\n } catch {\n root = null;\n }\n }\n const properties = obj(root?.properties);\n if (!properties) return [];\n const required = new Set(Array.isArray(root?.required) ? root.required.map(String) : []);\n const fields: SchemaField[] = [];\n for (const [key, raw] of Object.entries(properties)) {\n const spec = obj(raw);\n if (!spec) continue;\n const words = wordsFor(spec[\"x-i18n\"], locale);\n const options = optionsOf(spec, words);\n const kind = kindOf(spec, options);\n if (!kind) continue;\n fields.push({\n key,\n kind,\n title: words?.title ?? str(spec.title) ?? key,\n description: words?.description ?? str(spec.description),\n placeholder: words?.placeholder ?? null,\n required: required.has(key),\n advanced: spec[\"x-advanced\"] === true,\n options,\n min: num(spec.minimum),\n max: num(spec.maximum),\n minLength: num(spec.minLength),\n maxLength: num(spec.maxLength),\n maxItems: num(spec.maxItems),\n pattern: str(spec.pattern),\n currency: str(obj(spec[\"x-money\"])?.currency) ?? \"CAD\",\n defaultValue: spec.default ?? null,\n });\n }\n return fields;\n}\n\n/** The words of the checks, passed translated. `{min}`, `{max}` are filled. */\nexport interface SchemaFormMessages {\n required: string;\n /** « At least {min} characters. » */\n tooShort: string;\n /** « At most {max} characters. » */\n tooLong: string;\n /** « Not below {min}. » */\n belowMin: string;\n /** « Not above {max}. » */\n aboveMax: string;\n /** « Not a number. » */\n notANumber: string;\n /** « Not in the expected form. » */\n badPattern: string;\n /** « At most {max} items. » */\n tooMany: string;\n}\n\nconst fill = (template: string, vars: Record<string, number>) => template.replace(/\\{(\\w+)\\}/g, (_, k: string) => String(vars[k] ?? \"\"));\n\n/** A list typed as « a, b, c »: its items. */\nexport const listItems = (text: string) => text.split(\",\").map((s) => s.trim()).filter(Boolean);\n\nconst asNumber = (text: string) => Number(text.replace(\",\", \".\"));\n\nfunction checkNumber(field: SchemaField, text: string, m: SchemaFormMessages): string | null {\n const n = asNumber(text);\n if (!Number.isFinite(n) || (field.kind === \"integer\" && !Number.isInteger(n))) return m.notANumber;\n if (field.min !== null && n < field.min) return fill(m.belowMin, { min: field.min });\n if (field.max !== null && n > field.max) return fill(m.aboveMax, { max: field.max });\n return null;\n}\n\nfunction checkText(field: SchemaField, text: string, m: SchemaFormMessages): string | null {\n if (field.minLength !== null && text.length < field.minLength) return fill(m.tooShort, { min: field.minLength });\n if (field.maxLength !== null && text.length > field.maxLength) return fill(m.tooLong, { max: field.maxLength });\n if (field.pattern !== null && !new RegExp(field.pattern, \"u\").test(text)) return m.badPattern;\n return null;\n}\n\n/** The raw answer of a field as the form holds it (a string, a boolean, or cents), checked against the schema's rules. Returns the message, or null. */\nexport function checkField(field: SchemaField, value: unknown, m: SchemaFormMessages): string | null {\n if (field.kind === \"boolean\") return null;\n const empty = field.kind === \"money\" ? value === null || value === undefined : textOf(value) === \"\";\n if (empty) return field.required ? m.required : null;\n if (field.kind === \"money\") return null;\n const text = textOf(value);\n if (field.kind === \"number\" || field.kind === \"integer\") return checkNumber(field, text, m);\n if (field.kind === \"list\") return field.maxItems !== null && listItems(text).length > field.maxItems ? fill(m.tooMany, { max: field.maxItems }) : null;\n return checkText(field, text, m);\n}\n\n/** The messages of every field that fails; an empty object is a valid form. */\nexport function checkValues(fields: readonly SchemaField[], values: Record<string, unknown>, m: SchemaFormMessages): Record<string, string> {\n const errors: Record<string, string> = {};\n for (const field of fields) {\n const message = checkField(field, values[field.key], m);\n if (message) errors[field.key] = message;\n }\n return errors;\n}\n\nconst textOf = (v: unknown) => (typeof v === \"string\" ? v.trim() : \"\");\n\n/** The answer a field starts on, from what was given or the schema's default. */\nfunction startOf(f: SchemaField, v: unknown): unknown {\n if (f.kind === \"boolean\") return v === true;\n if (f.kind === \"money\") return typeof v === \"number\" ? v : null;\n if (f.kind === \"list\" && Array.isArray(v)) return v.join(\", \");\n if (typeof v === \"string\" || typeof v === \"number\" || typeof v === \"boolean\") return String(v);\n return \"\";\n}\n\n/** What a form holds at the start: the schema's defaults, then the given values. */\nexport function initialValues(fields: readonly SchemaField[], given: Record<string, unknown> = {}): Record<string, unknown> {\n return Object.fromEntries(fields.map((f) => [f.key, startOf(f, given[f.key] ?? f.defaultValue)]));\n}\n\n/** The typed value of a non-empty answer. */\nfunction typed(f: SchemaField, text: string): unknown {\n if (f.kind === \"number\" || f.kind === \"integer\") return asNumber(text);\n return f.kind === \"list\" ? listItems(text) : text;\n}\n\n/** The typed payload the host receives: numbers as numbers, lists as arrays, money as integer cents, empty answers left out. */\nexport function payloadOf(fields: readonly SchemaField[], values: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const f of fields) {\n const v = values[f.key];\n if (f.kind === \"boolean\") out[f.key] = v === true;\n else if (f.kind === \"money\") {\n if (typeof v === \"number\") out[f.key] = v;\n } else if (textOf(v) !== \"\") out[f.key] = typed(f, textOf(v));\n }\n return out;\n}\n","\"use client\";\n// Client (the answers, what has been touched). A form drawn from a JSON Schema: the fields come from `fieldsFromSchema`\n// (pure), are drawn on the package's own fields (`Field`, `Input`, `Select`, `Textarea`, `Switch`, `MoneyInput`), checked\n// by the schema's rules, and handed to the host as a typed payload. The host keeps what is its own — uploads, pickers —\n// through `renderField`. Words are props; the block never fetches and never reads the clock.\nimport * as React from \"react\";\n\nimport { Button } from \"../button/button\";\nimport { cn } from \"../cn\";\nimport { Field, Input, Select, Textarea } from \"../field/field\";\nimport { MoneyInput } from \"../money-input/money-input\";\nimport { Switch } from \"../switch/switch\";\nimport { checkValues, fieldsFromSchema, initialValues, payloadOf, type SchemaField, type SchemaFormMessages } from \"./schema\";\n\n/** What a custom field receives to draw itself. */\nexport interface SchemaFieldContext {\n /** An id to wire the label (`htmlFor`) and the description. */\n id: string;\n /** The raw answer: a string, a boolean, or integer cents for a money field. */\n value: unknown;\n setValue: (value: unknown) => void;\n /** The refusal to show, or `null`. */\n error: string | null;\n disabled: boolean;\n}\n\nexport interface SchemaFormWords {\n /** The submit button: « Run ». */\n submit: string;\n /** The fold of the `x-advanced` fields: « More options ». */\n advanced: string;\n}\n\nexport interface SchemaFormProps extends Omit<React.ComponentProps<\"form\">, \"onSubmit\" | \"children\"> {\n /** The JSON Schema object (or its JSON text): `properties`, `required`, `x-i18n`, `x-advanced`. */\n schema: unknown;\n /** BCP 47 language for the `x-i18n` words and the money: `\"fr-CA\"`. */\n locale: string;\n /** The words, passed translated. */\n words: SchemaFormWords;\n /** The checks' words, passed translated. */\n messages: SchemaFormMessages;\n /** Answers to start from, by field key (over the schema's defaults). */\n values?: Record<string, unknown>;\n /** Called with the typed payload once every field passes. */\n onSubmit: (payload: Record<string, unknown>) => void;\n /** The form is being submitted: the fields are blocked and the button shows progress (no second submit). */\n submitting?: boolean;\n /** Draws a field in the host's way (an upload, a picker); return `undefined` for the default. */\n renderField?: (field: SchemaField, context: SchemaFieldContext) => React.ReactNode;\n /** Beside the submit button: a cost line, a note. */\n footer?: React.ReactNode;\n}\n\nfunction FieldControl({ field, ctx, locale }: Readonly<{ field: SchemaField; ctx: SchemaFieldContext; locale: string }>) {\n const { id, value, setValue, error, disabled } = ctx;\n const describedBy = [field.description ? `${id}-help` : null, error ? `${id}-error` : null].filter(Boolean).join(\" \") || undefined;\n const common = { id, disabled, \"aria-describedby\": describedBy, \"aria-required\": field.required || undefined } as const;\n const text = typeof value === \"string\" ? value : \"\";\n switch (field.kind) {\n case \"boolean\":\n return <Switch id={id} disabled={disabled} aria-describedby={describedBy} checked={value === true} onCheckedChange={setValue} />;\n case \"select\":\n return (\n <Select {...common} invalid={!!error} value={text} onChange={(e) => setValue(e.target.value)}>\n {!field.required && <option value=\"\" />}\n {field.options?.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </Select>\n );\n case \"textarea\":\n return <Textarea {...common} invalid={!!error} value={text} maxLength={field.maxLength ?? undefined} placeholder={field.placeholder ?? undefined} onChange={(e) => setValue(e.target.value)} />;\n case \"money\":\n return <MoneyInput {...common} invalid={!!error} value={typeof value === \"number\" ? value : null} onValueChange={setValue} currency={field.currency} locale={locale} />;\n case \"number\":\n case \"integer\":\n return <Input {...common} invalid={!!error} type=\"text\" inputMode={field.kind === \"integer\" ? \"numeric\" : \"decimal\"} value={text} placeholder={field.placeholder ?? undefined} onChange={(e) => setValue(e.target.value)} />;\n case \"date\":\n return <Input {...common} invalid={!!error} type=\"date\" value={text} onChange={(e) => setValue(e.target.value)} />;\n default:\n return <Input {...common} invalid={!!error} type=\"text\" value={text} maxLength={field.maxLength ?? undefined} placeholder={field.placeholder ?? undefined} onChange={(e) => setValue(e.target.value)} />;\n }\n}\n\n/** A form from a JSON Schema: typed fields, the schema's rules, `x-i18n` words, `x-advanced` folded. */\nexport function SchemaForm({ schema, locale, words, messages, values: given, onSubmit, submitting = false, renderField, footer, className, ...props }: Readonly<SchemaFormProps>) {\n const base = React.useId();\n const fields = React.useMemo(() => fieldsFromSchema(schema, locale), [schema, locale]);\n const [answers, setAnswers] = React.useState(() => initialValues(fields, given));\n const [shown, setShown] = React.useState<Set<string>>(() => new Set());\n const errors = React.useMemo(() => checkValues(fields, answers, messages), [fields, answers, messages]);\n const formRef = React.useRef<HTMLFormElement>(null);\n const draw = (field: SchemaField) => {\n const id = `${base}-${field.key}`;\n const error = shown.has(field.key) ? (errors[field.key] ?? null) : null;\n const ctx: SchemaFieldContext = { id, value: answers[field.key], setValue: (v) => setAnswers((a) => ({ ...a, [field.key]: v })), error, disabled: submitting };\n const custom = renderField?.(field, ctx);\n const inline = field.kind === \"boolean\";\n return (\n <Field.Root key={field.key} data-field={field.key} data-kind={field.kind} onBlur={() => setShown((s) => (s.has(field.key) ? s : new Set(s).add(field.key)))}>\n <div className={cn(inline && \"flex items-center justify-between gap-3\")}>\n <Field.Label htmlFor={id}>\n {field.title}\n {field.required && <span aria-hidden> *</span>}\n </Field.Label>\n {inline && (custom ?? <FieldControl field={field} ctx={ctx} locale={locale} />)}\n </div>\n {!inline && (custom ?? <FieldControl field={field} ctx={ctx} locale={locale} />)}\n {field.description && <Field.Hint id={`${id}-help`}>{field.description}</Field.Hint>}\n {error && <Field.Error id={`${id}-error`}>{error}</Field.Error>}\n </Field.Root>\n );\n };\n const main = fields.filter((f) => !f.advanced);\n const more = fields.filter((f) => f.advanced);\n return (\n <form\n ref={formRef}\n noValidate\n data-schema-form=\"\"\n className={cn(\"flex flex-col gap-4\", className)}\n onSubmit={(event) => {\n event.preventDefault();\n if (submitting) return;\n const failing = Object.keys(errors);\n if (failing.length > 0) {\n setShown(new Set(fields.map((f) => f.key)));\n const first = fields.find((f) => errors[f.key]);\n if (first) formRef.current?.querySelector<HTMLElement>(`[data-field=\"${first.key}\"] :is(input,select,textarea,button[role=switch])`)?.focus();\n return;\n }\n onSubmit(payloadOf(fields, answers));\n }}\n {...props}\n >\n <div className=\"flex flex-col gap-3\">{main.map(draw)}</div>\n {more.length > 0 && (\n <details className=\"rounded-lg border border-border px-3 py-2\" open={more.some((f) => shown.has(f.key) && errors[f.key]) || undefined}>\n <summary className=\"cursor-pointer select-none text-sm font-medium text-fg-secondary\">{words.advanced}</summary>\n <div className=\"mt-3 flex flex-col gap-3\">{more.map(draw)}</div>\n </details>\n )}\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div className=\"min-w-0 text-xs text-fg-secondary\">{footer}</div>\n <Button type=\"submit\" variant=\"primary\" size=\"md\" loading={submitting}>\n {words.submit}\n </Button>\n </div>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAM,iBAAiB;AAEvB,IAAM,MAAM,CAAC,MAA4B,KAAK,OAAO,MAAM,YAAY,CAAC,MAAM,QAAQ,CAAC,IAAK,IAAY;AACxG,IAAM,MAAM,CAAC,MAAgB,OAAO,MAAM,YAAY,EAAE,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AAAA,QACpD,KAAK,SAAS,KACb,qBAAC,aAAQ,WAAU,6CAA4C,MAAM,KAAK,KAAK,CAAC,MAAM,MAAM,IAAI,EAAE,GAAG,KAAK,OAAO,EAAE,GAAG,CAAC,KAAK,QAC1H;AAAA,8BAAC,aAAQ,WAAU,oEAAoE,gBAAM,UAAS;AAAA,UACtG,oBAAC,SAAI,WAAU,4BAA4B,eAAK,IAAI,IAAI,GAAE;AAAA,WAC5D;AAAA,QAEF,qBAAC,SAAI,WAAU,qDACb;AAAA,8BAAC,SAAI,WAAU,qCAAqC,kBAAO;AAAA,UAC3D,oBAAC,UAAO,MAAK,UAAS,SAAQ,WAAU,MAAK,MAAK,SAAS,YACxD,gBAAM,QACT;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { L as LinkComponent } from '../block-link-BAg4eoZk.js';
3
- import { ShopPhoto } from '../shop.js';
3
+ import { ShopSectionProps, ShopPhoto } from '../shop.js';
4
4
 
5
5
  type BookingVariant = "strip" | "panel" | "closing" | "sticky";
6
6
  /** `closing`: the second action beside « Book » (`Call`, `Directions`): the host chooses it from the shop's settings. */
@@ -15,7 +15,7 @@ type BookingTime = {
15
15
  /** The booking page with this time chosen. */
16
16
  href: string;
17
17
  };
18
- type BookingSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
18
+ type BookingSectionProps = Omit<React.ComponentProps<"section">, "title"> & Pick<ShopSectionProps, "mascot"> & {
19
19
  /** @default "strip" */
20
20
  variant?: BookingVariant;
21
21
  /** `strip`: the next free times, in order (the first `count`). */
@@ -6,7 +6,7 @@ import {
6
6
  } from "../chunk-5D7NMUF6.js";
7
7
  import {
8
8
  ShopSection
9
- } from "../chunk-A7MQPIEG.js";
9
+ } from "../chunk-M3T5RQYV.js";
10
10
  import {
11
11
  Page,
12
12
  cn
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shop/booking/booking.tsx"],"sourcesContent":["// Server-safe (the phone bar is a client island imported through its own entry). The way to book (ADR-007 §3): `strip` —\n// the next free times, one tap each, in one line; `panel` — the closing call in a box; `closing` — the closing call of a look (the shop's photo or mark, the next free time, Book); `sticky` — the phone bar, held at the bottom\n// edge and never over content. The times are resolved by the product: the section draws them, it never fetches.\nimport { buttonVariants } from \"@krizaka/ui/button\";\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { StickyAction } from \"@krizaka/ui/sticky-action\";\nimport * as React from \"react\";\n\nimport { BlockLink, type LinkComponent } from \"../../block-link\";\nimport { cn } from \"../../cn\";\nimport { Page } from \"../../page/page\";\nimport { type ShopPhoto, ShopSection } from \"../frame\";\nimport { Photo } from \"../photo\";\n\nexport type BookingVariant = \"strip\" | \"panel\" | \"closing\" | \"sticky\";\n\n/** `closing`: the second action beside « Book » (`Call`, `Directions`): the host chooses it from the shop's settings. */\nexport type BookingSecondary = { label: string; href: string };\n\nexport type BookingTime = {\n id: string;\n /** In words, formatted by the app (`Today 4:30 pm`). */\n label: string;\n /** The booking page with this time chosen. */\n href: string;\n};\n\nexport type BookingSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"strip\" */\n variant?: BookingVariant;\n /** `strip`: the next free times, in order (the first `count`). */\n times?: readonly BookingTime[];\n /** `strip`: the group's name (`Next free times`). */\n label: string;\n /** `strip`: said when no time is free. */\n emptyLabel?: string;\n /** The booking page (`All times →`, `Book`). */\n href: string;\n /** The words of that link / button. */\n actionLabel: string;\n /** `panel`: the invitation (`Ready when you are`), and why. */\n title?: React.ReactNode;\n body?: React.ReactNode;\n /** `closing`: the shop's photo, one the page does not already show (the host plans it). Wins over `mark`. */\n photo?: ShopPhoto;\n /** `closing`: the shop's mark, when there is no photo. Decorative (hidden from assistive technology). */\n mark?: React.ReactNode;\n /**\n * `closing`: the next free time (`Tomorrow 9 am`). On a closed day it is the next opening's. Absent, the call is the\n * title and the primary action alone: never an empty box.\n */\n nextTime?: BookingTime;\n /** `closing`: the words before the time (`Next free time`). */\n nextTimeLabel?: string;\n /** `closing`: « Call » or « Directions ». */\n secondary?: BookingSecondary;\n linkAs?: LinkComponent;\n /** `sticky`: the selector of the page's own action (`#hero-book`): while it is on screen the bar hides. */\n hideWhileVisible?: string;\n};\n\ntype ClosingCallProps = Omit<React.ComponentProps<\"section\">, \"title\"> &\n Pick<BookingSectionProps, \"body\" | \"photo\" | \"mark\" | \"nextTime\" | \"nextTimeLabel\" | \"secondary\" | \"href\" | \"actionLabel\" | \"linkAs\"> & { title: React.ReactNode };\n\n/** The photo, or the mark when there is none, or nothing: the call then reads on one column. */\nfunction ClosingMedia({ photo, mark }: Pick<BookingSectionProps, \"photo\" | \"mark\">) {\n if (photo) return <Photo photo={photo} ratio=\"4/3\" sizes=\"(min-width: 64rem) 36rem, calc(100vw - 2rem)\" />;\n if (!mark) return null;\n return (\n <div aria-hidden className=\"grid aspect-[4/3] w-full place-items-center overflow-hidden rounded-xl bg-accent-soft text-fg-accent [&>svg]:h-1/2 [&>svg]:w-auto\">\n {mark}\n </div>\n );\n}\n\nfunction ClosingCall({ title, body, photo, mark, nextTime, nextTimeLabel, secondary, href, actionLabel, linkAs, className, ...props }: ClosingCallProps) {\n const headingId = React.useId();\n const hasMedia = Boolean(photo ?? mark);\n return (\n <ShopSection aria-labelledby={headingId} data-variant=\"closing\" bleed className={className} {...props}>\n <Page>\n <div className={cn(\"grid items-center gap-6 rounded-2xl bg-surface-1 p-4 sm:p-6 lg:gap-10 lg:p-8\", hasMedia && \"lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]\")}>\n <ClosingMedia photo={photo} mark={mark} />\n <div className=\"flex min-w-0 flex-col items-start gap-4\">\n <h2 id={headingId} className=\"m-0 text-2xl font-bold leading-tight text-fg sm:text-3xl\">\n {title}\n </h2>\n {body ? <p className=\"m-0 max-w-prose text-[15px] leading-relaxed text-fg-secondary\">{body}</p> : null}\n {nextTime ? (\n <p className=\"m-0 flex flex-wrap items-center gap-2 text-sm text-fg-secondary\">\n {nextTimeLabel ? <span>{nextTimeLabel}</span> : null}\n <BlockLink href={nextTime.href} linkAs={linkAs} className=\"inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-2 px-3 text-sm font-semibold tabular-nums text-fg no-underline hover:border-accent hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {nextTime.label}\n </BlockLink>\n </p>\n ) : null}\n <div className=\"flex flex-wrap items-center gap-3\">\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size: \"lg\" }), \"no-underline\")}>\n {actionLabel}\n </BlockLink>\n {secondary ? (\n <BlockLink href={secondary.href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"secondary\", size: \"lg\" }), \"no-underline\")}>\n {secondary.label}\n </BlockLink>\n ) : null}\n </div>\n </div>\n </div>\n </Page>\n </ShopSection>\n );\n}\n\n/** The way to book: the next free times, a closing call, or the phone bar. */\nexport function BookingSection({ variant = \"strip\", times = [], label, emptyLabel, href, actionLabel, title, body, linkAs, hideWhileVisible, photo, mark, nextTime, nextTimeLabel, secondary, className, ...props }: BookingSectionProps) {\n const action = (size: \"md\" | \"lg\") => (\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size }), \"no-underline\")}>\n {actionLabel}\n </BlockLink>\n );\n if (variant === \"sticky\") {\n return (\n <StickyAction hideWhileVisible={hideWhileVisible} data-variant=\"sticky\" className={className} {...(props as object)}>\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size: \"lg\" }), \"w-full justify-center no-underline\")}>\n {actionLabel}\n </BlockLink>\n </StickyAction>\n );\n }\n if (variant === \"closing\") {\n return <ClosingCall title={title ?? label} body={body} photo={photo} mark={mark} nextTime={nextTime} nextTimeLabel={nextTimeLabel} secondary={secondary} href={href} actionLabel={actionLabel} linkAs={linkAs} className={className} {...props} />;\n }\n if (variant === \"panel\") {\n return (\n <ShopSection aria-label={typeof title === \"string\" ? title : label} data-variant=\"panel\" className={className} {...props}>\n <CtaPanel title={title ?? label} body={body}>\n {action(\"lg\")}\n </CtaPanel>\n </ShopSection>\n );\n }\n return (\n <ShopSection aria-label={label} data-variant=\"strip\" className={className} {...props}>\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-2 rounded-xl border border-border-default bg-surface-1 p-3 sm:px-4\">\n <p className=\"m-0 order-1 text-sm font-semibold text-fg\">{label}</p>\n {times.length > 0 ? (\n <ul className=\"m-0 order-3 grid w-full list-none grid-cols-2 gap-2 p-0 sm:order-2 sm:flex sm:w-auto sm:min-w-0 sm:flex-1 sm:flex-wrap\">\n {times.map((t) => (\n <li key={t.id}>\n <BlockLink href={t.href} linkAs={linkAs} className=\"inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-2 px-3 text-[13px] font-semibold tabular-nums text-fg no-underline hover:border-accent hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {t.label}\n </BlockLink>\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"m-0 order-3 w-full text-sm text-fg-secondary sm:order-2 sm:w-auto sm:flex-1\">{emptyLabel}</p>\n )}\n <BlockLink href={href} linkAs={linkAs} className=\"order-2 ml-auto inline-flex min-h-11 items-center gap-1 text-[13px] sm:order-3 font-semibold text-fg-accent no-underline hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {actionLabel} <span aria-hidden>→</span>\n </BlockLink>\n </div>\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,YAAY,WAAW;AA4DH,cAuBN,YAvBM;AADpB,SAAS,aAAa,EAAE,OAAO,KAAK,GAAgD;AAClF,MAAI,MAAO,QAAO,oBAAC,SAAM,OAAc,OAAM,OAAM,OAAM,gDAA+C;AACxG,MAAI,CAAC,KAAM,QAAO;AAClB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version":3,"sources":["../../src/shop/booking/booking.tsx"],"sourcesContent":["// Server-safe (the phone bar is a client island imported through its own entry). The way to book (ADR-007 §3): `strip` —\n// the next free times, one tap each, in one line; `panel` — the closing call in a box; `closing` — the closing call of a look (the shop's photo or mark, the next free time, Book); `sticky` — the phone bar, held at the bottom\n// edge and never over content. The times are resolved by the product: the section draws them, it never fetches.\nimport { buttonVariants } from \"@krizaka/ui/button\";\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { StickyAction } from \"@krizaka/ui/sticky-action\";\nimport * as React from \"react\";\n\nimport { BlockLink, type LinkComponent } from \"../../block-link\";\nimport { cn } from \"../../cn\";\nimport { Page } from \"../../page/page\";\nimport { type ShopPhoto, ShopSection, type ShopSectionProps } from \"../frame\";\nimport { Photo } from \"../photo\";\n\nexport type BookingVariant = \"strip\" | \"panel\" | \"closing\" | \"sticky\";\n\n/** `closing`: the second action beside « Book » (`Call`, `Directions`): the host chooses it from the shop's settings. */\nexport type BookingSecondary = { label: string; href: string };\n\nexport type BookingTime = {\n id: string;\n /** In words, formatted by the app (`Today 4:30 pm`). */\n label: string;\n /** The booking page with this time chosen. */\n href: string;\n};\n\nexport type BookingSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & Pick<ShopSectionProps, \"mascot\"> & {\n /** @default \"strip\" */\n variant?: BookingVariant;\n /** `strip`: the next free times, in order (the first `count`). */\n times?: readonly BookingTime[];\n /** `strip`: the group's name (`Next free times`). */\n label: string;\n /** `strip`: said when no time is free. */\n emptyLabel?: string;\n /** The booking page (`All times →`, `Book`). */\n href: string;\n /** The words of that link / button. */\n actionLabel: string;\n /** `panel`: the invitation (`Ready when you are`), and why. */\n title?: React.ReactNode;\n body?: React.ReactNode;\n /** `closing`: the shop's photo, one the page does not already show (the host plans it). Wins over `mark`. */\n photo?: ShopPhoto;\n /** `closing`: the shop's mark, when there is no photo. Decorative (hidden from assistive technology). */\n mark?: React.ReactNode;\n /**\n * `closing`: the next free time (`Tomorrow 9 am`). On a closed day it is the next opening's. Absent, the call is the\n * title and the primary action alone: never an empty box.\n */\n nextTime?: BookingTime;\n /** `closing`: the words before the time (`Next free time`). */\n nextTimeLabel?: string;\n /** `closing`: « Call » or « Directions ». */\n secondary?: BookingSecondary;\n linkAs?: LinkComponent;\n /** `sticky`: the selector of the page's own action (`#hero-book`): while it is on screen the bar hides. */\n hideWhileVisible?: string;\n};\n\ntype ClosingCallProps = Omit<React.ComponentProps<\"section\">, \"title\"> & Pick<ShopSectionProps, \"mascot\"> &\n Pick<BookingSectionProps, \"body\" | \"photo\" | \"mark\" | \"nextTime\" | \"nextTimeLabel\" | \"secondary\" | \"href\" | \"actionLabel\" | \"linkAs\"> & { title: React.ReactNode };\n\n/** The photo, or the mark when there is none, or nothing: the call then reads on one column. */\nfunction ClosingMedia({ photo, mark }: Pick<BookingSectionProps, \"photo\" | \"mark\">) {\n if (photo) return <Photo photo={photo} ratio=\"4/3\" sizes=\"(min-width: 64rem) 36rem, calc(100vw - 2rem)\" />;\n if (!mark) return null;\n return (\n <div aria-hidden className=\"grid aspect-[4/3] w-full place-items-center overflow-hidden rounded-xl bg-accent-soft text-fg-accent [&>svg]:h-1/2 [&>svg]:w-auto\">\n {mark}\n </div>\n );\n}\n\nfunction ClosingCall({ title, body, photo, mark, nextTime, nextTimeLabel, secondary, href, actionLabel, linkAs, className, ...props }: ClosingCallProps) {\n const headingId = React.useId();\n const hasMedia = Boolean(photo ?? mark);\n return (\n <ShopSection aria-labelledby={headingId} data-variant=\"closing\" bleed className={className} {...props}>\n <Page>\n <div className={cn(\"grid items-center gap-6 rounded-2xl bg-surface-1 p-4 sm:p-6 lg:gap-10 lg:p-8\", hasMedia && \"lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]\")}>\n <ClosingMedia photo={photo} mark={mark} />\n <div className=\"flex min-w-0 flex-col items-start gap-4\">\n <h2 id={headingId} className=\"m-0 text-2xl font-bold leading-tight text-fg sm:text-3xl\">\n {title}\n </h2>\n {body ? <p className=\"m-0 max-w-prose text-[15px] leading-relaxed text-fg-secondary\">{body}</p> : null}\n {nextTime ? (\n <p className=\"m-0 flex flex-wrap items-center gap-2 text-sm text-fg-secondary\">\n {nextTimeLabel ? <span>{nextTimeLabel}</span> : null}\n <BlockLink href={nextTime.href} linkAs={linkAs} className=\"inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-2 px-3 text-sm font-semibold tabular-nums text-fg no-underline hover:border-accent hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {nextTime.label}\n </BlockLink>\n </p>\n ) : null}\n <div className=\"flex flex-wrap items-center gap-3\">\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size: \"lg\" }), \"no-underline\")}>\n {actionLabel}\n </BlockLink>\n {secondary ? (\n <BlockLink href={secondary.href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"secondary\", size: \"lg\" }), \"no-underline\")}>\n {secondary.label}\n </BlockLink>\n ) : null}\n </div>\n </div>\n </div>\n </Page>\n </ShopSection>\n );\n}\n\n/** The way to book: the next free times, a closing call, or the phone bar. */\nexport function BookingSection({ variant = \"strip\", times = [], label, emptyLabel, href, actionLabel, title, body, linkAs, hideWhileVisible, photo, mark, nextTime, nextTimeLabel, secondary, className, ...props }: BookingSectionProps) {\n const action = (size: \"md\" | \"lg\") => (\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size }), \"no-underline\")}>\n {actionLabel}\n </BlockLink>\n );\n if (variant === \"sticky\") {\n return (\n <StickyAction hideWhileVisible={hideWhileVisible} data-variant=\"sticky\" className={className} {...(props as object)}>\n <BlockLink href={href} linkAs={linkAs} className={cn(buttonVariants({ variant: \"primary\", size: \"lg\" }), \"w-full justify-center no-underline\")}>\n {actionLabel}\n </BlockLink>\n </StickyAction>\n );\n }\n if (variant === \"closing\") {\n return <ClosingCall title={title ?? label} body={body} photo={photo} mark={mark} nextTime={nextTime} nextTimeLabel={nextTimeLabel} secondary={secondary} href={href} actionLabel={actionLabel} linkAs={linkAs} className={className} {...props} />;\n }\n if (variant === \"panel\") {\n return (\n <ShopSection aria-label={typeof title === \"string\" ? title : label} data-variant=\"panel\" className={className} {...props}>\n <CtaPanel title={title ?? label} body={body}>\n {action(\"lg\")}\n </CtaPanel>\n </ShopSection>\n );\n }\n return (\n <ShopSection aria-label={label} data-variant=\"strip\" className={className} {...props}>\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-2 rounded-xl border border-border-default bg-surface-1 p-3 sm:px-4\">\n <p className=\"m-0 order-1 text-sm font-semibold text-fg\">{label}</p>\n {times.length > 0 ? (\n <ul className=\"m-0 order-3 grid w-full list-none grid-cols-2 gap-2 p-0 sm:order-2 sm:flex sm:w-auto sm:min-w-0 sm:flex-1 sm:flex-wrap\">\n {times.map((t) => (\n <li key={t.id}>\n <BlockLink href={t.href} linkAs={linkAs} className=\"inline-flex min-h-11 items-center rounded-md border border-border-control bg-surface-2 px-3 text-[13px] font-semibold tabular-nums text-fg no-underline hover:border-accent hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {t.label}\n </BlockLink>\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"m-0 order-3 w-full text-sm text-fg-secondary sm:order-2 sm:w-auto sm:flex-1\">{emptyLabel}</p>\n )}\n <BlockLink href={href} linkAs={linkAs} className=\"order-2 ml-auto inline-flex min-h-11 items-center gap-1 text-[13px] sm:order-3 font-semibold text-fg-accent no-underline hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\">\n {actionLabel} <span aria-hidden>→</span>\n </BlockLink>\n </div>\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,YAAY,WAAW;AA4DH,cAuBN,YAvBM;AADpB,SAAS,aAAa,EAAE,OAAO,KAAK,GAAgD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AAA,MAAY;AAAA,MAAC,oBAAC,UAAK,eAAW,MAAC,oBAAC;AAAA,OACnC;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-ZYHWJ7U5.js";
4
4
  import {
5
5
  ShopSection
6
- } from "../chunk-A7MQPIEG.js";
6
+ } from "../chunk-M3T5RQYV.js";
7
7
  import {
8
8
  cn
9
9
  } from "../chunk-B47WSPMP.js";
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
+ import { ShopSectionProps } from '../shop.js';
2
3
 
3
4
  type ShopQuestion = {
4
5
  id: string;
5
6
  question: string;
6
7
  answer: string;
7
8
  };
8
- type FaqSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
9
+ type FaqSectionProps = Omit<React.ComponentProps<"section">, "title"> & Pick<ShopSectionProps, "mascot"> & {
9
10
  /** @default "list" */
10
11
  variant?: "list";
11
12
  title: React.ReactNode;
package/dist/shop/faq.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShopSection
3
- } from "../chunk-A7MQPIEG.js";
3
+ } from "../chunk-M3T5RQYV.js";
4
4
  import "../chunk-B47WSPMP.js";
5
5
 
6
6
  // src/shop/faq/faq.tsx
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shop/faq/faq.tsx"],"sourcesContent":["// Server-safe. The questions clients ask (ADR-007 §3): a native `details` each — no script — and the page's FAQPage\n// JSON-LD, so a search engine reads the same answers.\nimport * as React from \"react\";\n\nimport { ShopSection } from \"../frame\";\n\nexport type ShopQuestion = { id: string; question: string; answer: string };\n\nexport type FaqSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** @default \"list\" */\n variant?: \"list\";\n title: React.ReactNode;\n questions: readonly ShopQuestion[];\n};\n\n/** The FAQPage structured data of a list of questions, as a JSON string safe inside a `script`. */\nexport function faqJsonLd(questions: readonly ShopQuestion[]): string {\n const data = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"FAQPage\",\n mainEntity: questions.map((q) => ({ \"@type\": \"Question\", name: q.question, acceptedAnswer: { \"@type\": \"Answer\", text: q.answer } })),\n };\n return JSON.stringify(data).replace(/</g, \"\\\\u003c\");\n}\n\n/** The questions and their answers. */\nexport function FaqSection({ title, questions, className, ...props }: FaqSectionProps) {\n if (questions.length === 0) return null;\n return (\n <ShopSection title={title} className={className} data-variant=\"list\" {...props}>\n <div className=\"max-w-3xl divide-y divide-border-subtle border-y border-border-subtle\">\n {questions.map((q) => (\n <details key={q.id} className=\"group py-3\">\n <summary className=\"flex min-h-11 cursor-pointer list-none items-center justify-between gap-4 font-semibold text-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden\">\n {q.question}\n <span aria-hidden className=\"shrink-0 text-fg-secondary transition-transform group-open:rotate-45 motion-reduce:transition-none\">+</span>\n </summary>\n <p className=\"m-0 mt-2 text-[15px] leading-relaxed text-fg-secondary\">{q.answer}</p>\n </details>\n ))}\n </div>\n <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: faqJsonLd(questions) }} />\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAiCY,SAEE,KAFF;AAjBL,SAAS,UAAU,WAA4C;AACpE,QAAM,OAAO;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,YAAY,UAAU,IAAI,CAAC,OAAO,EAAE,SAAS,YAAY,MAAM,EAAE,UAAU,gBAAgB,EAAE,SAAS,UAAU,MAAM,EAAE,OAAO,EAAE,EAAE;AAAA,EACrI;AACA,SAAO,KAAK,UAAU,IAAI,EAAE,QAAQ,MAAM,SAAS;AACrD;AAGO,SAAS,WAAW,EAAE,OAAO,WAAW,WAAW,GAAG,MAAM,GAAoB;AACrF,MAAI,UAAU,WAAW,EAAG,QAAO;AACnC,SACE,qBAAC,eAAY,OAAc,WAAsB,gBAAa,QAAQ,GAAG,OACvE;AAAA,wBAAC,SAAI,WAAU,yEACZ,oBAAU,IAAI,CAAC,MACd,qBAAC,aAAmB,WAAU,cAC5B;AAAA,2BAAC,aAAQ,WAAU,wNAChB;AAAA,UAAE;AAAA,QACH,oBAAC,UAAK,eAAW,MAAC,WAAU,sGAAqG,eAAC;AAAA,SACpI;AAAA,MACA,oBAAC,OAAE,WAAU,0DAA0D,YAAE,QAAO;AAAA,SALpE,EAAE,EAMhB,CACD,GACH;AAAA,IACA,oBAAC,YAAO,MAAK,uBAAsB,yBAAyB,EAAE,QAAQ,UAAU,SAAS,EAAE,GAAG;AAAA,KAChG;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/shop/faq/faq.tsx"],"sourcesContent":["// Server-safe. The questions clients ask (ADR-007 §3): a native `details` each — no script — and the page's FAQPage\n// JSON-LD, so a search engine reads the same answers.\nimport * as React from \"react\";\n\nimport { ShopSection, type ShopSectionProps } from \"../frame\";\n\nexport type ShopQuestion = { id: string; question: string; answer: string };\n\nexport type FaqSectionProps = Omit<React.ComponentProps<\"section\">, \"title\"> & Pick<ShopSectionProps, \"mascot\"> & {\n /** @default \"list\" */\n variant?: \"list\";\n title: React.ReactNode;\n questions: readonly ShopQuestion[];\n};\n\n/** The FAQPage structured data of a list of questions, as a JSON string safe inside a `script`. */\nexport function faqJsonLd(questions: readonly ShopQuestion[]): string {\n const data = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"FAQPage\",\n mainEntity: questions.map((q) => ({ \"@type\": \"Question\", name: q.question, acceptedAnswer: { \"@type\": \"Answer\", text: q.answer } })),\n };\n return JSON.stringify(data).replace(/</g, \"\\\\u003c\");\n}\n\n/** The questions and their answers. */\nexport function FaqSection({ title, questions, className, ...props }: FaqSectionProps) {\n if (questions.length === 0) return null;\n return (\n <ShopSection title={title} className={className} data-variant=\"list\" {...props}>\n <div className=\"max-w-3xl divide-y divide-border-subtle border-y border-border-subtle\">\n {questions.map((q) => (\n <details key={q.id} className=\"group py-3\">\n <summary className=\"flex min-h-11 cursor-pointer list-none items-center justify-between gap-4 font-semibold text-fg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden\">\n {q.question}\n <span aria-hidden className=\"shrink-0 text-fg-secondary transition-transform group-open:rotate-45 motion-reduce:transition-none\">+</span>\n </summary>\n <p className=\"m-0 mt-2 text-[15px] leading-relaxed text-fg-secondary\">{q.answer}</p>\n </details>\n ))}\n </div>\n <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: faqJsonLd(questions) }} />\n </ShopSection>\n );\n}\n"],"mappings":";;;;;;AAiCY,SAEE,KAFF;AAjBL,SAAS,UAAU,WAA4C;AACpE,QAAM,OAAO;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,YAAY,UAAU,IAAI,CAAC,OAAO,EAAE,SAAS,YAAY,MAAM,EAAE,UAAU,gBAAgB,EAAE,SAAS,UAAU,MAAM,EAAE,OAAO,EAAE,EAAE;AAAA,EACrI;AACA,SAAO,KAAK,UAAU,IAAI,EAAE,QAAQ,MAAM,SAAS;AACrD;AAGO,SAAS,WAAW,EAAE,OAAO,WAAW,WAAW,GAAG,MAAM,GAAoB;AACrF,MAAI,UAAU,WAAW,EAAG,QAAO;AACnC,SACE,qBAAC,eAAY,OAAc,WAAsB,gBAAa,QAAQ,GAAG,OACvE;AAAA,wBAAC,SAAI,WAAU,yEACZ,oBAAU,IAAI,CAAC,MACd,qBAAC,aAAmB,WAAU,cAC5B;AAAA,2BAAC,aAAQ,WAAU,wNAChB;AAAA,UAAE;AAAA,QACH,oBAAC,UAAK,eAAW,MAAC,WAAU,sGAAqG,eAAC;AAAA,SACpI;AAAA,MACA,oBAAC,OAAE,WAAU,0DAA0D,YAAE,QAAO;AAAA,SALpE,EAAE,EAMhB,CACD,GACH;AAAA,IACA,oBAAC,YAAO,MAAK,uBAAsB,yBAAyB,EAAE,QAAQ,UAAU,SAAS,EAAE,GAAG;AAAA,KAChG;AAEJ;","names":[]}
@@ -6,7 +6,7 @@ import {
6
6
  } from "../chunk-ZYHWJ7U5.js";
7
7
  import {
8
8
  ShopSection
9
- } from "../chunk-A7MQPIEG.js";
9
+ } from "../chunk-M3T5RQYV.js";
10
10
  import {
11
11
  cn
12
12
  } from "../chunk-B47WSPMP.js";
@@ -0,0 +1,43 @@
1
+ import * as _krizaka_tokens_shop_presets from '@krizaka/tokens/shop-presets';
2
+ import { ShopPage, Section } from '../shop.js';
3
+ import { MascotBird } from '@krizaka/ui/mascots';
4
+ import * as React from 'react';
5
+ import 'zod/mini';
6
+
7
+ /** What `applyLook` reads of a look: its id and version, and one variant per section type. */
8
+ type ShopLookLike = {
9
+ id: string;
10
+ version: number;
11
+ variants: Readonly<Record<string, string>>;
12
+ };
13
+ /** The six looks, in the order of the addendum (Cahier first). */
14
+ declare const SHOP_LOOKS: _krizaka_tokens_shop_presets.ShopPreset[];
15
+ /** A look by id, or undefined for a trade preset or an unknown id. */
16
+ declare const shopLookOf: (id: string) => _krizaka_tokens_shop_presets.ShopPreset | undefined;
17
+ /**
18
+ * The page wearing a look: its preset reference, the look's own density and accent, and the variants of its sections. Everything
19
+ * else is the owner's and stays: `applyLook(applyLook(p, a), b)` has the content of `p`.
20
+ */
21
+ declare function applyLook(page: ShopPage, look: ShopLookLike): ShopPage;
22
+
23
+ /** The section (and booking variant) that carries a bird, and which: the beaver builds the shop, the owl reads, the falcon watches, the crane listens, the flamingo answers, the pigeon delivers. */
24
+ declare const MASCOT_SLOTS: {
25
+ readonly "booking:strip": "beaver";
26
+ readonly reviews: "owl";
27
+ readonly policies: "falcon";
28
+ readonly story: "crane";
29
+ readonly faq: "flamingo";
30
+ readonly "booking:closing": "pigeon";
31
+ };
32
+ /** The bird of a section under a look, or none: only a look with `mascots: "on"`; never the hero, the gallery, the wall or the TV. */
33
+ declare function mascotFor(section: Pick<Section, "type" | "variant">, look: {
34
+ mascots?: string;
35
+ } | undefined): MascotBird | undefined;
36
+ /** The bird, small, in the brand's accent: decorative (`aria-hidden`), the words stay beside it. */
37
+ declare function ShopMascot({ bird, size }: {
38
+ bird: MascotBird;
39
+ size?: number;
40
+ }): React.JSX.Element;
41
+
42
+ export { MASCOT_SLOTS, SHOP_LOOKS, ShopMascot, applyLook, mascotFor, shopLookOf };
43
+ export type { ShopLookLike };
@@ -0,0 +1,52 @@
1
+ import {
2
+ SECTION_DEFINITIONS
3
+ } from "../chunk-ZFR6ZNXD.js";
4
+ import "../chunk-ZYHWJ7U5.js";
5
+
6
+ // src/shop/look/apply-look.ts
7
+ import { shopPresets } from "@krizaka/tokens/shop-presets";
8
+ var SHOP_LOOKS = ["look-cahier", "look-krizaka", "look-editorial", "look-boutique", "look-affiche", "look-nuit"].map((id) => shopPresets.find((p) => p.id === id)).filter((p) => p !== void 0);
9
+ var shopLookOf = (id) => SHOP_LOOKS.find((p) => p.id === id);
10
+ var REWRITTEN_BOOKING = /* @__PURE__ */ new Set(["strip", "panel"]);
11
+ var variantsOf = (type) => SECTION_DEFINITIONS.find((d) => d.type === type)?.variants;
12
+ function restyle(section, look) {
13
+ const variant = look.variants[section.type];
14
+ if (!variant || variant === section.variant || !variantsOf(section.type)?.includes(variant)) return section;
15
+ if (section.type === "booking" && !REWRITTEN_BOOKING.has(section.variant)) return section;
16
+ return { ...section, variant };
17
+ }
18
+ function applyLook(page, look) {
19
+ const sections = page.sections.map((s) => restyle(s, look));
20
+ const same = page.preset.id === look.id && page.preset.version === look.version && page.density === void 0 && page.accent === void 0 && sections.every((s, i) => s === page.sections[i]);
21
+ if (same) return page;
22
+ return { ...page, preset: { id: look.id, version: look.version }, density: void 0, accent: void 0, sections };
23
+ }
24
+
25
+ // src/shop/look/mascots.tsx
26
+ import { Mascot } from "@krizaka/ui/mascots";
27
+ import { jsx } from "react/jsx-runtime";
28
+ var MASCOT_SLOTS = {
29
+ "booking:strip": "beaver",
30
+ reviews: "owl",
31
+ policies: "falcon",
32
+ story: "crane",
33
+ faq: "flamingo",
34
+ "booking:closing": "pigeon"
35
+ };
36
+ function mascotFor(section, look) {
37
+ if (look?.mascots !== "on") return void 0;
38
+ const slots = MASCOT_SLOTS;
39
+ return slots[`${section.type}:${section.variant}`] ?? (section.type === "booking" ? void 0 : slots[section.type]);
40
+ }
41
+ function ShopMascot({ bird, size = 56 }) {
42
+ return /* @__PURE__ */ jsx(Mascot, { bird, tone: "brand", size, life: true, "aria-hidden": true });
43
+ }
44
+ export {
45
+ MASCOT_SLOTS,
46
+ SHOP_LOOKS,
47
+ ShopMascot,
48
+ applyLook,
49
+ mascotFor,
50
+ shopLookOf
51
+ };
52
+ //# sourceMappingURL=look.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/shop/look/apply-look.ts","../../src/shop/look/mascots.tsx"],"sourcesContent":["// Pure. A look (`look-*` of @krizaka/tokens, akinaza#478) is applied to a shop page by rewriting the variants of the sections the\n// page already has — never their order, settings, blocks, text or photos. The closing call and the sticky bar are different jobs\n// from the strip of next times, so a look leaves them as they are.\nimport { shopPresets } from \"@krizaka/tokens/shop-presets\";\n\nimport { SECTION_DEFINITIONS } from \"../catalogue\";\nimport type { Section, ShopPage } from \"../schema\";\n\n/** What `applyLook` reads of a look: its id and version, and one variant per section type. */\nexport type ShopLookLike = { id: string; version: number; variants: Readonly<Record<string, string>> };\n\n/** The six looks, in the order of the addendum (Cahier first). */\nexport const SHOP_LOOKS = [\"look-cahier\", \"look-krizaka\", \"look-editorial\", \"look-boutique\", \"look-affiche\", \"look-nuit\"]\n .map((id) => shopPresets.find((p) => p.id === id))\n .filter((p): p is (typeof shopPresets)[number] => p !== undefined);\n\n/** A look by id, or undefined for a trade preset or an unknown id. */\nexport const shopLookOf = (id: string) => SHOP_LOOKS.find((p) => p.id === id);\n\n/** Booking variants a look rewrites: the strip of next times and the panel. `closing` and `sticky` keep their own job. */\nconst REWRITTEN_BOOKING = new Set([\"strip\", \"panel\"]);\n\nconst variantsOf = (type: string) => SECTION_DEFINITIONS.find((d) => d.type === type)?.variants as readonly string[] | undefined;\n\nfunction restyle(section: Section, look: ShopLookLike): Section {\n const variant = look.variants[section.type];\n if (!variant || variant === section.variant || !variantsOf(section.type)?.includes(variant)) return section;\n if (section.type === \"booking\" && !REWRITTEN_BOOKING.has(section.variant)) return section;\n return { ...section, variant } as Section;\n}\n\n/**\n * The page wearing a look: its preset reference, the look's own density and accent, and the variants of its sections. Everything\n * else is the owner's and stays: `applyLook(applyLook(p, a), b)` has the content of `p`.\n */\nexport function applyLook(page: ShopPage, look: ShopLookLike): ShopPage {\n const sections = page.sections.map((s) => restyle(s, look));\n const same = page.preset.id === look.id && page.preset.version === look.version && page.density === undefined && page.accent === undefined && sections.every((s, i) => s === page.sections[i]);\n if (same) return page;\n return { ...page, preset: { id: look.id, version: look.version }, density: undefined, accent: undefined, sections };\n}\n","// Server-safe. The Krizaka look's birds (akinaza#478): at most one per section, each one doing its job, never on the first\n// screen nor on the pictures. The host asks `mascotFor` and hands the result to the section's `mascot` slot.\nimport { Mascot, type MascotBird } from \"@krizaka/ui/mascots\";\nimport * as React from \"react\";\n\nimport type { Section } from \"../schema\";\n\n/** The section (and booking variant) that carries a bird, and which: the beaver builds the shop, the owl reads, the falcon watches, the crane listens, the flamingo answers, the pigeon delivers. */\nexport const MASCOT_SLOTS = {\n \"booking:strip\": \"beaver\",\n reviews: \"owl\",\n policies: \"falcon\",\n story: \"crane\",\n faq: \"flamingo\",\n \"booking:closing\": \"pigeon\",\n} as const satisfies Record<string, MascotBird>;\n\n/** The bird of a section under a look, or none: only a look with `mascots: \"on\"`; never the hero, the gallery, the wall or the TV. */\nexport function mascotFor(section: Pick<Section, \"type\" | \"variant\">, look: { mascots?: string } | undefined): MascotBird | undefined {\n if (look?.mascots !== \"on\") return undefined;\n const slots = MASCOT_SLOTS as Record<string, MascotBird>;\n return slots[`${section.type}:${section.variant}`] ?? (section.type === \"booking\" ? undefined : slots[section.type]);\n}\n\n/** The bird, small, in the brand's accent: decorative (`aria-hidden`), the words stay beside it. */\nexport function ShopMascot({ bird, size = 56 }: { bird: MascotBird; size?: number }) {\n return <Mascot bird={bird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F,IAAM,eAAe;AAAA,EAC1B,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AAAA,EACL,mBAAmB;AACrB;AAGO,SAAS,UAAU,SAA4C,MAAgE;AACpI,MAAI,MAAM,YAAY,KAAM,QAAO;AACnC,QAAM,QAAQ;AACd,SAAO,MAAM,GAAG,QAAQ,IAAI,IAAI,QAAQ,OAAO,EAAE,MAAM,QAAQ,SAAS,YAAY,SAAY,MAAM,QAAQ,IAAI;AACpH;AAGO,SAAS,WAAW,EAAE,MAAM,OAAO,GAAG,GAAwC;AACnF,SAAO,oBAAC,UAAO,MAAY,MAAK,SAAQ,MAAY,MAAI,MAAC,eAAW,MAAC;AACvE;","names":[]}
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
+ import { ShopSectionProps } from '../shop.js';
2
3
 
3
4
  type ShopPolicy = {
4
5
  id: string;
5
6
  term: string;
6
7
  details: React.ReactNode;
7
8
  };
8
- type PoliciesSectionProps = Omit<React.ComponentProps<"section">, "title"> & {
9
+ type PoliciesSectionProps = Omit<React.ComponentProps<"section">, "title"> & Pick<ShopSectionProps, "mascot"> & {
9
10
  /** @default "inline" */
10
11
  variant?: "inline";
11
12
  title: React.ReactNode;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ShopSection
3
- } from "../chunk-A7MQPIEG.js";
3
+ } from "../chunk-M3T5RQYV.js";
4
4
  import "../chunk-B47WSPMP.js";
5
5
 
6
6
  // src/shop/policies/policies.tsx