@invisibleloop/pulse 0.1.21

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 (344) hide show
  1. package/.claude/commands/build-page.md +59 -0
  2. package/.claude/commands/new-doc-page.md +45 -0
  3. package/.claude/commands/verify.md +52 -0
  4. package/.claude/pulse-checklist.md +111 -0
  5. package/.claude/settings.local.json +102 -0
  6. package/.github/workflows/ci.yml +22 -0
  7. package/.github/workflows/publish.yml +41 -0
  8. package/.pulse/load-reports/home/1773432711417.json +22 -0
  9. package/CLAUDE.md +383 -0
  10. package/README.md +95 -0
  11. package/docs/.claude/pulse-checklist.md +111 -0
  12. package/docs/public/.pulse-ui-version +1 -0
  13. package/docs/public/dist/accessibility.boot-5DVTARJU.js +115 -0
  14. package/docs/public/dist/actions.boot-P66HKQEM.js +164 -0
  15. package/docs/public/dist/auth.boot-IMAJAUPH.js +140 -0
  16. package/docs/public/dist/caching.boot-DVR6KDE7.js +53 -0
  17. package/docs/public/dist/components--accordion.boot-3HVKMNWC.js +11 -0
  18. package/docs/public/dist/components--alert.boot-GCEXOZAC.js +6 -0
  19. package/docs/public/dist/components--app-badge.boot-DVT3GCHJ.js +6 -0
  20. package/docs/public/dist/components--avatar.boot-PSW24EVA.js +5 -0
  21. package/docs/public/dist/components--badge.boot-TYDY2RMK.js +7 -0
  22. package/docs/public/dist/components--banner.boot-EI5PZSZK.js +7 -0
  23. package/docs/public/dist/components--breadcrumbs.boot-SMA2E2GO.js +34 -0
  24. package/docs/public/dist/components--button.boot-J54BQM2E.js +23 -0
  25. package/docs/public/dist/components--card.boot-PZGNDIB6.js +138 -0
  26. package/docs/public/dist/components--carousel.boot-TP6LPFZZ.js +12 -0
  27. package/docs/public/dist/components--charts.boot-2EOYQWKL.js +108 -0
  28. package/docs/public/dist/components--checkbox.boot-DS5BSL6T.js +54 -0
  29. package/docs/public/dist/components--cluster.boot-HHVIBBJG.js +9 -0
  30. package/docs/public/dist/components--code-window.boot-2GR2DV33.js +20 -0
  31. package/docs/public/dist/components--container.boot-7LOOGK2K.js +5 -0
  32. package/docs/public/dist/components--cta.boot-FSNZ5YRT.js +11 -0
  33. package/docs/public/dist/components--divider.boot-3NI2C3QG.js +6 -0
  34. package/docs/public/dist/components--empty.boot-YX2UR3PV.js +7 -0
  35. package/docs/public/dist/components--feature.boot-MUD7NSUO.js +13 -0
  36. package/docs/public/dist/components--fieldset.boot-J7BYHMKF.js +19 -0
  37. package/docs/public/dist/components--fileupload.boot-NIKVTTPD.js +52 -0
  38. package/docs/public/dist/components--footer.boot-EYUK5FRG.js +14 -0
  39. package/docs/public/dist/components--grid.boot-URDQVDDR.js +59 -0
  40. package/docs/public/dist/components--heading.boot-BPQKU43E.js +44 -0
  41. package/docs/public/dist/components--hero.boot-4RAPRGAB.js +17 -0
  42. package/docs/public/dist/components--icons.boot-ZITNU5JP.js +68 -0
  43. package/docs/public/dist/components--image.boot-XEEGHQZF.js +19 -0
  44. package/docs/public/dist/components--input.boot-SGASZG5K.js +7 -0
  45. package/docs/public/dist/components--list.boot-W3XC5MHD.js +55 -0
  46. package/docs/public/dist/components--media.boot-5VFIETZO.js +13 -0
  47. package/docs/public/dist/components--modal.boot-RZUYXBN2.js +47 -0
  48. package/docs/public/dist/components--nav.boot-ODBOHU7O.js +33 -0
  49. package/docs/public/dist/components--pricing.boot-4AQ4ZVBY.js +21 -0
  50. package/docs/public/dist/components--progress.boot-GHAGYZOK.js +30 -0
  51. package/docs/public/dist/components--prose.boot-QANJL6JI.js +67 -0
  52. package/docs/public/dist/components--pullquote.boot-Q2WMNAZU.js +22 -0
  53. package/docs/public/dist/components--radio.boot-TJRDQ2OL.js +75 -0
  54. package/docs/public/dist/components--rating.boot-QBAN6DEL.js +38 -0
  55. package/docs/public/dist/components--search.boot-PXH5O5AG.js +17 -0
  56. package/docs/public/dist/components--section.boot-AQGIYHWW.js +12 -0
  57. package/docs/public/dist/components--segmented.boot-BEVTKEJO.js +33 -0
  58. package/docs/public/dist/components--select.boot-47X5RHOC.js +10 -0
  59. package/docs/public/dist/components--slider.boot-PSRRX7XL.js +47 -0
  60. package/docs/public/dist/components--spinner.boot-MZ5MO2OH.js +22 -0
  61. package/docs/public/dist/components--stack.boot-DI4NJXBF.js +9 -0
  62. package/docs/public/dist/components--stat.boot-QMFUWBQT.js +9 -0
  63. package/docs/public/dist/components--stepper.boot-34PP2NEV.js +22 -0
  64. package/docs/public/dist/components--table.boot-FCQGSFIQ.js +11 -0
  65. package/docs/public/dist/components--testimonial.boot-DWQPDKYG.js +11 -0
  66. package/docs/public/dist/components--textarea.boot-QVXLBOJ5.js +4 -0
  67. package/docs/public/dist/components--timeline.boot-26LN52P2.js +95 -0
  68. package/docs/public/dist/components--toggle.boot-IQQEI76S.js +29 -0
  69. package/docs/public/dist/components--tooltip.boot-LGHCO6NN.js +9 -0
  70. package/docs/public/dist/components.boot-SE6PQ4P7.js +103 -0
  71. package/docs/public/dist/config.boot-DTRRWUE6.js +126 -0
  72. package/docs/public/dist/constraints.boot-DUHDZBMC.js +71 -0
  73. package/docs/public/dist/deploy.boot-SLAD3NI2.js +163 -0
  74. package/docs/public/dist/docs-8e3d4b5c.css +1 -0
  75. package/docs/public/dist/extending.boot-UA3CN243.js +159 -0
  76. package/docs/public/dist/faq.boot-6EQAWLQR.js +43 -0
  77. package/docs/public/dist/getting-started.boot-TDKIFL5U.js +86 -0
  78. package/docs/public/dist/guard.boot-AUHAWTG4.js +80 -0
  79. package/docs/public/dist/home.boot-BVQXRH32.js +383 -0
  80. package/docs/public/dist/how-it-works.boot-LTWAKWKW.js +104 -0
  81. package/docs/public/dist/hydration.boot-JRM6IPJL.js +78 -0
  82. package/docs/public/dist/images.boot-M6ZVKTZS.js +80 -0
  83. package/docs/public/dist/manifest.json +94 -0
  84. package/docs/public/dist/meta.boot-7NXGPHR4.js +79 -0
  85. package/docs/public/dist/mutations.boot-F6F43UDX.js +79 -0
  86. package/docs/public/dist/navigation.boot-AOXWS3ZF.js +57 -0
  87. package/docs/public/dist/performance.boot-C3UPCOBK.js +98 -0
  88. package/docs/public/dist/persist.boot-WT32PQOQ.js +61 -0
  89. package/docs/public/dist/project-structure.boot-FB3LRVJ4.js +63 -0
  90. package/docs/public/dist/prompt-examples.boot-YKR4VDK4.js +31 -0
  91. package/docs/public/dist/pulse-ui-81a85c03.css +1 -0
  92. package/docs/public/dist/raw-responses.boot-M4KA5YXL.js +104 -0
  93. package/docs/public/dist/routing.boot-FNX5FDGH.js +70 -0
  94. package/docs/public/dist/runtime-B73WLANC.js +1 -0
  95. package/docs/public/dist/runtime-KO4BHUQ3.js +49 -0
  96. package/docs/public/dist/runtime-L2HNXIHW.js +59 -0
  97. package/docs/public/dist/runtime-QFURDKA2.js +5 -0
  98. package/docs/public/dist/runtime-UVPXO4IR.js +375 -0
  99. package/docs/public/dist/runtime-VMJA3Z4N.js +10 -0
  100. package/docs/public/dist/runtime-ZJ4FXT5O.js +11 -0
  101. package/docs/public/dist/server-api.boot-K7X3LCFB.js +219 -0
  102. package/docs/public/dist/server-data.boot-Y7HQYC4R.js +157 -0
  103. package/docs/public/dist/slash-commands.boot-V2UV7OW2.js +26 -0
  104. package/docs/public/dist/spec.boot-2WU7ZHCV.js +159 -0
  105. package/docs/public/dist/state.boot-B24GUE3R.js +73 -0
  106. package/docs/public/dist/store.boot-TLIB4XHH.js +150 -0
  107. package/docs/public/dist/streaming.boot-W2DZSMW4.js +80 -0
  108. package/docs/public/dist/stripe.boot-QN3C2GEL.js +164 -0
  109. package/docs/public/dist/supabase.boot-BG4XXLZE.js +303 -0
  110. package/docs/public/dist/testing.boot-6U4WKMTE.js +130 -0
  111. package/docs/public/dist/validation.boot-PQHYGW5B.js +100 -0
  112. package/docs/public/docs.css +2020 -0
  113. package/docs/public/menu.js +83 -0
  114. package/docs/public/pulse-ui.css +2739 -0
  115. package/docs/public/pulse-ui.js +236 -0
  116. package/docs/server.js +192 -0
  117. package/docs/src/lib/component-page.js +47 -0
  118. package/docs/src/lib/highlight.js +255 -0
  119. package/docs/src/lib/layout.js +131 -0
  120. package/docs/src/lib/metrics-store.js +6 -0
  121. package/docs/src/lib/nav.js +159 -0
  122. package/docs/src/lib/stats.js +81 -0
  123. package/docs/src/pages/accessibility.js +157 -0
  124. package/docs/src/pages/actions.js +191 -0
  125. package/docs/src/pages/auth.js +177 -0
  126. package/docs/src/pages/caching.js +95 -0
  127. package/docs/src/pages/components/accordion.js +48 -0
  128. package/docs/src/pages/components/alert.js +35 -0
  129. package/docs/src/pages/components/app-badge.js +41 -0
  130. package/docs/src/pages/components/avatar.js +35 -0
  131. package/docs/src/pages/components/badge.js +36 -0
  132. package/docs/src/pages/components/banner.js +45 -0
  133. package/docs/src/pages/components/breadcrumbs.js +94 -0
  134. package/docs/src/pages/components/button.js +84 -0
  135. package/docs/src/pages/components/card.js +225 -0
  136. package/docs/src/pages/components/carousel.js +72 -0
  137. package/docs/src/pages/components/charts.js +278 -0
  138. package/docs/src/pages/components/checkbox.js +129 -0
  139. package/docs/src/pages/components/cluster.js +47 -0
  140. package/docs/src/pages/components/code-window.js +57 -0
  141. package/docs/src/pages/components/container.js +40 -0
  142. package/docs/src/pages/components/cta.js +53 -0
  143. package/docs/src/pages/components/divider.js +37 -0
  144. package/docs/src/pages/components/empty.js +36 -0
  145. package/docs/src/pages/components/feature.js +60 -0
  146. package/docs/src/pages/components/fieldset.js +65 -0
  147. package/docs/src/pages/components/fileupload.js +127 -0
  148. package/docs/src/pages/components/footer.js +58 -0
  149. package/docs/src/pages/components/grid.js +165 -0
  150. package/docs/src/pages/components/heading.js +107 -0
  151. package/docs/src/pages/components/hero.js +65 -0
  152. package/docs/src/pages/components/icons.js +285 -0
  153. package/docs/src/pages/components/image.js +71 -0
  154. package/docs/src/pages/components/input.js +51 -0
  155. package/docs/src/pages/components/list.js +112 -0
  156. package/docs/src/pages/components/media.js +51 -0
  157. package/docs/src/pages/components/modal.js +111 -0
  158. package/docs/src/pages/components/nav.js +86 -0
  159. package/docs/src/pages/components/pricing.js +68 -0
  160. package/docs/src/pages/components/progress.js +102 -0
  161. package/docs/src/pages/components/prose.js +111 -0
  162. package/docs/src/pages/components/pullquote.js +71 -0
  163. package/docs/src/pages/components/radio.js +194 -0
  164. package/docs/src/pages/components/rating.js +106 -0
  165. package/docs/src/pages/components/search.js +61 -0
  166. package/docs/src/pages/components/section.js +59 -0
  167. package/docs/src/pages/components/segmented.js +121 -0
  168. package/docs/src/pages/components/select.js +45 -0
  169. package/docs/src/pages/components/slider.js +114 -0
  170. package/docs/src/pages/components/spinner.js +73 -0
  171. package/docs/src/pages/components/stack.js +48 -0
  172. package/docs/src/pages/components/stat.js +55 -0
  173. package/docs/src/pages/components/stepper.js +66 -0
  174. package/docs/src/pages/components/table.js +45 -0
  175. package/docs/src/pages/components/testimonial.js +49 -0
  176. package/docs/src/pages/components/textarea.js +31 -0
  177. package/docs/src/pages/components/timeline.js +227 -0
  178. package/docs/src/pages/components/toggle.js +84 -0
  179. package/docs/src/pages/components/tooltip.js +48 -0
  180. package/docs/src/pages/components.js +204 -0
  181. package/docs/src/pages/config.js +193 -0
  182. package/docs/src/pages/constraints.js +99 -0
  183. package/docs/src/pages/deploy.js +233 -0
  184. package/docs/src/pages/extending.js +198 -0
  185. package/docs/src/pages/faq.js +96 -0
  186. package/docs/src/pages/getting-started.js +106 -0
  187. package/docs/src/pages/guard.js +121 -0
  188. package/docs/src/pages/home.js +401 -0
  189. package/docs/src/pages/how-it-works.js +183 -0
  190. package/docs/src/pages/hydration.js +98 -0
  191. package/docs/src/pages/images.js +121 -0
  192. package/docs/src/pages/meta.js +120 -0
  193. package/docs/src/pages/mutations.js +106 -0
  194. package/docs/src/pages/navigation.js +85 -0
  195. package/docs/src/pages/performance.js +157 -0
  196. package/docs/src/pages/persist.js +88 -0
  197. package/docs/src/pages/project-structure.js +90 -0
  198. package/docs/src/pages/prompt-examples.js +186 -0
  199. package/docs/src/pages/raw-responses.js +124 -0
  200. package/docs/src/pages/routing.js +99 -0
  201. package/docs/src/pages/server-api.js +281 -0
  202. package/docs/src/pages/server-data.js +185 -0
  203. package/docs/src/pages/slash-commands.js +55 -0
  204. package/docs/src/pages/spec.js +207 -0
  205. package/docs/src/pages/state.js +101 -0
  206. package/docs/src/pages/store.js +181 -0
  207. package/docs/src/pages/streaming.js +108 -0
  208. package/docs/src/pages/stripe.js +193 -0
  209. package/docs/src/pages/supabase.js +323 -0
  210. package/docs/src/pages/testing.js +198 -0
  211. package/docs/src/pages/validation.js +138 -0
  212. package/examples/contact.js +166 -0
  213. package/examples/counter.js +94 -0
  214. package/examples/dev.server.js +91 -0
  215. package/examples/examples.test.js +394 -0
  216. package/examples/pricing.js +244 -0
  217. package/examples/products.js +191 -0
  218. package/examples/quiz.js +208 -0
  219. package/examples/shared.js +78 -0
  220. package/examples/todos.js +162 -0
  221. package/package.json +75 -0
  222. package/public/.pulse-ui-version +1 -0
  223. package/public/chippy-bird.css +246 -0
  224. package/public/examples/contact.css +119 -0
  225. package/public/examples/counter.css +79 -0
  226. package/public/examples/pricing.css +132 -0
  227. package/public/examples/products.css +100 -0
  228. package/public/examples/quiz.css +200 -0
  229. package/public/examples/todos.css +137 -0
  230. package/public/favicon.ico +0 -0
  231. package/public/log-dashboard.css +383 -0
  232. package/public/pulse-ui.css +2740 -0
  233. package/public/pulse-ui.js +236 -0
  234. package/public/pulse.css +149 -0
  235. package/scripts/build.js +411 -0
  236. package/src/agent/checklist.md +111 -0
  237. package/src/agent/coverage-check.js +66 -0
  238. package/src/agent/guide-components.md +274 -0
  239. package/src/agent/guide-examples.md +54 -0
  240. package/src/agent/guide-routing.md +36 -0
  241. package/src/agent/guide-server.md +258 -0
  242. package/src/agent/guide-spec.md +103 -0
  243. package/src/agent/guide-styles.md +191 -0
  244. package/src/agent/guide.md +979 -0
  245. package/src/agent/identity.md +106 -0
  246. package/src/agent/workflow.md +108 -0
  247. package/src/cli/cli.test.js +82 -0
  248. package/src/cli/dev.js +195 -0
  249. package/src/cli/discover.js +113 -0
  250. package/src/cli/index.js +361 -0
  251. package/src/cli/load-report.js +91 -0
  252. package/src/cli/load-runner.js +121 -0
  253. package/src/cli/report-server.js +723 -0
  254. package/src/cli/report.js +116 -0
  255. package/src/cli/scaffold.archive.js +1371 -0
  256. package/src/cli/scaffold.js +349 -0
  257. package/src/cli/start.js +74 -0
  258. package/src/html.js +19 -0
  259. package/src/mcp/server.js +884 -0
  260. package/src/mcp/validate-worker.js +110 -0
  261. package/src/runtime/image.js +74 -0
  262. package/src/runtime/image.test.js +111 -0
  263. package/src/runtime/index.js +621 -0
  264. package/src/runtime/navigate.js +146 -0
  265. package/src/runtime/runtime.test.js +773 -0
  266. package/src/runtime/ssr.js +464 -0
  267. package/src/runtime/ssr.test.js +421 -0
  268. package/src/runtime/store.js +92 -0
  269. package/src/runtime/toast.js +163 -0
  270. package/src/server/index.js +1386 -0
  271. package/src/server/server.test.js +1248 -0
  272. package/src/spec/schema.js +428 -0
  273. package/src/spec/schema.test.js +291 -0
  274. package/src/store/index.js +102 -0
  275. package/src/store/store.test.js +210 -0
  276. package/src/testing/html.js +283 -0
  277. package/src/testing/index.js +249 -0
  278. package/src/testing/testing.test.js +450 -0
  279. package/src/ui/accordion.js +28 -0
  280. package/src/ui/alert.js +43 -0
  281. package/src/ui/app-badge.js +48 -0
  282. package/src/ui/avatar.js +47 -0
  283. package/src/ui/badge.js +24 -0
  284. package/src/ui/banner.js +26 -0
  285. package/src/ui/breadcrumbs.js +38 -0
  286. package/src/ui/button.js +66 -0
  287. package/src/ui/card.js +34 -0
  288. package/src/ui/carousel.js +59 -0
  289. package/src/ui/charts.js +321 -0
  290. package/src/ui/checkbox.js +65 -0
  291. package/src/ui/cluster.js +44 -0
  292. package/src/ui/code-window.js +39 -0
  293. package/src/ui/container.js +24 -0
  294. package/src/ui/cta.js +37 -0
  295. package/src/ui/divider.js +29 -0
  296. package/src/ui/empty.js +33 -0
  297. package/src/ui/feature.js +33 -0
  298. package/src/ui/fieldset.js +37 -0
  299. package/src/ui/fileupload.js +89 -0
  300. package/src/ui/footer.js +38 -0
  301. package/src/ui/grid.js +36 -0
  302. package/src/ui/heading.js +45 -0
  303. package/src/ui/hero.js +37 -0
  304. package/src/ui/icons.js +161 -0
  305. package/src/ui/index.js +89 -0
  306. package/src/ui/input.js +74 -0
  307. package/src/ui/list.js +36 -0
  308. package/src/ui/media.js +44 -0
  309. package/src/ui/modal.js +80 -0
  310. package/src/ui/nav.js +61 -0
  311. package/src/ui/pricing.js +56 -0
  312. package/src/ui/progress.js +62 -0
  313. package/src/ui/prose.js +29 -0
  314. package/src/ui/pullquote.js +34 -0
  315. package/src/ui/radio.js +102 -0
  316. package/src/ui/rating.js +93 -0
  317. package/src/ui/search.js +77 -0
  318. package/src/ui/section.js +69 -0
  319. package/src/ui/segmented.js +50 -0
  320. package/src/ui/select.js +77 -0
  321. package/src/ui/slider.js +84 -0
  322. package/src/ui/spinner.js +34 -0
  323. package/src/ui/stack.js +36 -0
  324. package/src/ui/stat.js +52 -0
  325. package/src/ui/stepper.js +46 -0
  326. package/src/ui/switch.js +57 -0
  327. package/src/ui/table.js +45 -0
  328. package/src/ui/testimonial.js +48 -0
  329. package/src/ui/textarea.js +72 -0
  330. package/src/ui/timeline.js +72 -0
  331. package/src/ui/tooltip.js +28 -0
  332. package/src/ui/ui.test.js +1241 -0
  333. package/src/ui/uiimage.js +65 -0
  334. package/tsconfig.json +13 -0
  335. package/types/html.d.ts +17 -0
  336. package/types/image.d.ts +70 -0
  337. package/types/index.d.ts +7 -0
  338. package/types/navigate.d.ts +38 -0
  339. package/types/runtime.d.ts +63 -0
  340. package/types/schema.d.ts +243 -0
  341. package/types/server.d.ts +145 -0
  342. package/types/ssr.d.ts +110 -0
  343. package/types/testing.d.ts +154 -0
  344. package/types/ui.d.ts +704 -0
@@ -0,0 +1,112 @@
1
+ import { renderComponentPage, demo } from '../../lib/component-page.js'
2
+ import { prevNext } from '../../lib/nav.js'
3
+ import { table } from '../../lib/layout.js'
4
+ import { list } from '../../../../src/ui/index.js'
5
+
6
+ const { prev, next } = prevNext('/components/list')
7
+
8
+ export default {
9
+ route: '/components/list',
10
+ meta: {
11
+ title: 'List — Pulse Docs',
12
+ description: 'Styled ordered and unordered list component for Pulse UI.',
13
+ styles: ['/pulse-ui.css', '/docs.css'],
14
+ },
15
+ state: {},
16
+ view: () => renderComponentPage({
17
+ currentHref: '/components/list',
18
+ prev,
19
+ next,
20
+ name: 'list',
21
+ description: 'Styled unordered or ordered list with consistent spacing and colour tokens. Use this instead of raw <code>&lt;ul&gt;</code> / <code>&lt;ol&gt;</code>. Items are HTML strings — other components can be passed as items.',
22
+ content: `
23
+
24
+ <h2 class="doc-h2" id="unordered">Unordered</h2>
25
+ ${demo(
26
+ list({ items: ['Streaming SSR on every page', 'Security headers by default', 'Zero client-side dependencies', 'Lighthouse 100 out of the box'] }),
27
+ `list({
28
+ items: [
29
+ 'Streaming SSR on every page',
30
+ 'Security headers by default',
31
+ 'Zero client-side dependencies',
32
+ 'Lighthouse 100 out of the box',
33
+ ],
34
+ })`,
35
+ { col: true }
36
+ )}
37
+
38
+ <h2 class="doc-h2" id="ordered">Ordered</h2>
39
+ ${demo(
40
+ list({
41
+ ordered: true,
42
+ items: ['Create a new Pulse project', 'Add your pages to <code>src/pages/</code>', 'Run <code>pulse dev</code> to start the server', 'Deploy when ready'],
43
+ }),
44
+ `list({
45
+ ordered: true,
46
+ items: [
47
+ 'Create a new Pulse project',
48
+ 'Add your pages to src/pages/',
49
+ 'Run pulse dev to start the server',
50
+ 'Deploy when ready',
51
+ ],
52
+ })`,
53
+ { col: true }
54
+ )}
55
+
56
+ <h2 class="doc-h2" id="gap">Gap</h2>
57
+ <p>Control vertical spacing between items with the <code>gap</code> prop.</p>
58
+ ${demo(
59
+ `<div class="u-flex u-gap-8">
60
+ <div>
61
+ <p class="u-text-muted u-text-sm u-mb-2">xs</p>
62
+ ${list({ gap: 'xs', items: ['Design', 'Build', 'Ship'] })}
63
+ </div>
64
+ <div>
65
+ <p class="u-text-muted u-text-sm u-mb-2">sm (default)</p>
66
+ ${list({ gap: 'sm', items: ['Design', 'Build', 'Ship'] })}
67
+ </div>
68
+ <div>
69
+ <p class="u-text-muted u-text-sm u-mb-2">md</p>
70
+ ${list({ gap: 'md', items: ['Design', 'Build', 'Ship'] })}
71
+ </div>
72
+ </div>`,
73
+ `list({ gap: 'xs', items: [...] })
74
+ list({ gap: 'sm', items: [...] }) // default
75
+ list({ gap: 'md', items: [...] })`,
76
+ { col: true }
77
+ )}
78
+
79
+ <h2 class="doc-h2" id="rich-items">Items with markup</h2>
80
+ <p>Items are HTML strings — pass any markup including other components. Always escape user data before including it in item strings.</p>
81
+ ${demo(
82
+ list({
83
+ items: [
84
+ `<strong>spec.state</strong> — initial client state, deep-cloned on mount`,
85
+ `<strong>spec.mutations</strong> — synchronous state updates`,
86
+ `<strong>spec.actions</strong> — async operations with lifecycle hooks`,
87
+ `<strong>spec.server</strong> — server-side data fetchers`,
88
+ ],
89
+ }),
90
+ `list({
91
+ items: [
92
+ '<strong>spec.state</strong> — initial client state',
93
+ '<strong>spec.mutations</strong> — synchronous state updates',
94
+ '<strong>spec.actions</strong> — async operations with lifecycle hooks',
95
+ '<strong>spec.server</strong> — server-side data fetchers',
96
+ ],
97
+ })`,
98
+ { col: true }
99
+ )}
100
+
101
+ ${table(
102
+ ['Prop', 'Type', 'Default', ''],
103
+ [
104
+ ['<code>items</code>', 'string[]', '—', 'Array of HTML strings for each list item — escape user data before passing'],
105
+ ['<code>ordered</code>', 'boolean', '<code>false</code>', '<code>false</code> renders <code>&lt;ul&gt;</code>, <code>true</code> renders <code>&lt;ol&gt;</code>'],
106
+ ['<code>gap</code>', '<code>xs | sm | md</code>', '<code>sm</code>', 'Vertical spacing between items'],
107
+ ['<code>class</code>', 'string', '—', 'Extra classes on the list element'],
108
+ ]
109
+ )}
110
+ `,
111
+ }),
112
+ }
@@ -0,0 +1,51 @@
1
+ import { renderComponentPage, demo } from '../../lib/component-page.js'
2
+ import { prevNext } from '../../lib/nav.js'
3
+ import { table } from '../../lib/layout.js'
4
+ import { button, stack, media } from '../../../../src/ui/index.js'
5
+
6
+ const { prev, next } = prevNext('/components/media')
7
+
8
+ export default {
9
+ route: '/components/media',
10
+ meta: {
11
+ title: 'Media — Pulse Docs',
12
+ description: 'Media component for Pulse UI.',
13
+ styles: ['/pulse-ui.css', '/docs.css'],
14
+ },
15
+ state: {},
16
+ view: () => renderComponentPage({
17
+ currentHref: '/components/media',
18
+ prev,
19
+ next,
20
+ name: 'media',
21
+ description: 'Two-column image + text layout. Stacks vertically on mobile. Set <code>reverse</code> to alternate image position for multi-block feature sections.',
22
+ content: `
23
+ ${demo(
24
+ media({
25
+ image: `<div style="background:var(--ui-surface-2);border:1px solid var(--ui-border);border-radius:8px;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;color:var(--ui-muted);font-size:.875rem">Screenshot</div>`,
26
+ content: stack({ gap: 'md', content: '<h3 style="font-size:1.25rem;font-weight:700;color:var(--ui-text);margin:0">One-tap controls</h3><p style="color:var(--ui-muted);margin:0">Tap to flap. Chippy Bird takes seconds to learn and a lifetime to conquer.</p>' + button({ label: 'Download', href: '#' }) }),
27
+ }),
28
+ `media({
29
+ image: \`<img src="\${screenshot}" alt="App screenshot">\`,
30
+ content: stack({ gap: 'md', content:
31
+ '<h3>One-tap controls</h3>' +
32
+ '<p>Tap to flap.</p>' +
33
+ button({ label: 'Download', href: appStoreUrl })
34
+ }),
35
+ reverse: false,
36
+ })`
37
+ )}
38
+
39
+ ${table(
40
+ ['Prop', 'Type', 'Default', ''],
41
+ [
42
+ ['<code>image</code>', 'string (HTML)', '—', 'Raw HTML slot — img, figure, SVG, or styled div'],
43
+ ['<code>content</code>', 'string (HTML)', '—', 'Raw HTML slot'],
44
+ ['<code>reverse</code>', 'boolean', 'false', 'Puts text left, image right'],
45
+ ['<code>align</code>', 'string', "'center'", "'center' · 'start'"],
46
+ ['<code>gap</code>', 'string', "'md'", "'sm' · 'md' · 'lg'"],
47
+ ]
48
+ )}
49
+ `,
50
+ }),
51
+ }
@@ -0,0 +1,111 @@
1
+ import { renderComponentPage, demo } from '../../lib/component-page.js'
2
+ import { prevNext } from '../../lib/nav.js'
3
+ import { table, callout } from '../../lib/layout.js'
4
+ import { modal, modalTrigger, button, cluster } from '../../../../src/ui/index.js'
5
+
6
+ const { prev, next } = prevNext('/components/modal')
7
+
8
+ export default {
9
+ route: '/components/modal',
10
+ meta: {
11
+ title: 'Modal — Pulse Docs',
12
+ description: 'Modal dialog component for Pulse UI.',
13
+ styles: ['/pulse-ui.css', '/docs.css'],
14
+ },
15
+ state: {},
16
+ view: () => renderComponentPage({
17
+ currentHref: '/components/modal',
18
+ prev,
19
+ next,
20
+ name: 'modal / modalTrigger',
21
+ description: 'A <code>&lt;dialog&gt;</code>-based modal with backdrop, animated open/close, and keyboard dismiss. The Pulse runtime handles open and close natively — no extra script needed.',
22
+ content: `
23
+ ${demo(
24
+ cluster({ justify: 'center', content:
25
+ modalTrigger({ target: 'demo-modal', label: 'Open modal' }) +
26
+ modal({
27
+ id: 'demo-modal',
28
+ title: 'Confirm action',
29
+ content: '<p style="color:var(--ui-muted);margin:0">Are you sure you want to delete this item? This action cannot be undone.</p>',
30
+ footer:
31
+ button({ label: 'Cancel', variant: 'secondary', type: 'submit' }) +
32
+ button({ label: 'Delete', variant: 'danger' }),
33
+ }),
34
+ }),
35
+ `// Render the dialog somewhere on the page
36
+ modal({
37
+ id: 'confirm-delete',
38
+ title: 'Confirm action',
39
+ content: '<p>Are you sure? This cannot be undone.</p>',
40
+ footer:
41
+ button({ label: 'Cancel', variant: 'secondary' }) +
42
+ button({ label: 'Delete', variant: 'danger' }),
43
+ })
44
+
45
+ // Open it with a trigger button (or any element with data-dialog-open)
46
+ modalTrigger({ target: 'confirm-delete', label: 'Delete item', variant: 'danger' })`
47
+ )}
48
+
49
+ <h3 class="doc-h3" id="sizes"><a href="#sizes" class="heading-anchor">Sizes</a></h3>
50
+ ${demo(
51
+ cluster({ gap: 'sm', justify: 'center', content:
52
+ modalTrigger({ target: 'demo-sm', label: 'Small', variant: 'secondary', size: 'sm' }) +
53
+ modalTrigger({ target: 'demo-lg', label: 'Large', variant: 'secondary', size: 'sm' }) +
54
+ modal({ id: 'demo-sm', title: 'Small modal', size: 'sm', content: '<p style="color:var(--ui-muted);margin:0">A compact dialog for quick confirmations.</p>' }) +
55
+ modal({ id: 'demo-lg', title: 'Large modal', size: 'lg', content: '<p style="color:var(--ui-muted);margin:0">Use large modals for forms, rich content, or detail views that need more space.</p>' }),
56
+ }),
57
+ `modal({ id: 'my-modal', title: 'Large modal', size: 'lg', content: '...' })`
58
+ )}
59
+
60
+ ${table(
61
+ ['Prop', 'Type', 'Default', ''],
62
+ [
63
+ ['<code>id</code>', 'string', '—', 'Unique ID — required for triggers to target this dialog'],
64
+ ['<code>title</code>', 'string', '—', ''],
65
+ ['<code>level</code>', 'number', '2', 'Heading tag for the title (1–6). Visual style is unchanged.'],
66
+ ['<code>content</code>', 'string (HTML)', '—', 'Body HTML'],
67
+ ['<code>footer</code>', 'string (HTML)', '—', 'Footer HTML — typically button() calls'],
68
+ ['<code>size</code>', '<code>sm | md | lg | xl</code>', '<code>md</code>', ''],
69
+ ['<code>class</code>', 'string', '—', ''],
70
+ ]
71
+ )}
72
+
73
+ <h3 class="doc-h3" id="trigger-props"><a href="#trigger-props" class="heading-anchor">modalTrigger props</a></h3>
74
+
75
+ ${table(
76
+ ['Prop', 'Type', 'Default', ''],
77
+ [
78
+ ['<code>target</code>', 'string', '—', "The modal's <code>id</code>"],
79
+ ['<code>label</code>', 'string', '<code>Open</code>', ''],
80
+ ['<code>variant</code>', '<code>primary | secondary | ghost | danger</code>', '<code>primary</code>', ''],
81
+ ['<code>size</code>', '<code>sm | md | lg</code>', '<code>md</code>', ''],
82
+ ['<code>class</code>', 'string', '—', ''],
83
+ ]
84
+ )}
85
+
86
+ <h3 class="doc-h3" id="custom-trigger"><a href="#custom-trigger" class="heading-anchor">Custom triggers</a></h3>
87
+ <p class="doc-body">Any element with <code>data-dialog-open="&lt;id&gt;"</code> opens the dialog when clicked. Use <code>data-dialog-close</code> on any element inside or outside the dialog to close it programmatically:</p>
88
+ <pre class="code-block"><code>&lt;button data-dialog-open="my-modal"&gt;Open&lt;/button&gt;
89
+ &lt;button data-dialog-close&gt;Cancel&lt;/button&gt;</code></pre>
90
+ ${callout('tip', 'The dialog also closes on ESC, backdrop click, and <code>&lt;form method="dialog"&gt;</code> submit — all native browser behaviour, no JavaScript needed.')}
91
+
92
+ <h3 class="doc-h3" id="forms-inside"><a href="#forms-inside" class="heading-anchor">Forms inside a modal</a></h3>
93
+ <p class="doc-body"><code>modal()</code> wraps all content in <code>&lt;form method="dialog"&gt;</code> for native close behaviour. You <strong>cannot nest a <code>&lt;form data-action="..."&gt;</code> inside it</strong> — browsers silently discard nested forms, so the action will never fire.</p>
94
+ <p class="doc-body">When a modal button needs to trigger a Pulse action, place the form <em>outside</em> the modal and use the HTML <code>form</code> attribute to associate the button with it:</p>
95
+ <pre class="code-block"><code>// The action form lives outside the modal — hidden, no visible fields needed
96
+ &lt;form id="delete-form" data-action="deleteAccount" style="display:none"&gt;&lt;/form&gt;
97
+
98
+ \${modal({
99
+ id: 'confirm-delete',
100
+ title: 'Delete account?',
101
+ content: '&lt;p&gt;This cannot be undone.&lt;/p&gt;',
102
+ footer:
103
+ // type="submit" with no form= closes the modal natively (submits &lt;form method="dialog"&gt;)
104
+ button({ label: 'Cancel', variant: 'secondary', type: 'submit' }) +
105
+ // form="delete-form" associates this button with the external form → fires the action
106
+ button({ label: 'Confirm delete', variant: 'danger', attrs: { form: 'delete-form', type: 'submit' } }),
107
+ })}</code></pre>
108
+ ${callout('note', 'The hidden form needs no visible fields. <code>onStart</code> receives <code>state</code> and <code>formData</code> — read anything you need from state directly.')}
109
+ `,
110
+ }),
111
+ }
@@ -0,0 +1,86 @@
1
+ import { renderComponentPage, demo } from '../../lib/component-page.js'
2
+ import { prevNext } from '../../lib/nav.js'
3
+ import { table } from '../../lib/layout.js'
4
+ import { button, nav as uiNav } from '../../../../src/ui/index.js'
5
+
6
+ const { prev, next } = prevNext('/components/nav')
7
+
8
+ export default {
9
+ route: '/components/nav',
10
+ meta: {
11
+ title: 'Nav — Pulse Docs',
12
+ description: 'Nav component for Pulse UI.',
13
+ styles: ['/pulse-ui.css', '/docs.css'],
14
+ },
15
+ state: {},
16
+ view: () => renderComponentPage({
17
+ currentHref: '/components/nav',
18
+ prev,
19
+ next,
20
+ name: 'nav',
21
+ description: 'Sticky-capable site header with logo, navigation links, and an optional CTA button. On mobile (&lt; 640px) links collapse behind a burger button — clicking it reveals an overlay panel that sits on top of page content without pushing it down. Wired automatically by <code>pulse-ui.js</code>.',
22
+ content: `
23
+ ${demo(
24
+ uiNav({
25
+ logo: '<strong>MyApp</strong>',
26
+ logoHref: '/',
27
+ links: [{ label: 'Features', href: '#features' }, { label: 'Pricing', href: '#pricing' }, { label: 'FAQ', href: '#faq' }],
28
+ action: button({ label: 'Download', size: 'sm' }),
29
+ sticky: false,
30
+ }),
31
+ `nav({
32
+ logo: '<strong>MyApp</strong>',
33
+ logoHref: '/',
34
+ links: [
35
+ { label: 'Features', href: '#features' },
36
+ { label: 'Pricing', href: '#pricing' },
37
+ { label: 'FAQ', href: '#faq' },
38
+ ],
39
+ action: button({ label: 'Download', size: 'sm' }),
40
+ sticky: true,
41
+ })`
42
+ )}
43
+
44
+ <h2 class="doc-h2" id="mobile">Mobile view</h2>
45
+ <p>At &lt; 640px the links and action are hidden and replaced with a burger button. The panel opens as an overlay — no layout shift.</p>
46
+
47
+ <div class="demo-phone demo-mobile-nav">
48
+ <div class="demo-phone-statusbar"><div class="demo-phone-pill"></div></div>
49
+ ${uiNav({
50
+ logo: '<strong>MyApp</strong>',
51
+ logoHref: '/',
52
+ links: [{ label: 'Features', href: '#features' }, { label: 'Pricing', href: '#pricing' }, { label: 'FAQ', href: '#faq' }],
53
+ action: button({ label: 'Download', size: 'sm' }),
54
+ })}
55
+ <div class="demo-phone-content"><p>Tap the burger to open the overlay</p></div>
56
+ </div>
57
+
58
+ <h2 class="doc-h2" id="burger-left">Burger on the left</h2>
59
+ <p>Set <code>burgerAlign: 'left'</code> to place the burger before the logo — common in app-style layouts.</p>
60
+
61
+ <div class="demo-phone demo-mobile-nav">
62
+ <div class="demo-phone-statusbar"><div class="demo-phone-pill"></div></div>
63
+ ${uiNav({
64
+ logo: '<strong>MyApp</strong>',
65
+ logoHref: '/',
66
+ links: [{ label: 'Features', href: '#features' }, { label: 'Pricing', href: '#pricing' }, { label: 'FAQ', href: '#faq' }],
67
+ action: button({ label: 'Download', size: 'sm' }),
68
+ burgerAlign: 'left',
69
+ })}
70
+ <div class="demo-phone-content"><p>Burger on the left — logo stays right</p></div>
71
+ </div>
72
+
73
+ ${table(
74
+ ['Prop', 'Type', 'Default', ''],
75
+ [
76
+ ['<code>logo</code>', 'string (HTML)', '—', 'Raw HTML slot — SVG, img, or text'],
77
+ ['<code>logoHref</code>', 'string', "'/'", ''],
78
+ ['<code>links</code>', 'array', '[]', '<code>{ label, href }[]</code>'],
79
+ ['<code>action</code>', 'string (HTML)', '—', 'Raw HTML slot — shown in desktop bar and mobile menu'],
80
+ ['<code>sticky</code>', 'boolean', 'false', 'position: sticky with backdrop blur'],
81
+ ['<code>burgerAlign</code>', 'string', "'right'", "'right' or 'left' — mobile burger position"],
82
+ ]
83
+ )}
84
+ `,
85
+ }),
86
+ }
@@ -0,0 +1,68 @@
1
+ import { renderComponentPage, demo } from '../../lib/component-page.js'
2
+ import { prevNext } from '../../lib/nav.js'
3
+ import { table, section } from '../../lib/layout.js'
4
+ import { button, pricing } from '../../../../src/ui/index.js'
5
+
6
+ const { prev, next } = prevNext('/components/pricing')
7
+
8
+ export default {
9
+ route: '/components/pricing',
10
+ meta: {
11
+ title: 'Pricing — Pulse Docs',
12
+ description: 'Pricing component for Pulse UI.',
13
+ styles: ['/pulse-ui.css', '/docs.css'],
14
+ },
15
+ state: {},
16
+ view: () => renderComponentPage({
17
+ currentHref: '/components/pricing',
18
+ prev,
19
+ next,
20
+ name: 'pricing',
21
+ description: 'Single plan card with a feature list and CTA. Set <code>highlighted: true</code> on the recommended plan — it gets an accent border and a floating <code>badge</code> label.',
22
+ content: `
23
+ ${demo(
24
+ pricing({ name: 'Pro', price: '$9', period: '/month', description: 'For growing teams', features: ['Unlimited pages', 'Priority support', 'Custom domain'], highlighted: true, badge: 'Most popular', action: button({ label: 'Get started', fullWidth: true }) }),
25
+ `pricing({
26
+ name: 'Pro',
27
+ price: '$9',
28
+ period: '/month',
29
+ description: 'For growing teams',
30
+ features: ['Unlimited pages', 'Priority support', 'Custom domain'],
31
+ highlighted: true,
32
+ badge: 'Most popular',
33
+ action: button({ label: 'Get started', fullWidth: true }),
34
+ })`,
35
+ { col: true }
36
+ )}
37
+
38
+ ${section('multi-plan', 'Multi-plan layout')}
39
+ ${demo(
40
+ `<div class="ui-pricing-grid ui-pricing-grid--cols-3">` +
41
+ pricing({ name: 'Free', price: '$0', period: '/month', description: 'For personal projects', features: ['3 pages', 'Community support'], action: button({ label: 'Get started', variant: 'secondary', fullWidth: true }) }) +
42
+ pricing({ name: 'Pro', price: '$9', period: '/month', description: 'For growing teams', features: ['Unlimited pages', 'Priority support', 'Custom domain'], highlighted: true, badge: 'Most popular', action: button({ label: 'Get started', fullWidth: true }) }) +
43
+ pricing({ name: 'Team', price: '$29', period: '/month', description: 'For large organisations', features: ['Everything in Pro', 'SSO', 'SLA'], action: button({ label: 'Get started', variant: 'secondary', fullWidth: true }) }) +
44
+ `</div>`,
45
+ `<div class="ui-pricing-grid ui-pricing-grid--cols-3">
46
+ \${pricing({ name: 'Free', price: '$0', ... })}
47
+ \${pricing({ name: 'Pro', price: '$9', highlighted: true, badge: 'Most popular', ... })}
48
+ \${pricing({ name: 'Team', price: '$29', ... })}
49
+ </div>`,
50
+ )}
51
+
52
+ ${table(
53
+ ['Prop', 'Type', 'Default', ''],
54
+ [
55
+ ['<code>name</code>', 'string', '—', ''],
56
+ ['<code>level</code>', 'number', '3', 'Heading tag for the plan name (1–6). Visual style is unchanged.'],
57
+ ['<code>price</code>', 'string', '—', 'Formatted string — e.g. "$9", "Free"'],
58
+ ['<code>period</code>', 'string', '—', 'e.g. "/month", "/year"'],
59
+ ['<code>description</code>', 'string', '—', ''],
60
+ ['<code>features</code>', 'string[]', '[]', 'List of feature strings'],
61
+ ['<code>action</code>', 'string (HTML)', '—', 'Raw HTML slot — typically a button()'],
62
+ ['<code>highlighted</code>', 'boolean', 'false', 'Accent border + elevated appearance'],
63
+ ['<code>badge</code>', 'string', '—', 'Floating label above the card'],
64
+ ]
65
+ )}
66
+ `,
67
+ }),
68
+ }
@@ -0,0 +1,102 @@
1
+ import { renderComponentPage, demo } from '../../lib/component-page.js'
2
+ import { prevNext } from '../../lib/nav.js'
3
+ import { table } from '../../lib/layout.js'
4
+ import { progress, stack } from '../../../../src/ui/index.js'
5
+
6
+ const { prev, next } = prevNext('/components/progress')
7
+
8
+ export default {
9
+ route: '/components/progress',
10
+ meta: {
11
+ title: 'Progress — Pulse Docs',
12
+ description: 'Progress bar component for Pulse UI.',
13
+ styles: ['/pulse-ui.css', '/docs.css'],
14
+ },
15
+ state: {},
16
+ view: () => renderComponentPage({
17
+ currentHref: '/components/progress',
18
+ prev,
19
+ next,
20
+ name: 'progress',
21
+ description: 'Horizontal progress bar with determinate and indeterminate states. Correct <code>role="progressbar"</code> and ARIA attributes are set automatically.',
22
+ content: `
23
+
24
+ <h2 class="doc-h2" id="default">Default</h2>
25
+ ${demo(
26
+ stack({ gap: 'md', content:
27
+ progress({ value: 25 }) +
28
+ progress({ value: 50 }) +
29
+ progress({ value: 75 }) +
30
+ progress({ value: 100 }),
31
+ }),
32
+ `progress({ value: 25 })
33
+ progress({ value: 50 })
34
+ progress({ value: 75 })
35
+ progress({ value: 100 })`,
36
+ { col: true }
37
+ )}
38
+
39
+ <h2 class="doc-h2" id="label">With label and value</h2>
40
+ <p>Set <code>showLabel</code> and <code>showValue</code> to render text above the bar.</p>
41
+ ${demo(
42
+ stack({ gap: 'lg', content:
43
+ progress({ value: 68, label: 'Storage used', showLabel: true, showValue: true }) +
44
+ progress({ value: 32, label: 'Upload complete', showLabel: true, showValue: true }),
45
+ }),
46
+ `progress({ value: 68, label: 'Storage used', showLabel: true, showValue: true })
47
+ progress({ value: 32, label: 'Upload complete', showLabel: true, showValue: true })`,
48
+ { col: true }
49
+ )}
50
+
51
+ <h2 class="doc-h2" id="variants">Variants</h2>
52
+ ${demo(
53
+ stack({ gap: 'md', content:
54
+ progress({ value: 80, variant: 'accent' }) +
55
+ progress({ value: 80, variant: 'success' }) +
56
+ progress({ value: 80, variant: 'warning' }) +
57
+ progress({ value: 80, variant: 'error' }),
58
+ }),
59
+ `progress({ value: 80, variant: 'accent' })
60
+ progress({ value: 80, variant: 'success' })
61
+ progress({ value: 80, variant: 'warning' })
62
+ progress({ value: 80, variant: 'error' })`,
63
+ { col: true }
64
+ )}
65
+
66
+ <h2 class="doc-h2" id="sizes">Sizes</h2>
67
+ ${demo(
68
+ stack({ gap: 'md', content:
69
+ progress({ value: 60, size: 'sm' }) +
70
+ progress({ value: 60, size: 'md' }) +
71
+ progress({ value: 60, size: 'lg' }),
72
+ }),
73
+ `progress({ value: 60, size: 'sm' })
74
+ progress({ value: 60, size: 'md' })
75
+ progress({ value: 60, size: 'lg' })`,
76
+ { col: true }
77
+ )}
78
+
79
+ <h2 class="doc-h2" id="indeterminate">Indeterminate</h2>
80
+ <p>Omit <code>value</code> when the total duration is unknown — the bar animates continuously.</p>
81
+ ${demo(
82
+ progress({ label: 'Loading…' }),
83
+ `progress({ label: 'Loading…' }) // no value = indeterminate`,
84
+ { col: true }
85
+ )}
86
+
87
+ ${table(
88
+ ['Prop', 'Type', 'Default', ''],
89
+ [
90
+ ['<code>value</code>', 'number', '—', 'Current value. Omit for indeterminate.'],
91
+ ['<code>max</code>', 'number', '100', ''],
92
+ ['<code>label</code>', 'string', '—', 'Sets <code>aria-label</code> and the visible label when <code>showLabel</code> is true'],
93
+ ['<code>showLabel</code>', 'boolean', 'false', 'Render label text above the bar'],
94
+ ['<code>showValue</code>', 'boolean', 'false', 'Render percentage above the bar (right-aligned)'],
95
+ ['<code>variant</code>', '<code>accent | success | warning | error</code>', '<code>accent</code>', ''],
96
+ ['<code>size</code>', '<code>sm | md | lg</code>', '<code>md</code>', '.25rem / .5rem / 1rem'],
97
+ ['<code>class</code>', 'string', '—', ''],
98
+ ]
99
+ )}
100
+ `,
101
+ }),
102
+ }
@@ -0,0 +1,111 @@
1
+ import { renderComponentPage, demo } from '../../lib/component-page.js'
2
+ import { prevNext } from '../../lib/nav.js'
3
+ import { table, callout } from '../../lib/layout.js'
4
+ import { prose } from '../../../../src/ui/index.js'
5
+
6
+ const { prev, next } = prevNext('/components/prose')
7
+
8
+ const SAMPLE_HTML = `<h2>Why great coffee starts with water</h2>
9
+ <p>Most home baristas obsess over beans and grinders, but water quality is the single biggest variable in your cup. Tap water that is too hard leaves bitter, chalky espresso. Too soft and your shots taste flat and lifeless.</p>
10
+ <h3>The ideal mineral balance</h3>
11
+ <p>Speciality roasters recommend water with a total dissolved solids (TDS) between <strong>75–150 mg/L</strong> and a magnesium content of at least 10 mg/L. Magnesium is the mineral most responsible for extracting the fruity, floral notes from light roasts.</p>
12
+ <h3>What to do if your tap water is off</h3>
13
+ <ul>
14
+ <li>Use a filter jug — Brita Maxtra+ reduces hardness and chlorine</li>
15
+ <li>Try third-wave water sachets — add to distilled water for precise control</li>
16
+ <li>Blend tap with still mineral water to hit the right TDS range</li>
17
+ </ul>
18
+ <blockquote>Water is the ingredient you can control most precisely, yet almost nobody does.</blockquote>
19
+ <p>Once your water is dialled in, even a modest grinder will produce noticeably better results. <a href="#">Read our water guide</a> for a full breakdown by region.</p>`
20
+
21
+ export default {
22
+ route: '/components/prose',
23
+ meta: {
24
+ title: 'Prose — Pulse Docs',
25
+ description: 'Typography wrapper for CMS output and rich text content in Pulse UI.',
26
+ styles: ['/pulse-ui.css', '/docs.css'],
27
+ },
28
+ state: {},
29
+ view: () => renderComponentPage({
30
+ currentHref: '/components/prose',
31
+ prev,
32
+ next,
33
+ name: 'prose',
34
+ description: 'Typography wrapper for rich text you don\'t control: CMS output, markdown-rendered HTML, database content, blog posts. Styles all descendant elements — headings, paragraphs, lists, blockquotes, code, tables — using <code>--ui-*</code> tokens. No classes needed on individual elements.',
35
+ content: `
36
+
37
+ <h2 class="doc-h2" id="basic">Basic</h2>
38
+ <p>Pass any HTML string to <code>content</code>. All elements inside are styled automatically.</p>
39
+ ${demo(
40
+ prose({ content: SAMPLE_HTML }),
41
+ `import { prose } from '@invisibleloop/pulse/ui'
42
+
43
+ // CMS rich text field — output directly, fully styled
44
+ prose({ content: server.article.bodyHtml })
45
+
46
+ // Markdown rendered to HTML
47
+ prose({ content: renderMarkdown(server.post.body) })`,
48
+ { col: true }
49
+ )}
50
+
51
+ <h2 class="doc-h2" id="size">Size</h2>
52
+ <p>Scale the base font size for different contexts.</p>
53
+ ${demo(
54
+ `<div class="u-flex u-flex-col u-gap-8">
55
+ <div>
56
+ <p class="u-text-muted u-text-sm u-mb-3">sm — footnotes, sidebars</p>
57
+ ${prose({ content: '<p>The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.</p><ul><li>Smaller text</li><li>Tighter line height</li></ul>', size: 'sm' })}
58
+ </div>
59
+ <div>
60
+ <p class="u-text-muted u-text-sm u-mb-3">base (default)</p>
61
+ ${prose({ content: '<p>The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.</p><ul><li>Default size</li><li>Standard line height</li></ul>' })}
62
+ </div>
63
+ <div>
64
+ <p class="u-text-muted u-text-sm u-mb-3">lg — hero intro, feature descriptions</p>
65
+ ${prose({ content: '<p>The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.</p><ul><li>Larger text</li><li>More generous spacing</li></ul>', size: 'lg' })}
66
+ </div>
67
+ </div>`,
68
+ `prose({ content: cms.body, size: 'sm' }) // footnotes, sidebars
69
+ prose({ content: cms.body }) // default
70
+ prose({ content: cms.intro, size: 'lg' }) // hero intro`,
71
+ { col: true }
72
+ )}
73
+
74
+ <h2 class="doc-h2" id="elements">Styled elements</h2>
75
+ <p>Every common HTML element rendered inside <code>prose()</code> is styled using <code>--ui-*</code> tokens:</p>
76
+ ${demo(
77
+ prose({ content: `
78
+ <h2>h2 heading</h2>
79
+ <h3>h3 heading</h3>
80
+ <p>A paragraph with <strong>bold</strong>, <em>italic</em>, and <a href="#">a link</a>. Also <code>inline code</code>.</p>
81
+ <ul><li>Unordered item one</li><li>Unordered item two</li></ul>
82
+ <ol><li>Ordered item one</li><li>Ordered item two</li></ol>
83
+ <blockquote>A blockquote with an accent left border.</blockquote>
84
+ <pre><code>// A code block
85
+ const x = 1 + 2</code></pre>
86
+ <hr>
87
+ <p class="u-text-sm u-text-muted">End of content.</p>
88
+ ` }),
89
+ `prose({ content: \`
90
+ <h2>Section heading</h2>
91
+ <p>Paragraph with <strong>bold</strong> and <a href="#">a link</a>.</p>
92
+ <ul><li>List item</li></ul>
93
+ <blockquote>A quote.</blockquote>
94
+ <pre><code>const x = 1</code></pre>
95
+ \` })`,
96
+ { col: true }
97
+ )}
98
+
99
+ ${callout('warning', '<strong>Do not escape the content prop.</strong> <code>prose()</code> renders raw HTML — it is designed for trusted server-side content only. Never pass unescaped user input directly. Sanitise CMS output before rendering if your CMS allows arbitrary HTML.')}
100
+
101
+ ${table(
102
+ ['Prop', 'Type', 'Default', ''],
103
+ [
104
+ ['<code>content</code>', 'string', '—', 'Raw HTML string — rendered as-is, not escaped. Use for server-side content only.'],
105
+ ['<code>size</code>', '<code>sm | base | lg</code>', '<code>base</code>', 'Base font size scale. <code>sm</code>=0.875rem, <code>base</code>=1rem, <code>lg</code>=1.125rem'],
106
+ ['<code>class</code>', 'string', '—', 'Extra classes on the wrapper <code>&lt;div&gt;</code>'],
107
+ ]
108
+ )}
109
+ `,
110
+ }),
111
+ }