@brandlab-digital/site-next 3.20.0 → 4.1.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 (345) hide show
  1. package/README.md +24 -0
  2. package/dist/contact/client.d.ts +2 -0
  3. package/dist/contact/client.d.ts.map +1 -1
  4. package/dist/contact/client.js +6 -0
  5. package/dist/contact/client.js.map +1 -1
  6. package/dist/contact/form-client.d.ts.map +1 -1
  7. package/dist/contact/form-client.js +5 -1
  8. package/dist/contact/form-client.js.map +1 -1
  9. package/dist/contact/route-handler.d.ts +5 -0
  10. package/dist/contact/route-handler.d.ts.map +1 -1
  11. package/dist/contact/route-handler.js +1 -0
  12. package/dist/contact/route-handler.js.map +1 -1
  13. package/dist/contact/server-entry.d.ts +1 -0
  14. package/dist/contact/server-entry.d.ts.map +1 -1
  15. package/dist/contact/server-entry.js +1 -0
  16. package/dist/contact/server-entry.js.map +1 -1
  17. package/dist/contact/server.d.ts +8 -0
  18. package/dist/contact/server.d.ts.map +1 -1
  19. package/dist/contact/server.js +24 -0
  20. package/dist/contact/server.js.map +1 -1
  21. package/dist/contact/shared.d.ts +2 -0
  22. package/dist/contact/shared.d.ts.map +1 -1
  23. package/dist/contact/shared.js +2 -0
  24. package/dist/contact/shared.js.map +1 -1
  25. package/dist/contact/spam-filter.d.ts +65 -0
  26. package/dist/contact/spam-filter.d.ts.map +1 -0
  27. package/dist/contact/spam-filter.js +347 -0
  28. package/dist/contact/spam-filter.js.map +1 -0
  29. package/dist/contact/spam-places.d.ts +8 -0
  30. package/dist/contact/spam-places.d.ts.map +1 -0
  31. package/dist/contact/spam-places.js +8 -0
  32. package/dist/contact/spam-places.js.map +1 -0
  33. package/dist/instrumentation-client.d.ts +1 -1
  34. package/dist/instrumentation-client.js +1 -1
  35. package/dist/instrumentation-client.js.map +1 -1
  36. package/dist/navigation/index.d.ts +2 -3
  37. package/dist/navigation/index.d.ts.map +1 -1
  38. package/dist/navigation/index.js +2 -3
  39. package/dist/navigation/index.js.map +1 -1
  40. package/dist/next-config.d.ts +1 -17
  41. package/dist/next-config.d.ts.map +1 -1
  42. package/dist/next-config.js +2 -33
  43. package/dist/next-config.js.map +1 -1
  44. package/package.json +4 -33
  45. package/dist/ui-kit/brandlab-skin.d.ts +0 -112
  46. package/dist/ui-kit/brandlab-skin.d.ts.map +0 -1
  47. package/dist/ui-kit/brandlab-skin.js +0 -2
  48. package/dist/ui-kit/brandlab-skin.js.map +0 -1
  49. package/dist/ui-kit/form/copy.d.ts +0 -3
  50. package/dist/ui-kit/form/copy.d.ts.map +0 -1
  51. package/dist/ui-kit/form/copy.js +0 -5
  52. package/dist/ui-kit/form/copy.js.map +0 -1
  53. package/dist/ui-kit/form/dialog.d.ts +0 -24
  54. package/dist/ui-kit/form/dialog.d.ts.map +0 -1
  55. package/dist/ui-kit/form/dialog.js +0 -17
  56. package/dist/ui-kit/form/dialog.js.map +0 -1
  57. package/dist/ui-kit/form/field.d.ts +0 -30
  58. package/dist/ui-kit/form/field.d.ts.map +0 -1
  59. package/dist/ui-kit/form/field.js +0 -11
  60. package/dist/ui-kit/form/field.js.map +0 -1
  61. package/dist/ui-kit/form/index.d.ts +0 -7
  62. package/dist/ui-kit/form/index.d.ts.map +0 -1
  63. package/dist/ui-kit/form/index.js +0 -7
  64. package/dist/ui-kit/form/index.js.map +0 -1
  65. package/dist/ui-kit/form/photo-upload.d.ts +0 -40
  66. package/dist/ui-kit/form/photo-upload.d.ts.map +0 -1
  67. package/dist/ui-kit/form/photo-upload.js +0 -19
  68. package/dist/ui-kit/form/photo-upload.js.map +0 -1
  69. package/dist/ui-kit/form/quote-dialog.d.ts +0 -15
  70. package/dist/ui-kit/form/quote-dialog.d.ts.map +0 -1
  71. package/dist/ui-kit/form/quote-dialog.js +0 -68
  72. package/dist/ui-kit/form/quote-dialog.js.map +0 -1
  73. package/dist/ui-kit/form/quote-form.d.ts +0 -172
  74. package/dist/ui-kit/form/quote-form.d.ts.map +0 -1
  75. package/dist/ui-kit/form/quote-form.js +0 -238
  76. package/dist/ui-kit/form/quote-form.js.map +0 -1
  77. package/dist/ui-kit/form/thank-you.d.ts +0 -40
  78. package/dist/ui-kit/form/thank-you.d.ts.map +0 -1
  79. package/dist/ui-kit/form/thank-you.js +0 -36
  80. package/dist/ui-kit/form/thank-you.js.map +0 -1
  81. package/dist/ui-kit/icon-glyphs.d.ts +0 -41
  82. package/dist/ui-kit/icon-glyphs.d.ts.map +0 -1
  83. package/dist/ui-kit/icon-glyphs.js +0 -138
  84. package/dist/ui-kit/icon-glyphs.js.map +0 -1
  85. package/dist/ui-kit/icon-sprite.d.ts +0 -19
  86. package/dist/ui-kit/icon-sprite.d.ts.map +0 -1
  87. package/dist/ui-kit/icon-sprite.js +0 -44
  88. package/dist/ui-kit/icon-sprite.js.map +0 -1
  89. package/dist/ui-kit/icons.d.ts +0 -50
  90. package/dist/ui-kit/icons.d.ts.map +0 -1
  91. package/dist/ui-kit/icons.js +0 -55
  92. package/dist/ui-kit/icons.js.map +0 -1
  93. package/dist/ui-kit/prefetch.d.ts +0 -59
  94. package/dist/ui-kit/prefetch.d.ts.map +0 -1
  95. package/dist/ui-kit/prefetch.js +0 -63
  96. package/dist/ui-kit/prefetch.js.map +0 -1
  97. package/dist/ui-kit/primitives/badge.d.ts +0 -25
  98. package/dist/ui-kit/primitives/badge.d.ts.map +0 -1
  99. package/dist/ui-kit/primitives/badge.js +0 -21
  100. package/dist/ui-kit/primitives/badge.js.map +0 -1
  101. package/dist/ui-kit/primitives/breadcrumbs.d.ts +0 -27
  102. package/dist/ui-kit/primitives/breadcrumbs.d.ts.map +0 -1
  103. package/dist/ui-kit/primitives/breadcrumbs.js +0 -40
  104. package/dist/ui-kit/primitives/breadcrumbs.js.map +0 -1
  105. package/dist/ui-kit/primitives/button.d.ts +0 -32
  106. package/dist/ui-kit/primitives/button.d.ts.map +0 -1
  107. package/dist/ui-kit/primitives/button.js +0 -8
  108. package/dist/ui-kit/primitives/button.js.map +0 -1
  109. package/dist/ui-kit/primitives/card.d.ts +0 -40
  110. package/dist/ui-kit/primitives/card.d.ts.map +0 -1
  111. package/dist/ui-kit/primitives/card.js +0 -8
  112. package/dist/ui-kit/primitives/card.js.map +0 -1
  113. package/dist/ui-kit/primitives/index.d.ts +0 -16
  114. package/dist/ui-kit/primitives/index.d.ts.map +0 -1
  115. package/dist/ui-kit/primitives/index.js +0 -16
  116. package/dist/ui-kit/primitives/index.js.map +0 -1
  117. package/dist/ui-kit/primitives/layout.d.ts +0 -85
  118. package/dist/ui-kit/primitives/layout.d.ts.map +0 -1
  119. package/dist/ui-kit/primitives/layout.js +0 -52
  120. package/dist/ui-kit/primitives/layout.js.map +0 -1
  121. package/dist/ui-kit/primitives/links.d.ts +0 -74
  122. package/dist/ui-kit/primitives/links.d.ts.map +0 -1
  123. package/dist/ui-kit/primitives/links.js +0 -41
  124. package/dist/ui-kit/primitives/links.js.map +0 -1
  125. package/dist/ui-kit/primitives/lists.d.ts +0 -51
  126. package/dist/ui-kit/primitives/lists.d.ts.map +0 -1
  127. package/dist/ui-kit/primitives/lists.js +0 -34
  128. package/dist/ui-kit/primitives/lists.js.map +0 -1
  129. package/dist/ui-kit/primitives/media-frame.d.ts +0 -33
  130. package/dist/ui-kit/primitives/media-frame.d.ts.map +0 -1
  131. package/dist/ui-kit/primitives/media-frame.js +0 -61
  132. package/dist/ui-kit/primitives/media-frame.js.map +0 -1
  133. package/dist/ui-kit/primitives/media.d.ts +0 -40
  134. package/dist/ui-kit/primitives/media.d.ts.map +0 -1
  135. package/dist/ui-kit/primitives/media.js +0 -9
  136. package/dist/ui-kit/primitives/media.js.map +0 -1
  137. package/dist/ui-kit/primitives/quote-button.d.ts +0 -46
  138. package/dist/ui-kit/primitives/quote-button.d.ts.map +0 -1
  139. package/dist/ui-kit/primitives/quote-button.js +0 -38
  140. package/dist/ui-kit/primitives/quote-button.js.map +0 -1
  141. package/dist/ui-kit/primitives/stat.d.ts +0 -25
  142. package/dist/ui-kit/primitives/stat.d.ts.map +0 -1
  143. package/dist/ui-kit/primitives/stat.js +0 -7
  144. package/dist/ui-kit/primitives/stat.js.map +0 -1
  145. package/dist/ui-kit/repeated-slots.d.ts +0 -153
  146. package/dist/ui-kit/repeated-slots.d.ts.map +0 -1
  147. package/dist/ui-kit/repeated-slots.js +0 -100
  148. package/dist/ui-kit/repeated-slots.js.map +0 -1
  149. package/dist/ui-kit/sections/accordion.d.ts +0 -28
  150. package/dist/ui-kit/sections/accordion.d.ts.map +0 -1
  151. package/dist/ui-kit/sections/accordion.js +0 -14
  152. package/dist/ui-kit/sections/accordion.js.map +0 -1
  153. package/dist/ui-kit/sections/area-map.d.ts +0 -64
  154. package/dist/ui-kit/sections/area-map.d.ts.map +0 -1
  155. package/dist/ui-kit/sections/area-map.js +0 -146
  156. package/dist/ui-kit/sections/area-map.js.map +0 -1
  157. package/dist/ui-kit/sections/before-after.d.ts +0 -59
  158. package/dist/ui-kit/sections/before-after.d.ts.map +0 -1
  159. package/dist/ui-kit/sections/before-after.js +0 -42
  160. package/dist/ui-kit/sections/before-after.js.map +0 -1
  161. package/dist/ui-kit/sections/contact-block.d.ts +0 -77
  162. package/dist/ui-kit/sections/contact-block.d.ts.map +0 -1
  163. package/dist/ui-kit/sections/contact-block.js +0 -23
  164. package/dist/ui-kit/sections/contact-block.js.map +0 -1
  165. package/dist/ui-kit/sections/council-rules.d.ts +0 -64
  166. package/dist/ui-kit/sections/council-rules.d.ts.map +0 -1
  167. package/dist/ui-kit/sections/council-rules.js +0 -46
  168. package/dist/ui-kit/sections/council-rules.js.map +0 -1
  169. package/dist/ui-kit/sections/coverage.d.ts +0 -53
  170. package/dist/ui-kit/sections/coverage.d.ts.map +0 -1
  171. package/dist/ui-kit/sections/coverage.js +0 -57
  172. package/dist/ui-kit/sections/coverage.js.map +0 -1
  173. package/dist/ui-kit/sections/cta-band.d.ts +0 -67
  174. package/dist/ui-kit/sections/cta-band.d.ts.map +0 -1
  175. package/dist/ui-kit/sections/cta-band.js +0 -11
  176. package/dist/ui-kit/sections/cta-band.js.map +0 -1
  177. package/dist/ui-kit/sections/emergency-band.d.ts +0 -60
  178. package/dist/ui-kit/sections/emergency-band.d.ts.map +0 -1
  179. package/dist/ui-kit/sections/emergency-band.js +0 -43
  180. package/dist/ui-kit/sections/emergency-band.js.map +0 -1
  181. package/dist/ui-kit/sections/faqs.d.ts +0 -46
  182. package/dist/ui-kit/sections/faqs.d.ts.map +0 -1
  183. package/dist/ui-kit/sections/faqs.js +0 -39
  184. package/dist/ui-kit/sections/faqs.js.map +0 -1
  185. package/dist/ui-kit/sections/gallery.d.ts +0 -60
  186. package/dist/ui-kit/sections/gallery.d.ts.map +0 -1
  187. package/dist/ui-kit/sections/gallery.js +0 -39
  188. package/dist/ui-kit/sections/gallery.js.map +0 -1
  189. package/dist/ui-kit/sections/hero.d.ts +0 -168
  190. package/dist/ui-kit/sections/hero.d.ts.map +0 -1
  191. package/dist/ui-kit/sections/hero.js +0 -147
  192. package/dist/ui-kit/sections/hero.js.map +0 -1
  193. package/dist/ui-kit/sections/index.d.ts +0 -29
  194. package/dist/ui-kit/sections/index.d.ts.map +0 -1
  195. package/dist/ui-kit/sections/index.js +0 -29
  196. package/dist/ui-kit/sections/index.js.map +0 -1
  197. package/dist/ui-kit/sections/licences.d.ts +0 -95
  198. package/dist/ui-kit/sections/licences.d.ts.map +0 -1
  199. package/dist/ui-kit/sections/licences.js +0 -72
  200. package/dist/ui-kit/sections/licences.js.map +0 -1
  201. package/dist/ui-kit/sections/local-facts.d.ts +0 -107
  202. package/dist/ui-kit/sections/local-facts.d.ts.map +0 -1
  203. package/dist/ui-kit/sections/local-facts.js +0 -44
  204. package/dist/ui-kit/sections/local-facts.js.map +0 -1
  205. package/dist/ui-kit/sections/nearby-areas.d.ts +0 -50
  206. package/dist/ui-kit/sections/nearby-areas.d.ts.map +0 -1
  207. package/dist/ui-kit/sections/nearby-areas.js +0 -49
  208. package/dist/ui-kit/sections/nearby-areas.js.map +0 -1
  209. package/dist/ui-kit/sections/nearby-jobs.d.ts +0 -84
  210. package/dist/ui-kit/sections/nearby-jobs.d.ts.map +0 -1
  211. package/dist/ui-kit/sections/nearby-jobs.js +0 -72
  212. package/dist/ui-kit/sections/nearby-jobs.js.map +0 -1
  213. package/dist/ui-kit/sections/page-header.d.ts +0 -29
  214. package/dist/ui-kit/sections/page-header.d.ts.map +0 -1
  215. package/dist/ui-kit/sections/page-header.js +0 -9
  216. package/dist/ui-kit/sections/page-header.js.map +0 -1
  217. package/dist/ui-kit/sections/price-guide.d.ts +0 -59
  218. package/dist/ui-kit/sections/price-guide.d.ts.map +0 -1
  219. package/dist/ui-kit/sections/price-guide.js +0 -28
  220. package/dist/ui-kit/sections/price-guide.js.map +0 -1
  221. package/dist/ui-kit/sections/price-table.d.ts +0 -42
  222. package/dist/ui-kit/sections/price-table.d.ts.map +0 -1
  223. package/dist/ui-kit/sections/price-table.js +0 -29
  224. package/dist/ui-kit/sections/price-table.js.map +0 -1
  225. package/dist/ui-kit/sections/projects.d.ts +0 -79
  226. package/dist/ui-kit/sections/projects.d.ts.map +0 -1
  227. package/dist/ui-kit/sections/projects.js +0 -69
  228. package/dist/ui-kit/sections/projects.js.map +0 -1
  229. package/dist/ui-kit/sections/proof-strip.d.ts +0 -68
  230. package/dist/ui-kit/sections/proof-strip.d.ts.map +0 -1
  231. package/dist/ui-kit/sections/proof-strip.js +0 -27
  232. package/dist/ui-kit/sections/proof-strip.js.map +0 -1
  233. package/dist/ui-kit/sections/quote-checklist.d.ts +0 -43
  234. package/dist/ui-kit/sections/quote-checklist.d.ts.map +0 -1
  235. package/dist/ui-kit/sections/quote-checklist.js +0 -19
  236. package/dist/ui-kit/sections/quote-checklist.js.map +0 -1
  237. package/dist/ui-kit/sections/rating-chip.d.ts +0 -35
  238. package/dist/ui-kit/sections/rating-chip.d.ts.map +0 -1
  239. package/dist/ui-kit/sections/rating-chip.js +0 -21
  240. package/dist/ui-kit/sections/rating-chip.js.map +0 -1
  241. package/dist/ui-kit/sections/related-services.d.ts +0 -41
  242. package/dist/ui-kit/sections/related-services.d.ts.map +0 -1
  243. package/dist/ui-kit/sections/related-services.js +0 -52
  244. package/dist/ui-kit/sections/related-services.js.map +0 -1
  245. package/dist/ui-kit/sections/reviews-band.d.ts +0 -124
  246. package/dist/ui-kit/sections/reviews-band.d.ts.map +0 -1
  247. package/dist/ui-kit/sections/reviews-band.js +0 -115
  248. package/dist/ui-kit/sections/reviews-band.js.map +0 -1
  249. package/dist/ui-kit/sections/section-sequence.d.ts +0 -41
  250. package/dist/ui-kit/sections/section-sequence.d.ts.map +0 -1
  251. package/dist/ui-kit/sections/section-sequence.js +0 -36
  252. package/dist/ui-kit/sections/section-sequence.js.map +0 -1
  253. package/dist/ui-kit/sections/services-grid.d.ts +0 -82
  254. package/dist/ui-kit/sections/services-grid.d.ts.map +0 -1
  255. package/dist/ui-kit/sections/services-grid.js +0 -90
  256. package/dist/ui-kit/sections/services-grid.js.map +0 -1
  257. package/dist/ui-kit/sections/signature-section.d.ts +0 -42
  258. package/dist/ui-kit/sections/signature-section.d.ts.map +0 -1
  259. package/dist/ui-kit/sections/signature-section.js +0 -14
  260. package/dist/ui-kit/sections/signature-section.js.map +0 -1
  261. package/dist/ui-kit/sections/site-footer-columns.d.ts +0 -12
  262. package/dist/ui-kit/sections/site-footer-columns.d.ts.map +0 -1
  263. package/dist/ui-kit/sections/site-footer-columns.js +0 -63
  264. package/dist/ui-kit/sections/site-footer-columns.js.map +0 -1
  265. package/dist/ui-kit/sections/site-footer.d.ts +0 -66
  266. package/dist/ui-kit/sections/site-footer.d.ts.map +0 -1
  267. package/dist/ui-kit/sections/site-footer.js +0 -49
  268. package/dist/ui-kit/sections/site-footer.js.map +0 -1
  269. package/dist/ui-kit/sections/work-photos.d.ts +0 -15
  270. package/dist/ui-kit/sections/work-photos.d.ts.map +0 -1
  271. package/dist/ui-kit/sections/work-photos.js +0 -24
  272. package/dist/ui-kit/sections/work-photos.js.map +0 -1
  273. package/dist/ui-kit/shell/back-to-top-client.d.ts +0 -9
  274. package/dist/ui-kit/shell/back-to-top-client.d.ts.map +0 -1
  275. package/dist/ui-kit/shell/back-to-top-client.js +0 -8
  276. package/dist/ui-kit/shell/back-to-top-client.js.map +0 -1
  277. package/dist/ui-kit/shell/back-to-top.d.ts +0 -13
  278. package/dist/ui-kit/shell/back-to-top.d.ts.map +0 -1
  279. package/dist/ui-kit/shell/back-to-top.js +0 -14
  280. package/dist/ui-kit/shell/back-to-top.js.map +0 -1
  281. package/dist/ui-kit/shell/call-bar-client.d.ts +0 -8
  282. package/dist/ui-kit/shell/call-bar-client.d.ts.map +0 -1
  283. package/dist/ui-kit/shell/call-bar-client.js +0 -13
  284. package/dist/ui-kit/shell/call-bar-client.js.map +0 -1
  285. package/dist/ui-kit/shell/current-link.d.ts +0 -45
  286. package/dist/ui-kit/shell/current-link.d.ts.map +0 -1
  287. package/dist/ui-kit/shell/current-link.js +0 -54
  288. package/dist/ui-kit/shell/current-link.js.map +0 -1
  289. package/dist/ui-kit/shell/drawer-client.d.ts +0 -22
  290. package/dist/ui-kit/shell/drawer-client.d.ts.map +0 -1
  291. package/dist/ui-kit/shell/drawer-client.js +0 -70
  292. package/dist/ui-kit/shell/drawer-client.js.map +0 -1
  293. package/dist/ui-kit/shell/header-client.d.ts +0 -44
  294. package/dist/ui-kit/shell/header-client.d.ts.map +0 -1
  295. package/dist/ui-kit/shell/header-client.js +0 -59
  296. package/dist/ui-kit/shell/header-client.js.map +0 -1
  297. package/dist/ui-kit/shell/index.d.ts +0 -7
  298. package/dist/ui-kit/shell/index.d.ts.map +0 -1
  299. package/dist/ui-kit/shell/index.js +0 -7
  300. package/dist/ui-kit/shell/index.js.map +0 -1
  301. package/dist/ui-kit/shell/intent-prefetch.d.ts +0 -4
  302. package/dist/ui-kit/shell/intent-prefetch.d.ts.map +0 -1
  303. package/dist/ui-kit/shell/intent-prefetch.js +0 -62
  304. package/dist/ui-kit/shell/intent-prefetch.js.map +0 -1
  305. package/dist/ui-kit/shell/mobile-call-bar.d.ts +0 -25
  306. package/dist/ui-kit/shell/mobile-call-bar.d.ts.map +0 -1
  307. package/dist/ui-kit/shell/mobile-call-bar.js +0 -21
  308. package/dist/ui-kit/shell/mobile-call-bar.js.map +0 -1
  309. package/dist/ui-kit/shell/mobile-drawer.d.ts +0 -41
  310. package/dist/ui-kit/shell/mobile-drawer.d.ts.map +0 -1
  311. package/dist/ui-kit/shell/mobile-drawer.js +0 -41
  312. package/dist/ui-kit/shell/mobile-drawer.js.map +0 -1
  313. package/dist/ui-kit/shell/shell-context.d.ts +0 -3
  314. package/dist/ui-kit/shell/shell-context.d.ts.map +0 -1
  315. package/dist/ui-kit/shell/shell-context.js +0 -5
  316. package/dist/ui-kit/shell/shell-context.js.map +0 -1
  317. package/dist/ui-kit/shell/shell-quote.d.ts +0 -10
  318. package/dist/ui-kit/shell/shell-quote.d.ts.map +0 -1
  319. package/dist/ui-kit/shell/shell-quote.js +0 -13
  320. package/dist/ui-kit/shell/shell-quote.js.map +0 -1
  321. package/dist/ui-kit/shell/site-header.d.ts +0 -55
  322. package/dist/ui-kit/shell/site-header.d.ts.map +0 -1
  323. package/dist/ui-kit/shell/site-header.js +0 -35
  324. package/dist/ui-kit/shell/site-header.js.map +0 -1
  325. package/dist/ui-kit/shell/social-links.d.ts +0 -7
  326. package/dist/ui-kit/shell/social-links.d.ts.map +0 -1
  327. package/dist/ui-kit/shell/social-links.js +0 -12
  328. package/dist/ui-kit/shell/social-links.js.map +0 -1
  329. package/dist/ui-kit/shell/utility-bar.d.ts +0 -33
  330. package/dist/ui-kit/shell/utility-bar.d.ts.map +0 -1
  331. package/dist/ui-kit/shell/utility-bar.js +0 -15
  332. package/dist/ui-kit/shell/utility-bar.js.map +0 -1
  333. package/dist/ui-kit/skin-index.d.ts +0 -4
  334. package/dist/ui-kit/skin-index.d.ts.map +0 -1
  335. package/dist/ui-kit/skin-index.js +0 -3
  336. package/dist/ui-kit/skin-index.js.map +0 -1
  337. package/dist/ui-kit/skin.d.ts +0 -65
  338. package/dist/ui-kit/skin.d.ts.map +0 -1
  339. package/dist/ui-kit/skin.js +0 -60
  340. package/dist/ui-kit/skin.js.map +0 -1
  341. package/dist/ui-kit/structure.css +0 -2546
  342. package/dist/ui-kit/types.d.ts +0 -27
  343. package/dist/ui-kit/types.d.ts.map +0 -1
  344. package/dist/ui-kit/types.js +0 -6
  345. package/dist/ui-kit/types.js.map +0 -1
@@ -1,41 +0,0 @@
1
- /**
2
- * The ui-kit's icon glyphs as SVG markup, and the typed API a site registers its own icons through. Pure data with no
3
- * React and no Node APIs, so `next.config.ts` (which builds the sprite) and the browser bundle (which renders the
4
- * fallback) can both import it.
5
- *
6
- * From 3.14.0 every icon renders as `<svg aria-hidden="true" viewBox><use href="/_bl/icons.<hash>.svg#name"/></svg>`
7
- * once `defineBrandlabNextConfig({ icons })` has built the sprite; without it (tests, a site that has not opted in) the
8
- * same `<svg>` carries the glyph inline.
9
- */
10
- /** One glyph: the symbol's `viewBox` (default `0 0 24 24`) and its SVG child markup (paths, circles, groups). */
11
- export interface IconGlyph {
12
- readonly viewBox?: string;
13
- readonly body: string;
14
- }
15
- export declare const UI_ICON_NAMES: readonly ["phone", "chevron", "arrow", "arrow-up", "menu", "close", "star", "check", "camera", "mail", "facebook", "instagram", "google", "linkedin", "youtube", "tiktok"];
16
- export type UiIconName = (typeof UI_ICON_NAMES)[number];
17
- export declare const DEFAULT_ICON_VIEW_BOX = "0 0 24 24";
18
- /** The environment variable `defineBrandlabNextConfig({ icons })` sets to the sprite's path. */
19
- export declare const ICON_SPRITE_ENV = "NEXT_PUBLIC_BL_ICON_SPRITE";
20
- export declare const UI_ICON_GLYPHS: Readonly<Record<UiIconName, IconGlyph>>;
21
- /** A site's own icons, from `defineSiteIcons`. They join the library icons in the one sprite. */
22
- export interface SiteIconSet<Name extends string = string> {
23
- readonly names: readonly Name[];
24
- readonly glyphs: Readonly<Record<Name, IconGlyph>>;
25
- }
26
- /**
27
- * Register a site's own icons (signature art, trade marks the site draws itself) for the sprite. Names are lower-case
28
- * words joined by hyphens and may not reuse a library icon's name; each glyph is plain SVG shapes using
29
- * `currentColor` (no ids, links, styles or scripts), checked when the module loads.
30
- *
31
- * ```ts
32
- * // src/site/icons.ts
33
- * export const siteIcons = defineSiteIcons({ leaf: { body: '<path fill="currentColor" d="…"/>' } })
34
- * // next.config.ts: defineBrandlabNextConfig({ …, icons: { site: siteIcons } })
35
- * // src/site/ui.tsx: export const SiteIcon = createSiteIcon(siteIcons)
36
- * ```
37
- */
38
- export declare function defineSiteIcons<const Name extends string>(icons: Readonly<Record<Name, IconGlyph>>): SiteIconSet<Name>;
39
- /** The sprite's markup: one `<symbol id="name" viewBox>` per library icon, then the site's icons. */
40
- export declare function iconSpriteMarkup(site?: SiteIconSet): string;
41
- //# sourceMappingURL=icon-glyphs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon-glyphs.d.ts","sourceRoot":"","sources":["../../src/ui-kit/icon-glyphs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,iHAAiH;AACjH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,aAAa,4KAiBhB,CAAA;AACV,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,qBAAqB,cAAc,CAAA;AAEhD,gGAAgG;AAChG,eAAO,MAAM,eAAe,+BAA+B,CAAA;AAM3D,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,CAqDjE,CAAA;AAEF,iGAAiG;AACjG,MAAM,WAAW,WAAW,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IACvD,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAA;IAC/B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAA;CACnD;AAuBD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAetH;AAED,qGAAqG;AACrG,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,CAM3D"}
@@ -1,138 +0,0 @@
1
- /**
2
- * The ui-kit's icon glyphs as SVG markup, and the typed API a site registers its own icons through. Pure data with no
3
- * React and no Node APIs, so `next.config.ts` (which builds the sprite) and the browser bundle (which renders the
4
- * fallback) can both import it.
5
- *
6
- * From 3.14.0 every icon renders as `<svg aria-hidden="true" viewBox><use href="/_bl/icons.<hash>.svg#name"/></svg>`
7
- * once `defineBrandlabNextConfig({ icons })` has built the sprite; without it (tests, a site that has not opted in) the
8
- * same `<svg>` carries the glyph inline.
9
- */
10
- export const UI_ICON_NAMES = [
11
- 'phone',
12
- 'chevron',
13
- 'arrow',
14
- 'arrow-up',
15
- 'menu',
16
- 'close',
17
- 'star',
18
- 'check',
19
- 'camera',
20
- 'mail',
21
- 'facebook',
22
- 'instagram',
23
- 'google',
24
- 'linkedin',
25
- 'youtube',
26
- 'tiktok',
27
- ];
28
- export const DEFAULT_ICON_VIEW_BOX = '0 0 24 24';
29
- /** The environment variable `defineBrandlabNextConfig({ icons })` sets to the sprite's path. */
30
- export const ICON_SPRITE_ENV = 'NEXT_PUBLIC_BL_ICON_SPRITE';
31
- const stroke = (width, d) => `<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="${width}" d="${d}"/>`;
32
- const fill = (d) => `<path fill="currentColor" d="${d}"/>`;
33
- export const UI_ICON_GLYPHS = Object.freeze({
34
- phone: {
35
- body: stroke('1.6', 'M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106a1.125 1.125 0 0 0-1.173.417l-.97 1.293a1.125 1.125 0 0 1-1.21.38 12.035 12.035 0 0 1-7.143-7.143 1.125 1.125 0 0 1 .38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z'),
36
- },
37
- chevron: { body: stroke('1.8', 'm6 9 6 6 6-6') },
38
- arrow: { body: stroke('1.6', 'M13.5 4.5 21 12l-7.5 7.5M3 12h17.25') },
39
- 'arrow-up': { body: stroke('1.8', 'M12 20V4m0 0-7 7m7-7 7 7') },
40
- menu: { body: stroke('1.7', 'M4 7h16M4 12h16M4 17h16') },
41
- close: { body: stroke('1.7', 'M6 18 18 6M6 6l12 12') },
42
- star: { viewBox: '0 0 20 20', body: fill('M10 1.6 12.6 7l5.9.7-4.4 4 1.2 5.8L10 14.6l-5.3 2.9L5.9 11.7l-4.4-4L7.4 7 10 1.6Z') },
43
- check: { body: stroke('2', 'm4.5 12.75 6 6 9-13.5') },
44
- camera: {
45
- body: stroke('1.6', 'M3 8.25A2.25 2.25 0 0 1 5.25 6h1.372c.516 0 .966-.351 1.091-.852l.38-1.52A1.125 1.125 0 0 1 9.184 2.7h5.632c.516 0 .966.351 1.091.852l.38 1.52c.125.5.575.852 1.091.852h1.372A2.25 2.25 0 0 1 21 8.25v9.75a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18V8.25Z') +
46
- '<circle fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.6" cx="12" cy="12.75" r="3.75"/>',
47
- },
48
- mail: {
49
- body: stroke('1.6', 'M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0-8.69 5.6a2.25 2.25 0 0 1-2.12 0l-8.69-5.6'),
50
- },
51
- facebook: { body: fill('M9 8H6v4h3v12h5V12h3.642L18 8h-4V6.333C14 5.378 14.192 5 15.115 5H18V0h-3.808C10.596 0 9 1.583 9 4.615V8Z') },
52
- instagram: {
53
- body: '<rect x="3" y="3" width="18" height="18" rx="5" fill="none" stroke="currentColor" stroke-width="2"/>' +
54
- '<circle cx="12" cy="12" r="4.2" fill="none" stroke="currentColor" stroke-width="2"/>' +
55
- '<circle cx="17.4" cy="6.6" r="1.3" fill="currentColor"/>',
56
- },
57
- google: {
58
- body: fill('M21.6 12.23c0-.68-.06-1.33-.17-1.96H12v3.7h5.39a4.6 4.6 0 0 1-2 3.02v2.5h3.24c1.9-1.75 2.97-4.32 2.97-7.26ZM12 22c2.7 0 4.96-.9 6.62-2.43l-3.24-2.5c-.9.6-2.04.95-3.38.95-2.6 0-4.8-1.75-5.59-4.11H3.07v2.59A10 10 0 0 0 12 22Zm-5.59-8.09A6 6 0 0 1 6.1 12c0-.66.11-1.31.31-1.91V7.5H3.07A10 10 0 0 0 2 12c0 1.61.39 3.14 1.07 4.5l3.34-2.59ZM12 5.98c1.47 0 2.79.5 3.83 1.5l2.87-2.87A9.6 9.6 0 0 0 12 2a10 10 0 0 0-8.93 5.5l3.34 2.59C7.2 7.73 9.4 5.98 12 5.98Z'),
59
- },
60
- linkedin: {
61
- body: fill('M4.98 3.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5ZM3 9.75h4v11.5H3V9.75Zm6.5 0h3.83v1.57h.06c.53-1 1.84-2.07 3.79-2.07 4.05 0 4.8 2.67 4.8 6.13v5.87h-4v-5.2c0-1.24-.02-2.84-1.73-2.84-1.73 0-2 1.35-2 2.75v5.29h-4V9.75Z'),
62
- },
63
- youtube: {
64
- body: fill('M23 7.2a3 3 0 0 0-2.1-2.1C19 4.6 12 4.6 12 4.6s-7 0-8.9.5A3 3 0 0 0 1 7.2 31 31 0 0 0 .5 12a31 31 0 0 0 .5 4.8 3 3 0 0 0 2.1 2.1c1.9.5 8.9.5 8.9.5s7 0 8.9-.5a3 3 0 0 0 2.1-2.1 31 31 0 0 0 .5-4.8 31 31 0 0 0-.5-4.8ZM9.75 15.02V8.98L15.5 12l-5.75 3.02Z'),
65
- },
66
- tiktok: {
67
- body: fill('M16.6 2h-3.4v13.4a2.9 2.9 0 1 1-2.9-2.9c.3 0 .6 0 .9.1V9.1a6.3 6.3 0 1 0 5.4 6.3V8.6a8.1 8.1 0 0 0 4.4 1.3V6.5a4.5 4.5 0 0 1-4.4-4.5Z'),
68
- },
69
- });
70
- const ICON_NAME = /^[a-z][a-z0-9-]{0,39}$/;
71
- const VIEW_BOX = /^-?\d+(?:\.\d+)?(?: -?\d+(?:\.\d+)?){3}$/;
72
- const GLYPH_ELEMENTS = new Set([
73
- 'path', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'rect', 'g', 'title', 'desc',
74
- 'lineargradient', 'radialgradient', 'stop', 'defs', 'clippath', 'mask',
75
- ]);
76
- /** Why a glyph's markup is refused, or null when it is plain shapes. */
77
- function glyphProblem(body) {
78
- if (body.trim() === '')
79
- return 'is empty';
80
- for (const [, tag] of body.matchAll(/<\/?\s*([a-zA-Z][\w:-]*)/g)) {
81
- if (!GLYPH_ELEMENTS.has(tag.toLowerCase()))
82
- return `uses <${tag}>; a glyph holds shapes only (path, circle, rect, g and the like)`;
83
- }
84
- if (/<!|<\?/.test(body))
85
- return 'holds a comment, CDATA or processing instruction';
86
- if (/\son[a-z]+\s*=/i.test(body))
87
- return 'carries an event handler attribute';
88
- if (/(?:^|\s)(?:xlink:)?href\s*=/i.test(body))
89
- return 'links to another resource';
90
- if (/\sstyle\s*=|url\s*\(|javascript:/i.test(body))
91
- return 'carries a style or url() value';
92
- if (/\sid\s*=/i.test(body))
93
- return 'sets an id, which would clash once the sprite holds every icon';
94
- return null;
95
- }
96
- /**
97
- * Register a site's own icons (signature art, trade marks the site draws itself) for the sprite. Names are lower-case
98
- * words joined by hyphens and may not reuse a library icon's name; each glyph is plain SVG shapes using
99
- * `currentColor` (no ids, links, styles or scripts), checked when the module loads.
100
- *
101
- * ```ts
102
- * // src/site/icons.ts
103
- * export const siteIcons = defineSiteIcons({ leaf: { body: '<path fill="currentColor" d="…"/>' } })
104
- * // next.config.ts: defineBrandlabNextConfig({ …, icons: { site: siteIcons } })
105
- * // src/site/ui.tsx: export const SiteIcon = createSiteIcon(siteIcons)
106
- * ```
107
- */
108
- export function defineSiteIcons(icons) {
109
- if (!icons || typeof icons !== 'object' || Array.isArray(icons))
110
- throw new TypeError('defineSiteIcons takes an object of { name: { viewBox?, body } }.');
111
- const names = Object.keys(icons);
112
- const library = new Set(UI_ICON_NAMES);
113
- for (const name of names) {
114
- if (!ICON_NAME.test(name))
115
- throw new Error(`Site icon "${name}": names are lower-case words joined by hyphens, at most 40 characters.`);
116
- if (library.has(name))
117
- throw new Error(`Site icon "${name}" reuses a library icon's name; choose another name.`);
118
- const glyph = icons[name];
119
- if (!glyph || typeof glyph.body !== 'string')
120
- throw new Error(`Site icon "${name}" needs a body of SVG markup.`);
121
- if (glyph.viewBox !== undefined && !VIEW_BOX.test(glyph.viewBox))
122
- throw new Error(`Site icon "${name}": viewBox must be four numbers, for example "0 0 24 24".`);
123
- const problem = glyphProblem(glyph.body);
124
- if (problem)
125
- throw new Error(`Site icon "${name}" ${problem}.`);
126
- }
127
- const glyphs = Object.freeze(Object.fromEntries(names.map((name) => [name, Object.freeze({ ...icons[name] })])));
128
- return Object.freeze({ names: Object.freeze([...names]), glyphs });
129
- }
130
- /** The sprite's markup: one `<symbol id="name" viewBox>` per library icon, then the site's icons. */
131
- export function iconSpriteMarkup(site) {
132
- const symbols = [
133
- ...UI_ICON_NAMES.map((name) => [name, UI_ICON_GLYPHS[name]]),
134
- ...(site?.names ?? []).map((name) => [name, site.glyphs[name]]),
135
- ].map(([name, glyph]) => `<symbol id="${name}" viewBox="${glyph.viewBox ?? DEFAULT_ICON_VIEW_BOX}">${glyph.body}</symbol>`);
136
- return `<svg xmlns="http://www.w3.org/2000/svg">${symbols.join('')}</svg>\n`;
137
- }
138
- //# sourceMappingURL=icon-glyphs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon-glyphs.js","sourceRoot":"","sources":["../../src/ui-kit/icon-glyphs.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * The ui-kit's icon glyphs as SVG markup, and the typed API a site registers its own icons through. Pure data with no\n * React and no Node APIs, so `next.config.ts` (which builds the sprite) and the browser bundle (which renders the\n * fallback) can both import it.\n *\n * From 3.14.0 every icon renders as `<svg aria-hidden=\"true\" viewBox><use href=\"/_bl/icons.<hash>.svg#name\"/></svg>`\n * once `defineBrandlabNextConfig({ icons })` has built the sprite; without it (tests, a site that has not opted in) the\n * same `<svg>` carries the glyph inline.\n */\n\n/** One glyph: the symbol's `viewBox` (default `0 0 24 24`) and its SVG child markup (paths, circles, groups). */\nexport interface IconGlyph {\n readonly viewBox?: string\n readonly body: string\n}\n\nexport const UI_ICON_NAMES = [\n 'phone',\n 'chevron',\n 'arrow',\n 'arrow-up',\n 'menu',\n 'close',\n 'star',\n 'check',\n 'camera',\n 'mail',\n 'facebook',\n 'instagram',\n 'google',\n 'linkedin',\n 'youtube',\n 'tiktok',\n] as const\nexport type UiIconName = (typeof UI_ICON_NAMES)[number]\n\nexport const DEFAULT_ICON_VIEW_BOX = '0 0 24 24'\n\n/** The environment variable `defineBrandlabNextConfig({ icons })` sets to the sprite's path. */\nexport const ICON_SPRITE_ENV = 'NEXT_PUBLIC_BL_ICON_SPRITE'\n\nconst stroke = (width: string, d: string) =>\n `<path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"${width}\" d=\"${d}\"/>`\nconst fill = (d: string) => `<path fill=\"currentColor\" d=\"${d}\"/>`\n\nexport const UI_ICON_GLYPHS: Readonly<Record<UiIconName, IconGlyph>> = Object.freeze({\n phone: {\n body: stroke(\n '1.6',\n 'M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106a1.125 1.125 0 0 0-1.173.417l-.97 1.293a1.125 1.125 0 0 1-1.21.38 12.035 12.035 0 0 1-7.143-7.143 1.125 1.125 0 0 1 .38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z',\n ),\n },\n chevron: { body: stroke('1.8', 'm6 9 6 6 6-6') },\n arrow: { body: stroke('1.6', 'M13.5 4.5 21 12l-7.5 7.5M3 12h17.25') },\n 'arrow-up': { body: stroke('1.8', 'M12 20V4m0 0-7 7m7-7 7 7') },\n menu: { body: stroke('1.7', 'M4 7h16M4 12h16M4 17h16') },\n close: { body: stroke('1.7', 'M6 18 18 6M6 6l12 12') },\n star: { viewBox: '0 0 20 20', body: fill('M10 1.6 12.6 7l5.9.7-4.4 4 1.2 5.8L10 14.6l-5.3 2.9L5.9 11.7l-4.4-4L7.4 7 10 1.6Z') },\n check: { body: stroke('2', 'm4.5 12.75 6 6 9-13.5') },\n camera: {\n body:\n stroke(\n '1.6',\n 'M3 8.25A2.25 2.25 0 0 1 5.25 6h1.372c.516 0 .966-.351 1.091-.852l.38-1.52A1.125 1.125 0 0 1 9.184 2.7h5.632c.516 0 .966.351 1.091.852l.38 1.52c.125.5.575.852 1.091.852h1.372A2.25 2.25 0 0 1 21 8.25v9.75a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18V8.25Z',\n ) +\n '<circle fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.6\" cx=\"12\" cy=\"12.75\" r=\"3.75\"/>',\n },\n mail: {\n body: stroke(\n '1.6',\n 'M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0-8.69 5.6a2.25 2.25 0 0 1-2.12 0l-8.69-5.6',\n ),\n },\n facebook: { body: fill('M9 8H6v4h3v12h5V12h3.642L18 8h-4V6.333C14 5.378 14.192 5 15.115 5H18V0h-3.808C10.596 0 9 1.583 9 4.615V8Z') },\n instagram: {\n body:\n '<rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"/>' +\n '<circle cx=\"12\" cy=\"12\" r=\"4.2\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"/>' +\n '<circle cx=\"17.4\" cy=\"6.6\" r=\"1.3\" fill=\"currentColor\"/>',\n },\n google: {\n body: fill(\n 'M21.6 12.23c0-.68-.06-1.33-.17-1.96H12v3.7h5.39a4.6 4.6 0 0 1-2 3.02v2.5h3.24c1.9-1.75 2.97-4.32 2.97-7.26ZM12 22c2.7 0 4.96-.9 6.62-2.43l-3.24-2.5c-.9.6-2.04.95-3.38.95-2.6 0-4.8-1.75-5.59-4.11H3.07v2.59A10 10 0 0 0 12 22Zm-5.59-8.09A6 6 0 0 1 6.1 12c0-.66.11-1.31.31-1.91V7.5H3.07A10 10 0 0 0 2 12c0 1.61.39 3.14 1.07 4.5l3.34-2.59ZM12 5.98c1.47 0 2.79.5 3.83 1.5l2.87-2.87A9.6 9.6 0 0 0 12 2a10 10 0 0 0-8.93 5.5l3.34 2.59C7.2 7.73 9.4 5.98 12 5.98Z',\n ),\n },\n linkedin: {\n body: fill(\n 'M4.98 3.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5ZM3 9.75h4v11.5H3V9.75Zm6.5 0h3.83v1.57h.06c.53-1 1.84-2.07 3.79-2.07 4.05 0 4.8 2.67 4.8 6.13v5.87h-4v-5.2c0-1.24-.02-2.84-1.73-2.84-1.73 0-2 1.35-2 2.75v5.29h-4V9.75Z',\n ),\n },\n youtube: {\n body: fill(\n 'M23 7.2a3 3 0 0 0-2.1-2.1C19 4.6 12 4.6 12 4.6s-7 0-8.9.5A3 3 0 0 0 1 7.2 31 31 0 0 0 .5 12a31 31 0 0 0 .5 4.8 3 3 0 0 0 2.1 2.1c1.9.5 8.9.5 8.9.5s7 0 8.9-.5a3 3 0 0 0 2.1-2.1 31 31 0 0 0 .5-4.8 31 31 0 0 0-.5-4.8ZM9.75 15.02V8.98L15.5 12l-5.75 3.02Z',\n ),\n },\n tiktok: {\n body: fill('M16.6 2h-3.4v13.4a2.9 2.9 0 1 1-2.9-2.9c.3 0 .6 0 .9.1V9.1a6.3 6.3 0 1 0 5.4 6.3V8.6a8.1 8.1 0 0 0 4.4 1.3V6.5a4.5 4.5 0 0 1-4.4-4.5Z'),\n },\n})\n\n/** A site's own icons, from `defineSiteIcons`. They join the library icons in the one sprite. */\nexport interface SiteIconSet<Name extends string = string> {\n readonly names: readonly Name[]\n readonly glyphs: Readonly<Record<Name, IconGlyph>>\n}\n\nconst ICON_NAME = /^[a-z][a-z0-9-]{0,39}$/\nconst VIEW_BOX = /^-?\\d+(?:\\.\\d+)?(?: -?\\d+(?:\\.\\d+)?){3}$/\nconst GLYPH_ELEMENTS = new Set([\n 'path', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'rect', 'g', 'title', 'desc',\n 'lineargradient', 'radialgradient', 'stop', 'defs', 'clippath', 'mask',\n])\n\n/** Why a glyph's markup is refused, or null when it is plain shapes. */\nfunction glyphProblem(body: string): string | null {\n if (body.trim() === '') return 'is empty'\n for (const [, tag] of body.matchAll(/<\\/?\\s*([a-zA-Z][\\w:-]*)/g)) {\n if (!GLYPH_ELEMENTS.has(tag!.toLowerCase())) return `uses <${tag}>; a glyph holds shapes only (path, circle, rect, g and the like)`\n }\n if (/<!|<\\?/.test(body)) return 'holds a comment, CDATA or processing instruction'\n if (/\\son[a-z]+\\s*=/i.test(body)) return 'carries an event handler attribute'\n if (/(?:^|\\s)(?:xlink:)?href\\s*=/i.test(body)) return 'links to another resource'\n if (/\\sstyle\\s*=|url\\s*\\(|javascript:/i.test(body)) return 'carries a style or url() value'\n if (/\\sid\\s*=/i.test(body)) return 'sets an id, which would clash once the sprite holds every icon'\n return null\n}\n\n/**\n * Register a site's own icons (signature art, trade marks the site draws itself) for the sprite. Names are lower-case\n * words joined by hyphens and may not reuse a library icon's name; each glyph is plain SVG shapes using\n * `currentColor` (no ids, links, styles or scripts), checked when the module loads.\n *\n * ```ts\n * // src/site/icons.ts\n * export const siteIcons = defineSiteIcons({ leaf: { body: '<path fill=\"currentColor\" d=\"…\"/>' } })\n * // next.config.ts: defineBrandlabNextConfig({ …, icons: { site: siteIcons } })\n * // src/site/ui.tsx: export const SiteIcon = createSiteIcon(siteIcons)\n * ```\n */\nexport function defineSiteIcons<const Name extends string>(icons: Readonly<Record<Name, IconGlyph>>): SiteIconSet<Name> {\n if (!icons || typeof icons !== 'object' || Array.isArray(icons)) throw new TypeError('defineSiteIcons takes an object of { name: { viewBox?, body } }.')\n const names = Object.keys(icons) as Name[]\n const library = new Set<string>(UI_ICON_NAMES)\n for (const name of names) {\n if (!ICON_NAME.test(name)) throw new Error(`Site icon \"${name}\": names are lower-case words joined by hyphens, at most 40 characters.`)\n if (library.has(name)) throw new Error(`Site icon \"${name}\" reuses a library icon's name; choose another name.`)\n const glyph = icons[name] as IconGlyph | undefined\n if (!glyph || typeof glyph.body !== 'string') throw new Error(`Site icon \"${name}\" needs a body of SVG markup.`)\n if (glyph.viewBox !== undefined && !VIEW_BOX.test(glyph.viewBox)) throw new Error(`Site icon \"${name}\": viewBox must be four numbers, for example \"0 0 24 24\".`)\n const problem = glyphProblem(glyph.body)\n if (problem) throw new Error(`Site icon \"${name}\" ${problem}.`)\n }\n const glyphs = Object.freeze(Object.fromEntries(names.map((name) => [name, Object.freeze({ ...icons[name] })]))) as Record<Name, IconGlyph>\n return Object.freeze({ names: Object.freeze([...names]), glyphs })\n}\n\n/** The sprite's markup: one `<symbol id=\"name\" viewBox>` per library icon, then the site's icons. */\nexport function iconSpriteMarkup(site?: SiteIconSet): string {\n const symbols = [\n ...UI_ICON_NAMES.map((name) => [name, UI_ICON_GLYPHS[name]] as const),\n ...(site?.names ?? []).map((name) => [name, site!.glyphs[name]!] as const),\n ].map(([name, glyph]) => `<symbol id=\"${name}\" viewBox=\"${glyph.viewBox ?? DEFAULT_ICON_VIEW_BOX}\">${glyph.body}</symbol>`)\n return `<svg xmlns=\"http://www.w3.org/2000/svg\">${symbols.join('')}</svg>\\n`\n}\n"]}
@@ -1,19 +0,0 @@
1
- import { type SiteIconSet } from './icon-glyphs.js';
2
- /** The public folder the sprite is written to and served from. */
3
- export declare const ICON_SPRITE_FOLDER = "_bl";
4
- export interface IconSprite {
5
- /** The sprite's markup. */
6
- readonly svg: string;
7
- /** The first 12 hex characters of the markup's SHA-256. */
8
- readonly hash: string;
9
- /** The served path, for example `/_bl/icons.0123456789ab.svg`. */
10
- readonly href: string;
11
- }
12
- export declare function buildIconSprite(site?: SiteIconSet): IconSprite;
13
- /**
14
- * Writes the sprite to `public/_bl/icons.<hash>.svg` under the project root and removes earlier sprites there, so the
15
- * folder holds the current file only. Leaves an unchanged file untouched. Add `public/_bl/` to `.gitignore`: every
16
- * build writes it again.
17
- */
18
- export declare function writeIconSprite(projectRoot: string, site?: SiteIconSet): IconSprite;
19
- //# sourceMappingURL=icon-sprite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon-sprite.d.ts","sourceRoot":"","sources":["../../src/ui-kit/icon-sprite.ts"],"names":[],"mappings":"AAQA,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAErE,kEAAkE;AAClE,eAAO,MAAM,kBAAkB,QAAQ,CAAA;AAGvC,MAAM,WAAW,UAAU;IACzB,2BAA2B;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,CAiBnF"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Builds the icon sprite file (Node only; `defineBrandlabNextConfig({ icons })` calls it when the config loads). The
3
- * sprite holds every library icon and the site's own, and its name carries a hash of its content, so it is served as
4
- * an immutable static file and a changed icon set gets a new name.
5
- */
6
- import { createHash } from 'node:crypto';
7
- import { mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
8
- import { join } from 'node:path';
9
- import { iconSpriteMarkup } from './icon-glyphs.js';
10
- /** The public folder the sprite is written to and served from. */
11
- export const ICON_SPRITE_FOLDER = '_bl';
12
- const SPRITE_FILE = /^icons\.[0-9a-f]{12}\.svg$/;
13
- export function buildIconSprite(site) {
14
- const svg = iconSpriteMarkup(site);
15
- const hash = createHash('sha256').update(svg).digest('hex').slice(0, 12);
16
- return { svg, hash, href: `/${ICON_SPRITE_FOLDER}/icons.${hash}.svg` };
17
- }
18
- /**
19
- * Writes the sprite to `public/_bl/icons.<hash>.svg` under the project root and removes earlier sprites there, so the
20
- * folder holds the current file only. Leaves an unchanged file untouched. Add `public/_bl/` to `.gitignore`: every
21
- * build writes it again.
22
- */
23
- export function writeIconSprite(projectRoot, site) {
24
- const sprite = buildIconSprite(site);
25
- const folder = join(projectRoot, 'public', ICON_SPRITE_FOLDER);
26
- mkdirSync(folder, { recursive: true });
27
- const name = `icons.${sprite.hash}.svg`;
28
- for (const entry of readdirSync(folder)) {
29
- if (entry !== name && SPRITE_FILE.test(entry))
30
- rmSync(join(folder, entry), { force: true });
31
- }
32
- const path = join(folder, name);
33
- let current = null;
34
- try {
35
- current = readFileSync(path, 'utf8');
36
- }
37
- catch {
38
- current = null;
39
- }
40
- if (current !== sprite.svg)
41
- writeFileSync(path, sprite.svg);
42
- return sprite;
43
- }
44
- //# sourceMappingURL=icon-sprite.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon-sprite.js","sourceRoot":"","sources":["../../src/ui-kit/icon-sprite.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAoB,MAAM,kBAAkB,CAAA;AAErE,kEAAkE;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAA;AACvC,MAAM,WAAW,GAAG,4BAA4B,CAAA;AAWhD,MAAM,UAAU,eAAe,CAAC,IAAkB;IAChD,MAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;IAClC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACxE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,kBAAkB,UAAU,IAAI,MAAM,EAAE,CAAA;AACxE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,WAAmB,EAAE,IAAkB;IACrE,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAA;IACpC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAA;IAC9D,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACtC,MAAM,IAAI,GAAG,SAAS,MAAM,CAAC,IAAI,MAAM,CAAA;IACvC,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;QACxC,IAAI,KAAK,KAAK,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7F,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC/B,IAAI,OAAO,GAAkB,IAAI,CAAA;IACjC,IAAI,CAAC;QACH,OAAO,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,IAAI,CAAA;IAChB,CAAC;IACD,IAAI,OAAO,KAAK,MAAM,CAAC,GAAG;QAAE,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA;IAC3D,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["/**\n * Builds the icon sprite file (Node only; `defineBrandlabNextConfig({ icons })` calls it when the config loads). The\n * sprite holds every library icon and the site's own, and its name carries a hash of its content, so it is served as\n * an immutable static file and a changed icon set gets a new name.\n */\nimport { createHash } from 'node:crypto'\nimport { mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { iconSpriteMarkup, type SiteIconSet } from './icon-glyphs.js'\n\n/** The public folder the sprite is written to and served from. */\nexport const ICON_SPRITE_FOLDER = '_bl'\nconst SPRITE_FILE = /^icons\\.[0-9a-f]{12}\\.svg$/\n\nexport interface IconSprite {\n /** The sprite's markup. */\n readonly svg: string\n /** The first 12 hex characters of the markup's SHA-256. */\n readonly hash: string\n /** The served path, for example `/_bl/icons.0123456789ab.svg`. */\n readonly href: string\n}\n\nexport function buildIconSprite(site?: SiteIconSet): IconSprite {\n const svg = iconSpriteMarkup(site)\n const hash = createHash('sha256').update(svg).digest('hex').slice(0, 12)\n return { svg, hash, href: `/${ICON_SPRITE_FOLDER}/icons.${hash}.svg` }\n}\n\n/**\n * Writes the sprite to `public/_bl/icons.<hash>.svg` under the project root and removes earlier sprites there, so the\n * folder holds the current file only. Leaves an unchanged file untouched. Add `public/_bl/` to `.gitignore`: every\n * build writes it again.\n */\nexport function writeIconSprite(projectRoot: string, site?: SiteIconSet): IconSprite {\n const sprite = buildIconSprite(site)\n const folder = join(projectRoot, 'public', ICON_SPRITE_FOLDER)\n mkdirSync(folder, { recursive: true })\n const name = `icons.${sprite.hash}.svg`\n for (const entry of readdirSync(folder)) {\n if (entry !== name && SPRITE_FILE.test(entry)) rmSync(join(folder, entry), { force: true })\n }\n const path = join(folder, name)\n let current: string | null = null\n try {\n current = readFileSync(path, 'utf8')\n } catch {\n current = null\n }\n if (current !== sprite.svg) writeFileSync(path, sprite.svg)\n return sprite\n}\n"]}
@@ -1,50 +0,0 @@
1
- /**
2
- * The ui-kit's icons (no icon font). Every icon is decorative (`aria-hidden`): the control around it carries the
3
- * accessible name. Stroke and fill use `currentColor`, so a skin colours them through its classes or tokens.
4
- * `data-icon` names the glyph for skins and tests.
5
- *
6
- * From 3.14.0 an icon is `<svg aria-hidden="true" viewBox data-icon><use href="/_bl/icons.<hash>.svg#name"/></svg>`:
7
- * the glyphs live once in a static, immutable sprite that `defineBrandlabNextConfig({ icons })` builds, instead of
8
- * once per use in the HTML and the RSC payload. Without the sprite (tests, a site that has not opted in) the same
9
- * `<svg>` carries the glyph inline.
10
- */
11
- import type { UiSocialKind } from './types.js';
12
- import { type IconGlyph, type SiteIconSet, type UiIconName } from './icon-glyphs.js';
13
- export { UI_ICON_NAMES, type UiIconName } from './icon-glyphs.js';
14
- export interface IconProps {
15
- readonly className?: string | undefined;
16
- }
17
- /**
18
- * The sprite's path when `defineBrandlabNextConfig({ icons })` built one, or undefined. Next inlines the variable into
19
- * the server and browser bundles, so both render the same markup.
20
- */
21
- export declare function iconSpriteHref(): string | undefined;
22
- /** One icon from the library set by name. */
23
- export declare function Icon({ name, className }: IconProps & {
24
- name: UiIconName;
25
- }): import("react/jsx-runtime").JSX.Element;
26
- /** The icon for a social or Business Profile link. */
27
- export declare function SocialIcon({ kind, className }: IconProps & {
28
- kind: UiSocialKind;
29
- }): import("react/jsx-runtime").JSX.Element;
30
- /**
31
- * The component for a site's own icons, typed on its names. The same markup as `Icon`: a `<use>` into the shared
32
- * sprite once the config lists the set in `icons.site`, the glyph inline otherwise.
33
- *
34
- * ```tsx
35
- * export const SiteIcon = createSiteIcon(siteIcons) // src/site/ui.tsx
36
- * <SiteIcon name="leaf" />
37
- * ```
38
- */
39
- export declare function createSiteIcon<Name extends string>(icons: SiteIconSet<Name>): ({ name, className }: IconProps & {
40
- name: Name;
41
- }) => import("react/jsx-runtime").JSX.Element;
42
- /**
43
- * The one star the rating row repeats: its `<use>` reference into the sprite, or its glyph for the inline fallback.
44
- * `RatingStars` places five of them in one `<svg>`.
45
- */
46
- export declare function starGlyph(): {
47
- readonly href?: string;
48
- readonly glyph: IconGlyph;
49
- };
50
- //# sourceMappingURL=icons.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/ui-kit/icons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEjE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxC;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,CAGnD;AAgBD,6CAA6C;AAC7C,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,2CAEzE;AAED,sDAAsD;AACtD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,2CAEjF;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,yBACnC,SAAS,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,6CAMlE;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAGjF"}
@@ -1,55 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { DEFAULT_ICON_VIEW_BOX, UI_ICON_GLYPHS, } from './icon-glyphs.js';
3
- export { UI_ICON_NAMES } from './icon-glyphs.js';
4
- /**
5
- * The sprite's path when `defineBrandlabNextConfig({ icons })` built one, or undefined. Next inlines the variable into
6
- * the server and browser bundles, so both render the same markup.
7
- */
8
- export function iconSpriteHref() {
9
- const href = process.env.NEXT_PUBLIC_BL_ICON_SPRITE;
10
- return typeof href === 'string' && /^\/[\w./-]+\.svg$/.test(href) ? href : undefined;
11
- }
12
- function SvgIcon({ name, glyph, className }) {
13
- const viewBox = glyph.viewBox ?? DEFAULT_ICON_VIEW_BOX;
14
- const sprite = iconSpriteHref();
15
- if (sprite) {
16
- return (_jsx("svg", { "aria-hidden": "true", viewBox: viewBox, className: className, "data-icon": name, children: _jsx("use", { href: `${sprite}#${name}` }) }));
17
- }
18
- // The fallback: the glyph inline. Library glyphs are constants; site glyphs passed defineSiteIcons' shape checks.
19
- return _jsx("svg", { "aria-hidden": "true", viewBox: viewBox, className: className, "data-icon": name, dangerouslySetInnerHTML: { __html: glyph.body } });
20
- }
21
- /** One icon from the library set by name. */
22
- export function Icon({ name, className }) {
23
- return _jsx(SvgIcon, { name: name, glyph: UI_ICON_GLYPHS[name], className: className });
24
- }
25
- /** The icon for a social or Business Profile link. */
26
- export function SocialIcon({ kind, className }) {
27
- return _jsx(Icon, { name: kind, className: className });
28
- }
29
- /**
30
- * The component for a site's own icons, typed on its names. The same markup as `Icon`: a `<use>` into the shared
31
- * sprite once the config lists the set in `icons.site`, the glyph inline otherwise.
32
- *
33
- * ```tsx
34
- * export const SiteIcon = createSiteIcon(siteIcons) // src/site/ui.tsx
35
- * <SiteIcon name="leaf" />
36
- * ```
37
- */
38
- export function createSiteIcon(icons) {
39
- function SiteIcon({ name, className }) {
40
- const glyph = icons.glyphs[name];
41
- if (!glyph)
42
- throw new Error(`Site icon "${name}" is not in the registered set.`);
43
- return _jsx(SvgIcon, { name: name, glyph: glyph, className: className });
44
- }
45
- return SiteIcon;
46
- }
47
- /**
48
- * The one star the rating row repeats: its `<use>` reference into the sprite, or its glyph for the inline fallback.
49
- * `RatingStars` places five of them in one `<svg>`.
50
- */
51
- export function starGlyph() {
52
- const sprite = iconSpriteHref();
53
- return sprite ? { href: `${sprite}#star`, glyph: UI_ICON_GLYPHS.star } : { glyph: UI_ICON_GLYPHS.star };
54
- }
55
- //# sourceMappingURL=icons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/ui-kit/icons.tsx"],"names":[],"mappings":";AAWA,OAAO,EACL,qBAAqB,EACrB,cAAc,GAIf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,aAAa,EAAmB,MAAM,kBAAkB,CAAA;AAMjE;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAA;IACnD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;AACtF,CAAC;AAED,SAAS,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAkD;IACzF,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,qBAAqB,CAAA;IACtD,MAAM,MAAM,GAAG,cAAc,EAAE,CAAA;IAC/B,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CACL,6BAAiB,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,eAAa,IAAI,YAC7E,cAAK,IAAI,EAAE,GAAG,MAAM,IAAI,IAAI,EAAE,GAAI,GAC9B,CACP,CAAA;IACH,CAAC;IACD,kHAAkH;IAClH,OAAO,6BAAiB,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,eAAa,IAAI,EAAE,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,GAAI,CAAA;AAC7I,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAoC;IACxE,OAAO,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,GAAI,CAAA;AACnF,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAsC;IAChF,OAAO,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,CAAA;AACnD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAsB,KAAwB;IAC1E,SAAS,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAA8B;QAC/D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,cAAc,IAAI,iCAAiC,CAAC,CAAA;QAChF,OAAO,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,GAAI,CAAA;IACpE,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,MAAM,GAAG,cAAc,EAAE,CAAA;IAC/B,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,CAAA;AACzG,CAAC","sourcesContent":["/**\n * The ui-kit's icons (no icon font). Every icon is decorative (`aria-hidden`): the control around it carries the\n * accessible name. Stroke and fill use `currentColor`, so a skin colours them through its classes or tokens.\n * `data-icon` names the glyph for skins and tests.\n *\n * From 3.14.0 an icon is `<svg aria-hidden=\"true\" viewBox data-icon><use href=\"/_bl/icons.<hash>.svg#name\"/></svg>`:\n * the glyphs live once in a static, immutable sprite that `defineBrandlabNextConfig({ icons })` builds, instead of\n * once per use in the HTML and the RSC payload. Without the sprite (tests, a site that has not opted in) the same\n * `<svg>` carries the glyph inline.\n */\nimport type { UiSocialKind } from './types.js'\nimport {\n DEFAULT_ICON_VIEW_BOX,\n UI_ICON_GLYPHS,\n type IconGlyph,\n type SiteIconSet,\n type UiIconName,\n} from './icon-glyphs.js'\n\nexport { UI_ICON_NAMES, type UiIconName } from './icon-glyphs.js'\n\nexport interface IconProps {\n readonly className?: string | undefined\n}\n\n/**\n * The sprite's path when `defineBrandlabNextConfig({ icons })` built one, or undefined. Next inlines the variable into\n * the server and browser bundles, so both render the same markup.\n */\nexport function iconSpriteHref(): string | undefined {\n const href = process.env.NEXT_PUBLIC_BL_ICON_SPRITE\n return typeof href === 'string' && /^\\/[\\w./-]+\\.svg$/.test(href) ? href : undefined\n}\n\nfunction SvgIcon({ name, glyph, className }: IconProps & { name: string; glyph: IconGlyph }) {\n const viewBox = glyph.viewBox ?? DEFAULT_ICON_VIEW_BOX\n const sprite = iconSpriteHref()\n if (sprite) {\n return (\n <svg aria-hidden=\"true\" viewBox={viewBox} className={className} data-icon={name}>\n <use href={`${sprite}#${name}`} />\n </svg>\n )\n }\n // The fallback: the glyph inline. Library glyphs are constants; site glyphs passed defineSiteIcons' shape checks.\n return <svg aria-hidden=\"true\" viewBox={viewBox} className={className} data-icon={name} dangerouslySetInnerHTML={{ __html: glyph.body }} />\n}\n\n/** One icon from the library set by name. */\nexport function Icon({ name, className }: IconProps & { name: UiIconName }) {\n return <SvgIcon name={name} glyph={UI_ICON_GLYPHS[name]} className={className} />\n}\n\n/** The icon for a social or Business Profile link. */\nexport function SocialIcon({ kind, className }: IconProps & { kind: UiSocialKind }) {\n return <Icon name={kind} className={className} />\n}\n\n/**\n * The component for a site's own icons, typed on its names. The same markup as `Icon`: a `<use>` into the shared\n * sprite once the config lists the set in `icons.site`, the glyph inline otherwise.\n *\n * ```tsx\n * export const SiteIcon = createSiteIcon(siteIcons) // src/site/ui.tsx\n * <SiteIcon name=\"leaf\" />\n * ```\n */\nexport function createSiteIcon<Name extends string>(icons: SiteIconSet<Name>) {\n function SiteIcon({ name, className }: IconProps & { name: Name }) {\n const glyph = icons.glyphs[name]\n if (!glyph) throw new Error(`Site icon \"${name}\" is not in the registered set.`)\n return <SvgIcon name={name} glyph={glyph} className={className} />\n }\n return SiteIcon\n}\n\n/**\n * The one star the rating row repeats: its `<use>` reference into the sprite, or its glyph for the inline fallback.\n * `RatingStars` places five of them in one `<svg>`.\n */\nexport function starGlyph(): { readonly href?: string; readonly glyph: IconGlyph } {\n const sprite = iconSpriteHref()\n return sprite ? { href: `${sprite}#star`, glyph: UI_ICON_GLYPHS.star } : { glyph: UI_ICON_GLYPHS.star }\n}\n"]}
@@ -1,59 +0,0 @@
1
- /**
2
- * Prefetch by link role (W2, 3.13.0). Next's default `<Link>` prefetches the whole route when the link comes within
3
- * about 200 px of the viewport, so a long page of suburb, footer and map links fetched 16 to 45 pages on a full scroll
4
- * while visitors read 1.0 to 1.3 pages a session. Each link role now has one setting:
5
- *
6
- * - `auto` (Next's default): the main quote or contact action only, and never on its own page;
7
- * - `intent`: the top-level header links (7 at most, 3.15.0) and in-content service, project and blog cards (8 at
8
- * most, matching K11). They render `prefetch={false}` and `data-prefetch="intent"`; `IntentPrefetch` (mounted once
9
- * in the root layout) prefetches one of them when a visitor points at, focuses or touches it. Until 3.15.0 the
10
- * header links prefetched in view, which at 1440 px fetched 9 or 10 pages on landing (AA);
11
- * - `false`: the header logo, header panels, the drawer, the footer, area and suburb lists, nearby suburbs, area
12
- * maps, suburb finder results, other services in this suburb and any link inside a hidden container.
13
- *
14
- * The current page is never prefetched, whatever the role: a header link to it, and a quote button on its own quote
15
- * page, render `prefetch={false}`, and a link to a place on the same page (`#quote-hero`, `?page=2`) never
16
- * prefetches, because Next resolves it to the current page and fetches that.
17
- *
18
- * The ready gate's W2 journey fails a page that prefetches more than 8 destinations on landing or 12 after a full
19
- * scroll, or prefetches from an off role, a hidden link or the current page. It finds a site's own off-role
20
- * containers by the shared section ids (`coverage`, `nearby-areas`, `area-map`), the area map's `data-area-map` or
21
- * `data-bl-links` with one of `area`, `nearby`, `map`, `finder` or `other-services` on the list's container.
22
- */
23
- /** A link's prefetch setting: Next's default, on intent only, or off. */
24
- export type LinkPrefetch = 'auto' | 'intent' | false;
25
- export declare const LINK_PREFETCH_POLICY: Readonly<{
26
- readonly headerTopLevel: "intent";
27
- readonly primaryAction: "auto";
28
- readonly contentCard: "intent";
29
- readonly headerPanel: false;
30
- readonly drawer: false;
31
- readonly footer: false;
32
- readonly areaList: false;
33
- readonly nearbySuburbs: false;
34
- readonly areaMap: false;
35
- readonly finderResults: false;
36
- readonly otherServicesInSuburb: false;
37
- readonly hiddenContainer: false;
38
- }>;
39
- export type LinkPrefetchRole = keyof typeof LINK_PREFETCH_POLICY;
40
- /** The most links of each prefetching role on one page, and W2's page limits. */
41
- export declare const LINK_PREFETCH_LIMITS: Readonly<{
42
- headerTopLevel: 7;
43
- contentCard: 8;
44
- landingDestinations: 8;
45
- scrolledDestinations: 12;
46
- }>;
47
- /** The marker `IntentPrefetch` listens for. */
48
- export declare const INTENT_PREFETCH_SELECTOR = "a[data-prefetch=\"intent\"]";
49
- /** True for an href that stays on the current page: a fragment (`#quote-hero`), a query only (`?page=2`) or empty. */
50
- export declare function isSamePageHref(href: string): boolean;
51
- /**
52
- * The `next/link` props for a setting: nothing for `auto`, prefetch off for `false`, and off plus the marker for
53
- * `intent`. Given the `href`, a link that stays on the current page is always off, without the marker.
54
- */
55
- export declare function linkPrefetchProps(prefetch: LinkPrefetch | undefined, href?: string): {
56
- prefetch?: false;
57
- 'data-prefetch'?: 'intent';
58
- };
59
- //# sourceMappingURL=prefetch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prefetch.d.ts","sourceRoot":"","sources":["../../src/ui-kit/prefetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,yEAAyE;AACzE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;AAEpD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;EAaiB,CAAA;AAElD,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,oBAAoB,CAAA;AAEhE,iFAAiF;AACjF,eAAO,MAAM,oBAAoB;;;;;EAK/B,CAAA;AAEF,+CAA+C;AAC/C,eAAO,MAAM,wBAAwB,gCAA8B,CAAA;AAEnE,sHAAsH;AACtH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,eAAe,CAAC,EAAE,QAAQ,CAAA;CAAE,CAKrI"}
@@ -1,63 +0,0 @@
1
- /**
2
- * Prefetch by link role (W2, 3.13.0). Next's default `<Link>` prefetches the whole route when the link comes within
3
- * about 200 px of the viewport, so a long page of suburb, footer and map links fetched 16 to 45 pages on a full scroll
4
- * while visitors read 1.0 to 1.3 pages a session. Each link role now has one setting:
5
- *
6
- * - `auto` (Next's default): the main quote or contact action only, and never on its own page;
7
- * - `intent`: the top-level header links (7 at most, 3.15.0) and in-content service, project and blog cards (8 at
8
- * most, matching K11). They render `prefetch={false}` and `data-prefetch="intent"`; `IntentPrefetch` (mounted once
9
- * in the root layout) prefetches one of them when a visitor points at, focuses or touches it. Until 3.15.0 the
10
- * header links prefetched in view, which at 1440 px fetched 9 or 10 pages on landing (AA);
11
- * - `false`: the header logo, header panels, the drawer, the footer, area and suburb lists, nearby suburbs, area
12
- * maps, suburb finder results, other services in this suburb and any link inside a hidden container.
13
- *
14
- * The current page is never prefetched, whatever the role: a header link to it, and a quote button on its own quote
15
- * page, render `prefetch={false}`, and a link to a place on the same page (`#quote-hero`, `?page=2`) never
16
- * prefetches, because Next resolves it to the current page and fetches that.
17
- *
18
- * The ready gate's W2 journey fails a page that prefetches more than 8 destinations on landing or 12 after a full
19
- * scroll, or prefetches from an off role, a hidden link or the current page. It finds a site's own off-role
20
- * containers by the shared section ids (`coverage`, `nearby-areas`, `area-map`), the area map's `data-area-map` or
21
- * `data-bl-links` with one of `area`, `nearby`, `map`, `finder` or `other-services` on the list's container.
22
- */
23
- export const LINK_PREFETCH_POLICY = Object.freeze({
24
- headerTopLevel: 'intent',
25
- primaryAction: 'auto',
26
- contentCard: 'intent',
27
- headerPanel: false,
28
- drawer: false,
29
- footer: false,
30
- areaList: false,
31
- nearbySuburbs: false,
32
- areaMap: false,
33
- finderResults: false,
34
- otherServicesInSuburb: false,
35
- hiddenContainer: false,
36
- });
37
- /** The most links of each prefetching role on one page, and W2's page limits. */
38
- export const LINK_PREFETCH_LIMITS = Object.freeze({
39
- headerTopLevel: 7,
40
- contentCard: 8,
41
- landingDestinations: 8,
42
- scrolledDestinations: 12,
43
- });
44
- /** The marker `IntentPrefetch` listens for. */
45
- export const INTENT_PREFETCH_SELECTOR = 'a[data-prefetch="intent"]';
46
- /** True for an href that stays on the current page: a fragment (`#quote-hero`), a query only (`?page=2`) or empty. */
47
- export function isSamePageHref(href) {
48
- return href === '' || href.startsWith('#') || href.startsWith('?');
49
- }
50
- /**
51
- * The `next/link` props for a setting: nothing for `auto`, prefetch off for `false`, and off plus the marker for
52
- * `intent`. Given the `href`, a link that stays on the current page is always off, without the marker.
53
- */
54
- export function linkPrefetchProps(prefetch, href) {
55
- if (href !== undefined && isSamePageHref(href))
56
- return { prefetch: false };
57
- if (prefetch === 'intent')
58
- return { prefetch: false, 'data-prefetch': 'intent' };
59
- if (prefetch === false)
60
- return { prefetch: false };
61
- return {};
62
- }
63
- //# sourceMappingURL=prefetch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prefetch.js","sourceRoot":"","sources":["../../src/ui-kit/prefetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,MAAM;IACrB,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,KAAK;IAClB,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,KAAK;IACd,aAAa,EAAE,KAAK;IACpB,qBAAqB,EAAE,KAAK;IAC5B,eAAe,EAAE,KAAK;CACyB,CAAC,CAAA;AAIlD,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,cAAc,EAAE,CAAC;IACjB,WAAW,EAAE,CAAC;IACd,mBAAmB,EAAE,CAAC;IACtB,oBAAoB,EAAE,EAAE;CACzB,CAAC,CAAA;AAEF,+CAA+C;AAC/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAA;AAEnE,sHAAsH;AACtH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAkC,EAAE,IAAa;IACjF,IAAI,IAAI,KAAK,SAAS,IAAI,cAAc,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;IAC1E,IAAI,QAAQ,KAAK,QAAQ;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAA;IAChF,IAAI,QAAQ,KAAK,KAAK;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;IAClD,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["/**\n * Prefetch by link role (W2, 3.13.0). Next's default `<Link>` prefetches the whole route when the link comes within\n * about 200 px of the viewport, so a long page of suburb, footer and map links fetched 16 to 45 pages on a full scroll\n * while visitors read 1.0 to 1.3 pages a session. Each link role now has one setting:\n *\n * - `auto` (Next's default): the main quote or contact action only, and never on its own page;\n * - `intent`: the top-level header links (7 at most, 3.15.0) and in-content service, project and blog cards (8 at\n * most, matching K11). They render `prefetch={false}` and `data-prefetch=\"intent\"`; `IntentPrefetch` (mounted once\n * in the root layout) prefetches one of them when a visitor points at, focuses or touches it. Until 3.15.0 the\n * header links prefetched in view, which at 1440 px fetched 9 or 10 pages on landing (AA);\n * - `false`: the header logo, header panels, the drawer, the footer, area and suburb lists, nearby suburbs, area\n * maps, suburb finder results, other services in this suburb and any link inside a hidden container.\n *\n * The current page is never prefetched, whatever the role: a header link to it, and a quote button on its own quote\n * page, render `prefetch={false}`, and a link to a place on the same page (`#quote-hero`, `?page=2`) never\n * prefetches, because Next resolves it to the current page and fetches that.\n *\n * The ready gate's W2 journey fails a page that prefetches more than 8 destinations on landing or 12 after a full\n * scroll, or prefetches from an off role, a hidden link or the current page. It finds a site's own off-role\n * containers by the shared section ids (`coverage`, `nearby-areas`, `area-map`), the area map's `data-area-map` or\n * `data-bl-links` with one of `area`, `nearby`, `map`, `finder` or `other-services` on the list's container.\n */\n\n/** A link's prefetch setting: Next's default, on intent only, or off. */\nexport type LinkPrefetch = 'auto' | 'intent' | false\n\nexport const LINK_PREFETCH_POLICY = Object.freeze({\n headerTopLevel: 'intent',\n primaryAction: 'auto',\n contentCard: 'intent',\n headerPanel: false,\n drawer: false,\n footer: false,\n areaList: false,\n nearbySuburbs: false,\n areaMap: false,\n finderResults: false,\n otherServicesInSuburb: false,\n hiddenContainer: false,\n} as const satisfies Record<string, LinkPrefetch>)\n\nexport type LinkPrefetchRole = keyof typeof LINK_PREFETCH_POLICY\n\n/** The most links of each prefetching role on one page, and W2's page limits. */\nexport const LINK_PREFETCH_LIMITS = Object.freeze({\n headerTopLevel: 7,\n contentCard: 8,\n landingDestinations: 8,\n scrolledDestinations: 12,\n})\n\n/** The marker `IntentPrefetch` listens for. */\nexport const INTENT_PREFETCH_SELECTOR = 'a[data-prefetch=\"intent\"]'\n\n/** True for an href that stays on the current page: a fragment (`#quote-hero`), a query only (`?page=2`) or empty. */\nexport function isSamePageHref(href: string): boolean {\n return href === '' || href.startsWith('#') || href.startsWith('?')\n}\n\n/**\n * The `next/link` props for a setting: nothing for `auto`, prefetch off for `false`, and off plus the marker for\n * `intent`. Given the `href`, a link that stays on the current page is always off, without the marker.\n */\nexport function linkPrefetchProps(prefetch: LinkPrefetch | undefined, href?: string): { prefetch?: false; 'data-prefetch'?: 'intent' } {\n if (href !== undefined && isSamePageHref(href)) return { prefetch: false }\n if (prefetch === 'intent') return { prefetch: false, 'data-prefetch': 'intent' }\n if (prefetch === false) return { prefetch: false }\n return {}\n}\n"]}
@@ -1,25 +0,0 @@
1
- /**
2
- * `Badge` and `Chip` (3.14.0): a short label as text, never an image of text, with an optional decorative icon.
3
- * Server components. A badge marks a fact ("Licensed", "Fully insured"); a chip names a filter or a tag, and is the only
4
- * one a skin may make a pill (Romie, Absolute: "too many round elements").
5
- *
6
- * Both are rendered once per entry of a list, so their parts take no class (3.14.0 repeated slots): the site styles
7
- * `[data-bl="badge"]` and `[data-bl="chip"]` once in `src/site/skin.css`.
8
- */
9
- import { type UiIconName } from '../icons.js';
10
- import type { RepeatedSlotOf } from '../repeated-slots.js';
11
- import { type SkinEntry } from '../skin.js';
12
- export type BadgeSlot = RepeatedSlotOf<'badge'>;
13
- export type BadgeSkin = SkinEntry<BadgeSlot, never, Record<never, never>, BadgeSlot>;
14
- export type ChipSlot = RepeatedSlotOf<'chip'>;
15
- export type ChipSkin = SkinEntry<ChipSlot, never, Record<never, never>, ChipSlot>;
16
- export interface BadgeProps extends BadgeSkin {
17
- /** The label, in the site's words. */
18
- readonly children: string;
19
- /** A decorative icon before the label. */
20
- readonly icon?: UiIconName;
21
- }
22
- export type ChipProps = BadgeProps & ChipSkin;
23
- export declare function Badge({ children, icon }: BadgeProps): import("react/jsx-runtime").JSX.Element;
24
- export declare function Chip({ children, icon }: ChipProps): import("react/jsx-runtime").JSX.Element;
25
- //# sourceMappingURL=badge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/primitives/badge.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAEzD,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;AAC/C,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAA;AACpF,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;AAC7C,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAA;AAEjF,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAA;CAC3B;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAA;AAe7C,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,UAAU,2CAMnD;AAED,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,SAAS,2CAMjD"}
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * `Badge` and `Chip` (3.14.0): a short label as text, never an image of text, with an optional decorative icon.
4
- * Server components. A badge marks a fact ("Licensed", "Fully insured"); a chip names a filter or a tag, and is the only
5
- * one a skin may make a pill (Romie, Absolute: "too many round elements").
6
- *
7
- * Both are rendered once per entry of a list, so their parts take no class (3.14.0 repeated slots): the site styles
8
- * `[data-bl="badge"]` and `[data-bl="chip"]` once in `src/site/skin.css`.
9
- */
10
- import { Icon } from '../icons.js';
11
- import { repeatedSlot } from '../skin.js';
12
- function Label({ hook, children, icon }) {
13
- return (_jsxs("span", { "data-bl": hook, children: [icon ? (_jsx("span", { ...repeatedSlot('icon'), children: _jsx(Icon, { name: icon }) })) : null, _jsx("span", { ...repeatedSlot('label'), children: children })] }));
14
- }
15
- export function Badge({ children, icon }) {
16
- return (_jsx(Label, { hook: "badge", icon: icon, children: children }));
17
- }
18
- export function Chip({ children, icon }) {
19
- return (_jsx(Label, { hook: "chip", icon: icon, children: children }));
20
- }
21
- //# sourceMappingURL=badge.js.map