@brandlab-digital/site-next 3.20.0 → 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 (313) hide show
  1. package/dist/instrumentation-client.d.ts +1 -1
  2. package/dist/instrumentation-client.js +1 -1
  3. package/dist/instrumentation-client.js.map +1 -1
  4. package/dist/navigation/index.d.ts +2 -3
  5. package/dist/navigation/index.d.ts.map +1 -1
  6. package/dist/navigation/index.js +2 -3
  7. package/dist/navigation/index.js.map +1 -1
  8. package/dist/next-config.d.ts +1 -17
  9. package/dist/next-config.d.ts.map +1 -1
  10. package/dist/next-config.js +2 -33
  11. package/dist/next-config.js.map +1 -1
  12. package/package.json +4 -33
  13. package/dist/ui-kit/brandlab-skin.d.ts +0 -112
  14. package/dist/ui-kit/brandlab-skin.d.ts.map +0 -1
  15. package/dist/ui-kit/brandlab-skin.js +0 -2
  16. package/dist/ui-kit/brandlab-skin.js.map +0 -1
  17. package/dist/ui-kit/form/copy.d.ts +0 -3
  18. package/dist/ui-kit/form/copy.d.ts.map +0 -1
  19. package/dist/ui-kit/form/copy.js +0 -5
  20. package/dist/ui-kit/form/copy.js.map +0 -1
  21. package/dist/ui-kit/form/dialog.d.ts +0 -24
  22. package/dist/ui-kit/form/dialog.d.ts.map +0 -1
  23. package/dist/ui-kit/form/dialog.js +0 -17
  24. package/dist/ui-kit/form/dialog.js.map +0 -1
  25. package/dist/ui-kit/form/field.d.ts +0 -30
  26. package/dist/ui-kit/form/field.d.ts.map +0 -1
  27. package/dist/ui-kit/form/field.js +0 -11
  28. package/dist/ui-kit/form/field.js.map +0 -1
  29. package/dist/ui-kit/form/index.d.ts +0 -7
  30. package/dist/ui-kit/form/index.d.ts.map +0 -1
  31. package/dist/ui-kit/form/index.js +0 -7
  32. package/dist/ui-kit/form/index.js.map +0 -1
  33. package/dist/ui-kit/form/photo-upload.d.ts +0 -40
  34. package/dist/ui-kit/form/photo-upload.d.ts.map +0 -1
  35. package/dist/ui-kit/form/photo-upload.js +0 -19
  36. package/dist/ui-kit/form/photo-upload.js.map +0 -1
  37. package/dist/ui-kit/form/quote-dialog.d.ts +0 -15
  38. package/dist/ui-kit/form/quote-dialog.d.ts.map +0 -1
  39. package/dist/ui-kit/form/quote-dialog.js +0 -68
  40. package/dist/ui-kit/form/quote-dialog.js.map +0 -1
  41. package/dist/ui-kit/form/quote-form.d.ts +0 -172
  42. package/dist/ui-kit/form/quote-form.d.ts.map +0 -1
  43. package/dist/ui-kit/form/quote-form.js +0 -238
  44. package/dist/ui-kit/form/quote-form.js.map +0 -1
  45. package/dist/ui-kit/form/thank-you.d.ts +0 -40
  46. package/dist/ui-kit/form/thank-you.d.ts.map +0 -1
  47. package/dist/ui-kit/form/thank-you.js +0 -36
  48. package/dist/ui-kit/form/thank-you.js.map +0 -1
  49. package/dist/ui-kit/icon-glyphs.d.ts +0 -41
  50. package/dist/ui-kit/icon-glyphs.d.ts.map +0 -1
  51. package/dist/ui-kit/icon-glyphs.js +0 -138
  52. package/dist/ui-kit/icon-glyphs.js.map +0 -1
  53. package/dist/ui-kit/icon-sprite.d.ts +0 -19
  54. package/dist/ui-kit/icon-sprite.d.ts.map +0 -1
  55. package/dist/ui-kit/icon-sprite.js +0 -44
  56. package/dist/ui-kit/icon-sprite.js.map +0 -1
  57. package/dist/ui-kit/icons.d.ts +0 -50
  58. package/dist/ui-kit/icons.d.ts.map +0 -1
  59. package/dist/ui-kit/icons.js +0 -55
  60. package/dist/ui-kit/icons.js.map +0 -1
  61. package/dist/ui-kit/prefetch.d.ts +0 -59
  62. package/dist/ui-kit/prefetch.d.ts.map +0 -1
  63. package/dist/ui-kit/prefetch.js +0 -63
  64. package/dist/ui-kit/prefetch.js.map +0 -1
  65. package/dist/ui-kit/primitives/badge.d.ts +0 -25
  66. package/dist/ui-kit/primitives/badge.d.ts.map +0 -1
  67. package/dist/ui-kit/primitives/badge.js +0 -21
  68. package/dist/ui-kit/primitives/badge.js.map +0 -1
  69. package/dist/ui-kit/primitives/breadcrumbs.d.ts +0 -27
  70. package/dist/ui-kit/primitives/breadcrumbs.d.ts.map +0 -1
  71. package/dist/ui-kit/primitives/breadcrumbs.js +0 -40
  72. package/dist/ui-kit/primitives/breadcrumbs.js.map +0 -1
  73. package/dist/ui-kit/primitives/button.d.ts +0 -32
  74. package/dist/ui-kit/primitives/button.d.ts.map +0 -1
  75. package/dist/ui-kit/primitives/button.js +0 -8
  76. package/dist/ui-kit/primitives/button.js.map +0 -1
  77. package/dist/ui-kit/primitives/card.d.ts +0 -40
  78. package/dist/ui-kit/primitives/card.d.ts.map +0 -1
  79. package/dist/ui-kit/primitives/card.js +0 -8
  80. package/dist/ui-kit/primitives/card.js.map +0 -1
  81. package/dist/ui-kit/primitives/index.d.ts +0 -16
  82. package/dist/ui-kit/primitives/index.d.ts.map +0 -1
  83. package/dist/ui-kit/primitives/index.js +0 -16
  84. package/dist/ui-kit/primitives/index.js.map +0 -1
  85. package/dist/ui-kit/primitives/layout.d.ts +0 -85
  86. package/dist/ui-kit/primitives/layout.d.ts.map +0 -1
  87. package/dist/ui-kit/primitives/layout.js +0 -52
  88. package/dist/ui-kit/primitives/layout.js.map +0 -1
  89. package/dist/ui-kit/primitives/links.d.ts +0 -74
  90. package/dist/ui-kit/primitives/links.d.ts.map +0 -1
  91. package/dist/ui-kit/primitives/links.js +0 -41
  92. package/dist/ui-kit/primitives/links.js.map +0 -1
  93. package/dist/ui-kit/primitives/lists.d.ts +0 -51
  94. package/dist/ui-kit/primitives/lists.d.ts.map +0 -1
  95. package/dist/ui-kit/primitives/lists.js +0 -34
  96. package/dist/ui-kit/primitives/lists.js.map +0 -1
  97. package/dist/ui-kit/primitives/media-frame.d.ts +0 -33
  98. package/dist/ui-kit/primitives/media-frame.d.ts.map +0 -1
  99. package/dist/ui-kit/primitives/media-frame.js +0 -61
  100. package/dist/ui-kit/primitives/media-frame.js.map +0 -1
  101. package/dist/ui-kit/primitives/media.d.ts +0 -40
  102. package/dist/ui-kit/primitives/media.d.ts.map +0 -1
  103. package/dist/ui-kit/primitives/media.js +0 -9
  104. package/dist/ui-kit/primitives/media.js.map +0 -1
  105. package/dist/ui-kit/primitives/quote-button.d.ts +0 -46
  106. package/dist/ui-kit/primitives/quote-button.d.ts.map +0 -1
  107. package/dist/ui-kit/primitives/quote-button.js +0 -38
  108. package/dist/ui-kit/primitives/quote-button.js.map +0 -1
  109. package/dist/ui-kit/primitives/stat.d.ts +0 -25
  110. package/dist/ui-kit/primitives/stat.d.ts.map +0 -1
  111. package/dist/ui-kit/primitives/stat.js +0 -7
  112. package/dist/ui-kit/primitives/stat.js.map +0 -1
  113. package/dist/ui-kit/repeated-slots.d.ts +0 -153
  114. package/dist/ui-kit/repeated-slots.d.ts.map +0 -1
  115. package/dist/ui-kit/repeated-slots.js +0 -100
  116. package/dist/ui-kit/repeated-slots.js.map +0 -1
  117. package/dist/ui-kit/sections/accordion.d.ts +0 -28
  118. package/dist/ui-kit/sections/accordion.d.ts.map +0 -1
  119. package/dist/ui-kit/sections/accordion.js +0 -14
  120. package/dist/ui-kit/sections/accordion.js.map +0 -1
  121. package/dist/ui-kit/sections/area-map.d.ts +0 -64
  122. package/dist/ui-kit/sections/area-map.d.ts.map +0 -1
  123. package/dist/ui-kit/sections/area-map.js +0 -146
  124. package/dist/ui-kit/sections/area-map.js.map +0 -1
  125. package/dist/ui-kit/sections/before-after.d.ts +0 -59
  126. package/dist/ui-kit/sections/before-after.d.ts.map +0 -1
  127. package/dist/ui-kit/sections/before-after.js +0 -42
  128. package/dist/ui-kit/sections/before-after.js.map +0 -1
  129. package/dist/ui-kit/sections/contact-block.d.ts +0 -77
  130. package/dist/ui-kit/sections/contact-block.d.ts.map +0 -1
  131. package/dist/ui-kit/sections/contact-block.js +0 -23
  132. package/dist/ui-kit/sections/contact-block.js.map +0 -1
  133. package/dist/ui-kit/sections/council-rules.d.ts +0 -64
  134. package/dist/ui-kit/sections/council-rules.d.ts.map +0 -1
  135. package/dist/ui-kit/sections/council-rules.js +0 -46
  136. package/dist/ui-kit/sections/council-rules.js.map +0 -1
  137. package/dist/ui-kit/sections/coverage.d.ts +0 -53
  138. package/dist/ui-kit/sections/coverage.d.ts.map +0 -1
  139. package/dist/ui-kit/sections/coverage.js +0 -57
  140. package/dist/ui-kit/sections/coverage.js.map +0 -1
  141. package/dist/ui-kit/sections/cta-band.d.ts +0 -67
  142. package/dist/ui-kit/sections/cta-band.d.ts.map +0 -1
  143. package/dist/ui-kit/sections/cta-band.js +0 -11
  144. package/dist/ui-kit/sections/cta-band.js.map +0 -1
  145. package/dist/ui-kit/sections/emergency-band.d.ts +0 -60
  146. package/dist/ui-kit/sections/emergency-band.d.ts.map +0 -1
  147. package/dist/ui-kit/sections/emergency-band.js +0 -43
  148. package/dist/ui-kit/sections/emergency-band.js.map +0 -1
  149. package/dist/ui-kit/sections/faqs.d.ts +0 -46
  150. package/dist/ui-kit/sections/faqs.d.ts.map +0 -1
  151. package/dist/ui-kit/sections/faqs.js +0 -39
  152. package/dist/ui-kit/sections/faqs.js.map +0 -1
  153. package/dist/ui-kit/sections/gallery.d.ts +0 -60
  154. package/dist/ui-kit/sections/gallery.d.ts.map +0 -1
  155. package/dist/ui-kit/sections/gallery.js +0 -39
  156. package/dist/ui-kit/sections/gallery.js.map +0 -1
  157. package/dist/ui-kit/sections/hero.d.ts +0 -168
  158. package/dist/ui-kit/sections/hero.d.ts.map +0 -1
  159. package/dist/ui-kit/sections/hero.js +0 -147
  160. package/dist/ui-kit/sections/hero.js.map +0 -1
  161. package/dist/ui-kit/sections/index.d.ts +0 -29
  162. package/dist/ui-kit/sections/index.d.ts.map +0 -1
  163. package/dist/ui-kit/sections/index.js +0 -29
  164. package/dist/ui-kit/sections/index.js.map +0 -1
  165. package/dist/ui-kit/sections/licences.d.ts +0 -95
  166. package/dist/ui-kit/sections/licences.d.ts.map +0 -1
  167. package/dist/ui-kit/sections/licences.js +0 -72
  168. package/dist/ui-kit/sections/licences.js.map +0 -1
  169. package/dist/ui-kit/sections/local-facts.d.ts +0 -107
  170. package/dist/ui-kit/sections/local-facts.d.ts.map +0 -1
  171. package/dist/ui-kit/sections/local-facts.js +0 -44
  172. package/dist/ui-kit/sections/local-facts.js.map +0 -1
  173. package/dist/ui-kit/sections/nearby-areas.d.ts +0 -50
  174. package/dist/ui-kit/sections/nearby-areas.d.ts.map +0 -1
  175. package/dist/ui-kit/sections/nearby-areas.js +0 -49
  176. package/dist/ui-kit/sections/nearby-areas.js.map +0 -1
  177. package/dist/ui-kit/sections/nearby-jobs.d.ts +0 -84
  178. package/dist/ui-kit/sections/nearby-jobs.d.ts.map +0 -1
  179. package/dist/ui-kit/sections/nearby-jobs.js +0 -72
  180. package/dist/ui-kit/sections/nearby-jobs.js.map +0 -1
  181. package/dist/ui-kit/sections/page-header.d.ts +0 -29
  182. package/dist/ui-kit/sections/page-header.d.ts.map +0 -1
  183. package/dist/ui-kit/sections/page-header.js +0 -9
  184. package/dist/ui-kit/sections/page-header.js.map +0 -1
  185. package/dist/ui-kit/sections/price-guide.d.ts +0 -59
  186. package/dist/ui-kit/sections/price-guide.d.ts.map +0 -1
  187. package/dist/ui-kit/sections/price-guide.js +0 -28
  188. package/dist/ui-kit/sections/price-guide.js.map +0 -1
  189. package/dist/ui-kit/sections/price-table.d.ts +0 -42
  190. package/dist/ui-kit/sections/price-table.d.ts.map +0 -1
  191. package/dist/ui-kit/sections/price-table.js +0 -29
  192. package/dist/ui-kit/sections/price-table.js.map +0 -1
  193. package/dist/ui-kit/sections/projects.d.ts +0 -79
  194. package/dist/ui-kit/sections/projects.d.ts.map +0 -1
  195. package/dist/ui-kit/sections/projects.js +0 -69
  196. package/dist/ui-kit/sections/projects.js.map +0 -1
  197. package/dist/ui-kit/sections/proof-strip.d.ts +0 -68
  198. package/dist/ui-kit/sections/proof-strip.d.ts.map +0 -1
  199. package/dist/ui-kit/sections/proof-strip.js +0 -27
  200. package/dist/ui-kit/sections/proof-strip.js.map +0 -1
  201. package/dist/ui-kit/sections/quote-checklist.d.ts +0 -43
  202. package/dist/ui-kit/sections/quote-checklist.d.ts.map +0 -1
  203. package/dist/ui-kit/sections/quote-checklist.js +0 -19
  204. package/dist/ui-kit/sections/quote-checklist.js.map +0 -1
  205. package/dist/ui-kit/sections/rating-chip.d.ts +0 -35
  206. package/dist/ui-kit/sections/rating-chip.d.ts.map +0 -1
  207. package/dist/ui-kit/sections/rating-chip.js +0 -21
  208. package/dist/ui-kit/sections/rating-chip.js.map +0 -1
  209. package/dist/ui-kit/sections/related-services.d.ts +0 -41
  210. package/dist/ui-kit/sections/related-services.d.ts.map +0 -1
  211. package/dist/ui-kit/sections/related-services.js +0 -52
  212. package/dist/ui-kit/sections/related-services.js.map +0 -1
  213. package/dist/ui-kit/sections/reviews-band.d.ts +0 -124
  214. package/dist/ui-kit/sections/reviews-band.d.ts.map +0 -1
  215. package/dist/ui-kit/sections/reviews-band.js +0 -115
  216. package/dist/ui-kit/sections/reviews-band.js.map +0 -1
  217. package/dist/ui-kit/sections/section-sequence.d.ts +0 -41
  218. package/dist/ui-kit/sections/section-sequence.d.ts.map +0 -1
  219. package/dist/ui-kit/sections/section-sequence.js +0 -36
  220. package/dist/ui-kit/sections/section-sequence.js.map +0 -1
  221. package/dist/ui-kit/sections/services-grid.d.ts +0 -82
  222. package/dist/ui-kit/sections/services-grid.d.ts.map +0 -1
  223. package/dist/ui-kit/sections/services-grid.js +0 -90
  224. package/dist/ui-kit/sections/services-grid.js.map +0 -1
  225. package/dist/ui-kit/sections/signature-section.d.ts +0 -42
  226. package/dist/ui-kit/sections/signature-section.d.ts.map +0 -1
  227. package/dist/ui-kit/sections/signature-section.js +0 -14
  228. package/dist/ui-kit/sections/signature-section.js.map +0 -1
  229. package/dist/ui-kit/sections/site-footer-columns.d.ts +0 -12
  230. package/dist/ui-kit/sections/site-footer-columns.d.ts.map +0 -1
  231. package/dist/ui-kit/sections/site-footer-columns.js +0 -63
  232. package/dist/ui-kit/sections/site-footer-columns.js.map +0 -1
  233. package/dist/ui-kit/sections/site-footer.d.ts +0 -66
  234. package/dist/ui-kit/sections/site-footer.d.ts.map +0 -1
  235. package/dist/ui-kit/sections/site-footer.js +0 -49
  236. package/dist/ui-kit/sections/site-footer.js.map +0 -1
  237. package/dist/ui-kit/sections/work-photos.d.ts +0 -15
  238. package/dist/ui-kit/sections/work-photos.d.ts.map +0 -1
  239. package/dist/ui-kit/sections/work-photos.js +0 -24
  240. package/dist/ui-kit/sections/work-photos.js.map +0 -1
  241. package/dist/ui-kit/shell/back-to-top-client.d.ts +0 -9
  242. package/dist/ui-kit/shell/back-to-top-client.d.ts.map +0 -1
  243. package/dist/ui-kit/shell/back-to-top-client.js +0 -8
  244. package/dist/ui-kit/shell/back-to-top-client.js.map +0 -1
  245. package/dist/ui-kit/shell/back-to-top.d.ts +0 -13
  246. package/dist/ui-kit/shell/back-to-top.d.ts.map +0 -1
  247. package/dist/ui-kit/shell/back-to-top.js +0 -14
  248. package/dist/ui-kit/shell/back-to-top.js.map +0 -1
  249. package/dist/ui-kit/shell/call-bar-client.d.ts +0 -8
  250. package/dist/ui-kit/shell/call-bar-client.d.ts.map +0 -1
  251. package/dist/ui-kit/shell/call-bar-client.js +0 -13
  252. package/dist/ui-kit/shell/call-bar-client.js.map +0 -1
  253. package/dist/ui-kit/shell/current-link.d.ts +0 -45
  254. package/dist/ui-kit/shell/current-link.d.ts.map +0 -1
  255. package/dist/ui-kit/shell/current-link.js +0 -54
  256. package/dist/ui-kit/shell/current-link.js.map +0 -1
  257. package/dist/ui-kit/shell/drawer-client.d.ts +0 -22
  258. package/dist/ui-kit/shell/drawer-client.d.ts.map +0 -1
  259. package/dist/ui-kit/shell/drawer-client.js +0 -70
  260. package/dist/ui-kit/shell/drawer-client.js.map +0 -1
  261. package/dist/ui-kit/shell/header-client.d.ts +0 -44
  262. package/dist/ui-kit/shell/header-client.d.ts.map +0 -1
  263. package/dist/ui-kit/shell/header-client.js +0 -59
  264. package/dist/ui-kit/shell/header-client.js.map +0 -1
  265. package/dist/ui-kit/shell/index.d.ts +0 -7
  266. package/dist/ui-kit/shell/index.d.ts.map +0 -1
  267. package/dist/ui-kit/shell/index.js +0 -7
  268. package/dist/ui-kit/shell/index.js.map +0 -1
  269. package/dist/ui-kit/shell/intent-prefetch.d.ts +0 -4
  270. package/dist/ui-kit/shell/intent-prefetch.d.ts.map +0 -1
  271. package/dist/ui-kit/shell/intent-prefetch.js +0 -62
  272. package/dist/ui-kit/shell/intent-prefetch.js.map +0 -1
  273. package/dist/ui-kit/shell/mobile-call-bar.d.ts +0 -25
  274. package/dist/ui-kit/shell/mobile-call-bar.d.ts.map +0 -1
  275. package/dist/ui-kit/shell/mobile-call-bar.js +0 -21
  276. package/dist/ui-kit/shell/mobile-call-bar.js.map +0 -1
  277. package/dist/ui-kit/shell/mobile-drawer.d.ts +0 -41
  278. package/dist/ui-kit/shell/mobile-drawer.d.ts.map +0 -1
  279. package/dist/ui-kit/shell/mobile-drawer.js +0 -41
  280. package/dist/ui-kit/shell/mobile-drawer.js.map +0 -1
  281. package/dist/ui-kit/shell/shell-context.d.ts +0 -3
  282. package/dist/ui-kit/shell/shell-context.d.ts.map +0 -1
  283. package/dist/ui-kit/shell/shell-context.js +0 -5
  284. package/dist/ui-kit/shell/shell-context.js.map +0 -1
  285. package/dist/ui-kit/shell/shell-quote.d.ts +0 -10
  286. package/dist/ui-kit/shell/shell-quote.d.ts.map +0 -1
  287. package/dist/ui-kit/shell/shell-quote.js +0 -13
  288. package/dist/ui-kit/shell/shell-quote.js.map +0 -1
  289. package/dist/ui-kit/shell/site-header.d.ts +0 -55
  290. package/dist/ui-kit/shell/site-header.d.ts.map +0 -1
  291. package/dist/ui-kit/shell/site-header.js +0 -35
  292. package/dist/ui-kit/shell/site-header.js.map +0 -1
  293. package/dist/ui-kit/shell/social-links.d.ts +0 -7
  294. package/dist/ui-kit/shell/social-links.d.ts.map +0 -1
  295. package/dist/ui-kit/shell/social-links.js +0 -12
  296. package/dist/ui-kit/shell/social-links.js.map +0 -1
  297. package/dist/ui-kit/shell/utility-bar.d.ts +0 -33
  298. package/dist/ui-kit/shell/utility-bar.d.ts.map +0 -1
  299. package/dist/ui-kit/shell/utility-bar.js +0 -15
  300. package/dist/ui-kit/shell/utility-bar.js.map +0 -1
  301. package/dist/ui-kit/skin-index.d.ts +0 -4
  302. package/dist/ui-kit/skin-index.d.ts.map +0 -1
  303. package/dist/ui-kit/skin-index.js +0 -3
  304. package/dist/ui-kit/skin-index.js.map +0 -1
  305. package/dist/ui-kit/skin.d.ts +0 -65
  306. package/dist/ui-kit/skin.d.ts.map +0 -1
  307. package/dist/ui-kit/skin.js +0 -60
  308. package/dist/ui-kit/skin.js.map +0 -1
  309. package/dist/ui-kit/structure.css +0 -2546
  310. package/dist/ui-kit/types.d.ts +0 -27
  311. package/dist/ui-kit/types.d.ts.map +0 -1
  312. package/dist/ui-kit/types.js +0 -6
  313. package/dist/ui-kit/types.js.map +0 -1
@@ -1,72 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { formatInsuranceAmount, renderableCredentials, renderableLicences, resolveVerifiedFactForSurface, } from '@brandlab-digital/site-core/business';
3
- import { SECTION_READY, SECTION_SLOT_ATTRIBUTE, SECTION_SLOT_SKIP_ATTRIBUTE, formatSectionSlotSkips, } from '@brandlab-digital/site-core/section-order';
4
- import { Section, SectionHeading } from '../primitives/layout.js';
5
- import { Anchor } from '../primitives/links.js';
6
- import { repeatedSlot, slot } from '../skin.js';
7
- export const LICENCES_VARIANTS = ['licence', 'qualifications'];
8
- /** The public ABN Lookup page for an 11-digit ABN. */
9
- export function abnLookupUrl(abn) {
10
- return `https://abr.business.gov.au/ABN/View?abn=${abn.replace(/\s/g, '')}`;
11
- }
12
- /** An ABN as it is written: "12 345 678 901". */
13
- export function formatAbn(abn) {
14
- const digits = abn.replace(/\s/g, '');
15
- return `${digits.slice(0, 2)} ${digits.slice(2, 5)} ${digits.slice(5, 8)} ${digits.slice(8)}`;
16
- }
17
- const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
18
- /** What the evidence lets the variant show today, and the expected lines it has to leave out. */
19
- export function licencesContent(business, variant, asOf = new Date()) {
20
- const credentials = renderableCredentials(business.credentials, 'website-copy', asOf);
21
- const licences = variant === 'licence' ? renderableLicences(resolveVerifiedFactForSurface(business.registration.licences, 'website-copy', asOf) ?? [], asOf) : [];
22
- const skips = [];
23
- if (variant === 'licence' && licences.length === 0)
24
- skips.push({ slot: 'licence', reason: 'no-current-licence' });
25
- if (variant === 'qualifications' && credentials.qualifications.length === 0)
26
- skips.push({ slot: 'qualifications', reason: 'no-evidenced-qualification' });
27
- if (variant === 'qualifications' && credentials.insurance.length === 0)
28
- skips.push({ slot: 'insurance', reason: 'no-current-insurance' });
29
- const abn = resolveVerifiedFactForSurface(business.registration.abn, 'website-copy', asOf);
30
- return {
31
- licences,
32
- credentials: {
33
- ...(variant === 'qualifications' ? credentials : { ...credentials, qualifications: [] }),
34
- // A person's experience only: the business's age is the established line.
35
- experience: credentials.experience.filter((entry) => entry.holder === 'practitioner'),
36
- },
37
- skips,
38
- ...(abn ? { abn } : {}),
39
- };
40
- }
41
- function hasLines({ licences, credentials }) {
42
- return licences.length + credentials.qualifications.length + credentials.insurance.length > 0;
43
- }
44
- /** The section's guard for `SectionSequence`: skipped when the evidence allows no line at all. */
45
- export function licencesReady({ business, variant = 'licence', asOf }) {
46
- return hasLines(licencesContent(business, variant, asOf)) ? SECTION_READY : { render: false, reason: 'no-evidenced-credentials' };
47
- }
48
- function required(value, name) {
49
- if (!value?.trim())
50
- throw new Error(`Licences: labels.${name} is needed to show this line, in the site's words.`);
51
- return value;
52
- }
53
- function LicenceLine({ licence, registerLabel }) {
54
- return (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'licence', children: [_jsx("dt", { ...repeatedSlot('label'), children: licence.name }), _jsxs("dd", { ...repeatedSlot('value'), children: [_jsx("span", { ...repeatedSlot('number'), children: licence.identifier }), licence.licensee ? (_jsxs(_Fragment, { children: [' ', _jsx("span", { ...repeatedSlot('holder'), children: licence.licensee })] })) : null] }), licence.classes && licence.classes.length > 0 ? (_jsx("dd", { ...repeatedSlot('classes'), children: _jsx("ul", { role: "list", children: licence.classes.map((entry) => (_jsxs("li", { ...repeatedSlot('class'), children: [entry.name, entry.conditions && entry.conditions.length > 0 ? `: ${entry.conditions.join('; ')}` : null] }, entry.name))) }) })) : null, licence.registerUrl && registerLabel ? (_jsx("dd", { ...repeatedSlot('register'), children: _jsx(Anchor, { href: licence.registerUrl, prefetch: false, hooks: {}, children: registerLabel }) })) : null] }));
55
- }
56
- export function Licences({ title, eyebrow, lead, business, labels, asOf, headingId = 'licences-heading', tone, variant = 'licence', classes }) {
57
- const content = licencesContent(business, variant, asOf);
58
- if (!hasLines(content))
59
- return null;
60
- const { licences, credentials, skips, abn } = content;
61
- const experience = labels.experience && credentials.experience.length > 0 ? credentials.experience : [];
62
- const experienceLine = experience.length > 0 ? required(labels.experienceLine, 'experienceLine') : undefined;
63
- if (experienceLine && !experienceLine.includes('{years}'))
64
- throw new Error('Licences: labels.experienceLine needs {years}.');
65
- const established = labels.established ? credentials.established : undefined;
66
- const shownAbn = established && labels.abn && abn ? abn : undefined;
67
- const qualificationsLabel = credentials.qualifications.length > 0 ? required(labels.qualifications, 'qualifications') : undefined;
68
- const insuranceLabel = credentials.insurance.length > 0 ? required(labels.insurance, 'insurance') : undefined;
69
- const coverName = (cover) => required(labels.covers?.[cover], `covers['${cover}']`);
70
- return (_jsxs(Section, { id: "licences", labelledBy: headingId, tone: tone, variant: variant, classes: classes, hooks: skips.length > 0 ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips(skips) } : undefined, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsxs("dl", { ...slot(classes, 'list'), children: [licences.map((licence) => (_jsx(LicenceLine, { licence: licence, registerLabel: labels.register }, `${licence.name}-${licence.identifier}`))), qualificationsLabel ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'qualifications', children: [_jsx("dt", { ...repeatedSlot('label'), children: qualificationsLabel }), credentials.qualifications.map((entry) => (_jsx("dd", { ...repeatedSlot('value'), children: entry.title }, entry.title)))] })) : null, experienceLine ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'experience', children: [_jsx("dt", { ...repeatedSlot('label'), children: labels.experience }), experience.map((entry) => (_jsx("dd", { ...repeatedSlot('value'), children: experienceLine.replaceAll('{years}', String(entry.years)).replaceAll('{field}', entry.field) }, entry.claimId)))] })) : null, established ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'established', children: [_jsx("dt", { ...repeatedSlot('label'), children: labels.established }), _jsx("dd", { ...repeatedSlot('value'), children: _jsx("span", { ...repeatedSlot('date'), children: established.month ? `${MONTHS[established.month - 1]} ${established.year}` : established.year }) }), shownAbn ? (_jsxs("dd", { ...repeatedSlot('abn'), children: [labels.abn, " ", formatAbn(shownAbn), labels.abnLookup ? (_jsxs(_Fragment, { children: [' ', _jsx("span", { ...repeatedSlot('lookup'), children: _jsx(Anchor, { href: abnLookupUrl(shownAbn), prefetch: false, hooks: {}, children: labels.abnLookup }) })] })) : null] })) : null] })) : null, insuranceLabel ? (_jsxs("div", { ...repeatedSlot('row'), [SECTION_SLOT_ATTRIBUTE]: 'insurance', children: [_jsx("dt", { ...repeatedSlot('label'), children: insuranceLabel }), credentials.insurance.map((entry) => (_jsxs("dd", { ...repeatedSlot('value'), children: [_jsx("span", { ...repeatedSlot('cover'), children: coverName(entry.cover) }), ' ', _jsx("span", { ...repeatedSlot('amount'), children: formatInsuranceAmount(entry.amountAud) })] }, `${entry.cover}-${entry.amountAud}`)))] })) : null] })] }));
71
- }
72
- //# sourceMappingURL=licences.js.map
@@ -1 +0,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AE,KAAK,EAAE,KAAK,EAAE,EAAE,YAC7D,MAAM,CAAC,SAAS,GACV,GACJ,IACN,CACJ,CAAC,CAAC,CAAC,IAAI,IACL,CACN,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,EACP,cAAc,CAAC,CAAC,CAAC,CAChB,kBAAS,YAAY,CAAC,KAAK,CAAC,EAAQ,CAAC,sBAAsB,CAAC,EAAE,WAAW,aACvE,gBAAQ,YAAY,CAAC,OAAO,CAAC,YAAG,cAAc,GAAM,EACnD,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACpC,iBAAkD,YAAY,CAAC,OAAO,CAAC,aACrE,kBAAU,YAAY,CAAC,OAAO,CAAC,YAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAQ,EAAC,GAAG,EACpE,kBAAU,YAAY,CAAC,QAAQ,CAAC,YAAG,qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC,GAAQ,KAF1E,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,EAAE,CAGvC,CACN,CAAC,IACE,CACP,CAAC,CAAC,CAAC,IAAI,IACL,IACG,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `Licences` (`licences`, 3.15.0): the business's credentials as a ruled ledger, read straight from the site's business\n * facts (`site-core/business`), so the page can only say what the evidence allows. Server component.\n *\n * Variants (matrix part B):\n * - `licence` (licensed trades): each current licence as the register shows it (its name, number, licensee, classes\n * with their conditions and the register link), then the insurance lines;\n * - `qualifications` (trades with no licence, such as tree work): the qualifications as the business may state them,\n * without a person's name (\"AQF Level 3-qualified arborist\"), then the insurance lines.\n *\n * Locked:\n * - licences come only from a verified `registration.licences` fact whose evidence allows website copy and has not\n * expired, less any expired licence (`renderableLicences`); a licence number is never typed in by hand;\n * - qualifications and insurance come only through `renderableCredentials(credentials, 'website-copy')`: evidenced\n * for the surface, not expired, and no policy past its end date. The amount is `formatInsuranceAmount`'s (\"$20 million\");\n * - each line carries its K12-slots hook (`data-bl-slot=\"licence\" | \"qualifications\" | \"insurance\"`); a line the\n * variant expects but the evidence doesn't allow is left out and listed in `data-bl-slot-skip` with its reason;\n * with nothing to show, the section renders nothing;\n * - no default visible copy: the row labels, cover names and register link text are the site's (`labels`). A line\n * with no label fails the build rather than render unlabelled.\n *\n * Optional lines (3.19.0), shown only when the site gives their label:\n * - `labels.experience` with `labels.experienceLine` (\"More than {years} years of {field}\"): the evidenced\n * experience of the person doing the work (`holder: 'practitioner'`), right after the qualifications. A business's\n * own age is never shown here; that is the established line;\n * - `labels.established`: the month and year the business was established (`credentials.established`), and with\n * `labels.abn` the verified ABN from `registration.abn`, linking to ABN Lookup when `labels.abnLookup` is given.\n */\nimport type { ReactNode } from 'react'\nimport {\n formatInsuranceAmount,\n renderableCredentials,\n renderableLicences,\n resolveVerifiedFactForSurface,\n type BrandlabBusiness,\n type BrandlabInsuranceCover,\n type BrandlabLicence,\n type BrandlabRenderableCredentials,\n} from '@brandlab-digital/site-core/business'\nimport {\n SECTION_READY,\n SECTION_SLOT_ATTRIBUTE,\n SECTION_SLOT_SKIP_ATTRIBUTE,\n formatSectionSlotSkips,\n type BrandlabSectionReadiness,\n type BrandlabSectionSlotSkip,\n} from '@brandlab-digital/site-core/section-order'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport { Anchor } from '../primitives/links.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\n\nexport const LICENCES_VARIANTS = ['licence', 'qualifications'] as const\nexport type LicencesVariant = (typeof LICENCES_VARIANTS)[number]\n/** Rendered once per line: styled from the skin stylesheet, never by class. */\nexport type LicencesRepeatedSlot = RepeatedSlotOf<'licences'>\nexport type LicencesSlot = SectionSlot | SectionHeadingSlot | 'list' | LicencesRepeatedSlot\nexport type LicencesSkin = SkinEntry<LicencesSlot, LicencesVariant, Record<never, never>, LicencesRepeatedSlot>\n\n/** The site's words for the ledger. Each is needed only when its line renders. */\nexport interface LicencesLabels {\n /** The qualifications row's label, for example \"Qualifications\". */\n readonly qualifications?: string\n /** The insurance row's label, for example \"Insurance\". */\n readonly insurance?: string\n /** Each cover's name, for example `{ 'public-liability': 'Public liability' }`. */\n readonly covers?: Readonly<Partial<Record<BrandlabInsuranceCover, string>>>\n /** The register link's text, for example \"Check the register\". Left out, no register link renders. */\n readonly register?: string\n /** The experience row's label, for example \"Experience\" (3.19.0). Left out, the row doesn't render. */\n readonly experience?: string\n /** Each experience line with `{years}` and `{field}`, for example \"More than {years} years of {field}\". */\n readonly experienceLine?: string\n /** The established row's label, for example \"Established\" (3.19.0). Left out, the row doesn't render. */\n readonly established?: string\n /** The ABN's label in the established row, for example \"ABN\". Left out, the ABN doesn't show. */\n readonly abn?: string\n /** The ABN Lookup link's text, for example \"Check ABN Lookup\". Left out, the ABN shows without a link. */\n readonly abnLookup?: string\n}\n\n/** The public ABN Lookup page for an 11-digit ABN. */\nexport function abnLookupUrl(abn: string): string {\n return `https://abr.business.gov.au/ABN/View?abn=${abn.replace(/\\s/g, '')}`\n}\n\n/** An ABN as it is written: \"12 345 678 901\". */\nexport function formatAbn(abn: string): string {\n const digits = abn.replace(/\\s/g, '')\n return `${digits.slice(0, 2)} ${digits.slice(2, 5)} ${digits.slice(5, 8)} ${digits.slice(8)}`\n}\n\nconst MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n\n/** The business facts the ledger reads: `business.registration` and `business.credentials`. */\nexport type LicencesBusiness = Pick<BrandlabBusiness, 'registration' | 'credentials'>\n\nexport interface LicencesProps extends LicencesSkin {\n /** The H2, for example \"Qualified and insured\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n readonly business: LicencesBusiness\n readonly labels: LicencesLabels\n /** The day the page is built (tests pin it). */\n readonly asOf?: Date\n /** Defaults to `licences-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\ninterface LedgerContent {\n readonly licences: readonly BrandlabLicence[]\n readonly credentials: BrandlabRenderableCredentials\n readonly skips: readonly BrandlabSectionSlotSkip[]\n /** The verified ABN the website may show (3.19.0). */\n readonly abn?: string\n}\n\n/** What the evidence lets the variant show today, and the expected lines it has to leave out. */\nexport function licencesContent(business: LicencesBusiness, variant: LicencesVariant, asOf: Date = new Date()): LedgerContent {\n const credentials = renderableCredentials(business.credentials, 'website-copy', asOf)\n const licences = variant === 'licence' ? renderableLicences(resolveVerifiedFactForSurface(business.registration.licences, 'website-copy', asOf) ?? [], asOf) : []\n const skips: BrandlabSectionSlotSkip[] = []\n if (variant === 'licence' && licences.length === 0) skips.push({ slot: 'licence', reason: 'no-current-licence' })\n if (variant === 'qualifications' && credentials.qualifications.length === 0) skips.push({ slot: 'qualifications', reason: 'no-evidenced-qualification' })\n if (variant === 'qualifications' && credentials.insurance.length === 0) skips.push({ slot: 'insurance', reason: 'no-current-insurance' })\n const abn = resolveVerifiedFactForSurface(business.registration.abn, 'website-copy', asOf)\n return {\n licences,\n credentials: {\n ...(variant === 'qualifications' ? credentials : { ...credentials, qualifications: [] }),\n // A person's experience only: the business's age is the established line.\n experience: credentials.experience.filter((entry) => entry.holder === 'practitioner'),\n },\n skips,\n ...(abn ? { abn } : {}),\n }\n}\n\nfunction hasLines({ licences, credentials }: LedgerContent): boolean {\n return licences.length + credentials.qualifications.length + credentials.insurance.length > 0\n}\n\n/** The section's guard for `SectionSequence`: skipped when the evidence allows no line at all. */\nexport function licencesReady({ business, variant = 'licence', asOf }: Pick<LicencesProps, 'business' | 'variant' | 'asOf'>): BrandlabSectionReadiness {\n return hasLines(licencesContent(business, variant, asOf)) ? SECTION_READY : { render: false, reason: 'no-evidenced-credentials' }\n}\n\nfunction required(value: string | undefined, name: string): string {\n if (!value?.trim()) throw new Error(`Licences: labels.${name} is needed to show this line, in the site's words.`)\n return value\n}\n\nfunction LicenceLine({ licence, registerLabel }: { licence: BrandlabLicence; registerLabel: string | undefined }) {\n return (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'licence' }}>\n <dt {...repeatedSlot('label')}>{licence.name}</dt>\n <dd {...repeatedSlot('value')}>\n <span {...repeatedSlot('number')}>{licence.identifier}</span>\n {licence.licensee ? (\n <>\n {' '}\n <span {...repeatedSlot('holder')}>{licence.licensee}</span>\n </>\n ) : null}\n </dd>\n {licence.classes && licence.classes.length > 0 ? (\n <dd {...repeatedSlot('classes')}>\n <ul role=\"list\">\n {licence.classes.map((entry) => (\n <li key={entry.name} {...repeatedSlot('class')}>\n {entry.name}\n {entry.conditions && entry.conditions.length > 0 ? `: ${entry.conditions.join('; ')}` : null}\n </li>\n ))}\n </ul>\n </dd>\n ) : null}\n {licence.registerUrl && registerLabel ? (\n <dd {...repeatedSlot('register')}>\n <Anchor href={licence.registerUrl} prefetch={false} hooks={{}}>\n {registerLabel}\n </Anchor>\n </dd>\n ) : null}\n </div>\n )\n}\n\nexport function Licences({ title, eyebrow, lead, business, labels, asOf, headingId = 'licences-heading', tone, variant = 'licence', classes }: LicencesProps) {\n const content = licencesContent(business, variant, asOf)\n if (!hasLines(content)) return null\n const { licences, credentials, skips, abn } = content\n const experience = labels.experience && credentials.experience.length > 0 ? credentials.experience : []\n const experienceLine = experience.length > 0 ? required(labels.experienceLine, 'experienceLine') : undefined\n if (experienceLine && !experienceLine.includes('{years}')) throw new Error('Licences: labels.experienceLine needs {years}.')\n const established = labels.established ? credentials.established : undefined\n const shownAbn = established && labels.abn && abn ? abn : undefined\n const qualificationsLabel = credentials.qualifications.length > 0 ? required(labels.qualifications, 'qualifications') : undefined\n const insuranceLabel = credentials.insurance.length > 0 ? required(labels.insurance, 'insurance') : undefined\n const coverName = (cover: BrandlabInsuranceCover) => required(labels.covers?.[cover], `covers['${cover}']`)\n return (\n <Section\n id=\"licences\"\n labelledBy={headingId}\n tone={tone}\n variant={variant}\n classes={classes}\n hooks={skips.length > 0 ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips(skips) } : undefined}\n >\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <dl {...slot(classes, 'list')}>\n {licences.map((licence) => (\n <LicenceLine key={`${licence.name}-${licence.identifier}`} licence={licence} registerLabel={labels.register} />\n ))}\n {qualificationsLabel ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'qualifications' }}>\n <dt {...repeatedSlot('label')}>{qualificationsLabel}</dt>\n {credentials.qualifications.map((entry) => (\n <dd key={entry.title} {...repeatedSlot('value')}>\n {entry.title}\n </dd>\n ))}\n </div>\n ) : null}\n {experienceLine ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'experience' }}>\n <dt {...repeatedSlot('label')}>{labels.experience}</dt>\n {experience.map((entry) => (\n <dd key={entry.claimId} {...repeatedSlot('value')}>\n {experienceLine.replaceAll('{years}', String(entry.years)).replaceAll('{field}', entry.field)}\n </dd>\n ))}\n </div>\n ) : null}\n {established ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'established' }}>\n <dt {...repeatedSlot('label')}>{labels.established}</dt>\n <dd {...repeatedSlot('value')}>\n <span {...repeatedSlot('date')}>\n {established.month ? `${MONTHS[established.month - 1]} ${established.year}` : established.year}\n </span>\n </dd>\n {shownAbn ? (\n <dd {...repeatedSlot('abn')}>\n {labels.abn} {formatAbn(shownAbn)}\n {labels.abnLookup ? (\n <>\n {' '}\n <span {...repeatedSlot('lookup')}>\n <Anchor href={abnLookupUrl(shownAbn)} prefetch={false} hooks={{}}>\n {labels.abnLookup}\n </Anchor>\n </span>\n </>\n ) : null}\n </dd>\n ) : null}\n </div>\n ) : null}\n {insuranceLabel ? (\n <div {...repeatedSlot('row')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'insurance' }}>\n <dt {...repeatedSlot('label')}>{insuranceLabel}</dt>\n {credentials.insurance.map((entry) => (\n <dd key={`${entry.cover}-${entry.amountAud}`} {...repeatedSlot('value')}>\n <span {...repeatedSlot('cover')}>{coverName(entry.cover)}</span>{' '}\n <span {...repeatedSlot('amount')}>{formatInsuranceAmount(entry.amountAud)}</span>\n </dd>\n ))}\n </div>\n ) : null}\n </dl>\n </Section>\n )\n}\n"]}
@@ -1,107 +0,0 @@
1
- /**
2
- * `LocalFacts` (S16, `local-facts`, 3.15.0): what makes a suburb or service-in-suburb page true for this place, the
3
- * block that keeps location pages from being doorways. Server component.
4
- *
5
- * Only true items render, all from the site's data: an optional `intro` first (the page's own local overview, before
6
- * the heading, 3.15.0), the site's own sentences about real work here (`body`; 2 to 4
7
- * sentences on standard pages, the head page's owner-confirmed copy on `detailed`), sourced facts, one line about the
8
- * job here or nearby, and, in permit trades, the permit note from the council register. Locked (Romie, v1 §4.4): no
9
- * suburb trivia, no council facts beyond the permit note, no kilometre figures or "based in" (L10), no copy rotated from
10
- * a pool (L4). A phone link inside reports the `location` placement.
11
- *
12
- * The permit note is the `permit` slot (K12-slots): its line carries `data-bl-slot="permit"`. When the page passes a
13
- * `permit` but the register has no current record for the council (none, more than six months since it was checked,
14
- * or past its fees' financial year), the line renders nothing and the section lists
15
- * `data-bl-slot-skip="permit:no-current-council-record"`, which K12-slots reports as a warning until the record is
16
- * checked again. A page in a trade without a permit note passes no `permit`.
17
- *
18
- * 3.17.0: an optional photo, checklist and action. `photos` are the candidate photos in order (for example
19
- * `jobPhotos(job, media)` for the suburb's best job); the first one the page doesn't already show (`pagePhotos`, the
20
- * same no-repeat rule as `NearbyJobs`) renders, and only a genuine photo of the client's work. It comes first on phones
21
- * and sits beside the copy from 768 px. `checklist` is a `TickList` of the site's own points; `action` one button link,
22
- * for example the council guidance page.
23
- */
24
- import type { ReactNode } from 'react';
25
- import type { BrandlabMediaEntry } from '@brandlab-digital/site-core/media';
26
- import { type BrandlabCouncilPermitRecord } from '@brandlab-digital/site-core/council-register';
27
- import { type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order';
28
- import { type TickItem } from '../primitives/lists.js';
29
- import { type MediaLayout } from '../primitives/media.js';
30
- import { type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js';
31
- import type { RepeatedSlotOf } from '../repeated-slots.js';
32
- import { type SkinEntry } from '../skin.js';
33
- import type { UiLink } from '../types.js';
34
- import { type CouncilRecordSlot, type CouncilRuleWording } from './council-rules.js';
35
- export declare const LOCAL_FACTS_VARIANTS: readonly ["intro", "detailed"];
36
- export type LocalFactsVariant = (typeof LOCAL_FACTS_VARIANTS)[number];
37
- export type LocalFactsSlot = SectionSlot | SectionHeadingSlot | 'media' | 'intro' | 'body' | 'facts' | 'fact' | 'factSource' | 'checklist' | 'action' | 'job' | 'permit' | CouncilRecordSlot | 'fee';
38
- /** Rendered once per fact or fee: styled from the skin stylesheet, never by class. */
39
- export type LocalFactsRepeatedSlot = RepeatedSlotOf<'localFacts'>;
40
- export interface LocalFactsLayout {
41
- /** The photo's crop. Defaults to 4:3. */
42
- readonly ratio?: NonNullable<MediaLayout['ratio']>;
43
- /** The photo's side from 768 px. Defaults to `end`; it always comes first on phones. */
44
- readonly mediaSide?: 'start' | 'end';
45
- }
46
- export type LocalFactsSkin = SkinEntry<LocalFactsSlot, LocalFactsVariant, LocalFactsLayout, LocalFactsRepeatedSlot>;
47
- /** A candidate photo: a media-manifest entry with its id, as `jobPhotos()` returns them. */
48
- export type LocalFactsPhoto = BrandlabMediaEntry & {
49
- readonly id: string;
50
- };
51
- /** One sourced fact that changes the job here (a job or owner source; never a templated terrain line). */
52
- export interface LocalFact {
53
- /** A stable id, rendered as `data-item`. */
54
- readonly id: string;
55
- readonly text: ReactNode;
56
- /** Where the fact can be checked. */
57
- readonly source?: UiLink;
58
- }
59
- /** The permit note's data: the council's register record and how this site words it. */
60
- export interface LocalFactsPermit {
61
- /** The register record for the suburb's council; `undefined` when the register has none. */
62
- readonly record: BrandlabCouncilPermitRecord | undefined;
63
- /** The site's own wording of the rule in one or two lines. Defaults to the record's rule. */
64
- readonly rule?: CouncilRuleWording;
65
- /** The source link's text. Defaults to the council's name. */
66
- readonly sourceLabel?: string;
67
- /** The site's own council page, for example its "Tree removal and Hornsby Council" guide. */
68
- readonly councilPage?: UiLink;
69
- /** The day the page is built or refreshed (Sydney). Defaults to now. */
70
- readonly asOf?: Date;
71
- }
72
- export interface LocalFactsProps extends LocalFactsSkin {
73
- /** The H2, for example "Tree work in Castle Hill". */
74
- readonly title: ReactNode;
75
- readonly eyebrow?: ReactNode;
76
- readonly lead?: ReactNode;
77
- /**
78
- * The page's own introduction to the place (3.15.0), for example a suburb page's local overview paragraph. Site copy,
79
- * rendered first inside the section, before its heading, so the suburb page's intro lives in the `local-facts` place.
80
- */
81
- readonly intro?: ReactNode;
82
- /** The site's own copy about real work here: sentences on `intro`, the head page's copy (with H3s) on `detailed`. */
83
- readonly body?: ReactNode;
84
- readonly facts?: readonly LocalFact[];
85
- /** Candidate photos in order (3.17.0); the first the page doesn't already show renders. Genuine photos only. */
86
- readonly photos?: readonly LocalFactsPhoto[];
87
- /** Photos the page already shows, such as the hero's: media ids or `src` paths. The section never repeats one. */
88
- readonly pagePhotos?: readonly string[];
89
- /** The photo `sizes`. Defaults to half the width from 768 px. */
90
- readonly imageSizes?: string;
91
- /** The site's own points, as a tick list (3.17.0). */
92
- readonly checklist?: readonly TickItem[];
93
- /** One button link after the copy (3.17.0), for example the site's council guidance page. */
94
- readonly action?: UiLink;
95
- /** One line about the job here, or the nearest one labelled as nearby. */
96
- readonly job?: ReactNode;
97
- /** Permit trades only. */
98
- readonly permit?: LocalFactsPermit;
99
- /** Defaults to `local-facts-heading`. */
100
- readonly headingId?: string;
101
- /** Set by `SectionSequence`. */
102
- readonly tone?: SectionTone;
103
- }
104
- /** The guard for `SectionSequence`: renders when it has at least one true item to show. */
105
- export declare function localFactsReady({ intro, body, facts, checklist, job, permit, }: Pick<LocalFactsProps, 'intro' | 'body' | 'facts' | 'checklist' | 'job' | 'permit'>): BrandlabSectionReadiness;
106
- export declare function LocalFacts({ title, eyebrow, lead, intro, body, facts, photos, pagePhotos, imageSizes, checklist, action, job, permit, headingId, tone, variant, layout, classes, }: LocalFactsProps): import("react/jsx-runtime").JSX.Element | null;
107
- //# sourceMappingURL=local-facts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"local-facts.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/local-facts.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,EAAoD,KAAK,2BAA2B,EAAE,MAAM,8CAA8C,CAAA;AACjJ,OAAO,EAKL,KAAK,wBAAwB,EAC9B,MAAM,2CAA2C,CAAA;AAElD,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAS,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAChE,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,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAsB,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAExG,eAAO,MAAM,oBAAoB,gCAAiC,CAAA;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AACrE,MAAM,MAAM,cAAc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WAAW,GAAG,KAAK,GAAG,QAAQ,CAAC,GAAG,wBAAwB,CAI/G;AAmBD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAU,EACV,MAAW,EACX,UAAU,EACV,UAA6C,EAC7C,SAAc,EACd,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAiC,EACjC,IAAI,EACJ,OAAiB,EACjB,MAAM,EACN,OAAO,GACR,EAAE,eAAe,kDAsDjB"}
@@ -1,44 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { COUNCIL_PERMIT_SKIP_REASON, visibleCouncilRecord } from '@brandlab-digital/site-core/council-register';
3
- import { SECTION_READY, SECTION_SLOT_ATTRIBUTE, SECTION_SLOT_SKIP_ATTRIBUTE, formatSectionSlotSkips, } from '@brandlab-digital/site-core/section-order';
4
- import { Anchor, ButtonLink } from '../primitives/links.js';
5
- import { TickList } from '../primitives/lists.js';
6
- import { Media } from '../primitives/media.js';
7
- import { Section, SectionHeading } from '../primitives/layout.js';
8
- import { repeatedSlot, slot } from '../skin.js';
9
- import { CouncilRecordLines } from './council-rules.js';
10
- export const LOCAL_FACTS_VARIANTS = ['intro', 'detailed'];
11
- /** The guard for `SectionSequence`: renders when it has at least one true item to show. */
12
- export function localFactsReady({ intro, body, facts, checklist, job, permit, }) {
13
- const permitShown = permit ? visibleCouncilRecord(permit.record, permit.asOf) !== undefined : false;
14
- if (intro || body || (facts && facts.length > 0) || (checklist && checklist.length > 0) || job || permitShown)
15
- return SECTION_READY;
16
- return { render: false, reason: 'no-local-facts' };
17
- }
18
- function assertFacts(facts) {
19
- const ids = new Set();
20
- for (const fact of facts) {
21
- if (!fact.id || ids.has(fact.id))
22
- throw new Error(`LocalFacts: every fact needs its own id ("${fact.id}" is empty or repeated).`);
23
- ids.add(fact.id);
24
- }
25
- }
26
- function pickPhoto(photos, pagePhotos) {
27
- const shown = new Set(pagePhotos);
28
- const photo = photos.find((entry) => !shown.has(entry.id) && !shown.has(entry.src));
29
- if (photo && photo.provenance !== 'genuine') {
30
- throw new Error(`LocalFacts: "${photo.id}" is ${photo.provenance}; only a genuine photo of the client's work shows here.`);
31
- }
32
- return photo;
33
- }
34
- export function LocalFacts({ title, eyebrow, lead, intro, body, facts = [], photos = [], pagePhotos, imageSizes = '(min-width: 768px) 45vw, 100vw', checklist = [], action, job, permit, headingId = 'local-facts-heading', tone, variant = 'intro', layout, classes, }) {
35
- if (!localFactsReady({ intro, body, facts, checklist, job, permit }).render)
36
- return null;
37
- assertFacts(facts);
38
- const photo = pickPhoto(photos, pagePhotos);
39
- const record = permit ? visibleCouncilRecord(permit.record, permit.asOf) : undefined;
40
- const skip = permit && !record ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips([{ slot: 'permit', reason: COUNCIL_PERMIT_SKIP_REASON }]) } : undefined;
41
- const hooks = photo ? { ...skip, 'data-media-side': layout?.mediaSide ?? 'end' } : skip;
42
- return (_jsxs(Section, { id: "local-facts", labelledBy: headingId, tone: tone, variant: variant, classes: classes, phonePlacement: "location", hooks: hooks, children: [photo ? (_jsx("div", { ...slot(classes, 'media'), children: _jsx(Media, { media: photo, sizes: imageSizes, layout: { ratio: layout?.ratio ?? '4:3' } }) })) : null, intro ? _jsx("div", { ...slot(classes, 'intro'), children: intro }) : null, _jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), body ? _jsx("div", { ...slot(classes, 'body'), children: body }) : null, facts.length > 0 ? (_jsx("ul", { role: "list", ...slot(classes, 'facts'), children: facts.map((fact) => (_jsxs("li", { ...repeatedSlot('fact'), "data-item": fact.id, children: [fact.text, fact.source ? (_jsxs(_Fragment, { children: [' ', _jsx(Anchor, { href: fact.source.href, prefetch: false, hooks: repeatedSlot('factSource'), children: fact.source.label })] })) : null] }, fact.id))) })) : null, checklist.length > 0 ? (_jsx("div", { ...slot(classes, 'checklist'), children: _jsx(TickList, { items: checklist }) })) : null, job ? _jsx("p", { ...slot(classes, 'job'), children: job }) : null, permit && record ? (_jsx("div", { ...slot(classes, 'permit'), [SECTION_SLOT_ATTRIBUTE]: 'permit', "data-council": record.council, children: _jsx(CouncilRecordLines, { record: record, rule: permit.rule, sourceLabel: permit.sourceLabel, councilPage: permit.councilPage, classes: classes }) })) : null, action ? (_jsx("div", { ...slot(classes, 'action'), children: _jsx(ButtonLink, { href: action.href, prefetch: false, variant: "secondary", children: action.label }) })) : null] }));
43
- }
44
- //# sourceMappingURL=local-facts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"local-facts.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/local-facts.tsx"],"names":[],"mappings":";AAyBA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAoC,MAAM,8CAA8C,CAAA;AACjJ,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GAEvB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAiB,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,KAAK,EAAoB,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,cAAc,EAA+D,MAAM,yBAAyB,CAAA;AAE9H,OAAO,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAE/D,OAAO,EAAE,kBAAkB,EAAmD,MAAM,oBAAoB,CAAA;AAExG,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,UAAU,CAAU,CAAA;AAsFlE,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,SAAS,EACT,GAAG,EACH,MAAM,GAC6E;IACnF,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,o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AC,MAAM,CAAC,KAAK,GACX,IACR,CACJ,CAAC,CAAC,CAAC,IAAI,KATD,IAAI,CAAC,EAAE,CAUX,CACN,CAAC,GACC,CACN,CAAC,CAAC,CAAC,IAAI,EACP,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACtB,iBAAS,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,YACjC,KAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,GAAI,GAC1B,CACP,CAAC,CAAC,CAAC,IAAI,EACP,GAAG,CAAC,CAAC,CAAC,eAAO,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,YAAG,GAAG,GAAK,CAAC,CAAC,CAAC,IAAI,EACnD,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,CAClB,iBAAS,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAQ,CAAC,sBAAsB,CAAC,EAAE,QAAQ,kBAAkB,MAAM,CAAC,OAAO,YACxG,KAAC,kBAAkB,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,GAAI,GACzI,CACP,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,CAAC,CAAC,CACR,iBAAS,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,YAC9B,KAAC,UAAU,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAC,WAAW,YAChE,MAAM,CAAC,KAAK,GACF,GACT,CACP,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `LocalFacts` (S16, `local-facts`, 3.15.0): what makes a suburb or service-in-suburb page true for this place, the\n * block that keeps location pages from being doorways. Server component.\n *\n * Only true items render, all from the site's data: an optional `intro` first (the page's own local overview, before\n * the heading, 3.15.0), the site's own sentences about real work here (`body`; 2 to 4\n * sentences on standard pages, the head page's owner-confirmed copy on `detailed`), sourced facts, one line about the\n * job here or nearby, and, in permit trades, the permit note from the council register. Locked (Romie, v1 §4.4): no\n * suburb trivia, no council facts beyond the permit note, no kilometre figures or \"based in\" (L10), no copy rotated from\n * a pool (L4). A phone link inside reports the `location` placement.\n *\n * The permit note is the `permit` slot (K12-slots): its line carries `data-bl-slot=\"permit\"`. When the page passes a\n * `permit` but the register has no current record for the council (none, more than six months since it was checked,\n * or past its fees' financial year), the line renders nothing and the section lists\n * `data-bl-slot-skip=\"permit:no-current-council-record\"`, which K12-slots reports as a warning until the record is\n * checked again. A page in a trade without a permit note passes no `permit`.\n *\n * 3.17.0: an optional photo, checklist and action. `photos` are the candidate photos in order (for example\n * `jobPhotos(job, media)` for the suburb's best job); the first one the page doesn't already show (`pagePhotos`, the\n * same no-repeat rule as `NearbyJobs`) renders, and only a genuine photo of the client's work. It comes first on phones\n * and sits beside the copy from 768 px. `checklist` is a `TickList` of the site's own points; `action` one button link,\n * for example the council guidance page.\n */\nimport type { ReactNode } from 'react'\nimport type { BrandlabMediaEntry } from '@brandlab-digital/site-core/media'\nimport { COUNCIL_PERMIT_SKIP_REASON, visibleCouncilRecord, type BrandlabCouncilPermitRecord } from '@brandlab-digital/site-core/council-register'\nimport {\n SECTION_READY,\n SECTION_SLOT_ATTRIBUTE,\n SECTION_SLOT_SKIP_ATTRIBUTE,\n formatSectionSlotSkips,\n type BrandlabSectionReadiness,\n} from '@brandlab-digital/site-core/section-order'\nimport { Anchor, ButtonLink } from '../primitives/links.js'\nimport { TickList, type TickItem } from '../primitives/lists.js'\nimport { Media, type MediaLayout } from '../primitives/media.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'\nimport type { UiLink } from '../types.js'\nimport { CouncilRecordLines, type CouncilRecordSlot, type CouncilRuleWording } from './council-rules.js'\n\nexport const LOCAL_FACTS_VARIANTS = ['intro', 'detailed'] as const\nexport type LocalFactsVariant = (typeof LOCAL_FACTS_VARIANTS)[number]\nexport type LocalFactsSlot =\n | SectionSlot\n | SectionHeadingSlot\n | 'media'\n | 'intro'\n | 'body'\n | 'facts'\n | 'fact'\n | 'factSource'\n | 'checklist'\n | 'action'\n | 'job'\n | 'permit'\n | CouncilRecordSlot\n | 'fee'\n/** Rendered once per fact or fee: styled from the skin stylesheet, never by class. */\nexport type LocalFactsRepeatedSlot = RepeatedSlotOf<'localFacts'>\nexport interface LocalFactsLayout {\n /** The photo's crop. Defaults to 4:3. */\n readonly ratio?: NonNullable<MediaLayout['ratio']>\n /** The photo's side from 768 px. Defaults to `end`; it always comes first on phones. */\n readonly mediaSide?: 'start' | 'end'\n}\nexport type LocalFactsSkin = SkinEntry<LocalFactsSlot, LocalFactsVariant, LocalFactsLayout, LocalFactsRepeatedSlot>\n\n/** A candidate photo: a media-manifest entry with its id, as `jobPhotos()` returns them. */\nexport type LocalFactsPhoto = BrandlabMediaEntry & { readonly id: string }\n\n/** One sourced fact that changes the job here (a job or owner source; never a templated terrain line). */\nexport interface LocalFact {\n /** A stable id, rendered as `data-item`. */\n readonly id: string\n readonly text: ReactNode\n /** Where the fact can be checked. */\n readonly source?: UiLink\n}\n\n/** The permit note's data: the council's register record and how this site words it. */\nexport interface LocalFactsPermit {\n /** The register record for the suburb's council; `undefined` when the register has none. */\n readonly record: BrandlabCouncilPermitRecord | undefined\n /** The site's own wording of the rule in one or two lines. Defaults to the record's rule. */\n readonly rule?: CouncilRuleWording\n /** The source link's text. Defaults to the council's name. */\n readonly sourceLabel?: string\n /** The site's own council page, for example its \"Tree removal and Hornsby Council\" guide. */\n readonly councilPage?: UiLink\n /** The day the page is built or refreshed (Sydney). Defaults to now. */\n readonly asOf?: Date\n}\n\nexport interface LocalFactsProps extends LocalFactsSkin {\n /** The H2, for example \"Tree work in Castle Hill\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n /**\n * The page's own introduction to the place (3.15.0), for example a suburb page's local overview paragraph. Site copy,\n * rendered first inside the section, before its heading, so the suburb page's intro lives in the `local-facts` place.\n */\n readonly intro?: ReactNode\n /** The site's own copy about real work here: sentences on `intro`, the head page's copy (with H3s) on `detailed`. */\n readonly body?: ReactNode\n readonly facts?: readonly LocalFact[]\n /** Candidate photos in order (3.17.0); the first the page doesn't already show renders. Genuine photos only. */\n readonly photos?: readonly LocalFactsPhoto[]\n /** Photos the page already shows, such as the hero's: media ids or `src` paths. The section never repeats one. */\n readonly pagePhotos?: readonly string[]\n /** The photo `sizes`. Defaults to half the width from 768 px. */\n readonly imageSizes?: string\n /** The site's own points, as a tick list (3.17.0). */\n readonly checklist?: readonly TickItem[]\n /** One button link after the copy (3.17.0), for example the site's council guidance page. */\n readonly action?: UiLink\n /** One line about the job here, or the nearest one labelled as nearby. */\n readonly job?: ReactNode\n /** Permit trades only. */\n readonly permit?: LocalFactsPermit\n /** Defaults to `local-facts-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** The guard for `SectionSequence`: renders when it has at least one true item to show. */\nexport function localFactsReady({\n intro,\n body,\n facts,\n checklist,\n job,\n permit,\n}: Pick<LocalFactsProps, 'intro' | 'body' | 'facts' | 'checklist' | 'job' | 'permit'>): BrandlabSectionReadiness {\n const permitShown = permit ? visibleCouncilRecord(permit.record, permit.asOf) !== undefined : false\n if (intro || body || (facts && facts.length > 0) || (checklist && checklist.length > 0) || job || permitShown) return SECTION_READY\n return { render: false, reason: 'no-local-facts' }\n}\n\nfunction assertFacts(facts: readonly LocalFact[]) {\n const ids = new Set<string>()\n for (const fact of facts) {\n if (!fact.id || ids.has(fact.id)) throw new Error(`LocalFacts: every fact needs its own id (\"${fact.id}\" is empty or repeated).`)\n ids.add(fact.id)\n }\n}\n\nfunction pickPhoto(photos: readonly LocalFactsPhoto[], pagePhotos: readonly string[] | undefined) {\n const shown = new Set(pagePhotos)\n const photo = photos.find((entry) => !shown.has(entry.id) && !shown.has(entry.src))\n if (photo && photo.provenance !== 'genuine') {\n throw new Error(`LocalFacts: \"${photo.id}\" is ${photo.provenance}; only a genuine photo of the client's work shows here.`)\n }\n return photo\n}\n\nexport function LocalFacts({\n title,\n eyebrow,\n lead,\n intro,\n body,\n facts = [],\n photos = [],\n pagePhotos,\n imageSizes = '(min-width: 768px) 45vw, 100vw',\n checklist = [],\n action,\n job,\n permit,\n headingId = 'local-facts-heading',\n tone,\n variant = 'intro',\n layout,\n classes,\n}: LocalFactsProps) {\n if (!localFactsReady({ intro, body, facts, checklist, job, permit }).render) return null\n assertFacts(facts)\n const photo = pickPhoto(photos, pagePhotos)\n const record = permit ? visibleCouncilRecord(permit.record, permit.asOf) : undefined\n const skip = permit && !record ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips([{ slot: 'permit', reason: COUNCIL_PERMIT_SKIP_REASON }]) } : undefined\n const hooks = photo ? { ...skip, 'data-media-side': layout?.mediaSide ?? 'end' } : skip\n return (\n <Section id=\"local-facts\" labelledBy={headingId} tone={tone} variant={variant} classes={classes} phonePlacement=\"location\" hooks={hooks}>\n {photo ? (\n <div {...slot(classes, 'media')}>\n <Media media={photo} sizes={imageSizes} layout={{ ratio: layout?.ratio ?? '4:3' }} />\n </div>\n ) : null}\n {intro ? <div {...slot(classes, 'intro')}>{intro}</div> : null}\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n {body ? <div {...slot(classes, 'body')}>{body}</div> : null}\n {facts.length > 0 ? (\n <ul role=\"list\" {...slot(classes, 'facts')}>\n {facts.map((fact) => (\n <li key={fact.id} {...repeatedSlot('fact')} data-item={fact.id}>\n {fact.text}\n {fact.source ? (\n <>\n {' '}\n <Anchor href={fact.source.href} prefetch={false} hooks={repeatedSlot('factSource')}>\n {fact.source.label}\n </Anchor>\n </>\n ) : null}\n </li>\n ))}\n </ul>\n ) : null}\n {checklist.length > 0 ? (\n <div {...slot(classes, 'checklist')}>\n <TickList items={checklist} />\n </div>\n ) : null}\n {job ? <p {...slot(classes, 'job')}>{job}</p> : null}\n {permit && record ? (\n <div {...slot(classes, 'permit')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'permit' }} data-council={record.council}>\n <CouncilRecordLines record={record} rule={permit.rule} sourceLabel={permit.sourceLabel} councilPage={permit.councilPage} classes={classes} />\n </div>\n ) : null}\n {action ? (\n <div {...slot(classes, 'action')}>\n <ButtonLink href={action.href} prefetch={false} variant=\"secondary\">\n {action.label}\n </ButtonLink>\n </div>\n ) : null}\n </Section>\n )\n}\n"]}
@@ -1,50 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import { type SuburbCentreLookup } from '@brandlab-digital/site-core/locations';
3
- import { type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order';
4
- import { type LinkListLayout } from '../primitives/lists.js';
5
- import { type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js';
6
- import { type SkinEntry } from '../skin.js';
7
- import type { UiLink } from '../types.js';
8
- /** The most neighbours the section lists. */
9
- export declare const NEARBY_AREAS_LIMIT = 12;
10
- /** The neighbours `nearbyAreaLinks` returns by default (v1 §4.4: 4 to 6). */
11
- export declare const NEARBY_AREAS_DEFAULT = 6;
12
- export declare const NEARBY_AREAS_VARIANTS: readonly ["list", "chips"];
13
- export type NearbyAreasVariant = (typeof NEARBY_AREAS_VARIANTS)[number];
14
- export type NearbyAreasSlot = SectionSlot | SectionHeadingSlot | 'list' | 'region' | 'more';
15
- export type NearbyAreasLayout = LinkListLayout;
16
- export type NearbyAreasSkin = SkinEntry<NearbyAreasSlot, NearbyAreasVariant, NearbyAreasLayout>;
17
- export interface NearbyAreasProps extends NearbyAreasSkin {
18
- /** The H2, for example "Tree removal near Castle Hill". */
19
- readonly title: ReactNode;
20
- readonly eyebrow?: ReactNode;
21
- readonly lead?: ReactNode;
22
- /** The neighbours, nearest first (`nearbyAreaLinks`). */
23
- readonly areas: readonly UiLink[];
24
- /**
25
- * The page of the region these suburbs belong to, for example `{ label: 'All of the Hills District', href:
26
- * '/tree-services/hills-district' }` (the label is site copy). It sits after the ranked list, outside it, so it is
27
- * never ranked by distance, and it is never prefetched.
28
- */
29
- readonly regionLink?: UiLink;
30
- /** A link after the list (and the region link), for example the areas hub. Never prefetched. */
31
- readonly more?: UiLink;
32
- /** Defaults to `nearby-areas-heading`. */
33
- readonly headingId?: string;
34
- /** Set by `SectionSequence`. */
35
- readonly tone?: SectionTone;
36
- }
37
- /**
38
- * The nearest served suburbs to `origin` as links, nearest first by real distance (`nearestSuburbsWithin`). `link`
39
- * gives a suburb's page (or `undefined` to leave it out, for a suburb without that page).
40
- */
41
- export declare function nearbyAreaLinks(origin: string, served: readonly string[], options: {
42
- readonly centreOf: SuburbCentreLookup;
43
- readonly link: (suburb: string) => UiLink | undefined;
44
- readonly limit?: number;
45
- readonly maxKm?: number;
46
- }): UiLink[];
47
- /** The guard for `SectionSequence`. */
48
- export declare function nearbyAreasReady({ areas }: Pick<NearbyAreasProps, 'areas'>): BrandlabSectionReadiness;
49
- export declare function NearbyAreas({ title, eyebrow, lead, areas, regionLink, more, headingId, tone, variant, layout, classes }: NearbyAreasProps): import("react/jsx-runtime").JSX.Element | null;
50
- //# sourceMappingURL=nearby-areas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nearby-areas.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/nearby-areas.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAwB,KAAK,kBAAkB,EAAE,MAAM,uCAAuC,CAAA;AACrG,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACtE,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,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,OAAO,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1J,MAAM,EAAE,CAOV;AAED,uCAAuC;AACvC,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAAG,wBAAwB,CAErG;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAkC,EAAE,IAAI,EAAE,OAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,gBAAgB,kDAyB3K"}
@@ -1,49 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * `NearbyAreas` (S18, `nearby-areas`, 3.15.0): links to the real neighbours of a suburb page, or the same service in
4
- * the neighbouring suburbs on a service-in-suburb page. Server component.
5
- *
6
- * Locked (v1 §4.4, L3): the nearest served suburbs by real distance between registry centres, nearest first, never
7
- * shuffled or alphabetical; `nearbyAreaLinks()` builds them with site-core's `nearestSuburbsWithin`. Distances rank the
8
- * links and are never printed (L10). The list is lean (cost item 1f): `LinkList` entries are plain `<li><a>` with no
9
- * class, hook or icon, so each link stays under 120 bytes, and nothing in it prefetches (`data-bl-links="nearby"`, W2).
10
- * 4 to 6 links suit most pages; 12 is the most it renders.
11
- */
12
- import Link from 'next/link';
13
- import { nearestSuburbsWithin } from '@brandlab-digital/site-core/locations';
14
- import { SECTION_READY } from '@brandlab-digital/site-core/section-order';
15
- import { LinkList } from '../primitives/lists.js';
16
- import { Section, SectionHeading } from '../primitives/layout.js';
17
- import { slot } from '../skin.js';
18
- /** The most neighbours the section lists. */
19
- export const NEARBY_AREAS_LIMIT = 12;
20
- /** The neighbours `nearbyAreaLinks` returns by default (v1 §4.4: 4 to 6). */
21
- export const NEARBY_AREAS_DEFAULT = 6;
22
- export const NEARBY_AREAS_VARIANTS = ['list', 'chips'];
23
- /**
24
- * The nearest served suburbs to `origin` as links, nearest first by real distance (`nearestSuburbsWithin`). `link`
25
- * gives a suburb's page (or `undefined` to leave it out, for a suburb without that page).
26
- */
27
- export function nearbyAreaLinks(origin, served, options) {
28
- const limit = options.limit ?? NEARBY_AREAS_DEFAULT;
29
- if (limit > NEARBY_AREAS_LIMIT)
30
- throw new Error(`nearbyAreaLinks: at most ${NEARBY_AREAS_LIMIT} neighbours.`);
31
- const candidates = served.filter((suburb) => options.link(suburb) !== undefined);
32
- return nearestSuburbsWithin(origin, candidates, { centreOf: options.centreOf, limit, ...(options.maxKm !== undefined ? { maxKm: options.maxKm } : {}) }).map((entry) => options.link(entry.slug));
33
- }
34
- /** The guard for `SectionSequence`. */
35
- export function nearbyAreasReady({ areas }) {
36
- return areas.length > 0 ? SECTION_READY : { render: false, reason: 'no-nearby-areas' };
37
- }
38
- export function NearbyAreas({ title, eyebrow, lead, areas, regionLink, more, headingId = 'nearby-areas-heading', tone, variant = 'list', layout, classes }) {
39
- if (areas.length === 0)
40
- return null;
41
- if (areas.length > NEARBY_AREAS_LIMIT)
42
- throw new Error(`NearbyAreas: ${areas.length} neighbours; the section lists at most ${NEARBY_AREAS_LIMIT}.`);
43
- if (new Set(areas.map((area) => area.href)).size !== areas.length)
44
- throw new Error('NearbyAreas: a neighbour is listed twice.');
45
- if (regionLink && areas.some((area) => area.href === regionLink.href))
46
- throw new Error('NearbyAreas: the region link repeats a neighbour.');
47
- return (_jsxs(Section, { id: "nearby-areas", labelledBy: headingId, tone: tone, variant: variant, classes: classes, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsx(LinkList, { links: areas, kind: "nearby", layout: layout, classes: { root: classes?.list } }), regionLink ? (_jsx("p", { ...slot(classes, 'region'), children: _jsx(Link, { href: regionLink.href, prefetch: false, children: regionLink.label }) })) : null, more ? (_jsx("p", { ...slot(classes, 'more'), children: _jsx(Link, { href: more.href, prefetch: false, children: more.label }) })) : null] }));
48
- }
49
- //# sourceMappingURL=nearby-areas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nearby-areas.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/nearby-areas.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AACH,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,oBAAoB,EAA2B,MAAM,uCAAuC,CAAA;AACrG,OAAO,EAAE,aAAa,EAAiC,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAE,QAAQ,EAAuB,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,cAAc,EAA+D,MAAM,yBAAyB,CAAA;AAC9H,OAAO,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAGjD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AACpC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AAErC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAA;AA2B/D;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAc,EACd,MAAyB,EACzB,OAA2J;IAE3J,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,oBAAoB,CAAA;IACnD,IAAI,KAAK,GAAG,kBAAkB;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,kBAAkB,cAAc,CAAC,CAAA;IAC7G,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,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ighbouring suburbs on a service-in-suburb page. Server component.\n *\n * Locked (v1 §4.4, L3): the nearest served suburbs by real distance between registry centres, nearest first, never\n * shuffled or alphabetical; `nearbyAreaLinks()` builds them with site-core's `nearestSuburbsWithin`. Distances rank the\n * links and are never printed (L10). The list is lean (cost item 1f): `LinkList` entries are plain `<li><a>` with no\n * class, hook or icon, so each link stays under 120 bytes, and nothing in it prefetches (`data-bl-links=\"nearby\"`, W2).\n * 4 to 6 links suit most pages; 12 is the most it renders.\n */\nimport Link from 'next/link'\nimport type { ReactNode } from 'react'\nimport { nearestSuburbsWithin, type SuburbCentreLookup } from '@brandlab-digital/site-core/locations'\nimport { SECTION_READY, type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order'\nimport { LinkList, type LinkListLayout } from '../primitives/lists.js'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport { slot, type SkinEntry } from '../skin.js'\nimport type { UiLink } from '../types.js'\n\n/** The most neighbours the section lists. */\nexport const NEARBY_AREAS_LIMIT = 12\n/** The neighbours `nearbyAreaLinks` returns by default (v1 §4.4: 4 to 6). */\nexport const NEARBY_AREAS_DEFAULT = 6\n\nexport const NEARBY_AREAS_VARIANTS = ['list', 'chips'] as const\nexport type NearbyAreasVariant = (typeof NEARBY_AREAS_VARIANTS)[number]\nexport type NearbyAreasSlot = SectionSlot | SectionHeadingSlot | 'list' | 'region' | 'more'\nexport type NearbyAreasLayout = LinkListLayout\nexport type NearbyAreasSkin = SkinEntry<NearbyAreasSlot, NearbyAreasVariant, NearbyAreasLayout>\n\nexport interface NearbyAreasProps extends NearbyAreasSkin {\n /** The H2, for example \"Tree removal near Castle Hill\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n /** The neighbours, nearest first (`nearbyAreaLinks`). */\n readonly areas: readonly UiLink[]\n /**\n * The page of the region these suburbs belong to, for example `{ label: 'All of the Hills District', href:\n * '/tree-services/hills-district' }` (the label is site copy). It sits after the ranked list, outside it, so it is\n * never ranked by distance, and it is never prefetched.\n */\n readonly regionLink?: UiLink\n /** A link after the list (and the region link), for example the areas hub. Never prefetched. */\n readonly more?: UiLink\n /** Defaults to `nearby-areas-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/**\n * The nearest served suburbs to `origin` as links, nearest first by real distance (`nearestSuburbsWithin`). `link`\n * gives a suburb's page (or `undefined` to leave it out, for a suburb without that page).\n */\nexport function nearbyAreaLinks(\n origin: string,\n served: readonly string[],\n options: { readonly centreOf: SuburbCentreLookup; readonly link: (suburb: string) => UiLink | undefined; readonly limit?: number; readonly maxKm?: number },\n): UiLink[] {\n const limit = options.limit ?? NEARBY_AREAS_DEFAULT\n if (limit > NEARBY_AREAS_LIMIT) throw new Error(`nearbyAreaLinks: at most ${NEARBY_AREAS_LIMIT} neighbours.`)\n const candidates = served.filter((suburb) => options.link(suburb) !== undefined)\n return nearestSuburbsWithin(origin, candidates, { centreOf: options.centreOf, limit, ...(options.maxKm !== undefined ? { maxKm: options.maxKm } : {}) }).map(\n (entry) => options.link(entry.slug)!,\n )\n}\n\n/** The guard for `SectionSequence`. */\nexport function nearbyAreasReady({ areas }: Pick<NearbyAreasProps, 'areas'>): BrandlabSectionReadiness {\n return areas.length > 0 ? SECTION_READY : { render: false, reason: 'no-nearby-areas' }\n}\n\nexport function NearbyAreas({ title, eyebrow, lead, areas, regionLink, more, headingId = 'nearby-areas-heading', tone, variant = 'list', layout, classes }: NearbyAreasProps) {\n if (areas.length === 0) return null\n if (areas.length > NEARBY_AREAS_LIMIT) throw new Error(`NearbyAreas: ${areas.length} neighbours; the section lists at most ${NEARBY_AREAS_LIMIT}.`)\n if (new Set(areas.map((area) => area.href)).size !== areas.length) throw new Error('NearbyAreas: a neighbour is listed twice.')\n if (regionLink && areas.some((area) => area.href === regionLink.href)) throw new Error('NearbyAreas: the region link repeats a neighbour.')\n return (\n <Section id=\"nearby-areas\" labelledBy={headingId} tone={tone} variant={variant} classes={classes}>\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <LinkList links={areas} kind=\"nearby\" layout={layout} classes={{ root: classes?.list }} />\n {regionLink ? (\n <p {...slot(classes, 'region')}>\n <Link href={regionLink.href} prefetch={false}>\n {regionLink.label}\n </Link>\n </p>\n ) : null}\n {more ? (\n <p {...slot(classes, 'more')}>\n <Link href={more.href} prefetch={false}>\n {more.label}\n </Link>\n </p>\n ) : null}\n </Section>\n )\n}\n"]}
@@ -1,84 +0,0 @@
1
- /**
2
- * `NearbyJobs` (S17, `nearby-jobs`, 3.15.0): proof of real work near this place. Server component.
3
- *
4
- * The cards come from the job log (site-core `./jobs`): `nearbyJobs(origin, jobs, { centreOf, service })` ranks the
5
- * page suburb's own jobs first, then others by real distance within 10 km, at most three. Each card's heading is
6
- * `jobCardLabel`: "Tree removal in Castle Hill" for the page's own suburb, "Tree removal nearby: Ryde" for any other
7
- * (L4); only a job whose month is known says "Recent" (or `labelPrefix`) and ends ", {Month Year}". Distances rank the cards and are never
8
- * printed (L10). A card shows the job's first photo through `Media`, and only a genuine photo of that job: a stock or AI
9
- * image never stands for the client's work. With no job close enough the section renders nothing and its guard says
10
- * so (`no-jobs-nearby`, D2). A card links to the job's project page when the site has one (prefetch on intent).
11
- * Card photos are always lazy. `pagePhotos` names the photos the page already shows (the hero's): a card then takes the
12
- * job's next genuine photo, or none, so the hero's priority photo is never repeated below as a lazy copy (3.15.0; on
13
- * AA's suburb pages the repeat made Next report the hero, the LCP image, as lazy and downloaded it twice).
14
- *
15
- * 3.17.0: two cards never share a heading. Where a card's label repeats an earlier one ("Tree removal in Eastwood"
16
- * twice) it takes the job's own `title`, and a job without one fails the build; `layout.cardTitle: 'job'` uses the
17
- * title on every card that has one. A title from another suburb reads "Nearby: {title}" (L4, 3.17.1). `linkCue` ("View job") shows on a linked card, and the whole card then follows
18
- * the heading's link (the cue is `aria-hidden`, so the link's name stays the heading). `layout.arrangement: 'feature'`
19
- * sets one tall card beside two stacked from 1024 px. `footer` (a count line) and `link` ("See all our projects")
20
- * follow the list.
21
- */
22
- import type { ReactNode } from 'react';
23
- import { type BrandlabJob, type BrandlabNearbyJob } from '@brandlab-digital/site-core/jobs';
24
- import type { BrandlabMediaManifest } from '@brandlab-digital/site-core/media';
25
- import { type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order';
26
- import { type MediaLayout } from '../primitives/media.js';
27
- import { type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js';
28
- import type { RepeatedSlotOf } from '../repeated-slots.js';
29
- import { type SkinEntry } from '../skin.js';
30
- import type { UiLink } from '../types.js';
31
- export declare const NEARBY_JOBS_VARIANTS: readonly ["grid", "rail"];
32
- export type NearbyJobsVariant = (typeof NEARBY_JOBS_VARIANTS)[number];
33
- export type NearbyJobsSlot = SectionSlot | SectionHeadingSlot | 'list' | 'footer' | 'more' | RepeatedSlotOf<'nearbyJobs'>;
34
- /** Rendered once per job: styled from the skin stylesheet, never by class. */
35
- export type NearbyJobsRepeatedSlot = RepeatedSlotOf<'nearbyJobs'>;
36
- export interface NearbyJobsLayout {
37
- /** `grid`: columns on wide screens. Defaults to 3. */
38
- readonly columns?: 2 | 3;
39
- /** The photo's crop. Defaults to 4:3. */
40
- readonly ratio?: NonNullable<MediaLayout['ratio']>;
41
- /** `grid`: `even` (the default) or `feature`, one tall card beside two stacked from 1024 px (3.17.0). */
42
- readonly arrangement?: 'even' | 'feature';
43
- /** `label` (the default): the `jobCardLabel` heading; `job`: the job's own `title` where it has one (3.17.0). */
44
- readonly cardTitle?: 'label' | 'job';
45
- }
46
- export type NearbyJobsSkin = SkinEntry<NearbyJobsSlot, NearbyJobsVariant, NearbyJobsLayout, NearbyJobsRepeatedSlot>;
47
- export interface NearbyJobsProps extends NearbyJobsSkin {
48
- /** The H2, for example "Recent tree work near Castle Hill". */
49
- readonly title: ReactNode;
50
- readonly eyebrow?: ReactNode;
51
- readonly lead?: ReactNode;
52
- /** The ranked cards from `nearbyJobs()`, nearest first; at most three. */
53
- readonly jobs: readonly BrandlabNearbyJob[];
54
- /** The page's suburb slug: its own jobs read "in {Suburb}", every other "nearby: {Suburb}". */
55
- readonly pageSuburb: string;
56
- /** The service's name from the site's catalogue, for example `(slug) => services[slug].name`. */
57
- readonly serviceName: (service: string) => string;
58
- /** The suburb's name from the registry. */
59
- readonly suburbName: (suburb: string) => string;
60
- /** Replaces "Recent" on a dated card ("Completed tree removal …"); `''` for none. An undated card never has one. */
61
- readonly labelPrefix?: string;
62
- /** The media manifest, for the jobs' photos. Left out, the cards show no photo. */
63
- readonly media?: BrandlabMediaManifest;
64
- /** Photos the page already shows, such as the hero's: media ids or `src` paths. A card never repeats one. */
65
- readonly pagePhotos?: readonly string[];
66
- /** The job's project page, when the site has one. */
67
- readonly jobHref?: (job: BrandlabJob) => string | undefined;
68
- /** A visible cue on a linked card (3.17.0), for example "View job". Decorative: the link's name is the heading. */
69
- readonly linkCue?: ReactNode;
70
- /** A line after the list (3.17.0), for example "42 jobs logged across the Hills District". */
71
- readonly footer?: ReactNode;
72
- /** A link after the list (3.17.0), for example `{ label: 'See all our projects', href: '/projects' }`. */
73
- readonly link?: UiLink;
74
- /** The photo `sizes`. Defaults to one column of the grid. */
75
- readonly imageSizes?: string;
76
- /** Defaults to `nearby-jobs-heading`. */
77
- readonly headingId?: string;
78
- /** Set by `SectionSequence`. */
79
- readonly tone?: SectionTone;
80
- }
81
- /** The guard for `SectionSequence`: no card means no section (D2). */
82
- export declare function nearbyJobsReady({ jobs }: Pick<NearbyJobsProps, 'jobs'>): BrandlabSectionReadiness;
83
- export declare function NearbyJobs({ title, eyebrow, lead, jobs, pageSuburb, serviceName, suburbName, labelPrefix, media, pagePhotos, jobHref, linkCue, footer, link, imageSizes, headingId, tone, variant, layout, classes, }: NearbyJobsProps): import("react/jsx-runtime").JSX.Element | null;
84
- //# sourceMappingURL=nearby-jobs.d.ts.map
@@ -1 +0,0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