@brandlab-digital/site-next 3.19.1 → 4.0.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 (317) hide show
  1. package/dist/blog.d.ts +18 -2
  2. package/dist/blog.d.ts.map +1 -1
  3. package/dist/blog.js +14 -2
  4. package/dist/blog.js.map +1 -1
  5. package/dist/instrumentation-client.d.ts +1 -1
  6. package/dist/instrumentation-client.js +1 -1
  7. package/dist/instrumentation-client.js.map +1 -1
  8. package/dist/navigation/index.d.ts +2 -3
  9. package/dist/navigation/index.d.ts.map +1 -1
  10. package/dist/navigation/index.js +2 -3
  11. package/dist/navigation/index.js.map +1 -1
  12. package/dist/next-config.d.ts +1 -17
  13. package/dist/next-config.d.ts.map +1 -1
  14. package/dist/next-config.js +2 -33
  15. package/dist/next-config.js.map +1 -1
  16. package/package.json +4 -33
  17. package/dist/ui-kit/brandlab-skin.d.ts +0 -112
  18. package/dist/ui-kit/brandlab-skin.d.ts.map +0 -1
  19. package/dist/ui-kit/brandlab-skin.js +0 -2
  20. package/dist/ui-kit/brandlab-skin.js.map +0 -1
  21. package/dist/ui-kit/form/copy.d.ts +0 -3
  22. package/dist/ui-kit/form/copy.d.ts.map +0 -1
  23. package/dist/ui-kit/form/copy.js +0 -5
  24. package/dist/ui-kit/form/copy.js.map +0 -1
  25. package/dist/ui-kit/form/dialog.d.ts +0 -24
  26. package/dist/ui-kit/form/dialog.d.ts.map +0 -1
  27. package/dist/ui-kit/form/dialog.js +0 -17
  28. package/dist/ui-kit/form/dialog.js.map +0 -1
  29. package/dist/ui-kit/form/field.d.ts +0 -30
  30. package/dist/ui-kit/form/field.d.ts.map +0 -1
  31. package/dist/ui-kit/form/field.js +0 -11
  32. package/dist/ui-kit/form/field.js.map +0 -1
  33. package/dist/ui-kit/form/index.d.ts +0 -7
  34. package/dist/ui-kit/form/index.d.ts.map +0 -1
  35. package/dist/ui-kit/form/index.js +0 -7
  36. package/dist/ui-kit/form/index.js.map +0 -1
  37. package/dist/ui-kit/form/photo-upload.d.ts +0 -40
  38. package/dist/ui-kit/form/photo-upload.d.ts.map +0 -1
  39. package/dist/ui-kit/form/photo-upload.js +0 -19
  40. package/dist/ui-kit/form/photo-upload.js.map +0 -1
  41. package/dist/ui-kit/form/quote-dialog.d.ts +0 -15
  42. package/dist/ui-kit/form/quote-dialog.d.ts.map +0 -1
  43. package/dist/ui-kit/form/quote-dialog.js +0 -68
  44. package/dist/ui-kit/form/quote-dialog.js.map +0 -1
  45. package/dist/ui-kit/form/quote-form.d.ts +0 -172
  46. package/dist/ui-kit/form/quote-form.d.ts.map +0 -1
  47. package/dist/ui-kit/form/quote-form.js +0 -238
  48. package/dist/ui-kit/form/quote-form.js.map +0 -1
  49. package/dist/ui-kit/form/thank-you.d.ts +0 -40
  50. package/dist/ui-kit/form/thank-you.d.ts.map +0 -1
  51. package/dist/ui-kit/form/thank-you.js +0 -36
  52. package/dist/ui-kit/form/thank-you.js.map +0 -1
  53. package/dist/ui-kit/icon-glyphs.d.ts +0 -41
  54. package/dist/ui-kit/icon-glyphs.d.ts.map +0 -1
  55. package/dist/ui-kit/icon-glyphs.js +0 -138
  56. package/dist/ui-kit/icon-glyphs.js.map +0 -1
  57. package/dist/ui-kit/icon-sprite.d.ts +0 -19
  58. package/dist/ui-kit/icon-sprite.d.ts.map +0 -1
  59. package/dist/ui-kit/icon-sprite.js +0 -44
  60. package/dist/ui-kit/icon-sprite.js.map +0 -1
  61. package/dist/ui-kit/icons.d.ts +0 -50
  62. package/dist/ui-kit/icons.d.ts.map +0 -1
  63. package/dist/ui-kit/icons.js +0 -55
  64. package/dist/ui-kit/icons.js.map +0 -1
  65. package/dist/ui-kit/prefetch.d.ts +0 -59
  66. package/dist/ui-kit/prefetch.d.ts.map +0 -1
  67. package/dist/ui-kit/prefetch.js +0 -63
  68. package/dist/ui-kit/prefetch.js.map +0 -1
  69. package/dist/ui-kit/primitives/badge.d.ts +0 -25
  70. package/dist/ui-kit/primitives/badge.d.ts.map +0 -1
  71. package/dist/ui-kit/primitives/badge.js +0 -21
  72. package/dist/ui-kit/primitives/badge.js.map +0 -1
  73. package/dist/ui-kit/primitives/breadcrumbs.d.ts +0 -27
  74. package/dist/ui-kit/primitives/breadcrumbs.d.ts.map +0 -1
  75. package/dist/ui-kit/primitives/breadcrumbs.js +0 -40
  76. package/dist/ui-kit/primitives/breadcrumbs.js.map +0 -1
  77. package/dist/ui-kit/primitives/button.d.ts +0 -32
  78. package/dist/ui-kit/primitives/button.d.ts.map +0 -1
  79. package/dist/ui-kit/primitives/button.js +0 -8
  80. package/dist/ui-kit/primitives/button.js.map +0 -1
  81. package/dist/ui-kit/primitives/card.d.ts +0 -40
  82. package/dist/ui-kit/primitives/card.d.ts.map +0 -1
  83. package/dist/ui-kit/primitives/card.js +0 -8
  84. package/dist/ui-kit/primitives/card.js.map +0 -1
  85. package/dist/ui-kit/primitives/index.d.ts +0 -16
  86. package/dist/ui-kit/primitives/index.d.ts.map +0 -1
  87. package/dist/ui-kit/primitives/index.js +0 -16
  88. package/dist/ui-kit/primitives/index.js.map +0 -1
  89. package/dist/ui-kit/primitives/layout.d.ts +0 -85
  90. package/dist/ui-kit/primitives/layout.d.ts.map +0 -1
  91. package/dist/ui-kit/primitives/layout.js +0 -52
  92. package/dist/ui-kit/primitives/layout.js.map +0 -1
  93. package/dist/ui-kit/primitives/links.d.ts +0 -74
  94. package/dist/ui-kit/primitives/links.d.ts.map +0 -1
  95. package/dist/ui-kit/primitives/links.js +0 -41
  96. package/dist/ui-kit/primitives/links.js.map +0 -1
  97. package/dist/ui-kit/primitives/lists.d.ts +0 -51
  98. package/dist/ui-kit/primitives/lists.d.ts.map +0 -1
  99. package/dist/ui-kit/primitives/lists.js +0 -34
  100. package/dist/ui-kit/primitives/lists.js.map +0 -1
  101. package/dist/ui-kit/primitives/media-frame.d.ts +0 -33
  102. package/dist/ui-kit/primitives/media-frame.d.ts.map +0 -1
  103. package/dist/ui-kit/primitives/media-frame.js +0 -61
  104. package/dist/ui-kit/primitives/media-frame.js.map +0 -1
  105. package/dist/ui-kit/primitives/media.d.ts +0 -40
  106. package/dist/ui-kit/primitives/media.d.ts.map +0 -1
  107. package/dist/ui-kit/primitives/media.js +0 -9
  108. package/dist/ui-kit/primitives/media.js.map +0 -1
  109. package/dist/ui-kit/primitives/quote-button.d.ts +0 -46
  110. package/dist/ui-kit/primitives/quote-button.d.ts.map +0 -1
  111. package/dist/ui-kit/primitives/quote-button.js +0 -38
  112. package/dist/ui-kit/primitives/quote-button.js.map +0 -1
  113. package/dist/ui-kit/primitives/stat.d.ts +0 -25
  114. package/dist/ui-kit/primitives/stat.d.ts.map +0 -1
  115. package/dist/ui-kit/primitives/stat.js +0 -7
  116. package/dist/ui-kit/primitives/stat.js.map +0 -1
  117. package/dist/ui-kit/repeated-slots.d.ts +0 -153
  118. package/dist/ui-kit/repeated-slots.d.ts.map +0 -1
  119. package/dist/ui-kit/repeated-slots.js +0 -100
  120. package/dist/ui-kit/repeated-slots.js.map +0 -1
  121. package/dist/ui-kit/sections/accordion.d.ts +0 -28
  122. package/dist/ui-kit/sections/accordion.d.ts.map +0 -1
  123. package/dist/ui-kit/sections/accordion.js +0 -14
  124. package/dist/ui-kit/sections/accordion.js.map +0 -1
  125. package/dist/ui-kit/sections/area-map.d.ts +0 -64
  126. package/dist/ui-kit/sections/area-map.d.ts.map +0 -1
  127. package/dist/ui-kit/sections/area-map.js +0 -146
  128. package/dist/ui-kit/sections/area-map.js.map +0 -1
  129. package/dist/ui-kit/sections/before-after.d.ts +0 -59
  130. package/dist/ui-kit/sections/before-after.d.ts.map +0 -1
  131. package/dist/ui-kit/sections/before-after.js +0 -42
  132. package/dist/ui-kit/sections/before-after.js.map +0 -1
  133. package/dist/ui-kit/sections/contact-block.d.ts +0 -77
  134. package/dist/ui-kit/sections/contact-block.d.ts.map +0 -1
  135. package/dist/ui-kit/sections/contact-block.js +0 -23
  136. package/dist/ui-kit/sections/contact-block.js.map +0 -1
  137. package/dist/ui-kit/sections/council-rules.d.ts +0 -64
  138. package/dist/ui-kit/sections/council-rules.d.ts.map +0 -1
  139. package/dist/ui-kit/sections/council-rules.js +0 -46
  140. package/dist/ui-kit/sections/council-rules.js.map +0 -1
  141. package/dist/ui-kit/sections/coverage.d.ts +0 -53
  142. package/dist/ui-kit/sections/coverage.d.ts.map +0 -1
  143. package/dist/ui-kit/sections/coverage.js +0 -57
  144. package/dist/ui-kit/sections/coverage.js.map +0 -1
  145. package/dist/ui-kit/sections/cta-band.d.ts +0 -67
  146. package/dist/ui-kit/sections/cta-band.d.ts.map +0 -1
  147. package/dist/ui-kit/sections/cta-band.js +0 -11
  148. package/dist/ui-kit/sections/cta-band.js.map +0 -1
  149. package/dist/ui-kit/sections/emergency-band.d.ts +0 -60
  150. package/dist/ui-kit/sections/emergency-band.d.ts.map +0 -1
  151. package/dist/ui-kit/sections/emergency-band.js +0 -43
  152. package/dist/ui-kit/sections/emergency-band.js.map +0 -1
  153. package/dist/ui-kit/sections/faqs.d.ts +0 -46
  154. package/dist/ui-kit/sections/faqs.d.ts.map +0 -1
  155. package/dist/ui-kit/sections/faqs.js +0 -39
  156. package/dist/ui-kit/sections/faqs.js.map +0 -1
  157. package/dist/ui-kit/sections/gallery.d.ts +0 -60
  158. package/dist/ui-kit/sections/gallery.d.ts.map +0 -1
  159. package/dist/ui-kit/sections/gallery.js +0 -39
  160. package/dist/ui-kit/sections/gallery.js.map +0 -1
  161. package/dist/ui-kit/sections/hero.d.ts +0 -168
  162. package/dist/ui-kit/sections/hero.d.ts.map +0 -1
  163. package/dist/ui-kit/sections/hero.js +0 -147
  164. package/dist/ui-kit/sections/hero.js.map +0 -1
  165. package/dist/ui-kit/sections/index.d.ts +0 -29
  166. package/dist/ui-kit/sections/index.d.ts.map +0 -1
  167. package/dist/ui-kit/sections/index.js +0 -29
  168. package/dist/ui-kit/sections/index.js.map +0 -1
  169. package/dist/ui-kit/sections/licences.d.ts +0 -95
  170. package/dist/ui-kit/sections/licences.d.ts.map +0 -1
  171. package/dist/ui-kit/sections/licences.js +0 -72
  172. package/dist/ui-kit/sections/licences.js.map +0 -1
  173. package/dist/ui-kit/sections/local-facts.d.ts +0 -107
  174. package/dist/ui-kit/sections/local-facts.d.ts.map +0 -1
  175. package/dist/ui-kit/sections/local-facts.js +0 -44
  176. package/dist/ui-kit/sections/local-facts.js.map +0 -1
  177. package/dist/ui-kit/sections/nearby-areas.d.ts +0 -50
  178. package/dist/ui-kit/sections/nearby-areas.d.ts.map +0 -1
  179. package/dist/ui-kit/sections/nearby-areas.js +0 -49
  180. package/dist/ui-kit/sections/nearby-areas.js.map +0 -1
  181. package/dist/ui-kit/sections/nearby-jobs.d.ts +0 -84
  182. package/dist/ui-kit/sections/nearby-jobs.d.ts.map +0 -1
  183. package/dist/ui-kit/sections/nearby-jobs.js +0 -69
  184. package/dist/ui-kit/sections/nearby-jobs.js.map +0 -1
  185. package/dist/ui-kit/sections/page-header.d.ts +0 -29
  186. package/dist/ui-kit/sections/page-header.d.ts.map +0 -1
  187. package/dist/ui-kit/sections/page-header.js +0 -9
  188. package/dist/ui-kit/sections/page-header.js.map +0 -1
  189. package/dist/ui-kit/sections/price-guide.d.ts +0 -59
  190. package/dist/ui-kit/sections/price-guide.d.ts.map +0 -1
  191. package/dist/ui-kit/sections/price-guide.js +0 -28
  192. package/dist/ui-kit/sections/price-guide.js.map +0 -1
  193. package/dist/ui-kit/sections/price-table.d.ts +0 -42
  194. package/dist/ui-kit/sections/price-table.d.ts.map +0 -1
  195. package/dist/ui-kit/sections/price-table.js +0 -29
  196. package/dist/ui-kit/sections/price-table.js.map +0 -1
  197. package/dist/ui-kit/sections/projects.d.ts +0 -79
  198. package/dist/ui-kit/sections/projects.d.ts.map +0 -1
  199. package/dist/ui-kit/sections/projects.js +0 -69
  200. package/dist/ui-kit/sections/projects.js.map +0 -1
  201. package/dist/ui-kit/sections/proof-strip.d.ts +0 -68
  202. package/dist/ui-kit/sections/proof-strip.d.ts.map +0 -1
  203. package/dist/ui-kit/sections/proof-strip.js +0 -27
  204. package/dist/ui-kit/sections/proof-strip.js.map +0 -1
  205. package/dist/ui-kit/sections/quote-checklist.d.ts +0 -43
  206. package/dist/ui-kit/sections/quote-checklist.d.ts.map +0 -1
  207. package/dist/ui-kit/sections/quote-checklist.js +0 -19
  208. package/dist/ui-kit/sections/quote-checklist.js.map +0 -1
  209. package/dist/ui-kit/sections/rating-chip.d.ts +0 -35
  210. package/dist/ui-kit/sections/rating-chip.d.ts.map +0 -1
  211. package/dist/ui-kit/sections/rating-chip.js +0 -21
  212. package/dist/ui-kit/sections/rating-chip.js.map +0 -1
  213. package/dist/ui-kit/sections/related-services.d.ts +0 -41
  214. package/dist/ui-kit/sections/related-services.d.ts.map +0 -1
  215. package/dist/ui-kit/sections/related-services.js +0 -52
  216. package/dist/ui-kit/sections/related-services.js.map +0 -1
  217. package/dist/ui-kit/sections/reviews-band.d.ts +0 -124
  218. package/dist/ui-kit/sections/reviews-band.d.ts.map +0 -1
  219. package/dist/ui-kit/sections/reviews-band.js +0 -115
  220. package/dist/ui-kit/sections/reviews-band.js.map +0 -1
  221. package/dist/ui-kit/sections/section-sequence.d.ts +0 -41
  222. package/dist/ui-kit/sections/section-sequence.d.ts.map +0 -1
  223. package/dist/ui-kit/sections/section-sequence.js +0 -36
  224. package/dist/ui-kit/sections/section-sequence.js.map +0 -1
  225. package/dist/ui-kit/sections/services-grid.d.ts +0 -82
  226. package/dist/ui-kit/sections/services-grid.d.ts.map +0 -1
  227. package/dist/ui-kit/sections/services-grid.js +0 -90
  228. package/dist/ui-kit/sections/services-grid.js.map +0 -1
  229. package/dist/ui-kit/sections/signature-section.d.ts +0 -42
  230. package/dist/ui-kit/sections/signature-section.d.ts.map +0 -1
  231. package/dist/ui-kit/sections/signature-section.js +0 -14
  232. package/dist/ui-kit/sections/signature-section.js.map +0 -1
  233. package/dist/ui-kit/sections/site-footer-columns.d.ts +0 -12
  234. package/dist/ui-kit/sections/site-footer-columns.d.ts.map +0 -1
  235. package/dist/ui-kit/sections/site-footer-columns.js +0 -63
  236. package/dist/ui-kit/sections/site-footer-columns.js.map +0 -1
  237. package/dist/ui-kit/sections/site-footer.d.ts +0 -66
  238. package/dist/ui-kit/sections/site-footer.d.ts.map +0 -1
  239. package/dist/ui-kit/sections/site-footer.js +0 -49
  240. package/dist/ui-kit/sections/site-footer.js.map +0 -1
  241. package/dist/ui-kit/sections/work-photos.d.ts +0 -15
  242. package/dist/ui-kit/sections/work-photos.d.ts.map +0 -1
  243. package/dist/ui-kit/sections/work-photos.js +0 -24
  244. package/dist/ui-kit/sections/work-photos.js.map +0 -1
  245. package/dist/ui-kit/shell/back-to-top-client.d.ts +0 -9
  246. package/dist/ui-kit/shell/back-to-top-client.d.ts.map +0 -1
  247. package/dist/ui-kit/shell/back-to-top-client.js +0 -8
  248. package/dist/ui-kit/shell/back-to-top-client.js.map +0 -1
  249. package/dist/ui-kit/shell/back-to-top.d.ts +0 -13
  250. package/dist/ui-kit/shell/back-to-top.d.ts.map +0 -1
  251. package/dist/ui-kit/shell/back-to-top.js +0 -14
  252. package/dist/ui-kit/shell/back-to-top.js.map +0 -1
  253. package/dist/ui-kit/shell/call-bar-client.d.ts +0 -8
  254. package/dist/ui-kit/shell/call-bar-client.d.ts.map +0 -1
  255. package/dist/ui-kit/shell/call-bar-client.js +0 -13
  256. package/dist/ui-kit/shell/call-bar-client.js.map +0 -1
  257. package/dist/ui-kit/shell/current-link.d.ts +0 -45
  258. package/dist/ui-kit/shell/current-link.d.ts.map +0 -1
  259. package/dist/ui-kit/shell/current-link.js +0 -54
  260. package/dist/ui-kit/shell/current-link.js.map +0 -1
  261. package/dist/ui-kit/shell/drawer-client.d.ts +0 -22
  262. package/dist/ui-kit/shell/drawer-client.d.ts.map +0 -1
  263. package/dist/ui-kit/shell/drawer-client.js +0 -70
  264. package/dist/ui-kit/shell/drawer-client.js.map +0 -1
  265. package/dist/ui-kit/shell/header-client.d.ts +0 -44
  266. package/dist/ui-kit/shell/header-client.d.ts.map +0 -1
  267. package/dist/ui-kit/shell/header-client.js +0 -59
  268. package/dist/ui-kit/shell/header-client.js.map +0 -1
  269. package/dist/ui-kit/shell/index.d.ts +0 -7
  270. package/dist/ui-kit/shell/index.d.ts.map +0 -1
  271. package/dist/ui-kit/shell/index.js +0 -7
  272. package/dist/ui-kit/shell/index.js.map +0 -1
  273. package/dist/ui-kit/shell/intent-prefetch.d.ts +0 -4
  274. package/dist/ui-kit/shell/intent-prefetch.d.ts.map +0 -1
  275. package/dist/ui-kit/shell/intent-prefetch.js +0 -62
  276. package/dist/ui-kit/shell/intent-prefetch.js.map +0 -1
  277. package/dist/ui-kit/shell/mobile-call-bar.d.ts +0 -25
  278. package/dist/ui-kit/shell/mobile-call-bar.d.ts.map +0 -1
  279. package/dist/ui-kit/shell/mobile-call-bar.js +0 -21
  280. package/dist/ui-kit/shell/mobile-call-bar.js.map +0 -1
  281. package/dist/ui-kit/shell/mobile-drawer.d.ts +0 -41
  282. package/dist/ui-kit/shell/mobile-drawer.d.ts.map +0 -1
  283. package/dist/ui-kit/shell/mobile-drawer.js +0 -41
  284. package/dist/ui-kit/shell/mobile-drawer.js.map +0 -1
  285. package/dist/ui-kit/shell/shell-context.d.ts +0 -3
  286. package/dist/ui-kit/shell/shell-context.d.ts.map +0 -1
  287. package/dist/ui-kit/shell/shell-context.js +0 -5
  288. package/dist/ui-kit/shell/shell-context.js.map +0 -1
  289. package/dist/ui-kit/shell/shell-quote.d.ts +0 -10
  290. package/dist/ui-kit/shell/shell-quote.d.ts.map +0 -1
  291. package/dist/ui-kit/shell/shell-quote.js +0 -13
  292. package/dist/ui-kit/shell/shell-quote.js.map +0 -1
  293. package/dist/ui-kit/shell/site-header.d.ts +0 -55
  294. package/dist/ui-kit/shell/site-header.d.ts.map +0 -1
  295. package/dist/ui-kit/shell/site-header.js +0 -35
  296. package/dist/ui-kit/shell/site-header.js.map +0 -1
  297. package/dist/ui-kit/shell/social-links.d.ts +0 -7
  298. package/dist/ui-kit/shell/social-links.d.ts.map +0 -1
  299. package/dist/ui-kit/shell/social-links.js +0 -12
  300. package/dist/ui-kit/shell/social-links.js.map +0 -1
  301. package/dist/ui-kit/shell/utility-bar.d.ts +0 -33
  302. package/dist/ui-kit/shell/utility-bar.d.ts.map +0 -1
  303. package/dist/ui-kit/shell/utility-bar.js +0 -15
  304. package/dist/ui-kit/shell/utility-bar.js.map +0 -1
  305. package/dist/ui-kit/skin-index.d.ts +0 -4
  306. package/dist/ui-kit/skin-index.d.ts.map +0 -1
  307. package/dist/ui-kit/skin-index.js +0 -3
  308. package/dist/ui-kit/skin-index.js.map +0 -1
  309. package/dist/ui-kit/skin.d.ts +0 -65
  310. package/dist/ui-kit/skin.d.ts.map +0 -1
  311. package/dist/ui-kit/skin.js +0 -60
  312. package/dist/ui-kit/skin.js.map +0 -1
  313. package/dist/ui-kit/structure.css +0 -2546
  314. package/dist/ui-kit/types.d.ts +0 -27
  315. package/dist/ui-kit/types.d.ts.map +0 -1
  316. package/dist/ui-kit/types.js +0 -6
  317. package/dist/ui-kit/types.js.map +0 -1
@@ -1,46 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { COUNCIL_PERMIT_SKIP_REASON, formatCheckedMonth, visibleCouncilRecord, } from '@brandlab-digital/site-core/council-register';
3
- import { SECTION_READY } from '@brandlab-digital/site-core/section-order';
4
- import { Anchor } from '../primitives/links.js';
5
- import { Section, SectionHeading } from '../primitives/layout.js';
6
- import { repeatedSlot, slot } from '../skin.js';
7
- /** A fee in Australian dollars: whole dollars without cents ("$201", "$1,100"), otherwise two places ("$58.50"). */
8
- export function formatCouncilFeeAmount(amountAud) {
9
- const whole = Number.isInteger(amountAud);
10
- return new Intl.NumberFormat('en-AU', {
11
- style: 'currency',
12
- currency: 'AUD',
13
- minimumFractionDigits: whole ? 0 : 2,
14
- maximumFractionDigits: 2,
15
- }).format(amountAud);
16
- }
17
- /** The locked fee line: "{label}: $201 (2026/27)". Every figure carries its financial year. */
18
- export function councilFeeLine(fee, financialYear) {
19
- return `${fee.label}: ${formatCouncilFeeAmount(fee.amountAud)} (${financialYear})`;
20
- }
21
- /** The record when it may show on `asOf`; the guard for a section that renders it. */
22
- export function councilRecordReady(record, asOf) {
23
- return visibleCouncilRecord(record, asOf) ? SECTION_READY : { render: false, reason: COUNCIL_PERMIT_SKIP_REASON };
24
- }
25
- function ruleText(record, wording) {
26
- if (typeof wording === 'function')
27
- return wording(record);
28
- return wording ?? record.rule;
29
- }
30
- /** The record's lines: the rule, its fees, the source with the check month and the site's own council page. */
31
- export function CouncilRecordLines({ record, rule, sourceLabel, councilPage, classes, }) {
32
- const fees = record.fees && record.financialYear ? record.fees : [];
33
- return (_jsxs(_Fragment, { children: [_jsx("p", { ...slot(classes, 'rule'), children: ruleText(record, rule) }), fees.length > 0 ? (_jsx("ul", { role: "list", ...slot(classes, 'fees'), children: fees.map((fee) => (_jsx("li", { ...repeatedSlot('fee'), children: councilFeeLine(fee, record.financialYear) }, fee.label))) })) : null, _jsxs("p", { ...slot(classes, 'source'), children: [_jsx(Anchor, { href: record.sourceUrl, external: true, hooks: {}, children: sourceLabel ?? record.councilName }), `, checked ${formatCheckedMonth(record.checkedOn)}`] }), councilPage ? (_jsx("p", { ...slot(classes, 'councilLink'), children: _jsx(Anchor, { href: councilPage.href, prefetch: false, hooks: {}, children: councilPage.label }) })) : null] }));
34
- }
35
- /** The guard for `SectionSequence`: renders only while the register shows the record. */
36
- export function councilRulesReady({ record, asOf }) {
37
- return councilRecordReady(record, asOf);
38
- }
39
- /** A council page's rules from the register (playbook-trees §2.4): the rule, the fees with their year, the source. */
40
- export function CouncilRules({ record, title, eyebrow, lead, rule, sourceLabel, asOf, headingId = 'council-rules-heading', tone, classes }) {
41
- const shown = visibleCouncilRecord(record, asOf);
42
- if (!shown)
43
- return null;
44
- return (_jsxs(Section, { id: "council-rules", labelledBy: headingId, tone: tone, classes: classes, hooks: { 'data-council': shown.council }, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsx(CouncilRecordLines, { record: shown, rule: rule, sourceLabel: sourceLabel, classes: classes })] }));
45
- }
46
- //# sourceMappingURL=council-rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"council-rules.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/council-rules.tsx"],"names":[],"mappings":";AAaA,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,GAGrB,MAAM,8CAA8C,CAAA;AACrD,OAAO,EAAE,aAAa,EAAiC,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,cAAc,EAA+D,MAAM,yBAAyB,CAAA;AAE9H,OAAO,EAAE,YAAY,EAAE,IAAI,EAAoC,MAAM,YAAY,CAAA;AASjF,oHAAoH;AACpH,MAAM,UAAU,sBAAsB,CAAC,SAAiB;IACtD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;IACzC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;QACpC,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,KAAK;QACf,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,qBAAqB,EAAE,CAAC;KACzB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AACtB,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,cAAc,CAAC,GAAuB,EAAE,aAAqB;IAC3E,OAAO,GAAG,GAAG,CAAC,KAAK,KAAK,sBAAsB,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,aAAa,GAAG,CAAA;AACpF,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,kBAAkB,CAAC,MAA+C,EAAE,IAAW;IAC7F,OAAO,oBAAoB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,IACrF,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `CouncilRules` (`council-rules`, 3.15.0) and the council record lines it shares with `LocalFacts`' permit slot.\n * Server components.\n *\n * Both render one record of the council register (site-core `./council-register`, playbook-trees §2.4): the rule, each\n * fee with its financial year, the council's own page as the source and the month the record was checked. Nothing is\n * invented: a record the register hides (six months after it was checked, or on 1 July after its fees' financial year)\n * renders nothing, and the section's guard says why (`no-current-council-record`). The register's `rule` is a fact;\n * each site words its own sentence from it (`rule` as a function of the record), so same-trade sites never share a\n * council sentence. Locked truth wording: a fee reads \"{label}: $201 (2026/27)\" and the source line ends \", checked\n * {Month Year}\".\n */\nimport type { ReactNode } from 'react'\nimport {\n COUNCIL_PERMIT_SKIP_REASON,\n formatCheckedMonth,\n visibleCouncilRecord,\n type BrandlabCouncilFee,\n type BrandlabCouncilPermitRecord,\n} from '@brandlab-digital/site-core/council-register'\nimport { SECTION_READY, type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order'\nimport { Anchor } from '../primitives/links.js'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry, type SlotClasses } from '../skin.js'\nimport type { UiLink } from '../types.js'\n\n/** The site's wording of the register's rule: text, or a function of the record. Left out, the record's own rule. */\nexport type CouncilRuleWording = ReactNode | ((record: BrandlabCouncilPermitRecord) => ReactNode)\n\n/** The one-off parts of a council record's lines (shared by `CouncilRules` and `LocalFacts`' permit slot). */\nexport type CouncilRecordSlot = 'rule' | 'fees' | 'source' | 'councilLink'\n\n/** A fee in Australian dollars: whole dollars without cents (\"$201\", \"$1,100\"), otherwise two places (\"$58.50\"). */\nexport function formatCouncilFeeAmount(amountAud: number): string {\n const whole = Number.isInteger(amountAud)\n return new Intl.NumberFormat('en-AU', {\n style: 'currency',\n currency: 'AUD',\n minimumFractionDigits: whole ? 0 : 2,\n maximumFractionDigits: 2,\n }).format(amountAud)\n}\n\n/** The locked fee line: \"{label}: $201 (2026/27)\". Every figure carries its financial year. */\nexport function councilFeeLine(fee: BrandlabCouncilFee, financialYear: string): string {\n return `${fee.label}: ${formatCouncilFeeAmount(fee.amountAud)} (${financialYear})`\n}\n\n/** The record when it may show on `asOf`; the guard for a section that renders it. */\nexport function councilRecordReady(record: BrandlabCouncilPermitRecord | undefined, asOf?: Date): BrandlabSectionReadiness {\n return visibleCouncilRecord(record, asOf) ? SECTION_READY : { render: false, reason: COUNCIL_PERMIT_SKIP_REASON }\n}\n\nfunction ruleText(record: BrandlabCouncilPermitRecord, wording: CouncilRuleWording | undefined): ReactNode {\n if (typeof wording === 'function') return wording(record)\n return wording ?? record.rule\n}\n\n/** The record's lines: the rule, its fees, the source with the check month and the site's own council page. */\nexport function CouncilRecordLines({\n record,\n rule,\n sourceLabel,\n councilPage,\n classes,\n}: {\n readonly record: BrandlabCouncilPermitRecord\n readonly rule?: CouncilRuleWording\n readonly sourceLabel?: string\n readonly councilPage?: UiLink\n readonly classes?: SlotClasses<CouncilRecordSlot> | undefined\n}) {\n const fees = record.fees && record.financialYear ? record.fees : []\n return (\n <>\n <p {...slot(classes, 'rule')}>{ruleText(record, rule)}</p>\n {fees.length > 0 ? (\n <ul role=\"list\" {...slot(classes, 'fees')}>\n {fees.map((fee) => (\n <li key={fee.label} {...repeatedSlot('fee')}>\n {councilFeeLine(fee, record.financialYear!)}\n </li>\n ))}\n </ul>\n ) : null}\n <p {...slot(classes, 'source')}>\n <Anchor href={record.sourceUrl} external hooks={{}}>\n {sourceLabel ?? record.councilName}\n </Anchor>\n {`, checked ${formatCheckedMonth(record.checkedOn)}`}\n </p>\n {councilPage ? (\n <p {...slot(classes, 'councilLink')}>\n <Anchor href={councilPage.href} prefetch={false} hooks={{}}>\n {councilPage.label}\n </Anchor>\n </p>\n ) : null}\n </>\n )\n}\n\nexport type CouncilRulesSlot = SectionSlot | SectionHeadingSlot | CouncilRecordSlot | 'fee'\n/** The fees, one per register entry: styled from the skin stylesheet, never by class. */\nexport type CouncilRulesRepeatedSlot = RepeatedSlotOf<'councilRules'>\nexport type CouncilRulesSkin = SkinEntry<CouncilRulesSlot, never, Record<never, never>, CouncilRulesRepeatedSlot>\n\nexport interface CouncilRulesProps extends CouncilRulesSkin {\n /** The council's register record, for example `councilRegister.find((record) => record.council === page.council)`. */\n readonly record: BrandlabCouncilPermitRecord | undefined\n /** The H2, for example \"Hornsby Shire Council tree rules\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n /** The site's own wording of the rule (a function of the record keeps it true when the record changes). */\n readonly rule?: CouncilRuleWording\n /** The source link's text. Defaults to the council's name. */\n readonly sourceLabel?: string\n /** The day the page is built or refreshed (Sydney). Defaults to now. */\n readonly asOf?: Date\n /** Defaults to `council-rules-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** The guard for `SectionSequence`: renders only while the register shows the record. */\nexport function councilRulesReady({ record, asOf }: Pick<CouncilRulesProps, 'record' | 'asOf'>): BrandlabSectionReadiness {\n return councilRecordReady(record, asOf)\n}\n\n/** A council page's rules from the register (playbook-trees §2.4): the rule, the fees with their year, the source. */\nexport function CouncilRules({ record, title, eyebrow, lead, rule, sourceLabel, asOf, headingId = 'council-rules-heading', tone, classes }: CouncilRulesProps) {\n const shown = visibleCouncilRecord(record, asOf)\n if (!shown) return null\n return (\n <Section id=\"council-rules\" labelledBy={headingId} tone={tone} classes={classes} hooks={{ 'data-council': shown.council }}>\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <CouncilRecordLines record={shown} rule={rule} sourceLabel={sourceLabel} classes={classes} />\n </Section>\n )\n}\n"]}
@@ -1,53 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import { type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order';
3
- import { type LinkListEntry, type LinkListLayout } from '../primitives/lists.js';
4
- import { type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js';
5
- import type { RepeatedSlotOf } from '../repeated-slots.js';
6
- import { type SkinEntry } from '../skin.js';
7
- export declare const COVERAGE_VARIANTS: readonly ["list"];
8
- export type CoverageVariant = (typeof COVERAGE_VARIANTS)[number];
9
- export type CoverageSlot = SectionSlot | SectionHeadingSlot | 'groups' | 'hub' | RepeatedSlotOf<'coverage'>;
10
- /** Rendered once per group: styled from the skin stylesheet, never by class. */
11
- export type CoverageRepeatedSlot = RepeatedSlotOf<'coverage'>;
12
- export type CoverageLayout = LinkListLayout;
13
- export type CoverageSkin = SkinEntry<CoverageSlot, CoverageVariant, CoverageLayout, CoverageRepeatedSlot>;
14
- /** One group of areas, for example a region or a council. */
15
- export interface CoverageGroup {
16
- /** A stable slug, rendered as `data-item`. */
17
- readonly id: string;
18
- /** The group's H3, for example "Hills District". Left out on a region page that lists one group. */
19
- readonly title?: string;
20
- /** The group's own page, for example its region page; its heading links there. */
21
- readonly href?: string;
22
- /**
23
- * Every area in the group: `{ label, href }` links its page; `{ label }` with no `href` names an area whose page is
24
- * still noindex (it waits for its return wave) as plain text. Both count towards the hub's "All {n} areas".
25
- */
26
- readonly links: readonly LinkListEntry[];
27
- }
28
- /** The hub link: every area the site serves. */
29
- export interface CoverageHub {
30
- readonly href: string;
31
- /** How many areas the hub lists, for the locked label "All {n} areas". */
32
- readonly count: number;
33
- /** The site's own label instead. */
34
- readonly label?: string;
35
- }
36
- export interface CoverageProps extends CoverageSkin {
37
- /** The H2, for example "Tree services across the Hills District". */
38
- readonly title: ReactNode;
39
- readonly eyebrow?: ReactNode;
40
- readonly lead?: ReactNode;
41
- readonly groups: readonly CoverageGroup[];
42
- readonly hub?: CoverageHub;
43
- /** Defaults to `coverage-heading`. */
44
- readonly headingId?: string;
45
- /** Set by `SectionSequence`. */
46
- readonly tone?: SectionTone;
47
- }
48
- /** The hub link's text: the site's label, or "All {n} areas" ("All 1 area" never reads well, so one is "All areas"). */
49
- export declare function coverageHubLabel(hub: CoverageHub): string;
50
- /** The guard for `SectionSequence`. */
51
- export declare function coverageReady({ groups }: Pick<CoverageProps, 'groups'>): BrandlabSectionReadiness;
52
- export declare function Coverage({ title, eyebrow, lead, groups, hub, headingId, tone, variant, layout, classes }: CoverageProps): import("react/jsx-runtime").JSX.Element | null;
53
- //# sourceMappingURL=coverage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/coverage.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC1F,OAAO,EAA2B,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC9H,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAE/D,eAAO,MAAM,iBAAiB,mBAAoB,CAAA;AAClD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAChE,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,kBAAkB,GAAG,QAAQ,GAAG,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAC3G,gFAAgF;AAChF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAC7D,MAAM,MAAM,cAAc,GAAG,cAAc,CAAA;AAC3C,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,oBAAoB,CAAC,CAAA;AAEzG,6DAA6D;AAC7D,MAAM,WAA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,EAAE,OAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,aAAa,kDAkCrJ"}
@@ -1,57 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * `Coverage` (S15, `coverage`, 3.15.0): the areas served. Server component.
4
- *
5
- * On a region page it lists every suburb in the region; on the areas hub every region's suburbs, grouped (D4: every
6
- * suburb page is indexed and linked). While D4 return waves run, a suburb whose page is still noindex is an entry with
7
- * no `href`: its name as plain text in the same list (`<li>Putney</li>`), because indexable pages never link a noindex
8
- * location page. site-core's `coverageEntries()` decides link or text from the estate plan and the day. The lists are lean (cost item 1f): each group is a `LinkList` of plain
9
- * `<li><a>` entries with no class, hook or icon, so a 120-suburb region stays near 120 bytes a link, and nothing in the
10
- * section prefetches (`data-bl-links="area"`, W2). Groups come from the site's data in money order (regions or
11
- * councils); a group's heading links to its own page when it has one. The groups and their lists are repeated parts:
12
- * style them from `skin.css` (`[data-bl-section="coverage"] [data-slot="group"]`, `… [data-bl="link-list"]`). The hub link reads "All {n} areas" unless the
13
- * site gives its own label. Locked: no invented region names, no "based in" or distance text.
14
- */
15
- import Link from 'next/link';
16
- import { SECTION_READY } from '@brandlab-digital/site-core/section-order';
17
- import { LinkList } from '../primitives/lists.js';
18
- import { Section, SectionHeading } from '../primitives/layout.js';
19
- import { repeatedSlot, slot } from '../skin.js';
20
- export const COVERAGE_VARIANTS = ['list'];
21
- /** The hub link's text: the site's label, or "All {n} areas" ("All 1 area" never reads well, so one is "All areas"). */
22
- export function coverageHubLabel(hub) {
23
- if (hub.label?.trim())
24
- return hub.label;
25
- if (!Number.isInteger(hub.count) || hub.count < 1)
26
- throw new Error('Coverage: the hub count must be a whole number of areas, 1 or more.');
27
- return hub.count === 1 ? 'All areas' : `All ${hub.count} areas`;
28
- }
29
- /** The guard for `SectionSequence`. */
30
- export function coverageReady({ groups }) {
31
- return groups.some((group) => group.links.length > 0) ? SECTION_READY : { render: false, reason: 'no-areas' };
32
- }
33
- function assertGroups(groups) {
34
- const ids = new Set();
35
- for (const group of groups) {
36
- if (!group.id || ids.has(group.id))
37
- throw new Error(`Coverage: every group needs its own id ("${group.id}" is empty or repeated).`);
38
- ids.add(group.id);
39
- const seen = new Set();
40
- for (const link of group.links) {
41
- const key = link.href ?? `text:${link.label}`;
42
- if (seen.has(key))
43
- throw new Error(`Coverage: ${link.href ?? link.label} is listed twice in "${group.id}".`);
44
- seen.add(key);
45
- }
46
- }
47
- if (groups.length > 1 && groups.some((group) => !group.title?.trim()))
48
- throw new Error('Coverage: with more than one group, every group needs its title.');
49
- }
50
- export function Coverage({ title, eyebrow, lead, groups, hub, headingId = 'coverage-heading', tone, variant = 'list', layout, classes }) {
51
- const shown = groups.filter((group) => group.links.length > 0);
52
- if (shown.length === 0)
53
- return null;
54
- assertGroups(shown);
55
- return (_jsxs(Section, { id: "coverage", labelledBy: headingId, tone: tone, variant: variant, classes: classes, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsx("div", { ...slot(classes, 'groups'), children: shown.map((group) => (_jsxs("div", { ...repeatedSlot('group'), "data-item": group.id, children: [group.title ? (_jsx("h3", { ...repeatedSlot('groupHeading'), children: group.href ? (_jsx(Link, { href: group.href, prefetch: false, children: group.title })) : (group.title) })) : null, _jsx(LinkList, { links: group.links, kind: "area", layout: layout })] }, group.id))) }), hub ? (_jsx("p", { ...slot(classes, 'hub'), children: _jsx(Link, { href: hub.href, prefetch: false, children: coverageHubLabel(hub) }) })) : null] }));
56
- }
57
- //# sourceMappingURL=coverage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/coverage.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,aAAa,EAAiC,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAE,QAAQ,EAA2C,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EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,aAC1F,KAAC,cAAc,IAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAI,EAC/F,iBAAS,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,YAC7B,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACpB,kBAAwB,YAAY,CAAC,OAAO,CAAC,eAAa,KAAK,CAAC,EAAE,aAC/D,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CACb,gBAAQ,YAAY,CAAC,cAAc,CAAC,YACjC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CACZ,KAAC,IAAI,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,YACpC,KAAK,CAAC,KAAK,GACP,CACR,CAAC,CAAC,CAAC,CACF,KAAK,CAAC,KAAK,CACZ,GACE,CACN,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAC,MAAM,EAAC,MAAM,EAAE,MAAM,GAAI,KAZpD,KAAK,CAAC,EAAE,CAaZ,CACP,CAAC,GACE,EACL,GAAG,CAAC,CAAC,CAAC,CACL,eAAO,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,YACzB,KAAC,IAAI,IAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,YAClC,gBAAgB,CAAC,GAAG,CAAC,GACjB,GACL,CACL,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `Coverage` (S15, `coverage`, 3.15.0): the areas served. Server component.\n *\n * On a region page it lists every suburb in the region; on the areas hub every region's suburbs, grouped (D4: every\n * suburb page is indexed and linked). While D4 return waves run, a suburb whose page is still noindex is an entry with\n * no `href`: its name as plain text in the same list (`<li>Putney</li>`), because indexable pages never link a noindex\n * location page. site-core's `coverageEntries()` decides link or text from the estate plan and the day. The lists are lean (cost item 1f): each group is a `LinkList` of plain\n * `<li><a>` entries with no class, hook or icon, so a 120-suburb region stays near 120 bytes a link, and nothing in the\n * section prefetches (`data-bl-links=\"area\"`, W2). Groups come from the site's data in money order (regions or\n * councils); a group's heading links to its own page when it has one. The groups and their lists are repeated parts:\n * style them from `skin.css` (`[data-bl-section=\"coverage\"] [data-slot=\"group\"]`, `… [data-bl=\"link-list\"]`). The hub link reads \"All {n} areas\" unless the\n * site gives its own label. Locked: no invented region names, no \"based in\" or distance text.\n */\nimport Link from 'next/link'\nimport type { ReactNode } from 'react'\nimport { SECTION_READY, type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order'\nimport { LinkList, type LinkListEntry, type LinkListLayout } from '../primitives/lists.js'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\n\nexport const COVERAGE_VARIANTS = ['list'] as const\nexport type CoverageVariant = (typeof COVERAGE_VARIANTS)[number]\nexport type CoverageSlot = SectionSlot | SectionHeadingSlot | 'groups' | 'hub' | RepeatedSlotOf<'coverage'>\n/** Rendered once per group: styled from the skin stylesheet, never by class. */\nexport type CoverageRepeatedSlot = RepeatedSlotOf<'coverage'>\nexport type CoverageLayout = LinkListLayout\nexport type CoverageSkin = SkinEntry<CoverageSlot, CoverageVariant, CoverageLayout, CoverageRepeatedSlot>\n\n/** One group of areas, for example a region or a council. */\nexport interface CoverageGroup {\n /** A stable slug, rendered as `data-item`. */\n readonly id: string\n /** The group's H3, for example \"Hills District\". Left out on a region page that lists one group. */\n readonly title?: string\n /** The group's own page, for example its region page; its heading links there. */\n readonly href?: string\n /**\n * Every area in the group: `{ label, href }` links its page; `{ label }` with no `href` names an area whose page is\n * still noindex (it waits for its return wave) as plain text. Both count towards the hub's \"All {n} areas\".\n */\n readonly links: readonly LinkListEntry[]\n}\n\n/** The hub link: every area the site serves. */\nexport interface CoverageHub {\n readonly href: string\n /** How many areas the hub lists, for the locked label \"All {n} areas\". */\n readonly count: number\n /** The site's own label instead. */\n readonly label?: string\n}\n\nexport interface CoverageProps extends CoverageSkin {\n /** The H2, for example \"Tree services across the Hills District\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n readonly groups: readonly CoverageGroup[]\n readonly hub?: CoverageHub\n /** Defaults to `coverage-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** The hub link's text: the site's label, or \"All {n} areas\" (\"All 1 area\" never reads well, so one is \"All areas\"). */\nexport function coverageHubLabel(hub: CoverageHub): string {\n if (hub.label?.trim()) return hub.label\n if (!Number.isInteger(hub.count) || hub.count < 1) throw new Error('Coverage: the hub count must be a whole number of areas, 1 or more.')\n return hub.count === 1 ? 'All areas' : `All ${hub.count} areas`\n}\n\n/** The guard for `SectionSequence`. */\nexport function coverageReady({ groups }: Pick<CoverageProps, 'groups'>): BrandlabSectionReadiness {\n return groups.some((group) => group.links.length > 0) ? SECTION_READY : { render: false, reason: 'no-areas' }\n}\n\nfunction assertGroups(groups: readonly CoverageGroup[]) {\n const ids = new Set<string>()\n for (const group of groups) {\n if (!group.id || ids.has(group.id)) throw new Error(`Coverage: every group needs its own id (\"${group.id}\" is empty or repeated).`)\n ids.add(group.id)\n const seen = new Set<string>()\n for (const link of group.links) {\n const key = link.href ?? `text:${link.label}`\n if (seen.has(key)) throw new Error(`Coverage: ${link.href ?? link.label} is listed twice in \"${group.id}\".`)\n seen.add(key)\n }\n }\n if (groups.length > 1 && groups.some((group) => !group.title?.trim())) throw new Error('Coverage: with more than one group, every group needs its title.')\n}\n\nexport function Coverage({ title, eyebrow, lead, groups, hub, headingId = 'coverage-heading', tone, variant = 'list', layout, classes }: CoverageProps) {\n const shown = groups.filter((group) => group.links.length > 0)\n if (shown.length === 0) return null\n assertGroups(shown)\n return (\n <Section id=\"coverage\" labelledBy={headingId} tone={tone} variant={variant} classes={classes}>\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <div {...slot(classes, 'groups')}>\n {shown.map((group) => (\n <div key={group.id} {...repeatedSlot('group')} data-item={group.id}>\n {group.title ? (\n <h3 {...repeatedSlot('groupHeading')}>\n {group.href ? (\n <Link href={group.href} prefetch={false}>\n {group.title}\n </Link>\n ) : (\n group.title\n )}\n </h3>\n ) : null}\n <LinkList links={group.links} kind=\"area\" layout={layout} />\n </div>\n ))}\n </div>\n {hub ? (\n <p {...slot(classes, 'hub')}>\n <Link href={hub.href} prefetch={false}>\n {coverageHubLabel(hub)}\n </Link>\n </p>\n ) : null}\n </Section>\n )\n}\n"]}
@@ -1,67 +0,0 @@
1
- /**
2
- * S8 `CTABand` (`cta`): the one closing action design a site uses on every page. Server component, no client JS of
3
- * its own. A heading, an optional one-line summary, the quote button (`lead_cta_click` placement `section`, id
4
- * `quote-cta`) and one phone link (`phone_link_click` placement `cta`), phone first like the header, hero and call bar. No "what happens next" filler.
5
- *
6
- * Variants: `plain`; `photo`, with the site's backdrop image in `media` (decorative, so it renders `aria-hidden`);
7
- * `form`, with the site's own quote form in `form` beside the heading and the phone link (the form is the quote
8
- * action there, so the quote button is left out). A `photo` band without `media` or a `form` band without `form`
9
- * renders as `plain`.
10
- *
11
- * Placement (S8): on every page except contact, thank-you and 404, which already end in the form or a confirmation.
12
- * One variant per site, recorded in the skin.
13
- *
14
- * 3.16.0: an optional `eyebrow` above the heading; `layout.arrangement: 'split'` puts the heading and summary on one
15
- * side and the actions on the other from 768 px; and the band's colour comes from the skin's `--bl-color-cta` (falling
16
- * back to `--bl-color-band`), so a site sets its closing band apart from the footer.
17
- */
18
- import type { ReactNode } from 'react';
19
- import type { ButtonVariant } from '../primitives/links.js';
20
- import type { SectionTone } from '../primitives/layout.js';
21
- import { type SkinEntry } from '../skin.js';
22
- import type { UiPhone } from '../types.js';
23
- export declare const CTA_BAND_VARIANTS: readonly ["plain", "photo", "form"];
24
- export type CTABandVariant = (typeof CTA_BAND_VARIANTS)[number];
25
- export type CTABandSlot = 'root' | 'media' | 'inner' | 'content' | 'eyebrow' | 'heading' | 'summary' | 'actions' | 'quote' | 'phone' | 'form';
26
- export interface CTABandLayout {
27
- readonly align?: 'start' | 'center';
28
- /** The quote button's variant (default `primary`). */
29
- readonly quoteVariant?: ButtonVariant;
30
- /** The phone link's variant (default `button`). */
31
- readonly phoneVariant?: 'text' | 'button';
32
- /** `stacked` (the default) or `split`: the words on one side, the actions on the other (3.16.0). */
33
- readonly arrangement?: 'stacked' | 'split';
34
- }
35
- export type CTABandSkin = SkinEntry<CTABandSlot, CTABandVariant, CTABandLayout>;
36
- export declare const CTA_BAND_HEADING_ID = "bl-cta-heading";
37
- export interface CTABandProps extends CTABandSkin {
38
- /** The H2 text the site owns. */
39
- readonly heading: string;
40
- /** A short label above the heading (3.16.0). */
41
- readonly eyebrow?: string;
42
- /** One line under the heading. */
43
- readonly summary?: string;
44
- /**
45
- * The site's recorded quote label (C5) and the quote form it falls back to, for example `/contact#quote`. Required
46
- * for the `plain` and `photo` variants; the `form` variant leaves the quote button out, so it may omit this.
47
- */
48
- readonly quote?: {
49
- readonly label: string;
50
- readonly href: string;
51
- };
52
- readonly phone: UiPhone;
53
- /** Optional words before the number, for example "Call". */
54
- readonly phoneLabel?: string;
55
- /** The `photo` variant's backdrop: the site's image node (decorative). */
56
- readonly media?: ReactNode;
57
- /** The `form` variant's form: the site's own quote form. */
58
- readonly form?: ReactNode;
59
- /** The id of the band's H2 (default `bl-cta-heading`). */
60
- readonly headingId?: string;
61
- /** Set by `SectionSequence`; a `photo` band defaults to `photo`. */
62
- readonly tone?: SectionTone;
63
- /** Signature art, rendered `aria-hidden`. */
64
- readonly decoration?: ReactNode;
65
- }
66
- export declare function CTABand({ heading, eyebrow, summary, quote, phone, phoneLabel, media, form, headingId, tone, decoration, variant, layout, classes, }: CTABandProps): import("react/jsx-runtime").JSX.Element;
67
- //# sourceMappingURL=cta-band.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cta-band.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/cta-band.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,eAAO,MAAM,iBAAiB,qCAAsC,CAAA;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;AAE7I,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACnC,sDAAsD;IACtD,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAA;IACrC,mDAAmD;IACnD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACzC,oGAAoG;IACpG,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;CAC3C;AAED,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,EAAE,cAAc,EAAE,aAAa,CAAC,CAAA;AAE/E,eAAO,MAAM,mBAAmB,mBAAmB,CAAA;AAEnD,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,iCAAiC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,gDAAgD;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,kCAAkC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IAClE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAA;IAC3B,6CAA6C;IAC7C,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAA;CAChC;AAED,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,OAAO,EACP,OAAO,EACP,KAAK,EACL,KAAK,EACL,UAAU,EACV,KAAK,EACL,IAAI,EACJ,SAA+B,EAC/B,IAAI,EACJ,UAAU,EACV,OAAiB,EACjB,MAAM,EACN,OAAO,GACR,EAAE,YAAY,2CA+Cd"}
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { PhoneLink } from '../primitives/links.js';
3
- import { QuoteButton } from '../primitives/quote-button.js';
4
- import { slot } from '../skin.js';
5
- export const CTA_BAND_VARIANTS = ['plain', 'photo', 'form'];
6
- export const CTA_BAND_HEADING_ID = 'bl-cta-heading';
7
- export function CTABand({ heading, eyebrow, summary, quote, phone, phoneLabel, media, form, headingId = CTA_BAND_HEADING_ID, tone, decoration, variant = 'plain', layout, classes, }) {
8
- const shown = (variant === 'photo' && !media) || (variant === 'form' && !form) ? 'plain' : variant;
9
- return (_jsxs("section", { "data-bl-section": "cta", "data-variant": shown, "data-tone": tone ?? (shown === 'photo' ? 'photo' : undefined), "data-align": layout?.align ?? 'start', "data-arrangement": layout?.arrangement === 'split' && shown !== 'form' ? 'split' : undefined, "aria-labelledby": headingId, className: classes?.root, children: [decoration ? (_jsx("div", { "data-slot": "decoration", "aria-hidden": "true", children: decoration })) : null, shown === 'photo' ? (_jsx("div", { ...slot(classes, 'media'), "aria-hidden": "true", children: media })) : null, _jsxs("div", { ...slot(classes, 'inner'), children: [_jsxs("div", { ...slot(classes, 'content'), children: [eyebrow ? _jsx("p", { ...slot(classes, 'eyebrow'), children: eyebrow }) : null, _jsx("h2", { id: headingId, ...slot(classes, 'heading'), children: heading }), summary ? _jsx("p", { ...slot(classes, 'summary'), children: summary }) : null, _jsxs("div", { ...slot(classes, 'actions'), children: [_jsx(PhoneLink, { phone: phone, placement: "cta", label: phoneLabel, showIcon: true, variant: layout?.phoneVariant ?? 'button', classes: { root: classes?.phone } }), shown === 'form' || !quote ? null : (_jsx(QuoteButton, { label: quote.label, href: quote.href, placement: "section", ctaId: "quote-cta", variant: layout?.quoteVariant ?? 'primary', classes: { root: classes?.quote } }))] })] }), shown === 'form' ? _jsx("div", { ...slot(classes, 'form'), children: form }) : null] })] }));
10
- }
11
- //# sourceMappingURL=cta-band.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cta-band.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/cta-band.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGlD,OAAO,EAAE,WA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site uses on every page. Server component, no client JS of\n * its own. A heading, an optional one-line summary, the quote button (`lead_cta_click` placement `section`, id\n * `quote-cta`) and one phone link (`phone_link_click` placement `cta`), phone first like the header, hero and call bar. No \"what happens next\" filler.\n *\n * Variants: `plain`; `photo`, with the site's backdrop image in `media` (decorative, so it renders `aria-hidden`);\n * `form`, with the site's own quote form in `form` beside the heading and the phone link (the form is the quote\n * action there, so the quote button is left out). A `photo` band without `media` or a `form` band without `form`\n * renders as `plain`.\n *\n * Placement (S8): on every page except contact, thank-you and 404, which already end in the form or a confirmation.\n * One variant per site, recorded in the skin.\n *\n * 3.16.0: an optional `eyebrow` above the heading; `layout.arrangement: 'split'` puts the heading and summary on one\n * side and the actions on the other from 768 px; and the band's colour comes from the skin's `--bl-color-cta` (falling\n * back to `--bl-color-band`), so a site sets its closing band apart from the footer.\n */\nimport type { ReactNode } from 'react'\nimport { PhoneLink } from '../primitives/links.js'\nimport type { ButtonVariant } from '../primitives/links.js'\nimport type { SectionTone } from '../primitives/layout.js'\nimport { QuoteButton } from '../primitives/quote-button.js'\nimport { slot, type SkinEntry } from '../skin.js'\nimport type { UiPhone } from '../types.js'\n\nexport const CTA_BAND_VARIANTS = ['plain', 'photo', 'form'] as const\nexport type CTABandVariant = (typeof CTA_BAND_VARIANTS)[number]\n\nexport type CTABandSlot = 'root' | 'media' | 'inner' | 'content' | 'eyebrow' | 'heading' | 'summary' | 'actions' | 'quote' | 'phone' | 'form'\n\nexport interface CTABandLayout {\n readonly align?: 'start' | 'center'\n /** The quote button's variant (default `primary`). */\n readonly quoteVariant?: ButtonVariant\n /** The phone link's variant (default `button`). */\n readonly phoneVariant?: 'text' | 'button'\n /** `stacked` (the default) or `split`: the words on one side, the actions on the other (3.16.0). */\n readonly arrangement?: 'stacked' | 'split'\n}\n\nexport type CTABandSkin = SkinEntry<CTABandSlot, CTABandVariant, CTABandLayout>\n\nexport const CTA_BAND_HEADING_ID = 'bl-cta-heading'\n\nexport interface CTABandProps extends CTABandSkin {\n /** The H2 text the site owns. */\n readonly heading: string\n /** A short label above the heading (3.16.0). */\n readonly eyebrow?: string\n /** One line under the heading. */\n readonly summary?: string\n /**\n * The site's recorded quote label (C5) and the quote form it falls back to, for example `/contact#quote`. Required\n * for the `plain` and `photo` variants; the `form` variant leaves the quote button out, so it may omit this.\n */\n readonly quote?: { readonly label: string; readonly href: string }\n readonly phone: UiPhone\n /** Optional words before the number, for example \"Call\". */\n readonly phoneLabel?: string\n /** The `photo` variant's backdrop: the site's image node (decorative). */\n readonly media?: ReactNode\n /** The `form` variant's form: the site's own quote form. */\n readonly form?: ReactNode\n /** The id of the band's H2 (default `bl-cta-heading`). */\n readonly headingId?: string\n /** Set by `SectionSequence`; a `photo` band defaults to `photo`. */\n readonly tone?: SectionTone\n /** Signature art, rendered `aria-hidden`. */\n readonly decoration?: ReactNode\n}\n\nexport function CTABand({\n heading,\n eyebrow,\n summary,\n quote,\n phone,\n phoneLabel,\n media,\n form,\n headingId = CTA_BAND_HEADING_ID,\n tone,\n decoration,\n variant = 'plain',\n layout,\n classes,\n}: CTABandProps) {\n const shown: CTABandVariant = (variant === 'photo' && !media) || (variant === 'form' && !form) ? 'plain' : variant\n return (\n <section\n data-bl-section=\"cta\"\n data-variant={shown}\n data-tone={tone ?? (shown === 'photo' ? 'photo' : undefined)}\n data-align={layout?.align ?? 'start'}\n data-arrangement={layout?.arrangement === 'split' && shown !== 'form' ? 'split' : undefined}\n aria-labelledby={headingId}\n className={classes?.root}\n >\n {decoration ? (\n <div data-slot=\"decoration\" aria-hidden=\"true\">\n {decoration}\n </div>\n ) : null}\n {shown === 'photo' ? (\n <div {...slot(classes, 'media')} aria-hidden=\"true\">\n {media}\n </div>\n ) : null}\n <div {...slot(classes, 'inner')}>\n <div {...slot(classes, 'content')}>\n {eyebrow ? <p {...slot(classes, 'eyebrow')}>{eyebrow}</p> : null}\n <h2 id={headingId} {...slot(classes, 'heading')}>\n {heading}\n </h2>\n {summary ? <p {...slot(classes, 'summary')}>{summary}</p> : null}\n <div {...slot(classes, 'actions')}>\n <PhoneLink phone={phone} placement=\"cta\" label={phoneLabel} showIcon variant={layout?.phoneVariant ?? 'button'} classes={{ root: classes?.phone }} />\n {shown === 'form' || !quote ? null : (\n <QuoteButton\n label={quote.label}\n href={quote.href}\n placement=\"section\"\n ctaId=\"quote-cta\"\n variant={layout?.quoteVariant ?? 'primary'}\n classes={{ root: classes?.quote }}\n />\n )}\n </div>\n </div>\n {shown === 'form' ? <div {...slot(classes, 'form')}>{form}</div> : null}\n </div>\n </section>\n )\n}\n"]}
@@ -1,60 +0,0 @@
1
- /**
2
- * `EmergencyBand` (`emergency`, 3.15.0): the after-hours call band, straight after the proof strip. Server component,
3
- * no client JS.
4
- *
5
- * Locked:
6
- * - it renders **only** while the business facts record real after-hours work: `credentials.afterHours`, read through
7
- * `renderableCredentials(credentials, 'website-copy')`, so the claim needs its claims-register id, evidence that
8
- * allows website copy and has not expired, and (for a storm season) a day before its `endsOn`. Otherwise it renders
9
- * nothing (matrix: "C, real after-hours only");
10
- * - phone first: the phone link (`phone_link_click` placement `emergency`) comes before the optional quote button, as
11
- * in the header, hero, call bar and CTA band (K6);
12
- * - no response time: no record carries one, so a heading or summary that promises one ("within 60 minutes", "in 2
13
- * hours", "within the hour") fails the build;
14
- * - no default visible copy: the heading, summary and labels are the site's.
15
- */
16
- import { type BrandlabAfterHours, type BrandlabBusiness } from '@brandlab-digital/site-core/business';
17
- import { type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order';
18
- import type { SectionTone } from '../primitives/layout.js';
19
- import { type ButtonVariant } from '../primitives/links.js';
20
- import { type SkinEntry } from '../skin.js';
21
- import type { UiPhone } from '../types.js';
22
- export type EmergencyBandSlot = 'root' | 'inner' | 'content' | 'heading' | 'summary' | 'actions' | 'phone' | 'quote';
23
- export interface EmergencyBandLayout {
24
- /** The phone link's variant. Defaults to `button`. */
25
- readonly phoneVariant?: 'text' | 'button';
26
- /** The quote button's variant. Defaults to `secondary`: the call is the band's main action. */
27
- readonly quoteVariant?: ButtonVariant;
28
- }
29
- export type EmergencyBandSkin = SkinEntry<EmergencyBandSlot, never, EmergencyBandLayout>;
30
- /** The business facts the band reads: `business.credentials`. */
31
- export type EmergencyBandBusiness = Pick<BrandlabBusiness, 'credentials'>;
32
- export interface EmergencyBandProps extends EmergencyBandSkin {
33
- readonly business: EmergencyBandBusiness;
34
- /** The H2, for example "Tree down after a storm?". No response time. */
35
- readonly heading: string;
36
- /** One line under the heading. No response time. */
37
- readonly summary?: string;
38
- readonly phone: UiPhone;
39
- /** Words before the number, for example "Call". */
40
- readonly phoneLabel?: string;
41
- /** An optional quote action after the phone link, for work that can wait for a quote. */
42
- readonly quote?: {
43
- readonly label: string;
44
- readonly href: string;
45
- };
46
- /** The day the page is built (tests pin it). */
47
- readonly asOf?: Date;
48
- /** Defaults to `emergency-heading`. */
49
- readonly headingId?: string;
50
- /** Set by `SectionSequence`. */
51
- readonly tone?: SectionTone;
52
- }
53
- /** The after-hours work the band may stand on today, or nothing. */
54
- export declare function renderableAfterHours(business: EmergencyBandBusiness, asOf?: Date): (BrandlabAfterHours & {
55
- claimId: string;
56
- }) | undefined;
57
- /** The section's guard for `SectionSequence`: skipped unless real after-hours work is recorded and current. */
58
- export declare function emergencyBandReady({ business, asOf }: Pick<EmergencyBandProps, 'business' | 'asOf'>): BrandlabSectionReadiness;
59
- export declare function EmergencyBand({ business, heading, summary, phone, phoneLabel, quote, asOf, headingId, tone, layout, classes, }: EmergencyBandProps): import("react/jsx-runtime").JSX.Element | null;
60
- //# sourceMappingURL=emergency-band.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emergency-band.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/emergency-band.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAiB,KAAK,wBAAwB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AAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACpB,uCAAuC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAC5B;AAED,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,IAAI,GAAE,IAAiB,GAAG,CAAC,kBAAkB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,CAErJ;AAED,+GAA+G;AAC/G,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG,wBAAwB,CAE9H;AAKD,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,UAAU,EACV,KAAK,EACL,IAAI,EACJ,SAA+B,EAC/B,IAAI,EACJ,MAAM,EACN,OAAO,GACR,EAAE,kBAAkB,kDA6CpB"}
@@ -1,43 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * `EmergencyBand` (`emergency`, 3.15.0): the after-hours call band, straight after the proof strip. Server component,
4
- * no client JS.
5
- *
6
- * Locked:
7
- * - it renders **only** while the business facts record real after-hours work: `credentials.afterHours`, read through
8
- * `renderableCredentials(credentials, 'website-copy')`, so the claim needs its claims-register id, evidence that
9
- * allows website copy and has not expired, and (for a storm season) a day before its `endsOn`. Otherwise it renders
10
- * nothing (matrix: "C, real after-hours only");
11
- * - phone first: the phone link (`phone_link_click` placement `emergency`) comes before the optional quote button, as
12
- * in the header, hero, call bar and CTA band (K6);
13
- * - no response time: no record carries one, so a heading or summary that promises one ("within 60 minutes", "in 2
14
- * hours", "within the hour") fails the build;
15
- * - no default visible copy: the heading, summary and labels are the site's.
16
- */
17
- import { renderableCredentials, } from '@brandlab-digital/site-core/business';
18
- import { SECTION_READY } from '@brandlab-digital/site-core/section-order';
19
- import { PhoneLink } from '../primitives/links.js';
20
- import { QuoteButton } from '../primitives/quote-button.js';
21
- import { slot } from '../skin.js';
22
- /** The after-hours work the band may stand on today, or nothing. */
23
- export function renderableAfterHours(business, asOf = new Date()) {
24
- return renderableCredentials(business.credentials, 'website-copy', asOf).afterHours;
25
- }
26
- /** The section's guard for `SectionSequence`: skipped unless real after-hours work is recorded and current. */
27
- export function emergencyBandReady({ business, asOf }) {
28
- return renderableAfterHours(business, asOf) ? SECTION_READY : { render: false, reason: 'no-after-hours-record' };
29
- }
30
- /** A promised response time: "60 minutes", "in 2 hours", "1-2 hrs", "within the hour", "within an hour". */
31
- const RESPONSE_TIME = /\b\d+(?:\s*(?:-|–|to)\s*\d+)?\s*-?\s*(?:min(?:ute)?s?|h(?:ou)?rs?)\b|\bwithin\s+(?:an?|one|the)\s+hour\b|\bunder\s+an?\s+hour\b/i;
32
- export function EmergencyBand({ business, heading, summary, phone, phoneLabel, quote, asOf, headingId = 'emergency-heading', tone, layout, classes, }) {
33
- const afterHours = renderableAfterHours(business, asOf);
34
- if (!afterHours)
35
- return null;
36
- for (const text of [heading, summary]) {
37
- if (text && RESPONSE_TIME.test(text)) {
38
- throw new Error(`EmergencyBand: "${text}" promises a response time, which no record supports. Say what is done after hours instead.`);
39
- }
40
- }
41
- return (_jsx("section", { "data-bl-section": "emergency", "data-tone": tone, "aria-labelledby": headingId, className: classes?.root, children: _jsxs("div", { ...slot(classes, 'inner'), children: [_jsxs("div", { ...slot(classes, 'content'), children: [_jsx("h2", { id: headingId, ...slot(classes, 'heading'), children: heading }), summary ? _jsx("p", { ...slot(classes, 'summary'), children: summary }) : null] }), _jsxs("div", { ...slot(classes, 'actions'), children: [_jsx(PhoneLink, { phone: phone, placement: "emergency", label: phoneLabel, showIcon: true, variant: layout?.phoneVariant ?? 'button', classes: { root: classes?.phone } }), quote ? (_jsx(QuoteButton, { label: quote.label, href: quote.href, placement: "section", ctaId: "quote-emergency", variant: layout?.quoteVariant ?? 'secondary', classes: { root: classes?.quote } })) : null] })] }) }));
42
- }
43
- //# sourceMappingURL=emergency-band.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emergency-band.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/emergency-band.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,qBAAqB,GAGtB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAiC,MAAM,2CAA2C,CAAA;AAExG,OAAO,EAAE,SAAS,EAAsB,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAkCjD,oEAAoE;AACpE,MAAM,UAAU,oBAAoB,CAAC,QAA+B,EAAE,OAAa,IAAI,IAAI,EAAE;IAC3F,OAAO,qBAAqB,CAAC,QAAQ,CAAC,WAAW,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC,UAAU,CAAA;AACrF,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAiD;IAClG,OAAO,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAA;AAClH,CAAC;AAED,4GAA4G;AAC5G,MAAM,aAAa,GAAG,kIAAkI,CAAA;AAExJ,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,UAAU,EACV,KAAK,EACL,IAAI,EACJ,SAAS,GAAG,mBAAmB,EAC/B,IAAI,EACJ,MAAM,EACN,OAAO,GACY;IACnB,MAAM,UAAU,GAAG,oBAAoB,CAAC,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E,OAAO,EAAE,KAAK,EAAE,GACjC,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,IACF,GACE,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `EmergencyBand` (`emergency`, 3.15.0): the after-hours call band, straight after the proof strip. Server component,\n * no client JS.\n *\n * Locked:\n * - it renders **only** while the business facts record real after-hours work: `credentials.afterHours`, read through\n * `renderableCredentials(credentials, 'website-copy')`, so the claim needs its claims-register id, evidence that\n * allows website copy and has not expired, and (for a storm season) a day before its `endsOn`. Otherwise it renders\n * nothing (matrix: \"C, real after-hours only\");\n * - phone first: the phone link (`phone_link_click` placement `emergency`) comes before the optional quote button, as\n * in the header, hero, call bar and CTA band (K6);\n * - no response time: no record carries one, so a heading or summary that promises one (\"within 60 minutes\", \"in 2\n * hours\", \"within the hour\") fails the build;\n * - no default visible copy: the heading, summary and labels are the site's.\n */\nimport {\n renderableCredentials,\n type BrandlabAfterHours,\n type BrandlabBusiness,\n} from '@brandlab-digital/site-core/business'\nimport { SECTION_READY, type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order'\nimport type { SectionTone } from '../primitives/layout.js'\nimport { PhoneLink, type ButtonVariant } from '../primitives/links.js'\nimport { QuoteButton } from '../primitives/quote-button.js'\nimport { slot, type SkinEntry } from '../skin.js'\nimport type { UiPhone } from '../types.js'\n\nexport type EmergencyBandSlot = 'root' | 'inner' | 'content' | 'heading' | 'summary' | 'actions' | 'phone' | 'quote'\nexport interface EmergencyBandLayout {\n /** The phone link's variant. Defaults to `button`. */\n readonly phoneVariant?: 'text' | 'button'\n /** The quote button's variant. Defaults to `secondary`: the call is the band's main action. */\n readonly quoteVariant?: ButtonVariant\n}\nexport type EmergencyBandSkin = SkinEntry<EmergencyBandSlot, never, EmergencyBandLayout>\n\n/** The business facts the band reads: `business.credentials`. */\nexport type EmergencyBandBusiness = Pick<BrandlabBusiness, 'credentials'>\n\nexport interface EmergencyBandProps extends EmergencyBandSkin {\n readonly business: EmergencyBandBusiness\n /** The H2, for example \"Tree down after a storm?\". No response time. */\n readonly heading: string\n /** One line under the heading. No response time. */\n readonly summary?: string\n readonly phone: UiPhone\n /** Words before the number, for example \"Call\". */\n readonly phoneLabel?: string\n /** An optional quote action after the phone link, for work that can wait for a quote. */\n readonly quote?: { readonly label: string; readonly href: string }\n /** The day the page is built (tests pin it). */\n readonly asOf?: Date\n /** Defaults to `emergency-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** The after-hours work the band may stand on today, or nothing. */\nexport function renderableAfterHours(business: EmergencyBandBusiness, asOf: Date = new Date()): (BrandlabAfterHours & { claimId: string }) | undefined {\n return renderableCredentials(business.credentials, 'website-copy', asOf).afterHours\n}\n\n/** The section's guard for `SectionSequence`: skipped unless real after-hours work is recorded and current. */\nexport function emergencyBandReady({ business, asOf }: Pick<EmergencyBandProps, 'business' | 'asOf'>): BrandlabSectionReadiness {\n return renderableAfterHours(business, asOf) ? SECTION_READY : { render: false, reason: 'no-after-hours-record' }\n}\n\n/** A promised response time: \"60 minutes\", \"in 2 hours\", \"1-2 hrs\", \"within the hour\", \"within an hour\". */\nconst RESPONSE_TIME = /\\b\\d+(?:\\s*(?:-|–|to)\\s*\\d+)?\\s*-?\\s*(?:min(?:ute)?s?|h(?:ou)?rs?)\\b|\\bwithin\\s+(?:an?|one|the)\\s+hour\\b|\\bunder\\s+an?\\s+hour\\b/i\n\nexport function EmergencyBand({\n business,\n heading,\n summary,\n phone,\n phoneLabel,\n quote,\n asOf,\n headingId = 'emergency-heading',\n tone,\n layout,\n classes,\n}: EmergencyBandProps) {\n const afterHours = renderableAfterHours(business, asOf)\n if (!afterHours) return null\n for (const text of [heading, summary]) {\n if (text && RESPONSE_TIME.test(text)) {\n throw new Error(`EmergencyBand: \"${text}\" promises a response time, which no record supports. Say what is done after hours instead.`)\n }\n }\n return (\n <section\n data-bl-section=\"emergency\"\n data-tone={tone}\n aria-labelledby={headingId}\n className={classes?.root}\n >\n <div {...slot(classes, 'inner')}>\n <div {...slot(classes, 'content')}>\n <h2 id={headingId} {...slot(classes, 'heading')}>\n {heading}\n </h2>\n {summary ? <p {...slot(classes, 'summary')}>{summary}</p> : null}\n </div>\n <div {...slot(classes, 'actions')}>\n <PhoneLink\n phone={phone}\n placement=\"emergency\"\n label={phoneLabel}\n showIcon\n variant={layout?.phoneVariant ?? 'button'}\n classes={{ root: classes?.phone }}\n />\n {quote ? (\n <QuoteButton\n label={quote.label}\n href={quote.href}\n placement=\"section\"\n ctaId=\"quote-emergency\"\n variant={layout?.quoteVariant ?? 'secondary'}\n classes={{ root: classes?.quote }}\n />\n ) : null}\n </div>\n </div>\n </section>\n )\n}\n"]}
@@ -1,46 +0,0 @@
1
- /**
2
- * `FAQs` (S9, `faqs`): real questions and answers from the page's data, on `Accordion` (closed, one open at a time,
3
- * answers in the server HTML). Never emits `FAQPage` or any other schema (F14). Variants: `list`, or `grouped` for
4
- * the FAQs page (an H3 per group); one or two columns.
5
- */
6
- import type { ReactNode } from 'react';
7
- import { type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order';
8
- import { type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js';
9
- import type { RepeatedSlotOf } from '../repeated-slots.js';
10
- import { type SkinEntry } from '../skin.js';
11
- import { type AccordionSlot } from './accordion.js';
12
- export declare const FAQS_VARIANTS: readonly ["list", "grouped"];
13
- export type FAQsVariant = (typeof FAQS_VARIANTS)[number];
14
- export type FAQsSlot = SectionSlot | SectionHeadingSlot | 'columns' | 'column' | 'group' | 'subheading' | 'accordion' | Exclude<AccordionSlot, 'root'>;
15
- /** Rendered once per column, group or question: styled from the skin stylesheet, never by class (3.14.0). */
16
- export type FAQsRepeatedSlot = RepeatedSlotOf<'faqs'>;
17
- export type FAQsSkin = SkinEntry<FAQsSlot, FAQsVariant, {
18
- columns?: 1 | 2;
19
- }, FAQsRepeatedSlot>;
20
- export interface FAQItem {
21
- /** A stable slug, unique on the page. */
22
- readonly id: string;
23
- readonly question: string;
24
- readonly answer: ReactNode;
25
- /** The group on the FAQs page (`grouped`), for example "Prices and quotes". */
26
- readonly group?: string;
27
- }
28
- export interface FAQsProps extends FAQsSkin {
29
- /** The H2. */
30
- readonly title: ReactNode;
31
- readonly eyebrow?: ReactNode;
32
- readonly lead?: ReactNode;
33
- readonly items: readonly FAQItem[];
34
- /** The question open on load, only where the site recorded one. */
35
- readonly defaultOpen?: string;
36
- /** The accordion group name and id prefix. Defaults to `faq`. */
37
- readonly name?: string;
38
- /** Defaults to `faqs-heading`. */
39
- readonly headingId?: string;
40
- /** Set by `SectionSequence`. */
41
- readonly tone?: SectionTone;
42
- }
43
- /** Whether the section renders: nothing without questions (`no-faqs`). */
44
- export declare function faqsReady({ items }: Pick<FAQsProps, 'items'>): BrandlabSectionReadiness;
45
- export declare function FAQs({ title, eyebrow, lead, items, defaultOpen, name, headingId, tone, variant, layout, classes, }: FAQsProps): import("react/jsx-runtime").JSX.Element | null;
46
- //# sourceMappingURL=faqs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"faqs.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/faqs.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAA2B,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC9H,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE9D,eAAO,MAAM,aAAa,8BAA+B,CAAA;AACzD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC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,SAAS,EAAE,OAAO,CAAC,GAAG,wBAAwB,CAEvF;AAeD,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,EACL,WAAW,EACX,IAAY,EACZ,SAA0B,EAC1B,IAAI,EACJ,OAAgB,EAChB,MAAM,EACN,OAAO,GACR,EAAE,SAAS,kDAsCX"}
@@ -1,39 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { SECTION_READY } from '@brandlab-digital/site-core/section-order';
3
- import { Section, SectionHeading } from '../primitives/layout.js';
4
- import { repeatedSlot, slot } from '../skin.js';
5
- import { Accordion } from './accordion.js';
6
- export const FAQS_VARIANTS = ['list', 'grouped'];
7
- /** Whether the section renders: nothing without questions (`no-faqs`). */
8
- export function faqsReady({ items }) {
9
- return items.length > 0 ? SECTION_READY : { render: false, reason: 'no-faqs' };
10
- }
11
- /** Questions by group, in first-seen order; questions without a group come under no subheading. */
12
- function groupItems(items) {
13
- const groups = new Map();
14
- for (const item of items)
15
- groups.set(item.group ?? '', [...(groups.get(item.group ?? '') ?? []), item]);
16
- return [...groups];
17
- }
18
- function halves(list, columns) {
19
- if (columns === 1 || list.length < 2)
20
- return [list];
21
- const split = Math.ceil(list.length / 2);
22
- return [list.slice(0, split), list.slice(split)];
23
- }
24
- export function FAQs({ title, eyebrow, lead, items, defaultOpen, name = 'faq', headingId = 'faqs-heading', tone, variant = 'list', layout, classes, }) {
25
- if (!faqsReady({ items }).render)
26
- return null;
27
- if (new Set(items.map((item) => item.id)).size !== items.length)
28
- throw new Error('FAQs: question ids must be unique on the page.');
29
- if (defaultOpen !== undefined && !items.some((item) => item.id === defaultOpen)) {
30
- throw new Error(`FAQs: defaultOpen "${defaultOpen}" is not a question on this page.`);
31
- }
32
- const columns = layout?.columns ?? 1;
33
- const accordion = (list) => (_jsx(Accordion, { name: name, defaultOpen: list.some((item) => item.id === defaultOpen) ? defaultOpen : undefined, items: list.map((item) => ({ id: item.id, summary: item.question, content: item.answer })) }));
34
- const groups = variant === 'grouped' ? groupItems(items) : null;
35
- return (_jsxs(Section, { id: "faqs", labelledBy: headingId, tone: tone, variant: variant, classes: classes, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsx("div", { ...slot(classes, 'columns'), "data-columns": String(columns), children: groups
36
- ? halves(groups, columns).map((column, index) => (_jsx("div", { ...repeatedSlot('column'), children: column.map(([group, list]) => (_jsxs("div", { ...repeatedSlot('group'), children: [group ? _jsx("h3", { ...repeatedSlot('subheading'), children: group }) : null, accordion(list)] }, group))) }, index)))
37
- : halves(items, columns).map((column, index) => (_jsx("div", { ...repeatedSlot('column'), children: accordion(column) }, index))) })] }));
38
- }
39
- //# sourceMappingURL=faqs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"faqs.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/faqs.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,aAAa,EAAiC,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAE,OAAO,EAAE,cAAc,EAA+D,MAAM,yBAAyB,CAAA;AAE9H,OAAO,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAsB,MAAM,gBAAgB,CAAA;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,CAAU,CAAA;AAwCzD,0EAA0E;AAC1E,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAA4B;IAC3D,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA;AAChF,CAAC;AAED,mGAAmG;AACnG,SAAS,UAAU,CAAC,KAAyB;IAC3C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAA;IAC3C,KAAK,MA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AAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC7C,iBAAqB,YAAY,CAAC,QAAQ,CAAC,YACxC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAC7B,kBAAqB,YAAY,CAAC,OAAO,CAAC,aACvC,KAAK,CAAC,CAAC,CAAC,gBAAQ,YAAY,CAAC,YAAY,CAAC,YAAG,KAAK,GAAM,CAAC,CAAC,CAAC,IAAI,EAC/D,SAAS,CAAC,IAAI,CAAC,KAFR,KAAK,CAGT,CACP,CAAC,IANM,KAAK,CAOT,CACP,CAAC;oBACJ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5C,iBAAqB,YAAY,CAAC,QAAQ,CAAC,YACxC,SAAS,CAAC,MAAM,CAAC,IADV,KAAK,CAET,CACP,CAAC,GACF,IACE,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `FAQs` (S9, `faqs`): real questions and answers from the page's data, on `Accordion` (closed, one open at a time,\n * answers in the server HTML). Never emits `FAQPage` or any other schema (F14). Variants: `list`, or `grouped` for\n * the FAQs page (an H3 per group); one or two columns.\n */\nimport type { ReactNode } from 'react'\nimport { SECTION_READY, type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\nimport { Accordion, type AccordionSlot } from './accordion.js'\n\nexport const FAQS_VARIANTS = ['list', 'grouped'] as const\nexport type FAQsVariant = (typeof FAQS_VARIANTS)[number]\nexport type FAQsSlot =\n | SectionSlot\n | SectionHeadingSlot\n | 'columns'\n | 'column'\n | 'group'\n | 'subheading'\n | 'accordion'\n | Exclude<AccordionSlot, 'root'>\n/** Rendered once per column, group or question: styled from the skin stylesheet, never by class (3.14.0). */\nexport type FAQsRepeatedSlot = RepeatedSlotOf<'faqs'>\nexport type FAQsSkin = SkinEntry<FAQsSlot, FAQsVariant, { columns?: 1 | 2 }, FAQsRepeatedSlot>\n\nexport interface FAQItem {\n /** A stable slug, unique on the page. */\n readonly id: string\n readonly question: string\n readonly answer: ReactNode\n /** The group on the FAQs page (`grouped`), for example \"Prices and quotes\". */\n readonly group?: string\n}\n\nexport interface FAQsProps extends FAQsSkin {\n /** The H2. */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n readonly items: readonly FAQItem[]\n /** The question open on load, only where the site recorded one. */\n readonly defaultOpen?: string\n /** The accordion group name and id prefix. Defaults to `faq`. */\n readonly name?: string\n /** Defaults to `faqs-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** Whether the section renders: nothing without questions (`no-faqs`). */\nexport function faqsReady({ items }: Pick<FAQsProps, 'items'>): BrandlabSectionReadiness {\n return items.length > 0 ? SECTION_READY : { render: false, reason: 'no-faqs' }\n}\n\n/** Questions by group, in first-seen order; questions without a group come under no subheading. */\nfunction groupItems(items: readonly FAQItem[]): (readonly [string, readonly FAQItem[]])[] {\n const groups = new Map<string, FAQItem[]>()\n for (const item of items) groups.set(item.group ?? '', [...(groups.get(item.group ?? '') ?? []), item])\n return [...groups]\n}\n\nfunction halves<T>(list: readonly T[], columns: 1 | 2): (readonly T[])[] {\n if (columns === 1 || list.length < 2) return [list]\n const split = Math.ceil(list.length / 2)\n return [list.slice(0, split), list.slice(split)]\n}\n\nexport function FAQs({\n title,\n eyebrow,\n lead,\n items,\n defaultOpen,\n name = 'faq',\n headingId = 'faqs-heading',\n tone,\n variant = 'list',\n layout,\n classes,\n}: FAQsProps) {\n if (!faqsReady({ items }).render) return null\n if (new Set(items.map((item) => item.id)).size !== items.length) throw new Error('FAQs: question ids must be unique on the page.')\n if (defaultOpen !== undefined && !items.some((item) => item.id === defaultOpen)) {\n throw new Error(`FAQs: defaultOpen \"${defaultOpen}\" is not a question on this page.`)\n }\n const columns = layout?.columns ?? 1\n const accordion = (list: readonly FAQItem[]) => (\n <Accordion\n name={name}\n defaultOpen={list.some((item) => item.id === defaultOpen) ? defaultOpen : undefined}\n items={list.map((item) => ({ id: item.id, summary: item.question, content: item.answer }))}\n />\n )\n const groups = variant === 'grouped' ? groupItems(items) : null\n return (\n <Section id=\"faqs\" labelledBy={headingId} tone={tone} variant={variant} classes={classes}>\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <div {...slot(classes, 'columns')} data-columns={String(columns)}>\n {groups\n ? halves(groups, columns).map((column, index) => (\n <div key={index} {...repeatedSlot('column')}>\n {column.map(([group, list]) => (\n <div key={group} {...repeatedSlot('group')}>\n {group ? <h3 {...repeatedSlot('subheading')}>{group}</h3> : null}\n {accordion(list)}\n </div>\n ))}\n </div>\n ))\n : halves(items, columns).map((column, index) => (\n <div key={index} {...repeatedSlot('column')}>\n {accordion(column)}\n </div>\n ))}\n </div>\n </Section>\n )\n}\n"]}