@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,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 @@
1
- {"version":3,"file":"nearby-jobs.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/nearby-jobs.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAA2C,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpI,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,2CAA2C,CAAA;AAGxG,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;AAEzC,eAAO,MAAM,oBAAoB,2BAA4B,CAAA;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AACrE,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,kBAAkB,GA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C,EAAE,qBAAqB,CAAA;IACtC,6GAA6G;IAC7G,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,qDAAqD;IACrD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,MAAM,GAAG,SAAS,CAAA;IAC3D,mHAAmH;IACnH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAA;IAC5B,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;IAC3B,0GAA0G;IAC1G,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAC5B;AAED,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,GAAG,wBAAwB,CAEjG;AAaD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAiC,EACjC,IAAI,EACJ,OAAgB,EAChB,MAAM,EACN,OAAO,GACR,EAAE,eAAe,kDAwEjB"}
@@ -1,69 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { JOB_CARD_LIMIT, jobCardLabel, jobPhotos } from '@brandlab-digital/site-core/jobs';
3
- import { SECTION_READY } from '@brandlab-digital/site-core/section-order';
4
- import { LINK_PREFETCH_POLICY } from '../prefetch.js';
5
- import { Anchor, TextLink } from '../primitives/links.js';
6
- import { Media } from '../primitives/media.js';
7
- import { Section, SectionHeading } from '../primitives/layout.js';
8
- import { repeatedSlot, slot } from '../skin.js';
9
- export const NEARBY_JOBS_VARIANTS = ['grid', 'rail'];
10
- /** The guard for `SectionSequence`: no card means no section (D2). */
11
- export function nearbyJobsReady({ jobs }) {
12
- return jobs.length > 0 ? SECTION_READY : { render: false, reason: 'no-jobs-nearby' };
13
- }
14
- function photoOf(job, media, shown) {
15
- if (!media)
16
- return undefined;
17
- const photo = jobPhotos(job, media).find((entry) => !shown.has(entry.id) && !shown.has(entry.src));
18
- if (!photo)
19
- return undefined;
20
- if (photo.provenance !== 'genuine') {
21
- throw new Error(`NearbyJobs: "${photo.id}" is ${photo.provenance}; only a genuine photo of the job shows on its card.`);
22
- }
23
- if (photo.job !== undefined && photo.job !== job.id)
24
- throw new Error(`NearbyJobs: "${photo.id}" is a photo of ${photo.job}, not ${job.id}.`);
25
- return photo;
26
- }
27
- export function NearbyJobs({ title, eyebrow, lead, jobs, pageSuburb, serviceName, suburbName, labelPrefix, media, pagePhotos, jobHref, linkCue, footer, link, imageSizes, headingId = 'nearby-jobs-heading', tone, variant = 'grid', layout, classes, }) {
28
- if (jobs.length === 0)
29
- return null;
30
- if (jobs.length > JOB_CARD_LIMIT)
31
- throw new Error(`NearbyJobs: ${jobs.length} jobs; a page shows at most ${JOB_CARD_LIMIT} job cards.`);
32
- const ids = new Set();
33
- for (const { job } of jobs) {
34
- if (ids.has(job.id))
35
- throw new Error(`NearbyJobs: "${job.id}" is listed twice.`);
36
- ids.add(job.id);
37
- }
38
- const shown = new Set(pagePhotos);
39
- const columns = layout?.columns ?? 3;
40
- const ratio = layout?.ratio ?? '4:3';
41
- const feature = variant === 'grid' && layout?.arrangement === 'feature' && jobs.length === 3;
42
- const sizes = imageSizes ?? `(min-width: 1024px) ${Math.round(100 / columns)}vw, (min-width: 640px) 50vw, 100vw`;
43
- const headings = cardHeadings(jobs, layout?.cardTitle ?? 'label', (job) => jobCardLabel(job, { service: serviceName(job.service), suburbName: suburbName(job.suburb), pageSuburb, ...(labelPrefix === undefined ? {} : { prefix: labelPrefix }) }), pageSuburb);
44
- return (_jsxs(Section, { id: "nearby-jobs", labelledBy: headingId, tone: tone, variant: variant, classes: classes, hooks: { 'data-columns': String(columns), 'data-ratio': ratio, 'data-arrangement': feature ? 'feature' : undefined }, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsx("ul", { role: "list", ...slot(classes, 'list'), children: jobs.map(({ job }, index) => {
45
- const label = headings[index];
46
- const href = jobHref?.(job);
47
- const photo = photoOf(job, media, shown);
48
- return (_jsxs("li", { ...repeatedSlot('item'), "data-item": job.id, "data-suburb": job.suburb, "data-linked": href ? '' : undefined, children: [_jsxs("div", { ...repeatedSlot('body'), children: [_jsx("h3", { ...repeatedSlot('title'), children: href ? (_jsx(Anchor, { href: href, prefetch: LINK_PREFETCH_POLICY.contentCard, hooks: repeatedSlot('link'), children: label })) : (label) }), _jsx("p", { ...repeatedSlot('outcome'), children: job.outcome }), href && linkCue ? (_jsx("span", { ...repeatedSlot('cue'), "aria-hidden": "true", children: linkCue })) : null] }), photo ? (_jsx("div", { ...repeatedSlot('media'), children: _jsx(Media, { media: photo, sizes: sizes, layout: { ratio } }) })) : null] }, job.id));
49
- }) }), footer ? _jsx("p", { ...slot(classes, 'footer'), children: footer }) : null, link ? (_jsx("p", { ...slot(classes, 'more'), children: _jsx(TextLink, { href: link.href, prefetch: LINK_PREFETCH_POLICY.contentCard, children: link.label }) })) : null] }));
50
- }
51
- /** Each card's heading: its label, or the job's title where the label repeats an earlier card's or `cardTitle` is `job`. */
52
- function cardHeadings(jobs, cardTitle, labelOf, pageSuburb) {
53
- const used = new Set();
54
- // A job from another suburb keeps the "nearby" label when its own title stands in (L4, 3.17.1).
55
- const titleOf = (job) => (job.title && job.suburb !== pageSuburb ? `Nearby: ${job.title}` : job.title);
56
- return jobs.map(({ job }) => {
57
- const title = titleOf(job);
58
- let heading = cardTitle === 'job' && title ? title : labelOf(job);
59
- if (used.has(heading)) {
60
- if (!title || used.has(title)) {
61
- throw new Error(`NearbyJobs: two cards would both read "${heading}"; give job "${job.id}" its own title in the job log.`);
62
- }
63
- heading = title;
64
- }
65
- used.add(heading);
66
- return heading;
67
- });
68
- }
69
- //# sourceMappingURL=nearby-jobs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nearby-jobs.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/nearby-jobs.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAA4C,MAAM,kCAAkC,CAAA;AAEpI,OAAO,EAAE,aAAa,EAAiC,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACzD,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;AAG/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAA;AAoD7D,sEAAsE;AACtE,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAiC;IACrE,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAA;AACtF,CAAC;AAED,SAAS,OAAO,CAAC,GAAgB,EAAE,KAAwC,EAAE,KAA0B;IACrG,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAC5B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,KAA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,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACjE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,0CAA0C,OAAO,gBAAgB,GAAG,CAAC,EAAE,iCAAiC,CAAC,CAAA;YAC3H,CAAC;YACD,OAAO,GAAG,KAAK,CAAA;QACjB,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["/**\n * `NearbyJobs` (S17, `nearby-jobs`, 3.15.0): proof of real work near this place. Server component.\n *\n * The cards come from the job log (site-core `./jobs`): `nearbyJobs(origin, jobs, { centreOf, service })` ranks the\n * page suburb's own jobs first, then others by real distance within 10 km, at most three. Each card's heading is\n * `jobCardLabel`: \"Tree removal in Castle Hill\" for the page's own suburb, \"Tree removal nearby: Ryde\" for any other\n * (L4); only a job whose month is known says \"Recent\" (or `labelPrefix`) and ends \", {Month Year}\". Distances rank the cards and are never\n * printed (L10). A card shows the job's first photo through `Media`, and only a genuine photo of that job: a stock or AI\n * image never stands for the client's work. With no job close enough the section renders nothing and its guard says\n * so (`no-jobs-nearby`, D2). A card links to the job's project page when the site has one (prefetch on intent).\n * Card photos are always lazy. `pagePhotos` names the photos the page already shows (the hero's): a card then takes the\n * 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\n * AA's suburb pages the repeat made Next report the hero, the LCP image, as lazy and downloaded it twice).\n *\n * 3.17.0: two cards never share a heading. Where a card's label repeats an earlier one (\"Tree removal in Eastwood\"\n * twice) it takes the job's own `title`, and a job without one fails the build; `layout.cardTitle: 'job'` uses the\n * 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\n * the heading's link (the cue is `aria-hidden`, so the link's name stays the heading). `layout.arrangement: 'feature'`\n * sets one tall card beside two stacked from 1024 px. `footer` (a count line) and `link` (\"See all our projects\")\n * follow the list.\n */\nimport type { ReactNode } from 'react'\nimport { JOB_CARD_LIMIT, jobCardLabel, jobPhotos, type BrandlabJob, type BrandlabNearbyJob } from '@brandlab-digital/site-core/jobs'\nimport type { BrandlabMediaManifest } from '@brandlab-digital/site-core/media'\nimport { SECTION_READY, type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order'\nimport { LINK_PREFETCH_POLICY } from '../prefetch.js'\nimport { Anchor, TextLink } from '../primitives/links.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'\n\nexport const NEARBY_JOBS_VARIANTS = ['grid', 'rail'] as const\nexport type NearbyJobsVariant = (typeof NEARBY_JOBS_VARIANTS)[number]\nexport type NearbyJobsSlot = SectionSlot | SectionHeadingSlot | 'list' | 'footer' | 'more' | RepeatedSlotOf<'nearbyJobs'>\n/** Rendered once per job: styled from the skin stylesheet, never by class. */\nexport type NearbyJobsRepeatedSlot = RepeatedSlotOf<'nearbyJobs'>\nexport interface NearbyJobsLayout {\n /** `grid`: columns on wide screens. Defaults to 3. */\n readonly columns?: 2 | 3\n /** The photo's crop. Defaults to 4:3. */\n readonly ratio?: NonNullable<MediaLayout['ratio']>\n /** `grid`: `even` (the default) or `feature`, one tall card beside two stacked from 1024 px (3.17.0). */\n readonly arrangement?: 'even' | 'feature'\n /** `label` (the default): the `jobCardLabel` heading; `job`: the job's own `title` where it has one (3.17.0). */\n readonly cardTitle?: 'label' | 'job'\n}\nexport type NearbyJobsSkin = SkinEntry<NearbyJobsSlot, NearbyJobsVariant, NearbyJobsLayout, NearbyJobsRepeatedSlot>\n\nexport interface NearbyJobsProps extends NearbyJobsSkin {\n /** The H2, for example \"Recent tree work near Castle Hill\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n /** The ranked cards from `nearbyJobs()`, nearest first; at most three. */\n readonly jobs: readonly BrandlabNearbyJob[]\n /** The page's suburb slug: its own jobs read \"in {Suburb}\", every other \"nearby: {Suburb}\". */\n readonly pageSuburb: string\n /** The service's name from the site's catalogue, for example `(slug) => services[slug].name`. */\n readonly serviceName: (service: string) => string\n /** The suburb's name from the registry. */\n readonly suburbName: (suburb: string) => string\n /** Replaces \"Recent\" on a dated card (\"Completed tree removal …\"); `''` for none. An undated card never has one. */\n readonly labelPrefix?: string\n /** The media manifest, for the jobs' photos. Left out, the cards show no photo. */\n readonly media?: BrandlabMediaManifest\n /** Photos the page already shows, such as the hero's: media ids or `src` paths. A card never repeats one. */\n readonly pagePhotos?: readonly string[]\n /** The job's project page, when the site has one. */\n readonly jobHref?: (job: BrandlabJob) => string | undefined\n /** A visible cue on a linked card (3.17.0), for example \"View job\". Decorative: the link's name is the heading. */\n readonly linkCue?: ReactNode\n /** A line after the list (3.17.0), for example \"42 jobs logged across the Hills District\". */\n readonly footer?: ReactNode\n /** A link after the list (3.17.0), for example `{ label: 'See all our projects', href: '/projects' }`. */\n readonly link?: UiLink\n /** The photo `sizes`. Defaults to one column of the grid. */\n readonly imageSizes?: string\n /** Defaults to `nearby-jobs-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** The guard for `SectionSequence`: no card means no section (D2). */\nexport function nearbyJobsReady({ jobs }: Pick<NearbyJobsProps, 'jobs'>): BrandlabSectionReadiness {\n return jobs.length > 0 ? SECTION_READY : { render: false, reason: 'no-jobs-nearby' }\n}\n\nfunction photoOf(job: BrandlabJob, media: BrandlabMediaManifest | undefined, shown: ReadonlySet<string>) {\n if (!media) return undefined\n const photo = jobPhotos(job, media).find((entry) => !shown.has(entry.id) && !shown.has(entry.src))\n if (!photo) return undefined\n if (photo.provenance !== 'genuine') {\n throw new Error(`NearbyJobs: \"${photo.id}\" is ${photo.provenance}; only a genuine photo of the job shows on its card.`)\n }\n if (photo.job !== undefined && photo.job !== job.id) throw new Error(`NearbyJobs: \"${photo.id}\" is a photo of ${photo.job}, not ${job.id}.`)\n return photo\n}\n\nexport function NearbyJobs({\n title,\n eyebrow,\n lead,\n jobs,\n pageSuburb,\n serviceName,\n suburbName,\n labelPrefix,\n media,\n pagePhotos,\n jobHref,\n linkCue,\n footer,\n link,\n imageSizes,\n headingId = 'nearby-jobs-heading',\n tone,\n variant = 'grid',\n layout,\n classes,\n}: NearbyJobsProps) {\n if (jobs.length === 0) return null\n if (jobs.length > JOB_CARD_LIMIT) throw new Error(`NearbyJobs: ${jobs.length} jobs; a page shows at most ${JOB_CARD_LIMIT} job cards.`)\n const ids = new Set<string>()\n for (const { job } of jobs) {\n if (ids.has(job.id)) throw new Error(`NearbyJobs: \"${job.id}\" is listed twice.`)\n ids.add(job.id)\n }\n const shown = new Set(pagePhotos)\n const columns = layout?.columns ?? 3\n const ratio = layout?.ratio ?? '4:3'\n const feature = variant === 'grid' && layout?.arrangement === 'feature' && jobs.length === 3\n const sizes = imageSizes ?? `(min-width: 1024px) ${Math.round(100 / columns)}vw, (min-width: 640px) 50vw, 100vw`\n const headings = cardHeadings(\n jobs,\n layout?.cardTitle ?? 'label',\n (job) => jobCardLabel(job, { service: serviceName(job.service), suburbName: suburbName(job.suburb), pageSuburb, ...(labelPrefix === undefined ? {} : { prefix: labelPrefix }) }),\n pageSuburb,\n )\n return (\n <Section\n id=\"nearby-jobs\"\n labelledBy={headingId}\n tone={tone}\n variant={variant}\n classes={classes}\n hooks={{ 'data-columns': String(columns), 'data-ratio': ratio, 'data-arrangement': feature ? 'feature' : undefined }}\n >\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <ul role=\"list\" {...slot(classes, 'list')}>\n {jobs.map(({ job }, index) => {\n const label = headings[index]\n const href = jobHref?.(job)\n const photo = photoOf(job, media, shown)\n return (\n <li key={job.id} {...repeatedSlot('item')} data-item={job.id} data-suburb={job.suburb} data-linked={href ? '' : undefined}>\n <div {...repeatedSlot('body')}>\n <h3 {...repeatedSlot('title')}>\n {href ? (\n <Anchor href={href} prefetch={LINK_PREFETCH_POLICY.contentCard} hooks={repeatedSlot('link')}>\n {label}\n </Anchor>\n ) : (\n label\n )}\n </h3>\n <p {...repeatedSlot('outcome')}>{job.outcome}</p>\n {href && linkCue ? (\n <span {...repeatedSlot('cue')} aria-hidden=\"true\">\n {linkCue}\n </span>\n ) : null}\n </div>\n {photo ? (\n <div {...repeatedSlot('media')}>\n <Media media={photo} sizes={sizes} layout={{ ratio }} />\n </div>\n ) : null}\n </li>\n )\n })}\n </ul>\n {footer ? <p {...slot(classes, 'footer')}>{footer}</p> : null}\n {link ? (\n <p {...slot(classes, 'more')}>\n <TextLink href={link.href} prefetch={LINK_PREFETCH_POLICY.contentCard}>\n {link.label}\n </TextLink>\n </p>\n ) : null}\n </Section>\n )\n}\n\n/** Each card's heading: its label, or the job's title where the label repeats an earlier card's or `cardTitle` is `job`. */\nfunction cardHeadings(\n jobs: readonly BrandlabNearbyJob[],\n cardTitle: 'label' | 'job',\n labelOf: (job: BrandlabJob) => string,\n pageSuburb: string,\n): string[] {\n const used = new Set<string>()\n // A job from another suburb keeps the \"nearby\" label when its own title stands in (L4, 3.17.1).\n const titleOf = (job: BrandlabJob) => (job.title && job.suburb !== pageSuburb ? `Nearby: ${job.title}` : job.title)\n return jobs.map(({ job }) => {\n const title = titleOf(job)\n let heading = cardTitle === 'job' && title ? title : labelOf(job)\n if (used.has(heading)) {\n if (!title || used.has(title)) {\n throw new Error(`NearbyJobs: two cards would both read \"${heading}\"; give job \"${job.id}\" its own title in the job log.`)\n }\n heading = title\n }\n used.add(heading)\n return heading\n })\n}\n"]}
@@ -1,29 +0,0 @@
1
- /**
2
- * `PageHeader` (S2, `page-header`): the simple header of every hub and company page, contact included. Server
3
- * component: the page's one H1, an optional one-line summary and the breadcrumbs. No form, no phone button and no
4
- * review quote (Romie, ATS, Prestige and AB), so it takes no other content. Variants: `plain`, or `photo` (the site's
5
- * image behind, under a scrim the site colours, as the hero's scrim rule).
6
- */
7
- import type { ReactNode } from 'react';
8
- import { type SectionTone } from '../primitives/layout.js';
9
- import { type SkinEntry } from '../skin.js';
10
- export declare const PAGE_HEADER_VARIANTS: readonly ["plain", "photo"];
11
- export type PageHeaderVariant = (typeof PAGE_HEADER_VARIANTS)[number];
12
- export type PageHeaderSlot = 'root' | 'inner' | 'crumbs' | 'h1' | 'summary' | 'media' | 'scrim';
13
- export type PageHeaderSkin = SkinEntry<PageHeaderSlot, PageHeaderVariant>;
14
- export interface PageHeaderProps extends PageHeaderSkin {
15
- /** The page's H1, rendered once. */
16
- readonly title: ReactNode;
17
- /** One line under the H1. */
18
- readonly summary?: ReactNode;
19
- /** The page's breadcrumbs (the shared `Breadcrumbs`, with its own `nav`). */
20
- readonly breadcrumbs?: ReactNode;
21
- /** The `photo` variant's image (the site's `Media`). Ignored by `plain`. */
22
- readonly media?: ReactNode;
23
- /** Defaults to `page-title`. */
24
- readonly headingId?: string;
25
- /** Set by `SectionSequence`. A page using the `photo` variant offers its header with `tone: 'photo'`. */
26
- readonly tone?: SectionTone;
27
- }
28
- export declare function PageHeader({ title, summary, breadcrumbs, media, headingId, tone, variant, classes }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
29
- //# sourceMappingURL=page-header.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/page-header.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,oBAAoB,6BAA8B,CAAA;AAC/D,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AACrE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAC/F,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAA;AAEzE,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,6BAA6B;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAA;IAC5B,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAA;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B,gCAAgC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,yGAAyG;IACzG,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAC5B;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,SAAwB,EAAE,IAAI,EAAE,OAAiB,EAAE,OAAO,EAAE,EAAE,eAAe,2CAiB7I"}
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Section } from '../primitives/layout.js';
3
- import { slot } from '../skin.js';
4
- export const PAGE_HEADER_VARIANTS = ['plain', 'photo'];
5
- export function PageHeader({ title, summary, breadcrumbs, media, headingId = 'page-title', tone, variant = 'plain', classes }) {
6
- const photo = variant === 'photo' && media ? media : null;
7
- return (_jsxs(Section, { id: "page-header", labelledBy: headingId, tone: tone, variant: variant, classes: classes, children: [photo ? (_jsxs(_Fragment, { children: [_jsx("div", { ...slot(classes, 'media'), children: photo }), _jsx("div", { ...slot(classes, 'scrim'), "aria-hidden": "true" })] })) : null, breadcrumbs ? _jsx("div", { ...slot(classes, 'crumbs'), children: breadcrumbs }) : null, _jsx("h1", { id: headingId, ...slot(classes, 'h1'), children: title }), summary ? _jsx("p", { ...slot(classes, 'summary'), children: summary }) : null] }));
8
- }
9
- //# sourceMappingURL=page-header.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-header.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/page-header.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAEjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAU,CAAA;AAoB/D,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,GAAG,YAAY,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,OAAO,EAAmB;IAC5I,MAAM,KAAK,GAAG,OAAO,KAAK,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IACzD,OAAO,CACL,MAAC,OAAO,IAAC,EAAE,EAAC,aAAa,EAAC,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,aAC5F,KAAK,CAAC,CAAC,CAAC,CACP,8BACE,iBAAS,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,YAAG,KAAK,GAAO,EAC9C,iBAAS,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,iBAAc,MAAM,GAAG,IACrD,CACJ,CAAC,CAAC,CAAC,IAAI,EACP,WAAW,CAAC,CAAC,CAAC,iBAAS,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,YAAG,WAAW,GAAO,CAAC,CAAC,CAAC,IAAI,EAC3E,aAAI,EAAE,EAAE,SAAS,KAAM,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YACvC,KAAK,GACH,EACJ,OAAO,CAAC,CAAC,CAAC,eAAO,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,YAAG,OAAO,GAAK,CAAC,CAAC,CAAC,IAAI,IACxD,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `PageHeader` (S2, `page-header`): the simple header of every hub and company page, contact included. Server\n * component: the page's one H1, an optional one-line summary and the breadcrumbs. No form, no phone button and no\n * review quote (Romie, ATS, Prestige and AB), so it takes no other content. Variants: `plain`, or `photo` (the site's\n * image behind, under a scrim the site colours, as the hero's scrim rule).\n */\nimport type { ReactNode } from 'react'\nimport { Section, type SectionTone } from '../primitives/layout.js'\nimport { slot, type SkinEntry } from '../skin.js'\n\nexport const PAGE_HEADER_VARIANTS = ['plain', 'photo'] as const\nexport type PageHeaderVariant = (typeof PAGE_HEADER_VARIANTS)[number]\nexport type PageHeaderSlot = 'root' | 'inner' | 'crumbs' | 'h1' | 'summary' | 'media' | 'scrim'\nexport type PageHeaderSkin = SkinEntry<PageHeaderSlot, PageHeaderVariant>\n\nexport interface PageHeaderProps extends PageHeaderSkin {\n /** The page's H1, rendered once. */\n readonly title: ReactNode\n /** One line under the H1. */\n readonly summary?: ReactNode\n /** The page's breadcrumbs (the shared `Breadcrumbs`, with its own `nav`). */\n readonly breadcrumbs?: ReactNode\n /** The `photo` variant's image (the site's `Media`). Ignored by `plain`. */\n readonly media?: ReactNode\n /** Defaults to `page-title`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. A page using the `photo` variant offers its header with `tone: 'photo'`. */\n readonly tone?: SectionTone\n}\n\nexport function PageHeader({ title, summary, breadcrumbs, media, headingId = 'page-title', tone, variant = 'plain', classes }: PageHeaderProps) {\n const photo = variant === 'photo' && media ? media : null\n return (\n <Section id=\"page-header\" labelledBy={headingId} tone={tone} variant={variant} classes={classes}>\n {photo ? (\n <>\n <div {...slot(classes, 'media')}>{photo}</div>\n <div {...slot(classes, 'scrim')} aria-hidden=\"true\" />\n </>\n ) : null}\n {breadcrumbs ? <div {...slot(classes, 'crumbs')}>{breadcrumbs}</div> : null}\n <h1 id={headingId} {...slot(classes, 'h1')}>\n {title}\n </h1>\n {summary ? <p {...slot(classes, 'summary')}>{summary}</p> : null}\n </Section>\n )\n}\n"]}
@@ -1,59 +0,0 @@
1
- /**
2
- * `PriceGuide` (S19, `price-guide`): "Typical prices", which every service page carries. Server component. Bands come
3
- * from `prices.ts` in a renderable status only; with none the section renders nothing and reports
4
- * `no-approved-prices`, and the page links to its cost guide instead. Every variant shows the full price with its GST
5
- * flag, part prices only beside it, never a "from $X" teaser. What moves the price shows a dollar effect only where
6
- * the owner supplied one.
7
- *
8
- * Variants: `table` (`PriceTable`), `cards` (one card per job) or `bands` (a compact list).
9
- */
10
- import type { ReactNode } from 'react';
11
- import { type BrandlabPrice } from '@brandlab-digital/site-core/prices';
12
- import { type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order';
13
- import { type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js';
14
- import type { RepeatedSlotOf } from '../repeated-slots.js';
15
- import { type SkinEntry } from '../skin.js';
16
- import type { UiLink } from '../types.js';
17
- import { type PriceLabels, type PriceTableSlot } from './price-table.js';
18
- export declare const PRICE_GUIDE_VARIANTS: readonly ["table", "cards", "bands"];
19
- export type PriceGuideVariant = (typeof PRICE_GUIDE_VARIANTS)[number];
20
- export type PriceGuideSlot = SectionSlot | SectionHeadingSlot | Exclude<PriceTableSlot, 'root'> | 'cards' | 'card' | 'title' | 'figures' | 'bands' | 'band' | 'factors' | 'subheading' | 'factor' | 'name' | 'effect' | 'detail' | 'more' | 'link';
21
- /** Rendered once per price row, card, band or factor: styled from the skin stylesheet, never by class (3.14.0). */
22
- export type PriceGuideRepeatedSlot = RepeatedSlotOf<'priceGuide'>;
23
- export type PriceGuideSkin = SkinEntry<PriceGuideSlot, PriceGuideVariant, Record<never, never>, PriceGuideRepeatedSlot>;
24
- /** Something that moves the price. `effect` only when the owner supplied the dollar figure. */
25
- export interface PriceFactor {
26
- readonly label: string;
27
- readonly detail?: string;
28
- readonly effect?: {
29
- readonly low: number;
30
- readonly high?: number;
31
- };
32
- }
33
- export interface PriceGuideProps extends PriceGuideSkin {
34
- /** The H2. */
35
- readonly title: ReactNode;
36
- readonly eyebrow?: ReactNode;
37
- readonly lead?: ReactNode;
38
- readonly prices: readonly BrandlabPrice[];
39
- /** Only this service's bands, when `prices` holds the whole file. */
40
- readonly service?: string;
41
- readonly labels: PriceLabels;
42
- /** Defaults to "Typical prices"; otherwise only "Typical {service} prices" for `service`, or a rendered row's service. */
43
- readonly caption?: string;
44
- /** What moves the price, under its own H3. */
45
- readonly factors?: {
46
- readonly title: ReactNode;
47
- readonly items: readonly PriceFactor[];
48
- };
49
- /** The service's cost guide. */
50
- readonly costGuide?: UiLink;
51
- /** Defaults to `price-guide-heading`. */
52
- readonly headingId?: string;
53
- /** Set by `SectionSequence`. */
54
- readonly tone?: SectionTone;
55
- }
56
- /** Whether the section renders: nothing without a renderable band (`no-approved-prices`). */
57
- export declare function priceGuideReady({ prices, service }: Pick<PriceGuideProps, 'prices' | 'service'>): BrandlabSectionReadiness;
58
- export declare function PriceGuide({ title, eyebrow, lead, prices, service, labels, caption, factors, costGuide, headingId, tone, variant, classes, }: PriceGuideProps): import("react/jsx-runtime").JSX.Element | null;
59
- //# sourceMappingURL=price-guide.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"price-guide.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/price-guide.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM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AAe,kDAmEjB"}
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { PRICE_CAPTION, formatPriceBand, renderablePrices } from '@brandlab-digital/site-core/prices';
3
- import { SECTION_READY } from '@brandlab-digital/site-core/section-order';
4
- import { TextLink } from '../primitives/links.js';
5
- import { Section, SectionHeading } from '../primitives/layout.js';
6
- import { repeatedSlot, slot } from '../skin.js';
7
- import { PriceFigures, PriceScope, PriceTable, assertPriceWording } from './price-table.js';
8
- export const PRICE_GUIDE_VARIANTS = ['table', 'cards', 'bands'];
9
- /** Whether the section renders: nothing without a renderable band (`no-approved-prices`). */
10
- export function priceGuideReady({ prices, service }) {
11
- return renderablePrices(prices, service).length > 0 ? SECTION_READY : { render: false, reason: 'no-approved-prices' };
12
- }
13
- export function PriceGuide({ title, eyebrow, lead, prices, service, labels, caption = PRICE_CAPTION, factors, costGuide, headingId = 'price-guide-heading', tone, variant = 'table', classes, }) {
14
- const rows = renderablePrices(prices, service);
15
- assertPriceWording(caption, labels, service ? [service] : rows.map((row) => row.service));
16
- if (rows.length === 0)
17
- return null;
18
- let body;
19
- if (variant === 'table') {
20
- body = _jsx(PriceTable, { prices: rows, labels: labels, caption: caption, classes: { ...classes, root: undefined } });
21
- }
22
- else {
23
- const list = (row) => variant === 'cards' ? (_jsxs("li", { ...repeatedSlot('card'), children: [_jsx("h3", { ...repeatedSlot('title'), children: row.job }), _jsx("div", { ...repeatedSlot('figures'), children: _jsx(PriceFigures, { price: row, labels: labels }) }), _jsx(PriceScope, { price: row, labels: labels })] }, row.job)) : (_jsxs("li", { ...repeatedSlot('band'), children: [_jsx("span", { ...repeatedSlot('job'), children: row.job }), ' ', _jsx("div", { ...repeatedSlot('figures'), children: _jsx(PriceFigures, { price: row, labels: labels }) }), _jsx(PriceScope, { price: row, labels: labels })] }, row.job));
24
- body = (_jsxs(_Fragment, { children: [_jsx("p", { ...slot(classes, 'caption'), children: caption }), _jsx("ul", { role: "list", ...slot(classes, variant), children: rows.map(list) })] }));
25
- }
26
- return (_jsxs(Section, { id: "price-guide", labelledBy: headingId, tone: tone, variant: variant, classes: classes, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), body, factors && factors.items.length > 0 ? (_jsxs("div", { ...slot(classes, 'factors'), children: [_jsx("h3", { ...slot(classes, 'subheading'), children: factors.title }), _jsx("ul", { children: factors.items.map((factor) => (_jsxs("li", { ...repeatedSlot('factor'), children: [_jsx("span", { ...repeatedSlot('name'), children: factor.label }), factor.effect ? (_jsxs(_Fragment, { children: [' ', _jsx("span", { ...repeatedSlot('effect'), children: formatPriceBand(factor.effect) })] })) : null, factor.detail ? _jsx("p", { ...repeatedSlot('detail'), children: factor.detail }) : null] }, factor.label))) })] })) : null, costGuide ? (_jsx("p", { ...slot(classes, 'more'), children: _jsx(TextLink, { href: costGuide.href, variant: "standalone", classes: { root: classes?.link }, children: costGuide.label }) })) : null] }));
27
- }
28
- //# sourceMappingURL=price-guide.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"price-guide.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/price-guide.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAsB,MAAM,oCAAoC,CAAA;AACzH,OAAO,EAAE,aAAa,EAAiC,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,cAAc,EAA+D,MAAM,yBAAyB,CAAA;AAE9H,OAAO,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAE/D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAAyC,MAAM,kBAAkB,CAAA;AAElI,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAU,C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,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACrC,kBAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,aAC/B,gBAAQ,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,YAAG,OAAO,CAAC,KAAK,GAAM,EACzD,uBACG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7B,iBAA2B,YAAY,CAAC,QAAQ,CAAC,aAC/C,kBAAU,YAAY,CAAC,MAAM,CAAC,YAAG,MAAM,CAAC,KAAK,GAAQ,EACpD,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CACf,8BACG,GAAG,EACJ,kBAAU,YAAY,CAAC,QAAQ,CAAC,YAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,GAAQ,IACxE,CACJ,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,eAAO,YAAY,CAAC,QAAQ,CAAC,YAAG,MAAM,CAAC,MAAM,GAAK,CAAC,CAAC,CAAC,IAAI,KARnE,MAAM,CAAC,KAAK,CAShB,CACN,CAAC,GACC,IACD,CACP,CAAC,CAAC,CAAC,IAAI,EACP,SAAS,CAAC,CAAC,CAAC,CACX,eAAO,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,YAC1B,KAAC,QAAQ,IAAC,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,OAAO,EAAC,YAAY,EAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAClF,SAAS,CAAC,KAAK,GACP,GACT,CACL,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `PriceGuide` (S19, `price-guide`): \"Typical prices\", which every service page carries. Server component. Bands come\n * from `prices.ts` in a renderable status only; with none the section renders nothing and reports\n * `no-approved-prices`, and the page links to its cost guide instead. Every variant shows the full price with its GST\n * flag, part prices only beside it, never a \"from $X\" teaser. What moves the price shows a dollar effect only where\n * the owner supplied one.\n *\n * Variants: `table` (`PriceTable`), `cards` (one card per job) or `bands` (a compact list).\n */\nimport type { ReactNode } from 'react'\nimport { PRICE_CAPTION, formatPriceBand, renderablePrices, type BrandlabPrice } from '@brandlab-digital/site-core/prices'\nimport { SECTION_READY, type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order'\nimport { TextLink } 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 } from '../skin.js'\nimport type { UiLink } from '../types.js'\nimport { PriceFigures, PriceScope, PriceTable, assertPriceWording, type PriceLabels, type PriceTableSlot } from './price-table.js'\n\nexport const PRICE_GUIDE_VARIANTS = ['table', 'cards', 'bands'] as const\nexport type PriceGuideVariant = (typeof PRICE_GUIDE_VARIANTS)[number]\nexport type PriceGuideSlot =\n | SectionSlot\n | SectionHeadingSlot\n | Exclude<PriceTableSlot, 'root'>\n | 'cards'\n | 'card'\n | 'title'\n | 'figures'\n | 'bands'\n | 'band'\n | 'factors'\n | 'subheading'\n | 'factor'\n | 'name'\n | 'effect'\n | 'detail'\n | 'more'\n | 'link'\n/** Rendered once per price row, card, band or factor: styled from the skin stylesheet, never by class (3.14.0). */\nexport type PriceGuideRepeatedSlot = RepeatedSlotOf<'priceGuide'>\nexport type PriceGuideSkin = SkinEntry<PriceGuideSlot, PriceGuideVariant, Record<never, never>, PriceGuideRepeatedSlot>\n\n/** Something that moves the price. `effect` only when the owner supplied the dollar figure. */\nexport interface PriceFactor {\n readonly label: string\n readonly detail?: string\n readonly effect?: { readonly low: number; readonly high?: number }\n}\n\nexport interface PriceGuideProps extends PriceGuideSkin {\n /** The H2. */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n readonly prices: readonly BrandlabPrice[]\n /** Only this service's bands, when `prices` holds the whole file. */\n readonly service?: string\n readonly labels: PriceLabels\n /** Defaults to \"Typical prices\"; otherwise only \"Typical {service} prices\" for `service`, or a rendered row's service. */\n readonly caption?: string\n /** What moves the price, under its own H3. */\n readonly factors?: { readonly title: ReactNode; readonly items: readonly PriceFactor[] }\n /** The service's cost guide. */\n readonly costGuide?: UiLink\n /** Defaults to `price-guide-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** Whether the section renders: nothing without a renderable band (`no-approved-prices`). */\nexport function priceGuideReady({ prices, service }: Pick<PriceGuideProps, 'prices' | 'service'>): BrandlabSectionReadiness {\n return renderablePrices(prices, service).length > 0 ? SECTION_READY : { render: false, reason: 'no-approved-prices' }\n}\n\nexport function PriceGuide({\n title,\n eyebrow,\n lead,\n prices,\n service,\n labels,\n caption = PRICE_CAPTION,\n factors,\n costGuide,\n headingId = 'price-guide-heading',\n tone,\n variant = 'table',\n classes,\n}: PriceGuideProps) {\n const rows = renderablePrices(prices, service)\n assertPriceWording(caption, labels, service ? [service] : rows.map((row) => row.service))\n if (rows.length === 0) return null\n let body: ReactNode\n if (variant === 'table') {\n body = <PriceTable prices={rows} labels={labels} caption={caption} classes={{ ...classes, root: undefined }} />\n } else {\n const list = (row: BrandlabPrice) =>\n variant === 'cards' ? (\n <li key={row.job} {...repeatedSlot('card')}>\n <h3 {...repeatedSlot('title')}>{row.job}</h3>\n <div {...repeatedSlot('figures')}>\n <PriceFigures price={row} labels={labels} />\n </div>\n <PriceScope price={row} labels={labels} />\n </li>\n ) : (\n <li key={row.job} {...repeatedSlot('band')}>\n <span {...repeatedSlot('job')}>{row.job}</span>{' '}\n <div {...repeatedSlot('figures')}>\n <PriceFigures price={row} labels={labels} />\n </div>\n <PriceScope price={row} labels={labels} />\n </li>\n )\n body = (\n <>\n <p {...slot(classes, 'caption')}>{caption}</p>\n <ul role=\"list\" {...slot(classes, variant)}>\n {rows.map(list)}\n </ul>\n </>\n )\n }\n return (\n <Section id=\"price-guide\" labelledBy={headingId} tone={tone} variant={variant} classes={classes}>\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n {body}\n {factors && factors.items.length > 0 ? (\n <div {...slot(classes, 'factors')}>\n <h3 {...slot(classes, 'subheading')}>{factors.title}</h3>\n <ul>\n {factors.items.map((factor) => (\n <li key={factor.label} {...repeatedSlot('factor')}>\n <span {...repeatedSlot('name')}>{factor.label}</span>\n {factor.effect ? (\n <>\n {' '}\n <span {...repeatedSlot('effect')}>{formatPriceBand(factor.effect)}</span>\n </>\n ) : null}\n {factor.detail ? <p {...repeatedSlot('detail')}>{factor.detail}</p> : null}\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n {costGuide ? (\n <p {...slot(classes, 'more')}>\n <TextLink href={costGuide.href} variant=\"standalone\" classes={{ root: classes?.link }}>\n {costGuide.label}\n </TextLink>\n </p>\n ) : null}\n </Section>\n )\n}\n"]}
@@ -1,42 +0,0 @@
1
- import { type BrandlabPrice } from '@brandlab-digital/site-core/prices';
2
- import type { RepeatedSlotOf } from '../repeated-slots.js';
3
- import { type SkinEntry } from '../skin.js';
4
- export type PriceTableSlot = 'root' | 'table' | 'caption' | 'thead' | 'row' | 'job' | 'cell' | 'label' | 'range' | 'unit' | 'gst' | 'parts' | 'part' | 'includes' | 'excludes';
5
- /** Rendered once per price row: styled from the skin stylesheet, never by class (3.14.0). */
6
- export type PriceTableRepeatedSlot = RepeatedSlotOf<'priceTable'>;
7
- export type PriceTableSkin = SkinEntry<PriceTableSlot, never, Record<never, never>, PriceTableRepeatedSlot>;
8
- /** The words around the figures, in the site's Australian English. */
9
- export interface PriceLabels {
10
- /** The job column header, for example "Job". */
11
- readonly job: string;
12
- /** The price column header, for example "Typical price". */
13
- readonly price: string;
14
- /** The scope column header, for example "What's included". */
15
- readonly includes: string;
16
- /** Before what the price leaves out, for example "Not included". */
17
- readonly excludes: string;
18
- /** The GST flag beside a GST-inclusive price, for example "incl. GST". */
19
- readonly gstIncluded: string;
20
- /** The GST flag beside a GST-exclusive price, for example "excl. GST" (never "+ GST"). */
21
- readonly gstExcluded: string;
22
- }
23
- export interface PriceTableProps extends PriceTableSkin {
24
- readonly prices: readonly BrandlabPrice[];
25
- readonly labels: PriceLabels;
26
- /** Defaults to "Typical prices"; otherwise only "Typical {service} prices" for a service in `prices`. */
27
- readonly caption?: string;
28
- }
29
- /** Throws when the caption (checked against the page's service slugs) or the GST labels break the price rules. */
30
- export declare function assertPriceWording(caption: string, labels: PriceLabels, services: readonly string[]): void;
31
- /** The full price, its unit and GST flag, then any part prices beside it. */
32
- export declare function PriceFigures({ price, labels }: {
33
- price: BrandlabPrice;
34
- labels: PriceLabels;
35
- }): import("react/jsx-runtime").JSX.Element;
36
- /** What the price covers and leaves out. */
37
- export declare function PriceScope({ price, labels }: {
38
- price: BrandlabPrice;
39
- labels: PriceLabels;
40
- }): import("react/jsx-runtime").JSX.Element;
41
- export declare function PriceTable({ prices, labels, caption, classes }: PriceTableProps): import("react/jsx-runtime").JSX.Element | null;
42
- //# sourceMappingURL=price-table.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"price-table.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/price-table.tsx"],"names":[],"mappings":"AAWA,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAE/D,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,OAAO,GACP,SAAS,GACT,OAAO,GACP,KAAK,GACL,KAAK,GACL,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,KAAK,GACL,OAAO,GACP,MAAM,GACN,UAAU,GACV,UAAU,CAAA;AACd,6FAA6F;AAC7F,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AACjE,MAAM,MA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O,EAAE,EAAE,eAAe,kDA8C/F"}
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { PRICE_CAPTION, assertGstLabel, assertPriceCaption, formatPriceBand, renderablePrices, } from '@brandlab-digital/site-core/prices';
3
- import { repeatedSlot, slot } from '../skin.js';
4
- /** Throws when the caption (checked against the page's service slugs) or the GST labels break the price rules. */
5
- export function assertPriceWording(caption, labels, services) {
6
- assertPriceCaption(caption, services);
7
- assertGstLabel(labels.gstIncluded, 'labels.gstIncluded');
8
- assertGstLabel(labels.gstExcluded, 'labels.gstExcluded');
9
- }
10
- /** The full price, its unit and GST flag, then any part prices beside it. */
11
- export function PriceFigures({ price, labels }) {
12
- return (_jsxs(_Fragment, { children: [_jsx("span", { ...repeatedSlot('range'), children: formatPriceBand(price) }), price.unit ? (_jsxs(_Fragment, { children: [' ', _jsx("span", { ...repeatedSlot('unit'), children: price.unit })] })) : null, ' ', _jsx("span", { ...repeatedSlot('gst'), "data-gst": price.gstIncluded ? 'included' : 'excluded', children: price.gstIncluded ? labels.gstIncluded : labels.gstExcluded }), price.parts.length > 0 ? (_jsx("ul", { ...repeatedSlot('parts'), children: price.parts.map((part) => (_jsxs("li", { ...repeatedSlot('part'), children: [part.label, " ", formatPriceBand(part)] }, part.label))) })) : null] }));
13
- }
14
- /** What the price covers and leaves out. */
15
- export function PriceScope({ price, labels }) {
16
- return (_jsxs(_Fragment, { children: [price.includes.length > 0 ? (_jsx("ul", { ...repeatedSlot('includes'), children: price.includes.map((item) => (_jsx("li", { children: item }, item))) })) : null, price.excludes.length > 0 ? (_jsxs("p", { ...repeatedSlot('excludes'), children: [labels.excludes, ": ", price.excludes.join(', ')] })) : null] }));
17
- }
18
- function CellLabel({ children }) {
19
- return (_jsx("span", { ...repeatedSlot('label'), "aria-hidden": "true", children: children }));
20
- }
21
- export function PriceTable({ prices, labels, caption = PRICE_CAPTION, classes }) {
22
- const rows = renderablePrices(prices);
23
- assertPriceWording(caption, labels, rows.map((row) => row.service));
24
- if (rows.length === 0)
25
- return null;
26
- const hasScope = rows.some((row) => row.includes.length > 0 || row.excludes.length > 0);
27
- return (_jsx("div", { "data-bl": "price-table", className: classes?.root, children: _jsxs("table", { role: "table", ...slot(classes, 'table'), children: [_jsx("caption", { ...slot(classes, 'caption'), children: caption }), _jsx("thead", { role: "rowgroup", ...slot(classes, 'thead'), children: _jsxs("tr", { role: "row", children: [_jsx("th", { scope: "col", role: "columnheader", children: labels.job }), _jsx("th", { scope: "col", role: "columnheader", children: labels.price }), hasScope ? (_jsx("th", { scope: "col", role: "columnheader", children: labels.includes })) : null] }) }), _jsx("tbody", { role: "rowgroup", children: rows.map((row) => (_jsxs("tr", { role: "row", ...repeatedSlot('row'), children: [_jsx("th", { scope: "row", role: "rowheader", ...repeatedSlot('job'), children: row.job }), _jsxs("td", { role: "cell", ...repeatedSlot('cell'), "data-column": "price", children: [_jsx(CellLabel, { children: labels.price }), _jsx(PriceFigures, { price: row, labels: labels })] }), hasScope ? (_jsxs("td", { role: "cell", ...repeatedSlot('cell'), "data-column": "includes", children: [row.includes.length > 0 || row.excludes.length > 0 ? _jsx(CellLabel, { children: labels.includes }) : null, _jsx(PriceScope, { price: row, labels: labels })] })) : null] }, `${row.service}:${row.job}`))) })] }) }));
28
- }
29
- //# sourceMappingURL=price-table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"price-table.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/price-table.tsx"],"names":[],"mappings":";AAWA,OAAO,EACL,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GAEjB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AA6C/D,kHAAkH;AAClH,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,MAAmB,EAAE,QAA2B;IAClG,kBAAkB,CAAC,OAAO,EAAE,QAAQ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KAAC,SAAS,cAAE,MAAM,CAAC,QAAQ,GAAa,CAAC,CAAC,CAAC,IAAI,EACrG,KAAC,UAAU,IAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAI,IACvC,CACN,CAAC,CAAC,CAAC,IAAI,KAbD,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,GAAG,EAAE,CAc/B,CACN,CAAC,GACI,IACF,GACJ,CACP,CAAA;AACH,CAAC","sourcesContent":["/**\n * `PriceTable`: typical prices from `prices.ts` as a real `<table>`. Server component. The caption is \"Typical prices\"\n * by default and may only become \"Typical {service} prices\" (never a place name or \"market rates\"). Every row shows\n * the full price, the GST flag and, beside them only, any part price such as a call-out fee (NSW Fair Trading). Held\n * bands never render, and nothing renders without a renderable band.\n *\n * On narrow widths (container below 40rem) rows stack visually. Changing a table's CSS `display` can drop its\n * semantics in some screen readers, so every element carries its table role explicitly, and each cell repeats its\n * column label for sighted readers only (`aria-hidden`).\n */\nimport type { ReactNode } from 'react'\nimport {\n PRICE_CAPTION,\n assertGstLabel,\n assertPriceCaption,\n formatPriceBand,\n renderablePrices,\n type BrandlabPrice,\n} from '@brandlab-digital/site-core/prices'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\n\nexport type PriceTableSlot =\n | 'root'\n | 'table'\n | 'caption'\n | 'thead'\n | 'row'\n | 'job'\n | 'cell'\n | 'label'\n | 'range'\n | 'unit'\n | 'gst'\n | 'parts'\n | 'part'\n | 'includes'\n | 'excludes'\n/** Rendered once per price row: styled from the skin stylesheet, never by class (3.14.0). */\nexport type PriceTableRepeatedSlot = RepeatedSlotOf<'priceTable'>\nexport type PriceTableSkin = SkinEntry<PriceTableSlot, never, Record<never, never>, PriceTableRepeatedSlot>\n\n/** The words around the figures, in the site's Australian English. */\nexport interface PriceLabels {\n /** The job column header, for example \"Job\". */\n readonly job: string\n /** The price column header, for example \"Typical price\". */\n readonly price: string\n /** The scope column header, for example \"What's included\". */\n readonly includes: string\n /** Before what the price leaves out, for example \"Not included\". */\n readonly excludes: string\n /** The GST flag beside a GST-inclusive price, for example \"incl. GST\". */\n readonly gstIncluded: string\n /** The GST flag beside a GST-exclusive price, for example \"excl. GST\" (never \"+ GST\"). */\n readonly gstExcluded: string\n}\n\nexport interface PriceTableProps extends PriceTableSkin {\n readonly prices: readonly BrandlabPrice[]\n readonly labels: PriceLabels\n /** Defaults to \"Typical prices\"; otherwise only \"Typical {service} prices\" for a service in `prices`. */\n readonly caption?: string\n}\n\n/** Throws when the caption (checked against the page's service slugs) or the GST labels break the price rules. */\nexport function assertPriceWording(caption: string, labels: PriceLabels, services: readonly string[]) {\n assertPriceCaption(caption, services)\n assertGstLabel(labels.gstIncluded, 'labels.gstIncluded')\n assertGstLabel(labels.gstExcluded, 'labels.gstExcluded')\n}\n\n/** The full price, its unit and GST flag, then any part prices beside it. */\nexport function PriceFigures({ price, labels }: { price: BrandlabPrice; labels: PriceLabels }) {\n return (\n <>\n <span {...repeatedSlot('range')}>{formatPriceBand(price)}</span>\n {price.unit ? (\n <>\n {' '}\n <span {...repeatedSlot('unit')}>{price.unit}</span>\n </>\n ) : null}{' '}\n <span {...repeatedSlot('gst')} data-gst={price.gstIncluded ? 'included' : 'excluded'}>\n {price.gstIncluded ? labels.gstIncluded : labels.gstExcluded}\n </span>\n {price.parts.length > 0 ? (\n <ul {...repeatedSlot('parts')}>\n {price.parts.map((part) => (\n <li key={part.label} {...repeatedSlot('part')}>\n {part.label} {formatPriceBand(part)}\n </li>\n ))}\n </ul>\n ) : null}\n </>\n )\n}\n\n/** What the price covers and leaves out. */\nexport function PriceScope({ price, labels }: { price: BrandlabPrice; labels: PriceLabels }) {\n return (\n <>\n {price.includes.length > 0 ? (\n <ul {...repeatedSlot('includes')}>\n {price.includes.map((item) => (\n <li key={item}>{item}</li>\n ))}\n </ul>\n ) : null}\n {price.excludes.length > 0 ? (\n <p {...repeatedSlot('excludes')}>\n {labels.excludes}: {price.excludes.join(', ')}\n </p>\n ) : null}\n </>\n )\n}\n\nfunction CellLabel({ children }: { children: ReactNode }) {\n return (\n <span {...repeatedSlot('label')} aria-hidden=\"true\">\n {children}\n </span>\n )\n}\n\nexport function PriceTable({ prices, labels, caption = PRICE_CAPTION, classes }: PriceTableProps) {\n const rows = renderablePrices(prices)\n assertPriceWording(caption, labels, rows.map((row) => row.service))\n if (rows.length === 0) return null\n const hasScope = rows.some((row) => row.includes.length > 0 || row.excludes.length > 0)\n return (\n <div data-bl=\"price-table\" className={classes?.root}>\n <table role=\"table\" {...slot(classes, 'table')}>\n <caption {...slot(classes, 'caption')}>{caption}</caption>\n <thead role=\"rowgroup\" {...slot(classes, 'thead')}>\n <tr role=\"row\">\n <th scope=\"col\" role=\"columnheader\">\n {labels.job}\n </th>\n <th scope=\"col\" role=\"columnheader\">\n {labels.price}\n </th>\n {hasScope ? (\n <th scope=\"col\" role=\"columnheader\">\n {labels.includes}\n </th>\n ) : null}\n </tr>\n </thead>\n <tbody role=\"rowgroup\">\n {rows.map((row) => (\n <tr key={`${row.service}:${row.job}`} role=\"row\" {...repeatedSlot('row')}>\n <th scope=\"row\" role=\"rowheader\" {...repeatedSlot('job')}>\n {row.job}\n </th>\n <td role=\"cell\" {...repeatedSlot('cell')} data-column=\"price\">\n <CellLabel>{labels.price}</CellLabel>\n <PriceFigures price={row} labels={labels} />\n </td>\n {hasScope ? (\n <td role=\"cell\" {...repeatedSlot('cell')} data-column=\"includes\">\n {row.includes.length > 0 || row.excludes.length > 0 ? <CellLabel>{labels.includes}</CellLabel> : null}\n <PriceScope price={row} labels={labels} />\n </td>\n ) : null}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )\n}\n"]}
@@ -1,79 +0,0 @@
1
- /**
2
- * `Projects` (`projects`, 3.15.0): completed jobs as cards, each linking its project page (`/projects/{slug}`). Server
3
- * component. AA's `ProjectGrid`, re-implemented on the `Card` primitive.
4
- *
5
- * Locked:
6
- * - genuine photos only (v2 §11 imagery rule 4): a stock or AI image on a project card fails the build, and a project
7
- * without a photo shows as a card without one;
8
- * - at most 8 cards (K11; the in-content intent-prefetch limit); each card is one link, its title, which prefetches on
9
- * intent. The hub link after the list never prefetches;
10
- * - each card links its own project page, a child of the site's projects hub (`/projects/{slug}`, `/our-work/{slug}`);
11
- * - no default visible copy: the heading, titles, summaries and the suburb-and-month line all come from the site.
12
- *
13
- * `projectCardFromJob` builds a card from a site-core job log row (`./jobs`): the job's first genuine photo and its
14
- * outcome line; the title, the link and the meta line stay the site's.
15
- */
16
- import type { ReactNode } from 'react';
17
- import type { BrandlabJob } from '@brandlab-digital/site-core/jobs';
18
- import type { BrandlabMediaManifest, BrandlabMediaRatio } from '@brandlab-digital/site-core/media';
19
- import { type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order';
20
- import { type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js';
21
- import { type UiMedia } from '../primitives/media-frame.js';
22
- import { type SkinEntry } from '../skin.js';
23
- import type { UiLink } from '../types.js';
24
- /** The cards' parts are the `Card` primitive's (`[data-bl="card"]`), styled from the skin stylesheet. */
25
- export type ProjectsSlot = SectionSlot | SectionHeadingSlot | 'list' | 'more';
26
- export interface ProjectsLayout {
27
- /** Columns on wide screens. Defaults to 3. */
28
- readonly columns?: 2 | 3 | 4;
29
- /** The photos' crop. Defaults to 4:3. */
30
- readonly ratio?: BrandlabMediaRatio;
31
- }
32
- export type ProjectsSkin = SkinEntry<ProjectsSlot, never, ProjectsLayout>;
33
- /** The most project cards a section shows (K11; the in-content intent-prefetch limit). */
34
- export declare const PROJECTS_CARD_LIMIT: 8;
35
- /** One completed job as a card. */
36
- export interface ProjectCardData {
37
- /** A stable slug (the job id), rendered as `data-item`. */
38
- readonly id: string;
39
- /** The card's H3 and its link's whole name, for example "Gum removal over a pool, Epping". */
40
- readonly title: string;
41
- /** The project page, for example `/projects/epping-gum-removal`. From the site's data. */
42
- readonly href: string;
43
- /** What was done, in a line. */
44
- readonly summary?: ReactNode;
45
- /** A short line under the summary, for example the suburb and month. */
46
- readonly meta?: ReactNode;
47
- /** A genuine photo of this job from the media manifest. */
48
- readonly image?: UiMedia;
49
- }
50
- /**
51
- * A card from the job log: the job's first photo (`jobPhotos`, genuine ones only) and its outcome as the summary. The
52
- * site gives the title, the project page and the meta line in its own words.
53
- */
54
- export declare function projectCardFromJob(job: BrandlabJob, options: {
55
- readonly media: BrandlabMediaManifest;
56
- readonly title: string;
57
- readonly href: string;
58
- readonly meta?: ReactNode;
59
- }): ProjectCardData;
60
- export interface ProjectsProps extends ProjectsSkin {
61
- /** The H2, for example "Recent tree removal jobs". */
62
- readonly title: ReactNode;
63
- readonly eyebrow?: ReactNode;
64
- readonly lead?: ReactNode;
65
- /** Up to 8 projects, newest or nearest first. */
66
- readonly projects: readonly ProjectCardData[];
67
- /** A link after the cards, for example the projects hub. Never prefetched. */
68
- readonly more?: UiLink;
69
- /** The photos' `sizes`: a fluid `vw` string, or a number for a fixed CSS width. Defaults to one grid column. */
70
- readonly imageSizes?: string | number;
71
- /** Defaults to `projects-heading`. */
72
- readonly headingId?: string;
73
- /** Set by `SectionSequence`. */
74
- readonly tone?: SectionTone;
75
- }
76
- /** The section's guard for `SectionSequence`: skipped when no project is recorded. */
77
- export declare function projectsReady({ projects }: Pick<ProjectsProps, 'projects'>): BrandlabSectionReadiness;
78
- export declare function Projects({ title, eyebrow, lead, projects, more, imageSizes, headingId, tone, layout, classes, }: ProjectsProps): import("react/jsx-runtime").JSX.Element | null;
79
- //# sourceMappingURL=projects.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/projects.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE,OAAO,KAAK,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