create-businessdash 0.0.0-stage → 0.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 (1514) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +125 -2
  3. package/dist/index.mjs +3672 -0
  4. package/index.js +2 -0
  5. package/package.json +40 -5
  6. package/templates/angular/.claude/CLAUDE.md +54 -0
  7. package/templates/angular/.cursor/rules/cursor.mdc +60 -0
  8. package/templates/angular/.editorconfig +17 -0
  9. package/templates/angular/.env.example +62 -0
  10. package/templates/angular/.prettierrc +12 -0
  11. package/templates/angular/.vscode/extensions.json +4 -0
  12. package/templates/angular/.vscode/launch.json +20 -0
  13. package/templates/angular/.vscode/mcp.json +9 -0
  14. package/templates/angular/.vscode/tasks.json +42 -0
  15. package/templates/angular/AGENTS.md +54 -0
  16. package/templates/angular/README.md +382 -0
  17. package/templates/angular/_gitignore +49 -0
  18. package/templates/angular/angular.json +93 -0
  19. package/templates/angular/bd.config.ts +331 -0
  20. package/templates/angular/bd.data-model.config.ts +89 -0
  21. package/templates/angular/package.json +60 -0
  22. package/templates/angular/pnpm-lock.yaml +5506 -0
  23. package/templates/angular/public/favicon.ico +0 -0
  24. package/templates/angular/src/app/app.config.server.ts +10 -0
  25. package/templates/angular/src/app/app.config.ts +48 -0
  26. package/templates/angular/src/app/app.html +7 -0
  27. package/templates/angular/src/app/app.routes.server.ts +14 -0
  28. package/templates/angular/src/app/app.routes.ts +69 -0
  29. package/templates/angular/src/app/app.scss +5 -0
  30. package/templates/angular/src/app/app.spec.ts +25 -0
  31. package/templates/angular/src/app/app.ts +27 -0
  32. package/templates/angular/src/app/lib/bd-api.client.ts +416 -0
  33. package/templates/angular/src/app/lib/bd-forms.client.ts +107 -0
  34. package/templates/angular/src/app/lib/bd.service.ts +145 -0
  35. package/templates/angular/src/app/lib/followers.service.ts +143 -0
  36. package/templates/angular/src/app/pages/booking.page.ts +142 -0
  37. package/templates/angular/src/app/pages/cart.page.ts +131 -0
  38. package/templates/angular/src/app/pages/home.page.ts +37 -0
  39. package/templates/angular/src/app/pages/my-account.page.ts +197 -0
  40. package/templates/angular/src/app/pages/product-detail.page.ts +217 -0
  41. package/templates/angular/src/app/pages/reviews.page.ts +89 -0
  42. package/templates/angular/src/app/pages/service-area.page.ts +86 -0
  43. package/templates/angular/src/app/pages/services-index.page.ts +49 -0
  44. package/templates/angular/src/app/pages/store.page.ts +422 -0
  45. package/templates/angular/src/app/pages/subscriptions.page.ts +102 -0
  46. package/templates/angular/src/app/pages/todos.page.ts +194 -0
  47. package/templates/angular/src/app/pages/updates.page.ts +45 -0
  48. package/templates/angular/src/app/sections/about.component.ts +24 -0
  49. package/templates/angular/src/app/sections/blog.component.ts +33 -0
  50. package/templates/angular/src/app/sections/contact-form.component.ts +51 -0
  51. package/templates/angular/src/app/sections/footer.component.ts +14 -0
  52. package/templates/angular/src/app/sections/header.component.ts +36 -0
  53. package/templates/angular/src/app/sections/hero.component.ts +21 -0
  54. package/templates/angular/src/app/sections/news-banner.component.ts +50 -0
  55. package/templates/angular/src/app/sections/reviews-summary.component.ts +41 -0
  56. package/templates/angular/src/app/sections/sdk-setup-banner.component.ts +125 -0
  57. package/templates/angular/src/app/sections/services.component.ts +27 -0
  58. package/templates/angular/src/app/sections/subscribe.component.ts +140 -0
  59. package/templates/angular/src/app/sections/updates.component.ts +38 -0
  60. package/templates/angular/src/environments/environment.prod.ts +13 -0
  61. package/templates/angular/src/environments/environment.ts +23 -0
  62. package/templates/angular/src/index.html +13 -0
  63. package/templates/angular/src/main.server.ts +7 -0
  64. package/templates/angular/src/main.ts +5 -0
  65. package/templates/angular/src/server/bd-api.ts +1098 -0
  66. package/templates/angular/src/server/bd-seo.ts +55 -0
  67. package/templates/angular/src/server/bd-server.ts +293 -0
  68. package/templates/angular/src/server.ts +94 -0
  69. package/templates/angular/src/styles.scss +1102 -0
  70. package/templates/angular/tsconfig.app.json +11 -0
  71. package/templates/angular/tsconfig.json +33 -0
  72. package/templates/angular/tsconfig.spec.json +10 -0
  73. package/templates/astro/.env.example +48 -0
  74. package/templates/astro/.vscode/extensions.json +4 -0
  75. package/templates/astro/.vscode/launch.json +11 -0
  76. package/templates/astro/README.md +432 -0
  77. package/templates/astro/_gitignore +25 -0
  78. package/templates/astro/astro.config.mjs +13 -0
  79. package/templates/astro/bd.config.ts +331 -0
  80. package/templates/astro/bd.data-model.config.ts +90 -0
  81. package/templates/astro/package.json +40 -0
  82. package/templates/astro/pnpm-lock.yaml +3788 -0
  83. package/templates/astro/public/favicon.ico +0 -0
  84. package/templates/astro/public/favicon.svg +9 -0
  85. package/templates/astro/src/components/About.astro +59 -0
  86. package/templates/astro/src/components/Banner.astro +78 -0
  87. package/templates/astro/src/components/Blog.astro +62 -0
  88. package/templates/astro/src/components/Booking.astro +285 -0
  89. package/templates/astro/src/components/ContactForm.astro +89 -0
  90. package/templates/astro/src/components/ContactForm.tsx +80 -0
  91. package/templates/astro/src/components/Footer.astro +39 -0
  92. package/templates/astro/src/components/Gallery.astro +77 -0
  93. package/templates/astro/src/components/Header.astro +65 -0
  94. package/templates/astro/src/components/Hero.astro +45 -0
  95. package/templates/astro/src/components/NotFound.astro +22 -0
  96. package/templates/astro/src/components/Reviews.astro +169 -0
  97. package/templates/astro/src/components/SdkSetupBanner.astro +83 -0
  98. package/templates/astro/src/components/Services.astro +87 -0
  99. package/templates/astro/src/components/Subscribe.astro +196 -0
  100. package/templates/astro/src/components/Subscribe.tsx +171 -0
  101. package/templates/astro/src/layouts/Layout.astro +89 -0
  102. package/templates/astro/src/lib/bd-bundle.ts +113 -0
  103. package/templates/astro/src/lib/bd-distribution.ts +36 -0
  104. package/templates/astro/src/lib/bd-portal.ts +158 -0
  105. package/templates/astro/src/lib/bd-seo.ts +81 -0
  106. package/templates/astro/src/lib/bd-store.ts +185 -0
  107. package/templates/astro/src/lib/bd-suspension.ts +67 -0
  108. package/templates/astro/src/lib/bd-todos.ts +124 -0
  109. package/templates/astro/src/lib/bd.ts +73 -0
  110. package/templates/astro/src/pages/.well-known/mcp.json.ts +22 -0
  111. package/templates/astro/src/pages/404.astro +15 -0
  112. package/templates/astro/src/pages/[...slug].astro +50 -0
  113. package/templates/astro/src/pages/ai/product-feed.ts +25 -0
  114. package/templates/astro/src/pages/api/bd/cart/add.ts +41 -0
  115. package/templates/astro/src/pages/api/bd/cart/clear.ts +29 -0
  116. package/templates/astro/src/pages/api/bd/cart/coupon.ts +35 -0
  117. package/templates/astro/src/pages/api/bd/cart/get.ts +28 -0
  118. package/templates/astro/src/pages/api/bd/cart/remove.ts +33 -0
  119. package/templates/astro/src/pages/api/bd/cart/update.ts +41 -0
  120. package/templates/astro/src/pages/api/bd/checkout/start.ts +37 -0
  121. package/templates/astro/src/pages/api/bd/forms/[slug].ts +75 -0
  122. package/templates/astro/src/pages/api/bd/portal/plan.ts +31 -0
  123. package/templates/astro/src/pages/api/bd/portal/submit-review.ts +56 -0
  124. package/templates/astro/src/pages/api/bd/revalidate.ts +49 -0
  125. package/templates/astro/src/pages/api/bd/reviews.ts +39 -0
  126. package/templates/astro/src/pages/api/bd/scheduling/bookings.ts +44 -0
  127. package/templates/astro/src/pages/api/bd/scheduling/slots.ts +40 -0
  128. package/templates/astro/src/pages/api/bd/subscriptions/checkout.ts +29 -0
  129. package/templates/astro/src/pages/api/bd-auth/[...slug].ts +61 -0
  130. package/templates/astro/src/pages/api/mcp.ts +40 -0
  131. package/templates/astro/src/pages/index.astro +47 -0
  132. package/templates/astro/src/pages/llms.txt.ts +25 -0
  133. package/templates/astro/src/pages/my-account.astro +388 -0
  134. package/templates/astro/src/pages/reviews.astro +18 -0
  135. package/templates/astro/src/pages/robots.txt.ts +46 -0
  136. package/templates/astro/src/pages/services/[service]/[area].astro +103 -0
  137. package/templates/astro/src/pages/services/index.astro +104 -0
  138. package/templates/astro/src/pages/sitemap.xml.ts +89 -0
  139. package/templates/astro/src/pages/store/[id].astro +208 -0
  140. package/templates/astro/src/pages/store/cart.astro +458 -0
  141. package/templates/astro/src/pages/store/index.astro +567 -0
  142. package/templates/astro/src/pages/store/subscriptions.astro +155 -0
  143. package/templates/astro/src/pages/todos.astro +199 -0
  144. package/templates/astro/src/pages/updates.astro +135 -0
  145. package/templates/astro/src/styles/global.css +631 -0
  146. package/templates/astro/tsconfig.json +8 -0
  147. package/templates/elixir/.env.example +58 -0
  148. package/templates/elixir/README.md +293 -0
  149. package/templates/elixir/_gitignore +16 -0
  150. package/templates/elixir/assets/js/app.js +16 -0
  151. package/templates/elixir/bd-records/README.md +50 -0
  152. package/templates/elixir/bd-records/todo-images.json +14 -0
  153. package/templates/elixir/bd-records/todos.json +20 -0
  154. package/templates/elixir/bd.config.ts +331 -0
  155. package/templates/elixir/bd.data-model.config.ts +89 -0
  156. package/templates/elixir/config/config.exs +30 -0
  157. package/templates/elixir/config/dev.exs +20 -0
  158. package/templates/elixir/config/prod.exs +6 -0
  159. package/templates/elixir/config/runtime.exs +68 -0
  160. package/templates/elixir/config/test.exs +9 -0
  161. package/templates/elixir/lib/bd_starter/application.ex +29 -0
  162. package/templates/elixir/lib/bd_starter/bd/auth.ex +126 -0
  163. package/templates/elixir/lib/bd_starter/bd/cache.ex +148 -0
  164. package/templates/elixir/lib/bd_starter/bd/chat_session.ex +214 -0
  165. package/templates/elixir/lib/bd_starter/bd/client.ex +203 -0
  166. package/templates/elixir/lib/bd_starter/bd/customer_auth.ex +116 -0
  167. package/templates/elixir/lib/bd_starter/bd/resources/blog.ex +18 -0
  168. package/templates/elixir/lib/bd_starter/bd/resources/cart.ex +40 -0
  169. package/templates/elixir/lib/bd_starter/bd/resources/checkout.ex +22 -0
  170. package/templates/elixir/lib/bd_starter/bd/resources/data_model.ex +53 -0
  171. package/templates/elixir/lib/bd_starter/bd/resources/donations.ex +50 -0
  172. package/templates/elixir/lib/bd_starter/bd/resources/followers.ex +25 -0
  173. package/templates/elixir/lib/bd_starter/bd/resources/forms.ex +29 -0
  174. package/templates/elixir/lib/bd_starter/bd/resources/marketing.ex +20 -0
  175. package/templates/elixir/lib/bd_starter/bd/resources/notifications.ex +87 -0
  176. package/templates/elixir/lib/bd_starter/bd/resources/parallel_pages.ex +21 -0
  177. package/templates/elixir/lib/bd_starter/bd/resources/portal.ex +153 -0
  178. package/templates/elixir/lib/bd_starter/bd/resources/reviews.ex +8 -0
  179. package/templates/elixir/lib/bd_starter/bd/resources/scheduling.ex +122 -0
  180. package/templates/elixir/lib/bd_starter/bd/resources/storefront.ex +47 -0
  181. package/templates/elixir/lib/bd_starter/bd/resources/subscriptions.ex +13 -0
  182. package/templates/elixir/lib/bd_starter/bd/seo.ex +148 -0
  183. package/templates/elixir/lib/bd_starter/bd/sign_in_core.ex +258 -0
  184. package/templates/elixir/lib/bd_starter/bd/social_platforms.ex +46 -0
  185. package/templates/elixir/lib/bd_starter/bd/socials.ex +99 -0
  186. package/templates/elixir/lib/bd_starter/bd/webhook.ex +89 -0
  187. package/templates/elixir/lib/bd_starter/bd.ex +156 -0
  188. package/templates/elixir/lib/bd_starter/forms/backend.ex +74 -0
  189. package/templates/elixir/lib/bd_starter/forms/calculation.ex +158 -0
  190. package/templates/elixir/lib/bd_starter/forms/dates.ex +151 -0
  191. package/templates/elixir/lib/bd_starter/forms/field.ex +211 -0
  192. package/templates/elixir/lib/bd_starter/forms/field_path.ex +18 -0
  193. package/templates/elixir/lib/bd_starter/forms/form_controller.ex +615 -0
  194. package/templates/elixir/lib/bd_starter/forms/form_view.ex +339 -0
  195. package/templates/elixir/lib/bd_starter/forms/forms.ex +37 -0
  196. package/templates/elixir/lib/bd_starter/forms/forms_data.ex +298 -0
  197. package/templates/elixir/lib/bd_starter/forms/formula.ex +602 -0
  198. package/templates/elixir/lib/bd_starter/forms/formula_parser.ex +197 -0
  199. package/templates/elixir/lib/bd_starter/forms/js.ex +501 -0
  200. package/templates/elixir/lib/bd_starter/forms/json.ex +103 -0
  201. package/templates/elixir/lib/bd_starter/forms/messages.ex +95 -0
  202. package/templates/elixir/lib/bd_starter/forms/package_backend.ex +175 -0
  203. package/templates/elixir/lib/bd_starter/forms/quiz_arrange.ex +120 -0
  204. package/templates/elixir/lib/bd_starter/forms/quiz_backend.ex +14 -0
  205. package/templates/elixir/lib/bd_starter/forms/quiz_config.ex +51 -0
  206. package/templates/elixir/lib/bd_starter/forms/quiz_controller.ex +188 -0
  207. package/templates/elixir/lib/bd_starter/forms/quiz_engine.ex +682 -0
  208. package/templates/elixir/lib/bd_starter/forms/quiz_options.ex +99 -0
  209. package/templates/elixir/lib/bd_starter/forms/quiz_page.ex +93 -0
  210. package/templates/elixir/lib/bd_starter/forms/quiz_runs.ex +44 -0
  211. package/templates/elixir/lib/bd_starter/forms/quiz_scoring.ex +397 -0
  212. package/templates/elixir/lib/bd_starter/forms/quiz_state.ex +68 -0
  213. package/templates/elixir/lib/bd_starter/forms/quiz_words.ex +101 -0
  214. package/templates/elixir/lib/bd_starter/forms/quizzes.ex +98 -0
  215. package/templates/elixir/lib/bd_starter/forms/re.ex +22 -0
  216. package/templates/elixir/lib/bd_starter/forms/rules.ex +1355 -0
  217. package/templates/elixir/lib/bd_starter/forms/sample_backend.ex +44 -0
  218. package/templates/elixir/lib/bd_starter/forms/schema.ex +50 -0
  219. package/templates/elixir/lib/bd_starter/forms/submit_result.ex +60 -0
  220. package/templates/elixir/lib/bd_starter/forms/units.ex +75 -0
  221. package/templates/elixir/lib/bd_starter_web/bundle.ex +27 -0
  222. package/templates/elixir/lib/bd_starter_web/components/form_components.ex +779 -0
  223. package/templates/elixir/lib/bd_starter_web/components/layouts/app.html.heex +50 -0
  224. package/templates/elixir/lib/bd_starter_web/components/layouts/root.html.heex +24 -0
  225. package/templates/elixir/lib/bd_starter_web/components/layouts.ex +6 -0
  226. package/templates/elixir/lib/bd_starter_web/controllers/bd_auth_controller.ex +144 -0
  227. package/templates/elixir/lib/bd_starter_web/controllers/bd_customer_auth_controller.ex +224 -0
  228. package/templates/elixir/lib/bd_starter_web/controllers/blog_controller.ex +28 -0
  229. package/templates/elixir/lib/bd_starter_web/controllers/blog_html/index.html.heex +10 -0
  230. package/templates/elixir/lib/bd_starter_web/controllers/blog_html/show.html.heex +20 -0
  231. package/templates/elixir/lib/bd_starter_web/controllers/blog_html.ex +6 -0
  232. package/templates/elixir/lib/bd_starter_web/controllers/cart_controller.ex +140 -0
  233. package/templates/elixir/lib/bd_starter_web/controllers/cart_html/show.html.heex +42 -0
  234. package/templates/elixir/lib/bd_starter_web/controllers/cart_html.ex +6 -0
  235. package/templates/elixir/lib/bd_starter_web/controllers/error_html.ex +8 -0
  236. package/templates/elixir/lib/bd_starter_web/controllers/form_page_controller.ex +77 -0
  237. package/templates/elixir/lib/bd_starter_web/controllers/form_page_html/form.html.heex +2 -0
  238. package/templates/elixir/lib/bd_starter_web/controllers/form_page_html/quiz.html.heex +4 -0
  239. package/templates/elixir/lib/bd_starter_web/controllers/form_page_html.ex +5 -0
  240. package/templates/elixir/lib/bd_starter_web/controllers/page_controller.ex +56 -0
  241. package/templates/elixir/lib/bd_starter_web/controllers/page_html/home.html.heex +53 -0
  242. package/templates/elixir/lib/bd_starter_web/controllers/page_html/reviews.html.heex +10 -0
  243. package/templates/elixir/lib/bd_starter_web/controllers/page_html/updates.html.heex +8 -0
  244. package/templates/elixir/lib/bd_starter_web/controllers/page_html.ex +6 -0
  245. package/templates/elixir/lib/bd_starter_web/controllers/portal_controller.ex +109 -0
  246. package/templates/elixir/lib/bd_starter_web/controllers/portal_html/delete_account.html.heex +31 -0
  247. package/templates/elixir/lib/bd_starter_web/controllers/portal_html/index.html.heex +29 -0
  248. package/templates/elixir/lib/bd_starter_web/controllers/portal_html/sign_in.html.heex +18 -0
  249. package/templates/elixir/lib/bd_starter_web/controllers/portal_html.ex +6 -0
  250. package/templates/elixir/lib/bd_starter_web/controllers/seo_controller.ex +87 -0
  251. package/templates/elixir/lib/bd_starter_web/controllers/service_area_controller.ex +14 -0
  252. package/templates/elixir/lib/bd_starter_web/controllers/service_area_html/index.html.heex +12 -0
  253. package/templates/elixir/lib/bd_starter_web/controllers/service_area_html/show.html.heex +4 -0
  254. package/templates/elixir/lib/bd_starter_web/controllers/service_area_html.ex +6 -0
  255. package/templates/elixir/lib/bd_starter_web/controllers/store_controller.ex +34 -0
  256. package/templates/elixir/lib/bd_starter_web/controllers/store_html/index.html.heex +31 -0
  257. package/templates/elixir/lib/bd_starter_web/controllers/store_html/show.html.heex +29 -0
  258. package/templates/elixir/lib/bd_starter_web/controllers/store_html.ex +6 -0
  259. package/templates/elixir/lib/bd_starter_web/controllers/subscription_controller.ex +31 -0
  260. package/templates/elixir/lib/bd_starter_web/controllers/subscription_html/index.html.heex +14 -0
  261. package/templates/elixir/lib/bd_starter_web/controllers/subscription_html.ex +6 -0
  262. package/templates/elixir/lib/bd_starter_web/controllers/todos_controller.ex +58 -0
  263. package/templates/elixir/lib/bd_starter_web/controllers/todos_html/index.html.heex +38 -0
  264. package/templates/elixir/lib/bd_starter_web/controllers/todos_html.ex +6 -0
  265. package/templates/elixir/lib/bd_starter_web/controllers/webhook_controller.ex +30 -0
  266. package/templates/elixir/lib/bd_starter_web/endpoint.ex +40 -0
  267. package/templates/elixir/lib/bd_starter_web/live/chat_live.ex +113 -0
  268. package/templates/elixir/lib/bd_starter_web/live/form_live.ex +431 -0
  269. package/templates/elixir/lib/bd_starter_web/live/quiz_live.ex +532 -0
  270. package/templates/elixir/lib/bd_starter_web/live/sign_in_live.ex +533 -0
  271. package/templates/elixir/lib/bd_starter_web/money.ex +50 -0
  272. package/templates/elixir/lib/bd_starter_web/plugs/cache_body_reader.ex +33 -0
  273. package/templates/elixir/lib/bd_starter_web/router.ex +110 -0
  274. package/templates/elixir/lib/bd_starter_web.ex +75 -0
  275. package/templates/elixir/mix.exs +42 -0
  276. package/templates/elixir/package.json +20 -0
  277. package/templates/elixir/pnpm-lock.yaml +347 -0
  278. package/templates/elixir/priv/forms/demo-form.json +283 -0
  279. package/templates/elixir/priv/forms/demo-quiz.json +97 -0
  280. package/templates/elixir/priv/static/assets/app.css +113 -0
  281. package/templates/elixir/priv/static/bd-sign-in.css +51 -0
  282. package/templates/elixir/priv/static/forms.css +1153 -0
  283. package/templates/elixir/test/fixtures/forms-parity.json +3806 -0
  284. package/templates/elixir/test/fixtures/quiz-parity.json +9937 -0
  285. package/templates/elixir/test/form_controller_test.exs +314 -0
  286. package/templates/elixir/test/forms_parity_test.exs +206 -0
  287. package/templates/elixir/test/quiz_parity_test.exs +243 -0
  288. package/templates/elixir/test/support/parity.ex +46 -0
  289. package/templates/elixir/test/test_helper.exs +1 -0
  290. package/templates/elixir/tsconfig.json +19 -0
  291. package/templates/flutter/README.md +321 -0
  292. package/templates/flutter/_gitignore +9 -0
  293. package/templates/flutter/analysis_options.yaml +8 -0
  294. package/templates/flutter/bd-records/README.md +50 -0
  295. package/templates/flutter/bd-records/todo-images.json +14 -0
  296. package/templates/flutter/bd-records/todos.json +20 -0
  297. package/templates/flutter/bd.config.ts +331 -0
  298. package/templates/flutter/bd.data-model.config.ts +89 -0
  299. package/templates/flutter/lib/forms/demo_form.dart +289 -0
  300. package/templates/flutter/lib/forms/demo_quiz.dart +104 -0
  301. package/templates/flutter/lib/forms/form_hooks.dart +147 -0
  302. package/templates/flutter/lib/main.dart +120 -0
  303. package/templates/flutter/lib/ui/account_page.dart +153 -0
  304. package/templates/flutter/lib/ui/bd_scope.dart +39 -0
  305. package/templates/flutter/lib/ui/cart_page.dart +102 -0
  306. package/templates/flutter/lib/ui/chat_page.dart +111 -0
  307. package/templates/flutter/lib/ui/form_page.dart +50 -0
  308. package/templates/flutter/lib/ui/load_state.dart +62 -0
  309. package/templates/flutter/lib/ui/product_page.dart +71 -0
  310. package/templates/flutter/lib/ui/quiz_page.dart +83 -0
  311. package/templates/flutter/lib/ui/storefront_page.dart +85 -0
  312. package/templates/flutter/package.json +20 -0
  313. package/templates/flutter/packages/businessdash_forms/analysis_options.yaml +8 -0
  314. package/templates/flutter/packages/businessdash_forms/lib/businessdash_forms.dart +47 -0
  315. package/templates/flutter/packages/businessdash_forms/lib/src/controls/choice.dart +865 -0
  316. package/templates/flutter/packages/businessdash_forms/lib/src/controls/dates.dart +527 -0
  317. package/templates/flutter/packages/businessdash_forms/lib/src/controls/media.dart +507 -0
  318. package/templates/flutter/packages/businessdash_forms/lib/src/controls/static.dart +302 -0
  319. package/templates/flutter/packages/businessdash_forms/lib/src/controls/text.dart +537 -0
  320. package/templates/flutter/packages/businessdash_forms/lib/src/form.dart +781 -0
  321. package/templates/flutter/packages/businessdash_forms/lib/src/icons.dart +398 -0
  322. package/templates/flutter/packages/businessdash_forms/lib/src/logic.dart +719 -0
  323. package/templates/flutter/packages/businessdash_forms/lib/src/primitives.dart +1223 -0
  324. package/templates/flutter/packages/businessdash_forms/lib/src/quiz.dart +1225 -0
  325. package/templates/flutter/packages/businessdash_forms/lib/src/sign_in.dart +570 -0
  326. package/templates/flutter/packages/businessdash_forms/lib/src/sign_in_core.dart +1069 -0
  327. package/templates/flutter/packages/businessdash_forms/lib/src/style.dart +497 -0
  328. package/templates/flutter/packages/businessdash_forms/lib/src/tree.dart +491 -0
  329. package/templates/flutter/packages/businessdash_forms/pubspec.yaml +34 -0
  330. package/templates/flutter/packages/businessdash_forms/test/form_widget_test.dart +358 -0
  331. package/templates/flutter/packages/businessdash_forms/test/logic_test.dart +207 -0
  332. package/templates/flutter/packages/businessdash_forms/test/quiz_widget_test.dart +221 -0
  333. package/templates/flutter/packages/businessdash_forms/test/sign_in_test.dart +279 -0
  334. package/templates/flutter/packages/businessdash_sdk/CHANGELOG.md +66 -0
  335. package/templates/flutter/packages/businessdash_sdk/LICENSE +21 -0
  336. package/templates/flutter/packages/businessdash_sdk/analysis_options.yaml +6 -0
  337. package/templates/flutter/packages/businessdash_sdk/lib/businessdash_sdk.dart +21 -0
  338. package/templates/flutter/packages/businessdash_sdk/lib/forms.dart +29 -0
  339. package/templates/flutter/packages/businessdash_sdk/lib/src/bundle.dart +34 -0
  340. package/templates/flutter/packages/businessdash_sdk/lib/src/chat.dart +122 -0
  341. package/templates/flutter/packages/businessdash_sdk/lib/src/client.dart +161 -0
  342. package/templates/flutter/packages/businessdash_sdk/lib/src/customer_account.dart +31 -0
  343. package/templates/flutter/packages/businessdash_sdk/lib/src/donations.dart +179 -0
  344. package/templates/flutter/packages/businessdash_sdk/lib/src/errors.dart +82 -0
  345. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/backend.dart +488 -0
  346. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/calculation.dart +172 -0
  347. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/controller.dart +1004 -0
  348. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/dates.dart +173 -0
  349. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/forms_data.generated.dart +405 -0
  350. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/formula.dart +920 -0
  351. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/json.dart +462 -0
  352. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/quiz.dart +1185 -0
  353. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/quiz_backend.dart +382 -0
  354. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/quiz_controller.dart +277 -0
  355. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/quiz_page.dart +148 -0
  356. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/quiz_scoring.dart +550 -0
  357. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/quiz_screen.dart +388 -0
  358. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/quiz_words.dart +280 -0
  359. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/rules.dart +1268 -0
  360. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/schema.dart +1114 -0
  361. package/templates/flutter/packages/businessdash_sdk/lib/src/forms/units.dart +105 -0
  362. package/templates/flutter/packages/businessdash_sdk/lib/src/models.dart +311 -0
  363. package/templates/flutter/packages/businessdash_sdk/lib/src/money.dart +38 -0
  364. package/templates/flutter/packages/businessdash_sdk/lib/src/portal.dart +227 -0
  365. package/templates/flutter/packages/businessdash_sdk/lib/src/resources.dart +164 -0
  366. package/templates/flutter/packages/businessdash_sdk/lib/src/scheduling.dart +135 -0
  367. package/templates/flutter/packages/businessdash_sdk/lib/src/seo.dart +144 -0
  368. package/templates/flutter/packages/businessdash_sdk/lib/src/social_platforms.generated.dart +45 -0
  369. package/templates/flutter/packages/businessdash_sdk/lib/src/socials.dart +88 -0
  370. package/templates/flutter/packages/businessdash_sdk/pubspec.yaml +23 -0
  371. package/templates/flutter/packages/businessdash_sdk/test/bd_test.dart +335 -0
  372. package/templates/flutter/packages/businessdash_sdk/test/fixtures/forms-parity.json +3806 -0
  373. package/templates/flutter/packages/businessdash_sdk/test/fixtures/quiz-parity.json +9937 -0
  374. package/templates/flutter/packages/businessdash_sdk/test/form_controller_test.dart +449 -0
  375. package/templates/flutter/packages/businessdash_sdk/test/forms_parity_test.dart +254 -0
  376. package/templates/flutter/packages/businessdash_sdk/test/quiz_controller_test.dart +390 -0
  377. package/templates/flutter/packages/businessdash_sdk/test/quiz_parity_test.dart +269 -0
  378. package/templates/flutter/pnpm-lock.yaml +347 -0
  379. package/templates/flutter/pubspec.yaml +33 -0
  380. package/templates/flutter/tsconfig.json +19 -0
  381. package/templates/htmx/.env.example +59 -0
  382. package/templates/htmx/README.md +446 -0
  383. package/templates/htmx/_gitignore +7 -0
  384. package/templates/htmx/bd.config.ts +331 -0
  385. package/templates/htmx/bd.data-model.config.ts +89 -0
  386. package/templates/htmx/package.json +27 -0
  387. package/templates/htmx/pnpm-lock.yaml +97 -0
  388. package/templates/htmx/public/forms.css +1134 -0
  389. package/templates/htmx/public/index.html +68 -0
  390. package/templates/htmx/public/styles.css +1078 -0
  391. package/templates/htmx/server.ts +387 -0
  392. package/templates/htmx/src/bd.ts +142 -0
  393. package/templates/htmx/src/cache.ts +45 -0
  394. package/templates/htmx/src/form-pages.ts +35 -0
  395. package/templates/htmx/src/form.ts +955 -0
  396. package/templates/htmx/src/forms/demo-form.json +283 -0
  397. package/templates/htmx/src/forms/demo-quiz.json +97 -0
  398. package/templates/htmx/src/html.ts +55 -0
  399. package/templates/htmx/src/layout.ts +232 -0
  400. package/templates/htmx/src/pages.ts +975 -0
  401. package/templates/htmx/src/quiz.ts +582 -0
  402. package/templates/htmx/src/sections/about.ts +63 -0
  403. package/templates/htmx/src/sections/blog.ts +53 -0
  404. package/templates/htmx/src/sections/header.ts +42 -0
  405. package/templates/htmx/src/sections/hero.ts +48 -0
  406. package/templates/htmx/src/sections/services.ts +71 -0
  407. package/templates/htmx/src/sections/subscribe.ts +141 -0
  408. package/templates/htmx/src/sign-in.ts +636 -0
  409. package/templates/htmx/tsconfig.json +19 -0
  410. package/templates/kotlin/README.md +318 -0
  411. package/templates/kotlin/_gitignore +12 -0
  412. package/templates/kotlin/app/build.gradle.kts +70 -0
  413. package/templates/kotlin/app/src/main/AndroidManifest.xml +21 -0
  414. package/templates/kotlin/app/src/main/assets/bd-demo-form.json +283 -0
  415. package/templates/kotlin/app/src/main/assets/bd-demo-quiz.json +97 -0
  416. package/templates/kotlin/app/src/main/kotlin/app/bdstarter/AccountScreen.kt +209 -0
  417. package/templates/kotlin/app/src/main/kotlin/app/bdstarter/BdApp.kt +68 -0
  418. package/templates/kotlin/app/src/main/kotlin/app/bdstarter/DemoFormsBackend.kt +52 -0
  419. package/templates/kotlin/app/src/main/kotlin/app/bdstarter/FormScreen.kt +37 -0
  420. package/templates/kotlin/app/src/main/kotlin/app/bdstarter/MainActivity.kt +186 -0
  421. package/templates/kotlin/app/src/main/kotlin/app/bdstarter/QuizScreen.kt +75 -0
  422. package/templates/kotlin/app/src/main/kotlin/app/bdstarter/SessionStore.kt +68 -0
  423. package/templates/kotlin/app/src/main/kotlin/app/bdstarter/ShopViewModel.kt +73 -0
  424. package/templates/kotlin/app/src/main/res/values/strings.xml +4 -0
  425. package/templates/kotlin/app/src/main/res/values/themes.xml +5 -0
  426. package/templates/kotlin/app/src/main/res/values-night/themes.xml +4 -0
  427. package/templates/kotlin/bd/LICENSE +21 -0
  428. package/templates/kotlin/bd/README.md +31 -0
  429. package/templates/kotlin/bd/build.gradle.kts +126 -0
  430. package/templates/kotlin/bd/src/main/kotlin/app/bd/Auth.kt +58 -0
  431. package/templates/kotlin/bd/src/main/kotlin/app/bd/BdClient.kt +166 -0
  432. package/templates/kotlin/bd/src/main/kotlin/app/bd/BdError.kt +62 -0
  433. package/templates/kotlin/bd/src/main/kotlin/app/bd/Bundle.kt +52 -0
  434. package/templates/kotlin/bd/src/main/kotlin/app/bd/ChatFeed.kt +82 -0
  435. package/templates/kotlin/bd/src/main/kotlin/app/bd/DataModel.kt +95 -0
  436. package/templates/kotlin/bd/src/main/kotlin/app/bd/Donations.kt +111 -0
  437. package/templates/kotlin/bd/src/main/kotlin/app/bd/Models.kt +271 -0
  438. package/templates/kotlin/bd/src/main/kotlin/app/bd/Money.kt +48 -0
  439. package/templates/kotlin/bd/src/main/kotlin/app/bd/Portal.kt +250 -0
  440. package/templates/kotlin/bd/src/main/kotlin/app/bd/Resources.kt +129 -0
  441. package/templates/kotlin/bd/src/main/kotlin/app/bd/Scheduling.kt +134 -0
  442. package/templates/kotlin/bd/src/main/kotlin/app/bd/Seo.kt +120 -0
  443. package/templates/kotlin/bd/src/main/kotlin/app/bd/SocialPlatforms.generated.kt +46 -0
  444. package/templates/kotlin/bd/src/main/kotlin/app/bd/Socials.kt +79 -0
  445. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdCalculation.kt +157 -0
  446. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdDates.kt +108 -0
  447. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdFormController.kt +770 -0
  448. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdFormRules.kt +1149 -0
  449. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdFormSchema.kt +528 -0
  450. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdFormsBackend.kt +392 -0
  451. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdFormula.kt +767 -0
  452. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdJson.kt +294 -0
  453. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdQuizBackend.kt +310 -0
  454. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdQuizController.kt +281 -0
  455. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdQuizEngine.kt +578 -0
  456. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdQuizPage.kt +128 -0
  457. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdQuizScoring.kt +386 -0
  458. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdQuizScreen.kt +477 -0
  459. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdQuizWords.kt +196 -0
  460. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/BdUnits.kt +84 -0
  461. package/templates/kotlin/bd/src/main/kotlin/app/bd/forms/FormsData.generated.kt +292 -0
  462. package/templates/kotlin/bd/src/test/kotlin/app/bd/BdClientTest.kt +278 -0
  463. package/templates/kotlin/bd/src/test/kotlin/app/bd/forms/FormControllerTest.kt +294 -0
  464. package/templates/kotlin/bd/src/test/kotlin/app/bd/forms/FormsBackendPathTest.kt +27 -0
  465. package/templates/kotlin/bd/src/test/kotlin/app/bd/forms/FormsParityTest.kt +233 -0
  466. package/templates/kotlin/bd/src/test/kotlin/app/bd/forms/PackageFormsBackendTest.kt +123 -0
  467. package/templates/kotlin/bd/src/test/kotlin/app/bd/forms/QuizControllerTest.kt +359 -0
  468. package/templates/kotlin/bd/src/test/kotlin/app/bd/forms/QuizParityTest.kt +260 -0
  469. package/templates/kotlin/bd/src/test/resources/forms-parity.json +3806 -0
  470. package/templates/kotlin/bd/src/test/resources/quiz-parity.json +9937 -0
  471. package/templates/kotlin/bd-forms/build.gradle.kts +51 -0
  472. package/templates/kotlin/bd-forms/src/main/AndroidManifest.xml +5 -0
  473. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdChoiceControls.kt +651 -0
  474. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdDateControls.kt +470 -0
  475. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdFieldControl.kt +520 -0
  476. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdFieldTree.kt +328 -0
  477. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdForm.kt +573 -0
  478. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdFormStyle.kt +279 -0
  479. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdHtml.kt +438 -0
  480. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdIcon.kt +282 -0
  481. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdMediaControls.kt +412 -0
  482. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdQuiz.kt +896 -0
  483. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdStaticViews.kt +250 -0
  484. package/templates/kotlin/bd-forms/src/main/kotlin/app/bd/forms/ui/BdTextControls.kt +409 -0
  485. package/templates/kotlin/bd-forms/src/test/kotlin/app/bd/forms/ui/RendererLogicTest.kt +177 -0
  486. package/templates/kotlin/bd-records/README.md +50 -0
  487. package/templates/kotlin/bd-records/todo-images.json +14 -0
  488. package/templates/kotlin/bd-records/todos.json +20 -0
  489. package/templates/kotlin/bd-sign-in/build.gradle.kts +49 -0
  490. package/templates/kotlin/bd-sign-in/src/main/AndroidManifest.xml +27 -0
  491. package/templates/kotlin/bd-sign-in/src/main/kotlin/app/bd/signin/BdSignIn.kt +713 -0
  492. package/templates/kotlin/bd-sign-in/src/main/kotlin/app/bd/signin/BdSignInBackend.kt +291 -0
  493. package/templates/kotlin/bd-sign-in/src/main/kotlin/app/bd/signin/BdSignInChecks.kt +162 -0
  494. package/templates/kotlin/bd-sign-in/src/main/kotlin/app/bd/signin/BdSignInOAuth.kt +95 -0
  495. package/templates/kotlin/bd-sign-in/src/test/kotlin/app/bd/signin/BdSignInChecksTest.kt +64 -0
  496. package/templates/kotlin/bd.config.ts +331 -0
  497. package/templates/kotlin/bd.data-model.config.ts +89 -0
  498. package/templates/kotlin/build.gradle.kts +8 -0
  499. package/templates/kotlin/gradle/libs.versions.toml +38 -0
  500. package/templates/kotlin/gradle/wrapper/gradle-wrapper.jar +0 -0
  501. package/templates/kotlin/gradle/wrapper/gradle-wrapper.properties +10 -0
  502. package/templates/kotlin/gradle.properties +8 -0
  503. package/templates/kotlin/gradlew +248 -0
  504. package/templates/kotlin/gradlew.bat +112 -0
  505. package/templates/kotlin/local.properties.example +30 -0
  506. package/templates/kotlin/package.json +20 -0
  507. package/templates/kotlin/pnpm-lock.yaml +347 -0
  508. package/templates/kotlin/settings.gradle.kts +39 -0
  509. package/templates/kotlin/tsconfig.json +19 -0
  510. package/templates/laravel/.env.example +76 -0
  511. package/templates/laravel/README.md +316 -0
  512. package/templates/laravel/_gitignore +28 -0
  513. package/templates/laravel/app/Bd/Auth.php +181 -0
  514. package/templates/laravel/app/Bd/Bd.php +131 -0
  515. package/templates/laravel/app/Bd/BdAccessRejectedException.php +29 -0
  516. package/templates/laravel/app/Bd/BdApiException.php +18 -0
  517. package/templates/laravel/app/Bd/Client.php +358 -0
  518. package/templates/laravel/app/Bd/CustomerAnswer.php +58 -0
  519. package/templates/laravel/app/Bd/CustomerAuth.php +93 -0
  520. package/templates/laravel/app/Bd/Forms/Backend.php +35 -0
  521. package/templates/laravel/app/Bd/Forms/Calculation.php +179 -0
  522. package/templates/laravel/app/Bd/Forms/Dates.php +91 -0
  523. package/templates/laravel/app/Bd/Forms/Field.php +274 -0
  524. package/templates/laravel/app/Bd/Forms/FieldPath.php +36 -0
  525. package/templates/laravel/app/Bd/Forms/FormController.php +730 -0
  526. package/templates/laravel/app/Bd/Forms/FormView.php +307 -0
  527. package/templates/laravel/app/Bd/Forms/Forms.php +39 -0
  528. package/templates/laravel/app/Bd/Forms/FormsData.php +298 -0
  529. package/templates/laravel/app/Bd/Forms/FormsError.php +12 -0
  530. package/templates/laravel/app/Bd/Forms/Formula.php +696 -0
  531. package/templates/laravel/app/Bd/Forms/FormulaError.php +6 -0
  532. package/templates/laravel/app/Bd/Forms/FormulaParser.php +223 -0
  533. package/templates/laravel/app/Bd/Forms/Js.php +300 -0
  534. package/templates/laravel/app/Bd/Forms/Json.php +254 -0
  535. package/templates/laravel/app/Bd/Forms/Messages.php +89 -0
  536. package/templates/laravel/app/Bd/Forms/PackageBackend.php +181 -0
  537. package/templates/laravel/app/Bd/Forms/PickedFile.php +25 -0
  538. package/templates/laravel/app/Bd/Forms/QuizArrange.php +144 -0
  539. package/templates/laravel/app/Bd/Forms/QuizBackend.php +26 -0
  540. package/templates/laravel/app/Bd/Forms/QuizConfig.php +65 -0
  541. package/templates/laravel/app/Bd/Forms/QuizController.php +232 -0
  542. package/templates/laravel/app/Bd/Forms/QuizEngine.php +712 -0
  543. package/templates/laravel/app/Bd/Forms/QuizOptions.php +109 -0
  544. package/templates/laravel/app/Bd/Forms/QuizPage.php +99 -0
  545. package/templates/laravel/app/Bd/Forms/QuizScoring.php +459 -0
  546. package/templates/laravel/app/Bd/Forms/QuizState.php +96 -0
  547. package/templates/laravel/app/Bd/Forms/QuizWords.php +188 -0
  548. package/templates/laravel/app/Bd/Forms/Quizzes.php +123 -0
  549. package/templates/laravel/app/Bd/Forms/Rules.php +1593 -0
  550. package/templates/laravel/app/Bd/Forms/SampleBackend.php +48 -0
  551. package/templates/laravel/app/Bd/Forms/Schema.php +76 -0
  552. package/templates/laravel/app/Bd/Forms/Submission.php +33 -0
  553. package/templates/laravel/app/Bd/Forms/SubmitOptions.php +19 -0
  554. package/templates/laravel/app/Bd/Forms/SubmitResult.php +69 -0
  555. package/templates/laravel/app/Bd/Forms/Undefined.php +28 -0
  556. package/templates/laravel/app/Bd/Forms/Units.php +113 -0
  557. package/templates/laravel/app/Bd/Resources/Blog.php +50 -0
  558. package/templates/laravel/app/Bd/Resources/Cart.php +81 -0
  559. package/templates/laravel/app/Bd/Resources/Chatbot.php +117 -0
  560. package/templates/laravel/app/Bd/Resources/Checkout.php +51 -0
  561. package/templates/laravel/app/Bd/Resources/DataModel.php +61 -0
  562. package/templates/laravel/app/Bd/Resources/Donations.php +74 -0
  563. package/templates/laravel/app/Bd/Resources/Followers.php +48 -0
  564. package/templates/laravel/app/Bd/Resources/Forms.php +52 -0
  565. package/templates/laravel/app/Bd/Resources/Marketing.php +47 -0
  566. package/templates/laravel/app/Bd/Resources/Notifications.php +130 -0
  567. package/templates/laravel/app/Bd/Resources/ParallelPages.php +45 -0
  568. package/templates/laravel/app/Bd/Resources/Portal.php +241 -0
  569. package/templates/laravel/app/Bd/Resources/Reviews.php +22 -0
  570. package/templates/laravel/app/Bd/Resources/Scheduling.php +170 -0
  571. package/templates/laravel/app/Bd/Resources/Storefront.php +89 -0
  572. package/templates/laravel/app/Bd/Resources/Subscriptions.php +34 -0
  573. package/templates/laravel/app/Bd/Seo.php +167 -0
  574. package/templates/laravel/app/Bd/SignInCore.php +276 -0
  575. package/templates/laravel/app/Bd/SocialPlatforms.php +45 -0
  576. package/templates/laravel/app/Bd/Socials.php +118 -0
  577. package/templates/laravel/app/Bd/Webhook.php +93 -0
  578. package/templates/laravel/app/Http/Controllers/BdAuthController.php +146 -0
  579. package/templates/laravel/app/Http/Controllers/BdCustomerAuthController.php +214 -0
  580. package/templates/laravel/app/Http/Controllers/BlogController.php +49 -0
  581. package/templates/laravel/app/Http/Controllers/CartController.php +183 -0
  582. package/templates/laravel/app/Http/Controllers/Controller.php +8 -0
  583. package/templates/laravel/app/Http/Controllers/FormPageController.php +55 -0
  584. package/templates/laravel/app/Http/Controllers/HomeController.php +104 -0
  585. package/templates/laravel/app/Http/Controllers/PortalController.php +95 -0
  586. package/templates/laravel/app/Http/Controllers/SeoController.php +103 -0
  587. package/templates/laravel/app/Http/Controllers/ServiceAreaController.php +56 -0
  588. package/templates/laravel/app/Http/Controllers/StoreController.php +78 -0
  589. package/templates/laravel/app/Http/Controllers/SubscriptionController.php +40 -0
  590. package/templates/laravel/app/Http/Controllers/TodosController.php +87 -0
  591. package/templates/laravel/app/Http/Controllers/WebhookController.php +44 -0
  592. package/templates/laravel/app/Livewire/BdForm.php +508 -0
  593. package/templates/laravel/app/Livewire/BdQuiz.php +429 -0
  594. package/templates/laravel/app/Livewire/SignIn.php +449 -0
  595. package/templates/laravel/app/Support/Money.php +54 -0
  596. package/templates/laravel/app/Support/PhpSecurity.php +94 -0
  597. package/templates/laravel/artisan +16 -0
  598. package/templates/laravel/bd-records/README.md +50 -0
  599. package/templates/laravel/bd-records/todo-images.json +14 -0
  600. package/templates/laravel/bd-records/todos.json +20 -0
  601. package/templates/laravel/bd.config.ts +331 -0
  602. package/templates/laravel/bd.data-model.config.ts +89 -0
  603. package/templates/laravel/bootstrap/app.php +33 -0
  604. package/templates/laravel/bootstrap/cache/.gitkeep +0 -0
  605. package/templates/laravel/composer.json +47 -0
  606. package/templates/laravel/config/bd.php +75 -0
  607. package/templates/laravel/package.json +20 -0
  608. package/templates/laravel/phpunit.xml +22 -0
  609. package/templates/laravel/pnpm-lock.yaml +347 -0
  610. package/templates/laravel/public/bd-sign-in.css +48 -0
  611. package/templates/laravel/public/forms.css +1153 -0
  612. package/templates/laravel/public/index.php +17 -0
  613. package/templates/laravel/public/styles.css +100 -0
  614. package/templates/laravel/resources/forms/demo-form.json +283 -0
  615. package/templates/laravel/resources/forms/demo-quiz.json +97 -0
  616. package/templates/laravel/resources/views/forms/control.blade.php +238 -0
  617. package/templates/laravel/resources/views/forms/field.blade.php +39 -0
  618. package/templates/laravel/resources/views/forms/files.blade.php +36 -0
  619. package/templates/laravel/resources/views/forms/pair.blade.php +6 -0
  620. package/templates/laravel/resources/views/forms/repeater.blade.php +16 -0
  621. package/templates/laravel/resources/views/forms/styles.blade.php +8 -0
  622. package/templates/laravel/resources/views/forms/tree.blade.php +58 -0
  623. package/templates/laravel/resources/views/layout.blade.php +94 -0
  624. package/templates/laravel/resources/views/livewire/bd-form.blade.php +103 -0
  625. package/templates/laravel/resources/views/livewire/bd-quiz.blade.php +101 -0
  626. package/templates/laravel/resources/views/livewire/sign-in.blade.php +82 -0
  627. package/templates/laravel/resources/views/pages/blog-post.blade.php +24 -0
  628. package/templates/laravel/resources/views/pages/blog.blade.php +15 -0
  629. package/templates/laravel/resources/views/pages/cart.blade.php +41 -0
  630. package/templates/laravel/resources/views/pages/delete-account.blade.php +26 -0
  631. package/templates/laravel/resources/views/pages/form.blade.php +10 -0
  632. package/templates/laravel/resources/views/pages/home.blade.php +73 -0
  633. package/templates/laravel/resources/views/pages/my-account.blade.php +40 -0
  634. package/templates/laravel/resources/views/pages/product.blade.php +39 -0
  635. package/templates/laravel/resources/views/pages/quiz.blade.php +12 -0
  636. package/templates/laravel/resources/views/pages/reviews.blade.php +17 -0
  637. package/templates/laravel/resources/views/pages/service-area.blade.php +14 -0
  638. package/templates/laravel/resources/views/pages/services.blade.php +20 -0
  639. package/templates/laravel/resources/views/pages/sign-in.blade.php +30 -0
  640. package/templates/laravel/resources/views/pages/store.blade.php +35 -0
  641. package/templates/laravel/resources/views/pages/subscriptions.blade.php +19 -0
  642. package/templates/laravel/resources/views/pages/todos.blade.php +45 -0
  643. package/templates/laravel/resources/views/pages/updates.blade.php +13 -0
  644. package/templates/laravel/resources/views/quiz/actions.blade.php +14 -0
  645. package/templates/laravel/resources/views/quiz/error.blade.php +3 -0
  646. package/templates/laravel/resources/views/quiz/feedback.blade.php +19 -0
  647. package/templates/laravel/resources/views/quiz/header.blade.php +10 -0
  648. package/templates/laravel/resources/views/quiz/question.blade.php +55 -0
  649. package/templates/laravel/routes/web.php +97 -0
  650. package/templates/laravel/storage/framework/cache/.gitkeep +0 -0
  651. package/templates/laravel/storage/framework/sessions/.gitkeep +0 -0
  652. package/templates/laravel/storage/framework/views/.gitkeep +0 -0
  653. package/templates/laravel/storage/logs/.gitkeep +0 -0
  654. package/templates/laravel/tests/Fixtures/forms-parity.json +3806 -0
  655. package/templates/laravel/tests/Fixtures/quiz-parity.json +9937 -0
  656. package/templates/laravel/tests/Unit/FormControllerTest.php +310 -0
  657. package/templates/laravel/tests/Unit/FormsParityTest.php +314 -0
  658. package/templates/laravel/tests/Unit/PhpSecurityTest.php +38 -0
  659. package/templates/laravel/tests/Unit/QuizParityTest.php +303 -0
  660. package/templates/laravel/tsconfig.json +19 -0
  661. package/templates/nuxt/.env.example +47 -0
  662. package/templates/nuxt/README.md +446 -0
  663. package/templates/nuxt/_gitignore +10 -0
  664. package/templates/nuxt/app/app.vue +28 -0
  665. package/templates/nuxt/app/assets/css/bd-tokens.css +944 -0
  666. package/templates/nuxt/app/components/bd/About.vue +34 -0
  667. package/templates/nuxt/app/components/bd/BdFooter.vue +22 -0
  668. package/templates/nuxt/app/components/bd/BdHeader.vue +25 -0
  669. package/templates/nuxt/app/components/bd/Blog.vue +43 -0
  670. package/templates/nuxt/app/components/bd/Booking.vue +235 -0
  671. package/templates/nuxt/app/components/bd/ContactForm.vue +111 -0
  672. package/templates/nuxt/app/components/bd/Gallery.vue +46 -0
  673. package/templates/nuxt/app/components/bd/Hero.vue +14 -0
  674. package/templates/nuxt/app/components/bd/NewsBanner.vue +44 -0
  675. package/templates/nuxt/app/components/bd/NotFoundBody.vue +22 -0
  676. package/templates/nuxt/app/components/bd/ReviewForm.vue +106 -0
  677. package/templates/nuxt/app/components/bd/SdkSetupBanner.vue +111 -0
  678. package/templates/nuxt/app/components/bd/Services.vue +34 -0
  679. package/templates/nuxt/app/components/bd/Subscribe.vue +205 -0
  680. package/templates/nuxt/app/composables/useCart.ts +83 -0
  681. package/templates/nuxt/app/pages/[...slug].vue +52 -0
  682. package/templates/nuxt/app/pages/cart.vue +194 -0
  683. package/templates/nuxt/app/pages/index.vue +58 -0
  684. package/templates/nuxt/app/pages/my-account.vue +207 -0
  685. package/templates/nuxt/app/pages/reviews.vue +104 -0
  686. package/templates/nuxt/app/pages/services/[service]/[area].vue +85 -0
  687. package/templates/nuxt/app/pages/services/index.vue +57 -0
  688. package/templates/nuxt/app/pages/store/[id].vue +128 -0
  689. package/templates/nuxt/app/pages/store/index.vue +73 -0
  690. package/templates/nuxt/app/pages/subscriptions.vue +117 -0
  691. package/templates/nuxt/app/pages/todos.vue +222 -0
  692. package/templates/nuxt/app/pages/updates.vue +78 -0
  693. package/templates/nuxt/bd.config.ts +331 -0
  694. package/templates/nuxt/bd.data-model.config.ts +89 -0
  695. package/templates/nuxt/nuxt.config.ts +78 -0
  696. package/templates/nuxt/package.json +35 -0
  697. package/templates/nuxt/pnpm-lock.yaml +6211 -0
  698. package/templates/nuxt/public/favicon.ico +0 -0
  699. package/templates/nuxt/server/api/bd/cart/add.post.ts +21 -0
  700. package/templates/nuxt/server/api/bd/cart/clear.post.ts +10 -0
  701. package/templates/nuxt/server/api/bd/cart/coupon.post.ts +15 -0
  702. package/templates/nuxt/server/api/bd/cart/index.get.ts +25 -0
  703. package/templates/nuxt/server/api/bd/cart/remove.post.ts +10 -0
  704. package/templates/nuxt/server/api/bd/cart/update.post.ts +13 -0
  705. package/templates/nuxt/server/api/bd/checkout/start.post.ts +35 -0
  706. package/templates/nuxt/server/api/bd/forms/[slug].post.ts +37 -0
  707. package/templates/nuxt/server/api/bd/home.get.ts +284 -0
  708. package/templates/nuxt/server/api/bd/jsonld.get.ts +42 -0
  709. package/templates/nuxt/server/api/bd/legal.get.ts +30 -0
  710. package/templates/nuxt/server/api/bd/parallel/render.get.ts +53 -0
  711. package/templates/nuxt/server/api/bd/parallel/variants.get.ts +27 -0
  712. package/templates/nuxt/server/api/bd/portal/context.get.ts +76 -0
  713. package/templates/nuxt/server/api/bd/portal/plan.post.ts +27 -0
  714. package/templates/nuxt/server/api/bd/portal/submit-review.post.ts +53 -0
  715. package/templates/nuxt/server/api/bd/revalidate.post.ts +38 -0
  716. package/templates/nuxt/server/api/bd/reviews.get.ts +44 -0
  717. package/templates/nuxt/server/api/bd/scheduling/bookings.post.ts +40 -0
  718. package/templates/nuxt/server/api/bd/scheduling/slots.get.ts +37 -0
  719. package/templates/nuxt/server/api/bd/store/product/[id].get.ts +39 -0
  720. package/templates/nuxt/server/api/bd/store/products-meta.get.ts +101 -0
  721. package/templates/nuxt/server/api/bd/store/products.get.ts +53 -0
  722. package/templates/nuxt/server/api/bd/store/subscriptions/[id]/checkout.post.ts +36 -0
  723. package/templates/nuxt/server/api/bd/store/subscriptions.get.ts +42 -0
  724. package/templates/nuxt/server/api/bd/todos.get.ts +111 -0
  725. package/templates/nuxt/server/api/bd-auth/[...slug].ts +57 -0
  726. package/templates/nuxt/server/api/mcp.get.ts +14 -0
  727. package/templates/nuxt/server/api/mcp.post.ts +37 -0
  728. package/templates/nuxt/server/routes/.well-known/mcp.json.ts +31 -0
  729. package/templates/nuxt/server/routes/llms.txt.ts +43 -0
  730. package/templates/nuxt/server/routes/robots.txt.ts +38 -0
  731. package/templates/nuxt/server/routes/sitemap.xml.ts +60 -0
  732. package/templates/nuxt/server/utils/bd-cart.ts +73 -0
  733. package/templates/nuxt/server/utils/bd-env.ts +54 -0
  734. package/templates/nuxt/server/utils/bd-portal.ts +151 -0
  735. package/templates/nuxt/server/utils/bd.ts +36 -0
  736. package/templates/nuxt/tsconfig.json +18 -0
  737. package/templates/qwik/.env.example +48 -0
  738. package/templates/qwik/.prettierignore +37 -0
  739. package/templates/qwik/.vscode/launch.json +24 -0
  740. package/templates/qwik/.vscode/qwik-city.code-snippets +36 -0
  741. package/templates/qwik/.vscode/qwik.code-snippets +78 -0
  742. package/templates/qwik/README.md +436 -0
  743. package/templates/qwik/_gitignore +42 -0
  744. package/templates/qwik/bd.config.ts +331 -0
  745. package/templates/qwik/bd.data-model.config.ts +90 -0
  746. package/templates/qwik/eslint.config.js +76 -0
  747. package/templates/qwik/package.json +58 -0
  748. package/templates/qwik/pnpm-lock.yaml +4928 -0
  749. package/templates/qwik/public/favicon.svg +1 -0
  750. package/templates/qwik/public/manifest.json +9 -0
  751. package/templates/qwik/public/robots.txt +0 -0
  752. package/templates/qwik/qwik.env.d.ts +4 -0
  753. package/templates/qwik/src/components/bd/About.tsx +26 -0
  754. package/templates/qwik/src/components/bd/Banner.tsx +46 -0
  755. package/templates/qwik/src/components/bd/Blog.tsx +53 -0
  756. package/templates/qwik/src/components/bd/Booking.tsx +296 -0
  757. package/templates/qwik/src/components/bd/ContactForm.tsx +100 -0
  758. package/templates/qwik/src/components/bd/Footer.tsx +28 -0
  759. package/templates/qwik/src/components/bd/Gallery.tsx +53 -0
  760. package/templates/qwik/src/components/bd/Header.tsx +18 -0
  761. package/templates/qwik/src/components/bd/Hero.tsx +21 -0
  762. package/templates/qwik/src/components/bd/SdkSetupBanner.tsx +115 -0
  763. package/templates/qwik/src/components/bd/Services.tsx +38 -0
  764. package/templates/qwik/src/components/bd/SiteHeader.tsx +49 -0
  765. package/templates/qwik/src/components/bd/Stars.tsx +46 -0
  766. package/templates/qwik/src/components/bd/Subscribe.tsx +175 -0
  767. package/templates/qwik/src/components/router-head/router-head.tsx +48 -0
  768. package/templates/qwik/src/entry.dev.tsx +17 -0
  769. package/templates/qwik/src/entry.preview.tsx +21 -0
  770. package/templates/qwik/src/entry.ssr.tsx +31 -0
  771. package/templates/qwik/src/global.css +875 -0
  772. package/templates/qwik/src/lib/bd-content.ts +143 -0
  773. package/templates/qwik/src/lib/bd-distribution.ts +25 -0
  774. package/templates/qwik/src/lib/bd-portal.ts +181 -0
  775. package/templates/qwik/src/lib/bd-store.ts +308 -0
  776. package/templates/qwik/src/lib/bd-todos.ts +137 -0
  777. package/templates/qwik/src/lib/bd.ts +42 -0
  778. package/templates/qwik/src/root.tsx +38 -0
  779. package/templates/qwik/src/routes/.well-known/mcp.json/index.ts +19 -0
  780. package/templates/qwik/src/routes/[...slug]/index.tsx +85 -0
  781. package/templates/qwik/src/routes/ai/product-feed/index.ts +24 -0
  782. package/templates/qwik/src/routes/api/bd/revalidate/index.ts +45 -0
  783. package/templates/qwik/src/routes/api/bd-auth/[...slug]/index.ts +77 -0
  784. package/templates/qwik/src/routes/api/mcp/index.ts +38 -0
  785. package/templates/qwik/src/routes/cart/index.tsx +254 -0
  786. package/templates/qwik/src/routes/index.tsx +239 -0
  787. package/templates/qwik/src/routes/llms.txt/index.ts +23 -0
  788. package/templates/qwik/src/routes/my-account/index.tsx +370 -0
  789. package/templates/qwik/src/routes/reviews/index.tsx +147 -0
  790. package/templates/qwik/src/routes/robots.txt/index.ts +70 -0
  791. package/templates/qwik/src/routes/services/[service]/[area]/index.tsx +115 -0
  792. package/templates/qwik/src/routes/services/index.tsx +99 -0
  793. package/templates/qwik/src/routes/sitemap.xml/index.ts +62 -0
  794. package/templates/qwik/src/routes/store/[id]/index.tsx +362 -0
  795. package/templates/qwik/src/routes/store/index.tsx +436 -0
  796. package/templates/qwik/src/routes/store/order/index.tsx +74 -0
  797. package/templates/qwik/src/routes/subscriptions/index.tsx +164 -0
  798. package/templates/qwik/src/routes/todos/index.tsx +202 -0
  799. package/templates/qwik/src/routes/updates/index.tsx +106 -0
  800. package/templates/qwik/tsconfig.json +26 -0
  801. package/templates/qwik/vite.config.ts +115 -0
  802. package/templates/react-bun/.env.example +65 -0
  803. package/templates/react-bun/README.md +354 -0
  804. package/templates/react-bun/_gitignore +24 -0
  805. package/templates/react-bun/bd.config.ts +331 -0
  806. package/templates/react-bun/bd.data-model.config.ts +90 -0
  807. package/templates/react-bun/eslint.config.js +22 -0
  808. package/templates/react-bun/index.html +13 -0
  809. package/templates/react-bun/package.json +46 -0
  810. package/templates/react-bun/pnpm-lock.yaml +2060 -0
  811. package/templates/react-bun/public/favicon.svg +1 -0
  812. package/templates/react-bun/public/icons.svg +24 -0
  813. package/templates/react-bun/server.ts +978 -0
  814. package/templates/react-bun/src/App.css +910 -0
  815. package/templates/react-bun/src/App.tsx +104 -0
  816. package/templates/react-bun/src/assets/hero.png +0 -0
  817. package/templates/react-bun/src/assets/react.svg +1 -0
  818. package/templates/react-bun/src/assets/vite.svg +1 -0
  819. package/templates/react-bun/src/components/About.tsx +46 -0
  820. package/templates/react-bun/src/components/Banner.tsx +53 -0
  821. package/templates/react-bun/src/components/Blog.tsx +84 -0
  822. package/templates/react-bun/src/components/Booking.tsx +278 -0
  823. package/templates/react-bun/src/components/ContactForm.tsx +47 -0
  824. package/templates/react-bun/src/components/Footer.tsx +24 -0
  825. package/templates/react-bun/src/components/Gallery.tsx +83 -0
  826. package/templates/react-bun/src/components/Header.tsx +27 -0
  827. package/templates/react-bun/src/components/Hero.tsx +65 -0
  828. package/templates/react-bun/src/components/SdkSetupBanner.tsx +102 -0
  829. package/templates/react-bun/src/components/Services.tsx +92 -0
  830. package/templates/react-bun/src/components/Subscribe.tsx +169 -0
  831. package/templates/react-bun/src/index.css +302 -0
  832. package/templates/react-bun/src/lib/bd.ts +370 -0
  833. package/templates/react-bun/src/lib/router.tsx +54 -0
  834. package/templates/react-bun/src/main.tsx +14 -0
  835. package/templates/react-bun/src/pages/Cart.tsx +144 -0
  836. package/templates/react-bun/src/pages/MyAccount.tsx +207 -0
  837. package/templates/react-bun/src/pages/Product.tsx +220 -0
  838. package/templates/react-bun/src/pages/Reviews.tsx +73 -0
  839. package/templates/react-bun/src/pages/ServiceArea.tsx +41 -0
  840. package/templates/react-bun/src/pages/ServiceAreas.tsx +31 -0
  841. package/templates/react-bun/src/pages/Store.tsx +274 -0
  842. package/templates/react-bun/src/pages/Subscriptions.tsx +70 -0
  843. package/templates/react-bun/src/pages/Todos.tsx +147 -0
  844. package/templates/react-bun/src/pages/Updates.tsx +53 -0
  845. package/templates/react-bun/src/pages/ui.tsx +52 -0
  846. package/templates/react-bun/tsconfig.app.json +25 -0
  847. package/templates/react-bun/tsconfig.json +7 -0
  848. package/templates/react-bun/tsconfig.node.json +24 -0
  849. package/templates/react-bun/vite.config.ts +41 -0
  850. package/templates/react-native/.env.example +32 -0
  851. package/templates/react-native/README.md +299 -0
  852. package/templates/react-native/SECURITY-NOTES.md +22 -0
  853. package/templates/react-native/_gitignore +21 -0
  854. package/templates/react-native/app/(tabs)/_layout.tsx +13 -0
  855. package/templates/react-native/app/(tabs)/account.tsx +116 -0
  856. package/templates/react-native/app/(tabs)/cart.tsx +79 -0
  857. package/templates/react-native/app/(tabs)/chat.tsx +58 -0
  858. package/templates/react-native/app/(tabs)/form.tsx +41 -0
  859. package/templates/react-native/app/(tabs)/index.tsx +74 -0
  860. package/templates/react-native/app/_layout.tsx +19 -0
  861. package/templates/react-native/app/product/[id].tsx +78 -0
  862. package/templates/react-native/app.json +15 -0
  863. package/templates/react-native/bd-records/README.md +50 -0
  864. package/templates/react-native/bd-records/todo-images.json +14 -0
  865. package/templates/react-native/bd-records/todos.json +20 -0
  866. package/templates/react-native/bd.config.ts +331 -0
  867. package/templates/react-native/bd.data-model.config.ts +89 -0
  868. package/templates/react-native/metro.config.js +16 -0
  869. package/templates/react-native/package.json +51 -0
  870. package/templates/react-native/pnpm-lock.yaml +5967 -0
  871. package/templates/react-native/src/bd/auth.ts +152 -0
  872. package/templates/react-native/src/bd/client.ts +103 -0
  873. package/templates/react-native/src/bd/demo-form.json +283 -0
  874. package/templates/react-native/src/bd/forms.tsx +148 -0
  875. package/templates/react-native/src/bd/money.ts +29 -0
  876. package/templates/react-native/src/bd/session.ts +53 -0
  877. package/templates/react-native/src/bd/useBd.ts +63 -0
  878. package/templates/react-native/src/bd/useChat.ts +116 -0
  879. package/templates/react-native/src/bd-forms/BdForm.tsx +973 -0
  880. package/templates/react-native/src/bd-forms/__tests__/logic.test.ts +195 -0
  881. package/templates/react-native/src/bd-forms/controls.tsx +1966 -0
  882. package/templates/react-native/src/bd-forms/index.ts +34 -0
  883. package/templates/react-native/src/bd-forms/keyboard.ts +139 -0
  884. package/templates/react-native/src/bd-forms/logic.ts +737 -0
  885. package/templates/react-native/src/bd-forms/pickers.tsx +487 -0
  886. package/templates/react-native/src/bd-forms/primitives.tsx +1162 -0
  887. package/templates/react-native/src/bd-forms/runtime.ts +95 -0
  888. package/templates/react-native/src/bd-forms/static.tsx +304 -0
  889. package/templates/react-native/src/bd-forms/theme.ts +385 -0
  890. package/templates/react-native/src/components/LoadState.tsx +53 -0
  891. package/templates/react-native/src/components/SignInScreen.tsx +399 -0
  892. package/templates/react-native/tsconfig.json +19 -0
  893. package/templates/remix/.env.example +63 -0
  894. package/templates/remix/README.md +392 -0
  895. package/templates/remix/_gitignore +10 -0
  896. package/templates/remix/app/components/ContactForm.tsx +55 -0
  897. package/templates/remix/app/components/NewsBanner.tsx +43 -0
  898. package/templates/remix/app/components/SdkSetupBanner.tsx +96 -0
  899. package/templates/remix/app/components/SiteHeader.tsx +37 -0
  900. package/templates/remix/app/components/Subscribe.tsx +138 -0
  901. package/templates/remix/app/lib/bd-booking.server.ts +90 -0
  902. package/templates/remix/app/lib/bd-bundle.server.ts +143 -0
  903. package/templates/remix/app/lib/bd-cache.server.ts +71 -0
  904. package/templates/remix/app/lib/bd-distribution.server.ts +26 -0
  905. package/templates/remix/app/lib/bd-pages.server.ts +84 -0
  906. package/templates/remix/app/lib/bd-portal.server.ts +170 -0
  907. package/templates/remix/app/lib/bd-seo.server.ts +56 -0
  908. package/templates/remix/app/lib/bd-store.server.ts +320 -0
  909. package/templates/remix/app/lib/bd-todos.server.ts +124 -0
  910. package/templates/remix/app/lib/bd.server.ts +112 -0
  911. package/templates/remix/app/lib/format.ts +17 -0
  912. package/templates/remix/app/lib/sdk-sections.server.ts +217 -0
  913. package/templates/remix/app/root.tsx +73 -0
  914. package/templates/remix/app/routes/$.tsx +85 -0
  915. package/templates/remix/app/routes/[.well-known].[mcp.json].ts +19 -0
  916. package/templates/remix/app/routes/[llms.txt].ts +22 -0
  917. package/templates/remix/app/routes/[robots.txt].ts +45 -0
  918. package/templates/remix/app/routes/[sitemap.xml].ts +57 -0
  919. package/templates/remix/app/routes/_index.tsx +210 -0
  920. package/templates/remix/app/routes/ai.product-feed.ts +24 -0
  921. package/templates/remix/app/routes/api.bd-auth.$.ts +47 -0
  922. package/templates/remix/app/routes/api.bd.forms.ts +53 -0
  923. package/templates/remix/app/routes/api.bd.revalidate.ts +46 -0
  924. package/templates/remix/app/routes/api.mcp.ts +38 -0
  925. package/templates/remix/app/routes/api.reviews.ts +44 -0
  926. package/templates/remix/app/routes/book.tsx +155 -0
  927. package/templates/remix/app/routes/my-account.tsx +349 -0
  928. package/templates/remix/app/routes/reviews.tsx +129 -0
  929. package/templates/remix/app/routes/services.$service.$area.tsx +80 -0
  930. package/templates/remix/app/routes/services._index.tsx +51 -0
  931. package/templates/remix/app/routes/store.$id.tsx +287 -0
  932. package/templates/remix/app/routes/store._index.tsx +318 -0
  933. package/templates/remix/app/routes/store.cart.tsx +196 -0
  934. package/templates/remix/app/routes/store.subscriptions.tsx +122 -0
  935. package/templates/remix/app/routes/todos.tsx +163 -0
  936. package/templates/remix/app/routes/updates._index.tsx +70 -0
  937. package/templates/remix/app/routes.ts +9 -0
  938. package/templates/remix/app/styles.css +699 -0
  939. package/templates/remix/bd.config.ts +331 -0
  940. package/templates/remix/bd.data-model.config.ts +90 -0
  941. package/templates/remix/package.json +52 -0
  942. package/templates/remix/pnpm-lock.yaml +2368 -0
  943. package/templates/remix/react-router.config.ts +5 -0
  944. package/templates/remix/tsconfig.json +22 -0
  945. package/templates/remix/vite.config.ts +16 -0
  946. package/templates/solid/.cta.json +24 -0
  947. package/templates/solid/.cursorrules +35 -0
  948. package/templates/solid/.env.example +56 -0
  949. package/templates/solid/.vscode/settings.json +35 -0
  950. package/templates/solid/README.md +421 -0
  951. package/templates/solid/VERCEL.md +50 -0
  952. package/templates/solid/_gitignore +12 -0
  953. package/templates/solid/bd.config.ts +331 -0
  954. package/templates/solid/bd.data-model.config.ts +90 -0
  955. package/templates/solid/biome.json +39 -0
  956. package/templates/solid/package.json +63 -0
  957. package/templates/solid/pnpm-lock.yaml +4086 -0
  958. package/templates/solid/public/favicon.ico +0 -0
  959. package/templates/solid/public/logo192.png +0 -0
  960. package/templates/solid/public/logo512.png +0 -0
  961. package/templates/solid/public/manifest.json +25 -0
  962. package/templates/solid/public/robots.txt +3 -0
  963. package/templates/solid/src/components/Header.tsx +58 -0
  964. package/templates/solid/src/components/bd/About.tsx +22 -0
  965. package/templates/solid/src/components/bd/Blog.tsx +52 -0
  966. package/templates/solid/src/components/bd/Booking.tsx +286 -0
  967. package/templates/solid/src/components/bd/ContactForm.tsx +102 -0
  968. package/templates/solid/src/components/bd/Footer.tsx +23 -0
  969. package/templates/solid/src/components/bd/Gallery.tsx +52 -0
  970. package/templates/solid/src/components/bd/Header.tsx +25 -0
  971. package/templates/solid/src/components/bd/Hero.tsx +14 -0
  972. package/templates/solid/src/components/bd/NewsBanner.tsx +47 -0
  973. package/templates/solid/src/components/bd/SdkSetupBanner.tsx +111 -0
  974. package/templates/solid/src/components/bd/Services.tsx +34 -0
  975. package/templates/solid/src/components/bd/Stars.tsx +32 -0
  976. package/templates/solid/src/components/bd/Subscribe.tsx +217 -0
  977. package/templates/solid/src/components/bd/money.ts +38 -0
  978. package/templates/solid/src/env.ts +48 -0
  979. package/templates/solid/src/integrations/tanstack-query/header-user.tsx +5 -0
  980. package/templates/solid/src/integrations/tanstack-query/provider.tsx +8 -0
  981. package/templates/solid/src/lib/bd-distribution.ts +26 -0
  982. package/templates/solid/src/lib/bd-server-fns.ts +1346 -0
  983. package/templates/solid/src/lib/bd-todos.ts +122 -0
  984. package/templates/solid/src/lib/bd.ts +169 -0
  985. package/templates/solid/src/lib/utils.ts +6 -0
  986. package/templates/solid/src/routeTree.gen.ts +513 -0
  987. package/templates/solid/src/router.tsx +23 -0
  988. package/templates/solid/src/routes/$.tsx +63 -0
  989. package/templates/solid/src/routes/[.]well-known.mcp[.]json.tsx +16 -0
  990. package/templates/solid/src/routes/__root.tsx +64 -0
  991. package/templates/solid/src/routes/about.tsx +23 -0
  992. package/templates/solid/src/routes/ai.product-feed.tsx +18 -0
  993. package/templates/solid/src/routes/api/bd/revalidate.tsx +48 -0
  994. package/templates/solid/src/routes/api/bd-auth.$.tsx +63 -0
  995. package/templates/solid/src/routes/api/mcp.tsx +23 -0
  996. package/templates/solid/src/routes/demo.tanstack-query.tsx +28 -0
  997. package/templates/solid/src/routes/index.tsx +65 -0
  998. package/templates/solid/src/routes/llms[.]txt.tsx +18 -0
  999. package/templates/solid/src/routes/my-account.tsx +365 -0
  1000. package/templates/solid/src/routes/reviews.tsx +124 -0
  1001. package/templates/solid/src/routes/robots[.]txt.tsx +17 -0
  1002. package/templates/solid/src/routes/services.$service.$area.tsx +107 -0
  1003. package/templates/solid/src/routes/services.index.tsx +68 -0
  1004. package/templates/solid/src/routes/sitemap[.]xml.tsx +16 -0
  1005. package/templates/solid/src/routes/store.$id.tsx +253 -0
  1006. package/templates/solid/src/routes/store.cart.tsx +242 -0
  1007. package/templates/solid/src/routes/store.index.tsx +392 -0
  1008. package/templates/solid/src/routes/subscriptions.tsx +155 -0
  1009. package/templates/solid/src/routes/todos.tsx +214 -0
  1010. package/templates/solid/src/routes/updates.tsx +92 -0
  1011. package/templates/solid/src/styles.css +1571 -0
  1012. package/templates/solid/tsconfig.json +29 -0
  1013. package/templates/solid/ui.config.json +13 -0
  1014. package/templates/solid/vercel.json +7 -0
  1015. package/templates/solid/vite.config.ts +23 -0
  1016. package/templates/solid-1/.cta.json +24 -0
  1017. package/templates/solid-1/.cursorrules +35 -0
  1018. package/templates/solid-1/.env.example +56 -0
  1019. package/templates/solid-1/.vscode/settings.json +35 -0
  1020. package/templates/solid-1/README.md +385 -0
  1021. package/templates/solid-1/VERCEL.md +50 -0
  1022. package/templates/solid-1/_gitignore +12 -0
  1023. package/templates/solid-1/bd.config.ts +331 -0
  1024. package/templates/solid-1/bd.data-model.config.ts +90 -0
  1025. package/templates/solid-1/biome.json +39 -0
  1026. package/templates/solid-1/package.json +99 -0
  1027. package/templates/solid-1/pnpm-lock.yaml +3937 -0
  1028. package/templates/solid-1/public/favicon.ico +0 -0
  1029. package/templates/solid-1/public/logo192.png +0 -0
  1030. package/templates/solid-1/public/logo512.png +0 -0
  1031. package/templates/solid-1/public/manifest.json +25 -0
  1032. package/templates/solid-1/public/robots.txt +3 -0
  1033. package/templates/solid-1/src/components/Header.tsx +70 -0
  1034. package/templates/solid-1/src/components/bd/About.tsx +22 -0
  1035. package/templates/solid-1/src/components/bd/Blog.tsx +52 -0
  1036. package/templates/solid-1/src/components/bd/Booking.tsx +271 -0
  1037. package/templates/solid-1/src/components/bd/ContactForm.tsx +102 -0
  1038. package/templates/solid-1/src/components/bd/Footer.tsx +23 -0
  1039. package/templates/solid-1/src/components/bd/Gallery.tsx +52 -0
  1040. package/templates/solid-1/src/components/bd/Header.tsx +25 -0
  1041. package/templates/solid-1/src/components/bd/Hero.tsx +14 -0
  1042. package/templates/solid-1/src/components/bd/NewsBanner.tsx +47 -0
  1043. package/templates/solid-1/src/components/bd/SdkSetupBanner.tsx +111 -0
  1044. package/templates/solid-1/src/components/bd/Services.tsx +34 -0
  1045. package/templates/solid-1/src/components/bd/Stars.tsx +30 -0
  1046. package/templates/solid-1/src/components/bd/Subscribe.tsx +215 -0
  1047. package/templates/solid-1/src/components/bd/money.ts +38 -0
  1048. package/templates/solid-1/src/env.ts +48 -0
  1049. package/templates/solid-1/src/integrations/tanstack-query/header-user.tsx +5 -0
  1050. package/templates/solid-1/src/integrations/tanstack-query/provider.tsx +8 -0
  1051. package/templates/solid-1/src/lib/bd-distribution.ts +26 -0
  1052. package/templates/solid-1/src/lib/bd-server-fns.ts +1346 -0
  1053. package/templates/solid-1/src/lib/bd-todos.ts +122 -0
  1054. package/templates/solid-1/src/lib/bd.ts +169 -0
  1055. package/templates/solid-1/src/lib/demo-store.ts +14 -0
  1056. package/templates/solid-1/src/lib/utils.ts +6 -0
  1057. package/templates/solid-1/src/routeTree.gen.ts +555 -0
  1058. package/templates/solid-1/src/router.tsx +23 -0
  1059. package/templates/solid-1/src/routes/$.tsx +63 -0
  1060. package/templates/solid-1/src/routes/[.]well-known.mcp[.]json.tsx +16 -0
  1061. package/templates/solid-1/src/routes/__root.tsx +62 -0
  1062. package/templates/solid-1/src/routes/about.tsx +23 -0
  1063. package/templates/solid-1/src/routes/ai.product-feed.tsx +18 -0
  1064. package/templates/solid-1/src/routes/api/bd/revalidate.tsx +48 -0
  1065. package/templates/solid-1/src/routes/api/bd-auth.$.tsx +63 -0
  1066. package/templates/solid-1/src/routes/api/mcp.tsx +23 -0
  1067. package/templates/solid-1/src/routes/demo.form.tsx +339 -0
  1068. package/templates/solid-1/src/routes/demo.store.tsx +62 -0
  1069. package/templates/solid-1/src/routes/demo.tanstack-query.tsx +28 -0
  1070. package/templates/solid-1/src/routes/index.tsx +65 -0
  1071. package/templates/solid-1/src/routes/llms[.]txt.tsx +18 -0
  1072. package/templates/solid-1/src/routes/my-account.tsx +365 -0
  1073. package/templates/solid-1/src/routes/reviews.tsx +124 -0
  1074. package/templates/solid-1/src/routes/robots[.]txt.tsx +17 -0
  1075. package/templates/solid-1/src/routes/services.$service.$area.tsx +107 -0
  1076. package/templates/solid-1/src/routes/services.index.tsx +68 -0
  1077. package/templates/solid-1/src/routes/sitemap[.]xml.tsx +16 -0
  1078. package/templates/solid-1/src/routes/store.$id.tsx +253 -0
  1079. package/templates/solid-1/src/routes/store.cart.tsx +242 -0
  1080. package/templates/solid-1/src/routes/store.index.tsx +384 -0
  1081. package/templates/solid-1/src/routes/subscriptions.tsx +155 -0
  1082. package/templates/solid-1/src/routes/todos.tsx +214 -0
  1083. package/templates/solid-1/src/routes/updates.tsx +92 -0
  1084. package/templates/solid-1/src/styles.css +1571 -0
  1085. package/templates/solid-1/tsconfig.json +29 -0
  1086. package/templates/solid-1/ui.config.json +13 -0
  1087. package/templates/solid-1/vercel.json +7 -0
  1088. package/templates/solid-1/vite.config.ts +22 -0
  1089. package/templates/svelte/.cursor/mcp.json +11 -0
  1090. package/templates/svelte/.env.example +61 -0
  1091. package/templates/svelte/.mcp.json +15 -0
  1092. package/templates/svelte/.opencode/opencode.json +6 -0
  1093. package/templates/svelte/.opencode/svelte.json +3 -0
  1094. package/templates/svelte/.prettierignore +10 -0
  1095. package/templates/svelte/.prettierrc +19 -0
  1096. package/templates/svelte/.storybook/main.ts +17 -0
  1097. package/templates/svelte/.storybook/preview.ts +21 -0
  1098. package/templates/svelte/.vscode/extensions.json +7 -0
  1099. package/templates/svelte/.vscode/settings.json +5 -0
  1100. package/templates/svelte/AGENTS.md +23 -0
  1101. package/templates/svelte/CLAUDE.md +23 -0
  1102. package/templates/svelte/README.md +416 -0
  1103. package/templates/svelte/_gitignore +30 -0
  1104. package/templates/svelte/_npmrc +1 -0
  1105. package/templates/svelte/bd.config.ts +331 -0
  1106. package/templates/svelte/bd.data-model.config.ts +89 -0
  1107. package/templates/svelte/drizzle.config.ts +11 -0
  1108. package/templates/svelte/messages/en.json +4 -0
  1109. package/templates/svelte/messages/es.json +4 -0
  1110. package/templates/svelte/package.json +80 -0
  1111. package/templates/svelte/playwright.config.ts +6 -0
  1112. package/templates/svelte/pnpm-lock.yaml +4332 -0
  1113. package/templates/svelte/project.inlang/settings.json +15 -0
  1114. package/templates/svelte/src/app.d.ts +13 -0
  1115. package/templates/svelte/src/app.html +17 -0
  1116. package/templates/svelte/src/env.ts +22 -0
  1117. package/templates/svelte/src/hooks.server.ts +17 -0
  1118. package/templates/svelte/src/hooks.ts +4 -0
  1119. package/templates/svelte/src/lib/assets/favicon.svg +1 -0
  1120. package/templates/svelte/src/lib/bd/cart-client.ts +111 -0
  1121. package/templates/svelte/src/lib/components/bd/About.svelte +31 -0
  1122. package/templates/svelte/src/lib/components/bd/Banner.svelte +79 -0
  1123. package/templates/svelte/src/lib/components/bd/Blog.svelte +47 -0
  1124. package/templates/svelte/src/lib/components/bd/Booking.svelte +243 -0
  1125. package/templates/svelte/src/lib/components/bd/ContactForm.svelte +69 -0
  1126. package/templates/svelte/src/lib/components/bd/Footer.svelte +35 -0
  1127. package/templates/svelte/src/lib/components/bd/Gallery.svelte +54 -0
  1128. package/templates/svelte/src/lib/components/bd/Header.svelte +51 -0
  1129. package/templates/svelte/src/lib/components/bd/Hero.svelte +19 -0
  1130. package/templates/svelte/src/lib/components/bd/SdkSetupBanner.svelte +107 -0
  1131. package/templates/svelte/src/lib/components/bd/Services.svelte +36 -0
  1132. package/templates/svelte/src/lib/components/bd/StoreNav.svelte +65 -0
  1133. package/templates/svelte/src/lib/components/bd/Subscribe.svelte +180 -0
  1134. package/templates/svelte/src/lib/index.ts +1 -0
  1135. package/templates/svelte/src/lib/server/bd-ai.ts +21 -0
  1136. package/templates/svelte/src/lib/server/bd-bundle.ts +142 -0
  1137. package/templates/svelte/src/lib/server/bd-parallel.ts +94 -0
  1138. package/templates/svelte/src/lib/server/bd-portal.ts +187 -0
  1139. package/templates/svelte/src/lib/server/bd-seo.ts +40 -0
  1140. package/templates/svelte/src/lib/server/bd-store.ts +262 -0
  1141. package/templates/svelte/src/lib/server/bd.ts +45 -0
  1142. package/templates/svelte/src/lib/server/db/index.ts +30 -0
  1143. package/templates/svelte/src/lib/server/db/schema.ts +7 -0
  1144. package/templates/svelte/src/lib/vitest-examples/Welcome.svelte +8 -0
  1145. package/templates/svelte/src/lib/vitest-examples/Welcome.svelte.spec.ts +13 -0
  1146. package/templates/svelte/src/lib/vitest-examples/greet.spec.ts +8 -0
  1147. package/templates/svelte/src/lib/vitest-examples/greet.ts +3 -0
  1148. package/templates/svelte/src/routes/+error.svelte +30 -0
  1149. package/templates/svelte/src/routes/+layout.svelte +33 -0
  1150. package/templates/svelte/src/routes/+page.server.ts +167 -0
  1151. package/templates/svelte/src/routes/+page.svelte +45 -0
  1152. package/templates/svelte/src/routes/.well-known/mcp.json/+server.ts +34 -0
  1153. package/templates/svelte/src/routes/[...slug]/+page.server.ts +30 -0
  1154. package/templates/svelte/src/routes/[...slug]/+page.svelte +19 -0
  1155. package/templates/svelte/src/routes/api/bd/cart/+server.ts +19 -0
  1156. package/templates/svelte/src/routes/api/bd/cart/clear/+server.ts +13 -0
  1157. package/templates/svelte/src/routes/api/bd/cart/coupon/+server.ts +29 -0
  1158. package/templates/svelte/src/routes/api/bd/cart/items/+server.ts +28 -0
  1159. package/templates/svelte/src/routes/api/bd/cart/items/[itemId]/+server.ts +31 -0
  1160. package/templates/svelte/src/routes/api/bd/checkout/start/+server.ts +15 -0
  1161. package/templates/svelte/src/routes/api/bd/forms/[slug]/+server.ts +36 -0
  1162. package/templates/svelte/src/routes/api/bd/revalidate/+server.ts +40 -0
  1163. package/templates/svelte/src/routes/api/bd/reviews/+server.ts +37 -0
  1164. package/templates/svelte/src/routes/api/bd/scheduling/bookings/+server.ts +41 -0
  1165. package/templates/svelte/src/routes/api/bd/scheduling/slots/+server.ts +33 -0
  1166. package/templates/svelte/src/routes/api/bd/subscriptions/[id]/checkout/+server.ts +43 -0
  1167. package/templates/svelte/src/routes/api/bd-auth/[...slug]/+server.ts +63 -0
  1168. package/templates/svelte/src/routes/api/mcp/+server.ts +40 -0
  1169. package/templates/svelte/src/routes/bd-tokens.css +518 -0
  1170. package/templates/svelte/src/routes/demo/+page.svelte +6 -0
  1171. package/templates/svelte/src/routes/demo/paraglide/+page.svelte +22 -0
  1172. package/templates/svelte/src/routes/demo/playwright/+page.svelte +1 -0
  1173. package/templates/svelte/src/routes/demo/playwright/page.svelte.e2e.ts +6 -0
  1174. package/templates/svelte/src/routes/layout.css +10 -0
  1175. package/templates/svelte/src/routes/llms.txt/+server.ts +42 -0
  1176. package/templates/svelte/src/routes/my-account/+page.server.ts +165 -0
  1177. package/templates/svelte/src/routes/my-account/+page.svelte +291 -0
  1178. package/templates/svelte/src/routes/reviews/+page.server.ts +40 -0
  1179. package/templates/svelte/src/routes/reviews/+page.svelte +137 -0
  1180. package/templates/svelte/src/routes/robots.txt/+server.ts +52 -0
  1181. package/templates/svelte/src/routes/services/+page.server.ts +15 -0
  1182. package/templates/svelte/src/routes/services/+page.svelte +70 -0
  1183. package/templates/svelte/src/routes/services/[service]/[area]/+page.server.ts +41 -0
  1184. package/templates/svelte/src/routes/services/[service]/[area]/+page.svelte +67 -0
  1185. package/templates/svelte/src/routes/sitemap.xml/+server.ts +63 -0
  1186. package/templates/svelte/src/routes/store/+page.server.ts +98 -0
  1187. package/templates/svelte/src/routes/store/+page.svelte +514 -0
  1188. package/templates/svelte/src/routes/store/[id]/+page.server.ts +54 -0
  1189. package/templates/svelte/src/routes/store/[id]/+page.svelte +511 -0
  1190. package/templates/svelte/src/routes/store/cart/+page.server.ts +17 -0
  1191. package/templates/svelte/src/routes/store/cart/+page.svelte +237 -0
  1192. package/templates/svelte/src/routes/store/order/+page.server.ts +24 -0
  1193. package/templates/svelte/src/routes/store/order/+page.svelte +68 -0
  1194. package/templates/svelte/src/routes/store/subscriptions/+page.server.ts +35 -0
  1195. package/templates/svelte/src/routes/store/subscriptions/+page.svelte +136 -0
  1196. package/templates/svelte/src/routes/todos/+page.server.ts +153 -0
  1197. package/templates/svelte/src/routes/todos/+page.svelte +175 -0
  1198. package/templates/svelte/src/routes/updates/+page.server.ts +20 -0
  1199. package/templates/svelte/src/routes/updates/+page.svelte +94 -0
  1200. package/templates/svelte/src/stories/Button.stories.svelte +31 -0
  1201. package/templates/svelte/src/stories/Button.svelte +30 -0
  1202. package/templates/svelte/src/stories/Configure.mdx +388 -0
  1203. package/templates/svelte/src/stories/Header.stories.svelte +26 -0
  1204. package/templates/svelte/src/stories/Header.svelte +45 -0
  1205. package/templates/svelte/src/stories/Page.stories.svelte +30 -0
  1206. package/templates/svelte/src/stories/Page.svelte +70 -0
  1207. package/templates/svelte/src/stories/assets/accessibility.png +0 -0
  1208. package/templates/svelte/src/stories/assets/accessibility.svg +1 -0
  1209. package/templates/svelte/src/stories/assets/addon-library.png +0 -0
  1210. package/templates/svelte/src/stories/assets/assets.png +0 -0
  1211. package/templates/svelte/src/stories/assets/avif-test-image.avif +0 -0
  1212. package/templates/svelte/src/stories/assets/context.png +0 -0
  1213. package/templates/svelte/src/stories/assets/discord.svg +1 -0
  1214. package/templates/svelte/src/stories/assets/docs.png +0 -0
  1215. package/templates/svelte/src/stories/assets/figma-plugin.png +0 -0
  1216. package/templates/svelte/src/stories/assets/github.svg +1 -0
  1217. package/templates/svelte/src/stories/assets/share.png +0 -0
  1218. package/templates/svelte/src/stories/assets/styling.png +0 -0
  1219. package/templates/svelte/src/stories/assets/testing.png +0 -0
  1220. package/templates/svelte/src/stories/assets/theming.png +0 -0
  1221. package/templates/svelte/src/stories/assets/tutorials.svg +1 -0
  1222. package/templates/svelte/src/stories/assets/youtube.svg +1 -0
  1223. package/templates/svelte/src/stories/button.css +30 -0
  1224. package/templates/svelte/src/stories/header.css +32 -0
  1225. package/templates/svelte/src/stories/page.css +68 -0
  1226. package/templates/svelte/tsconfig.json +8 -0
  1227. package/templates/svelte/vite.config.ts +88 -0
  1228. package/templates/svelte/vitest.shims.d.ts +1 -0
  1229. package/templates/swift/BdStarter.xcconfig +30 -0
  1230. package/templates/swift/LICENSE +21 -0
  1231. package/templates/swift/Package.swift +62 -0
  1232. package/templates/swift/README.md +334 -0
  1233. package/templates/swift/Sources/BdForms/Backend/BdFormsBackend.swift +441 -0
  1234. package/templates/swift/Sources/BdForms/Controller/BdFormController.swift +717 -0
  1235. package/templates/swift/Sources/BdForms/Engine/BdCalculation.swift +173 -0
  1236. package/templates/swift/Sources/BdForms/Engine/BdFormRules+Client.swift +200 -0
  1237. package/templates/swift/Sources/BdForms/Engine/BdFormRules.swift +949 -0
  1238. package/templates/swift/Sources/BdForms/Engine/BdFormula.swift +783 -0
  1239. package/templates/swift/Sources/BdForms/Engine/BdUnits.swift +171 -0
  1240. package/templates/swift/Sources/BdForms/Generated/BdFormsData.generated.swift +294 -0
  1241. package/templates/swift/Sources/BdForms/Model/BdFormSchema.swift +509 -0
  1242. package/templates/swift/Sources/BdForms/Model/BdJSON.swift +302 -0
  1243. package/templates/swift/Sources/BdForms/Quiz/BdQuizBackend.swift +313 -0
  1244. package/templates/swift/Sources/BdForms/Quiz/BdQuizController.swift +271 -0
  1245. package/templates/swift/Sources/BdForms/Quiz/BdQuizEngine.swift +757 -0
  1246. package/templates/swift/Sources/BdForms/Quiz/BdQuizPage.swift +124 -0
  1247. package/templates/swift/Sources/BdForms/Quiz/BdQuizScoring.swift +445 -0
  1248. package/templates/swift/Sources/BdForms/Quiz/BdQuizScreen.swift +461 -0
  1249. package/templates/swift/Sources/BdForms/Quiz/BdQuizWords.swift +110 -0
  1250. package/templates/swift/Sources/BdForms/UI/BdFieldTree.swift +352 -0
  1251. package/templates/swift/Sources/BdForms/UI/BdForm.swift +346 -0
  1252. package/templates/swift/Sources/BdForms/UI/BdFormStyle.swift +247 -0
  1253. package/templates/swift/Sources/BdForms/UI/BdHTML.swift +304 -0
  1254. package/templates/swift/Sources/BdForms/UI/BdIcon.swift +351 -0
  1255. package/templates/swift/Sources/BdForms/UI/Controls/BdChoiceControls.swift +677 -0
  1256. package/templates/swift/Sources/BdForms/UI/Controls/BdDateControls.swift +360 -0
  1257. package/templates/swift/Sources/BdForms/UI/Controls/BdFieldControl.swift +338 -0
  1258. package/templates/swift/Sources/BdForms/UI/Controls/BdMediaControls.swift +412 -0
  1259. package/templates/swift/Sources/BdForms/UI/Controls/BdStaticViews.swift +183 -0
  1260. package/templates/swift/Sources/BdForms/UI/Controls/BdTextControls.swift +388 -0
  1261. package/templates/swift/Sources/BdForms/UI/Quiz/BdQuiz.swift +696 -0
  1262. package/templates/swift/Sources/BdSignIn/BdSignInBackend.swift +299 -0
  1263. package/templates/swift/Sources/BdSignIn/BdSignInChecks.swift +158 -0
  1264. package/templates/swift/Sources/BdSignIn/BdSignInView.swift +806 -0
  1265. package/templates/swift/Sources/BdStarterApp/BdEnvironment.swift +138 -0
  1266. package/templates/swift/Sources/BdStarterApp/ViewModels/CartViewModel.swift +74 -0
  1267. package/templates/swift/Sources/BdStarterApp/ViewModels/ChatViewModel.swift +87 -0
  1268. package/templates/swift/Sources/BdStarterApp/ViewModels/StorefrontViewModel.swift +73 -0
  1269. package/templates/swift/Sources/BdStarterApp/ViewModels/ViewModel.swift +53 -0
  1270. package/templates/swift/Sources/BdStarterApp/Views/AccountView.swift +163 -0
  1271. package/templates/swift/Sources/BdStarterApp/Views/BdFormView.swift +50 -0
  1272. package/templates/swift/Sources/BdStarterApp/Views/BdQuizView.swift +59 -0
  1273. package/templates/swift/Sources/BdStarterApp/Views/BlogView.swift +33 -0
  1274. package/templates/swift/Sources/BdStarterApp/Views/CartView.swift +73 -0
  1275. package/templates/swift/Sources/BdStarterApp/Views/ChatView.swift +57 -0
  1276. package/templates/swift/Sources/BdStarterApp/Views/LoadState.swift +50 -0
  1277. package/templates/swift/Sources/BdStarterApp/Views/ProductDetailView.swift +57 -0
  1278. package/templates/swift/Sources/BdStarterApp/Views/RootView.swift +60 -0
  1279. package/templates/swift/Sources/BdStarterApp/Views/StorefrontView.swift +68 -0
  1280. package/templates/swift/Sources/BusinessDashKit/BdAuth.swift +113 -0
  1281. package/templates/swift/Sources/BusinessDashKit/BdClient.swift +223 -0
  1282. package/templates/swift/Sources/BusinessDashKit/BdConfiguration.swift +59 -0
  1283. package/templates/swift/Sources/BusinessDashKit/BdError.swift +71 -0
  1284. package/templates/swift/Sources/BusinessDashKit/BdSessionStore.swift +83 -0
  1285. package/templates/swift/Sources/BusinessDashKit/ChatFeed.swift +145 -0
  1286. package/templates/swift/Sources/BusinessDashKit/Donations.swift +144 -0
  1287. package/templates/swift/Sources/BusinessDashKit/JSONValue.swift +118 -0
  1288. package/templates/swift/Sources/BusinessDashKit/Models.swift +447 -0
  1289. package/templates/swift/Sources/BusinessDashKit/Money.swift +33 -0
  1290. package/templates/swift/Sources/BusinessDashKit/Resources.swift +439 -0
  1291. package/templates/swift/Sources/BusinessDashKit/Scheduling.swift +128 -0
  1292. package/templates/swift/Sources/BusinessDashKit/Seo.swift +169 -0
  1293. package/templates/swift/Sources/BusinessDashKit/SocialPlatforms.generated.swift +48 -0
  1294. package/templates/swift/Sources/BusinessDashKit/Socials.swift +160 -0
  1295. package/templates/swift/Tests/BdFormsTests/ControllerTests.swift +356 -0
  1296. package/templates/swift/Tests/BdFormsTests/Fixtures/forms-parity.json +3806 -0
  1297. package/templates/swift/Tests/BdFormsTests/Fixtures/quiz-parity.json +9937 -0
  1298. package/templates/swift/Tests/BdFormsTests/FormsBackendPathTests.swift +17 -0
  1299. package/templates/swift/Tests/BdFormsTests/ParityTests.swift +192 -0
  1300. package/templates/swift/Tests/BdFormsTests/QuizControllerTests.swift +342 -0
  1301. package/templates/swift/Tests/BdFormsTests/QuizParityTests.swift +230 -0
  1302. package/templates/swift/Tests/BdSignInTests/BdSignInChecksTests.swift +49 -0
  1303. package/templates/swift/Tests/BusinessDashKitTests/BusinessDashKitTests.swift +367 -0
  1304. package/templates/swift/_gitignore +9 -0
  1305. package/templates/swift/bd-records/README.md +50 -0
  1306. package/templates/swift/bd-records/todo-images.json +14 -0
  1307. package/templates/swift/bd-records/todos.json +20 -0
  1308. package/templates/swift/bd.config.ts +331 -0
  1309. package/templates/swift/bd.data-model.config.ts +89 -0
  1310. package/templates/swift/package.json +20 -0
  1311. package/templates/swift/pnpm-lock.yaml +347 -0
  1312. package/templates/swift/tsconfig.json +19 -0
  1313. package/templates/t3/.env.example +62 -0
  1314. package/templates/t3/README.md +428 -0
  1315. package/templates/t3/_gitignore +46 -0
  1316. package/templates/t3/bd.config.ts +331 -0
  1317. package/templates/t3/bd.data-model.config.ts +90 -0
  1318. package/templates/t3/biome.jsonc +69 -0
  1319. package/templates/t3/drizzle.config.ts +15 -0
  1320. package/templates/t3/next.config.js +17 -0
  1321. package/templates/t3/package.json +64 -0
  1322. package/templates/t3/pnpm-lock.yaml +1843 -0
  1323. package/templates/t3/postcss.config.js +5 -0
  1324. package/templates/t3/public/favicon.ico +0 -0
  1325. package/templates/t3/src/app/.well-known/mcp.json/route.ts +17 -0
  1326. package/templates/t3/src/app/[...slug]/page.tsx +71 -0
  1327. package/templates/t3/src/app/_actions/plans.ts +60 -0
  1328. package/templates/t3/src/app/_actions/review.ts +88 -0
  1329. package/templates/t3/src/app/_actions/store.ts +119 -0
  1330. package/templates/t3/src/app/_components/bd/About.tsx +25 -0
  1331. package/templates/t3/src/app/_components/bd/AuthButtons.tsx +49 -0
  1332. package/templates/t3/src/app/_components/bd/Blog.tsx +47 -0
  1333. package/templates/t3/src/app/_components/bd/Booking.tsx +257 -0
  1334. package/templates/t3/src/app/_components/bd/ContactForm.tsx +82 -0
  1335. package/templates/t3/src/app/_components/bd/Footer.tsx +25 -0
  1336. package/templates/t3/src/app/_components/bd/Gallery.tsx +49 -0
  1337. package/templates/t3/src/app/_components/bd/Header.tsx +27 -0
  1338. package/templates/t3/src/app/_components/bd/Hero.tsx +14 -0
  1339. package/templates/t3/src/app/_components/bd/NewsBanner.tsx +57 -0
  1340. package/templates/t3/src/app/_components/bd/ReviewForm.tsx +95 -0
  1341. package/templates/t3/src/app/_components/bd/Reviews.tsx +83 -0
  1342. package/templates/t3/src/app/_components/bd/ReviewsLoadMore.tsx +107 -0
  1343. package/templates/t3/src/app/_components/bd/SdkSetupBanner.tsx +97 -0
  1344. package/templates/t3/src/app/_components/bd/Services.tsx +30 -0
  1345. package/templates/t3/src/app/_components/bd/SignInScreen.tsx +32 -0
  1346. package/templates/t3/src/app/_components/bd/Subscribe.tsx +157 -0
  1347. package/templates/t3/src/app/_components/bd/Updates.tsx +90 -0
  1348. package/templates/t3/src/app/_components/post.tsx +50 -0
  1349. package/templates/t3/src/app/ai/product-feed/route.ts +21 -0
  1350. package/templates/t3/src/app/api/bd/revalidate/route.ts +16 -0
  1351. package/templates/t3/src/app/api/bd-auth/[...slug]/route.ts +39 -0
  1352. package/templates/t3/src/app/api/mcp/route.ts +36 -0
  1353. package/templates/t3/src/app/api/trpc/[trpc]/route.ts +34 -0
  1354. package/templates/t3/src/app/layout.tsx +55 -0
  1355. package/templates/t3/src/app/llms.txt/route.ts +21 -0
  1356. package/templates/t3/src/app/my-account/page.tsx +259 -0
  1357. package/templates/t3/src/app/not-found.tsx +26 -0
  1358. package/templates/t3/src/app/page.tsx +89 -0
  1359. package/templates/t3/src/app/robots.txt/route.ts +51 -0
  1360. package/templates/t3/src/app/services/[service]/[area]/page.tsx +114 -0
  1361. package/templates/t3/src/app/sitemap.xml/route.ts +75 -0
  1362. package/templates/t3/src/app/store/[id]/page.tsx +69 -0
  1363. package/templates/t3/src/app/store/_components/AddToCart.tsx +117 -0
  1364. package/templates/t3/src/app/store/_components/CartClient.tsx +198 -0
  1365. package/templates/t3/src/app/store/_components/Notice.tsx +11 -0
  1366. package/templates/t3/src/app/store/_components/StoreView.tsx +372 -0
  1367. package/templates/t3/src/app/store/_components/store-utils.ts +63 -0
  1368. package/templates/t3/src/app/store/cart/page.tsx +28 -0
  1369. package/templates/t3/src/app/store/layout.tsx +38 -0
  1370. package/templates/t3/src/app/store/order/page.tsx +88 -0
  1371. package/templates/t3/src/app/store/page.tsx +104 -0
  1372. package/templates/t3/src/app/store/subscriptions/page.tsx +110 -0
  1373. package/templates/t3/src/app/todos/TodoCreateForm.tsx +68 -0
  1374. package/templates/t3/src/app/todos/page.tsx +134 -0
  1375. package/templates/t3/src/env.js +78 -0
  1376. package/templates/t3/src/server/api/root.ts +25 -0
  1377. package/templates/t3/src/server/api/routers/bd.ts +359 -0
  1378. package/templates/t3/src/server/api/routers/post.ts +30 -0
  1379. package/templates/t3/src/server/api/trpc.ts +106 -0
  1380. package/templates/t3/src/server/db/index.ts +40 -0
  1381. package/templates/t3/src/server/db/schema.ts +26 -0
  1382. package/templates/t3/src/server/lib/bd-distribution.ts +28 -0
  1383. package/templates/t3/src/server/lib/bd-portal.ts +163 -0
  1384. package/templates/t3/src/server/lib/bd-seo.ts +55 -0
  1385. package/templates/t3/src/server/lib/bd-store.ts +177 -0
  1386. package/templates/t3/src/server/lib/bd-todos.ts +138 -0
  1387. package/templates/t3/src/server/lib/bd.ts +260 -0
  1388. package/templates/t3/src/styles/globals.css +1088 -0
  1389. package/templates/t3/src/trpc/query-client.ts +25 -0
  1390. package/templates/t3/src/trpc/react.tsx +78 -0
  1391. package/templates/t3/src/trpc/server.ts +30 -0
  1392. package/templates/t3/start-database.sh +88 -0
  1393. package/templates/t3/tsconfig.json +42 -0
  1394. package/templates/vanilla/.env.example +51 -0
  1395. package/templates/vanilla/README.md +345 -0
  1396. package/templates/vanilla/_gitignore +7 -0
  1397. package/templates/vanilla/bd.config.ts +331 -0
  1398. package/templates/vanilla/bd.data-model.config.ts +89 -0
  1399. package/templates/vanilla/lib/cache.ts +58 -0
  1400. package/templates/vanilla/package.json +23 -0
  1401. package/templates/vanilla/pnpm-lock.yaml +97 -0
  1402. package/templates/vanilla/public/banner.js +75 -0
  1403. package/templates/vanilla/public/bd.js +435 -0
  1404. package/templates/vanilla/public/index.html +74 -0
  1405. package/templates/vanilla/public/main.js +59 -0
  1406. package/templates/vanilla/public/pages/_ui.js +24 -0
  1407. package/templates/vanilla/public/pages/cart.js +143 -0
  1408. package/templates/vanilla/public/pages/my-account.js +182 -0
  1409. package/templates/vanilla/public/pages/product.js +211 -0
  1410. package/templates/vanilla/public/pages/reviews.js +56 -0
  1411. package/templates/vanilla/public/pages/services-area.js +33 -0
  1412. package/templates/vanilla/public/pages/services.js +26 -0
  1413. package/templates/vanilla/public/pages/store.js +271 -0
  1414. package/templates/vanilla/public/pages/subscriptions.js +80 -0
  1415. package/templates/vanilla/public/pages/todos.js +160 -0
  1416. package/templates/vanilla/public/pages/updates.js +46 -0
  1417. package/templates/vanilla/public/sections/about.js +47 -0
  1418. package/templates/vanilla/public/sections/blog.js +66 -0
  1419. package/templates/vanilla/public/sections/booking.js +304 -0
  1420. package/templates/vanilla/public/sections/contact-form.js +104 -0
  1421. package/templates/vanilla/public/sections/gallery.js +70 -0
  1422. package/templates/vanilla/public/sections/hero.js +43 -0
  1423. package/templates/vanilla/public/sections/services.js +70 -0
  1424. package/templates/vanilla/public/sections/subscribe.js +160 -0
  1425. package/templates/vanilla/public/setup-banner.js +81 -0
  1426. package/templates/vanilla/public/styles.css +1720 -0
  1427. package/templates/vanilla/server.ts +1192 -0
  1428. package/templates/vanilla/src/content/en/home/about.json +4 -0
  1429. package/templates/vanilla/src/content/en/home/hero.json +6 -0
  1430. package/templates/vanilla/src/content/en/shared/brand.json +5 -0
  1431. package/templates/vanilla/src/content/en/shared/companyInfo.json +11 -0
  1432. package/templates/vanilla/tsconfig.json +14 -0
  1433. package/templates/vapor/.env.example +38 -0
  1434. package/templates/vapor/Package.resolved +285 -0
  1435. package/templates/vapor/Package.swift +33 -0
  1436. package/templates/vapor/Public/bd-sign-in.css +53 -0
  1437. package/templates/vapor/Public/forms.css +1158 -0
  1438. package/templates/vapor/Public/styles.css +100 -0
  1439. package/templates/vapor/README.md +280 -0
  1440. package/templates/vapor/Resources/Forms/demo-form.json +283 -0
  1441. package/templates/vapor/Resources/Forms/demo-quiz.json +97 -0
  1442. package/templates/vapor/Resources/Views/account.leaf +23 -0
  1443. package/templates/vapor/Resources/Views/base.leaf +51 -0
  1444. package/templates/vapor/Resources/Views/blog.leaf +18 -0
  1445. package/templates/vapor/Resources/Views/cart.leaf +30 -0
  1446. package/templates/vapor/Resources/Views/delete-account.leaf +26 -0
  1447. package/templates/vapor/Resources/Views/form.leaf +6 -0
  1448. package/templates/vapor/Resources/Views/home.leaf +37 -0
  1449. package/templates/vapor/Resources/Views/post.leaf +15 -0
  1450. package/templates/vapor/Resources/Views/product.leaf +28 -0
  1451. package/templates/vapor/Resources/Views/quiz.leaf +6 -0
  1452. package/templates/vapor/Resources/Views/reviews.leaf +16 -0
  1453. package/templates/vapor/Resources/Views/service-area.leaf +9 -0
  1454. package/templates/vapor/Resources/Views/services.leaf +15 -0
  1455. package/templates/vapor/Resources/Views/store.leaf +37 -0
  1456. package/templates/vapor/Resources/Views/subscriptions.leaf +18 -0
  1457. package/templates/vapor/Resources/Views/todos.leaf +28 -0
  1458. package/templates/vapor/Sources/App/Bd/BdCache.swift +99 -0
  1459. package/templates/vapor/Sources/App/Bd/BdClient.swift +178 -0
  1460. package/templates/vapor/Sources/App/Bd/BdWebhook.swift +92 -0
  1461. package/templates/vapor/Sources/App/Bd/Donations.swift +95 -0
  1462. package/templates/vapor/Sources/App/Bd/JSONValue.swift +66 -0
  1463. package/templates/vapor/Sources/App/Bd/Models.swift +153 -0
  1464. package/templates/vapor/Sources/App/Bd/Money.swift +29 -0
  1465. package/templates/vapor/Sources/App/Bd/PortalResources.swift +372 -0
  1466. package/templates/vapor/Sources/App/Bd/Resources.swift +115 -0
  1467. package/templates/vapor/Sources/App/Bd/Scheduling.swift +135 -0
  1468. package/templates/vapor/Sources/App/Bd/Seo.swift +169 -0
  1469. package/templates/vapor/Sources/App/Bd/SignInCore.swift +232 -0
  1470. package/templates/vapor/Sources/App/Bd/SocialPlatforms.generated.swift +48 -0
  1471. package/templates/vapor/Sources/App/Bd/Socials.swift +96 -0
  1472. package/templates/vapor/Sources/App/Controllers/AccountController.swift +435 -0
  1473. package/templates/vapor/Sources/App/Controllers/CartController.swift +107 -0
  1474. package/templates/vapor/Sources/App/Controllers/Contexts.swift +124 -0
  1475. package/templates/vapor/Sources/App/Controllers/PageController.swift +151 -0
  1476. package/templates/vapor/Sources/App/Controllers/SeoController.swift +83 -0
  1477. package/templates/vapor/Sources/App/Controllers/SignInController.swift +583 -0
  1478. package/templates/vapor/Sources/App/Controllers/StoreController.swift +48 -0
  1479. package/templates/vapor/Sources/App/Controllers/WebhookController.swift +34 -0
  1480. package/templates/vapor/Sources/App/Forms/FormPage.swift +900 -0
  1481. package/templates/vapor/Sources/App/Forms/FormPost.swift +125 -0
  1482. package/templates/vapor/Sources/App/Forms/FormRoutes.swift +36 -0
  1483. package/templates/vapor/Sources/App/Forms/FormSamples.swift +45 -0
  1484. package/templates/vapor/Sources/App/Forms/QuizPage.swift +481 -0
  1485. package/templates/vapor/Sources/App/Forms/QuizRoutes.swift +77 -0
  1486. package/templates/vapor/Sources/App/configure.swift +18 -0
  1487. package/templates/vapor/Sources/App/entrypoint.swift +20 -0
  1488. package/templates/vapor/Sources/App/routes.swift +62 -0
  1489. package/templates/vapor/Sources/BdForms/Backend/BdFormsBackend.swift +445 -0
  1490. package/templates/vapor/Sources/BdForms/Controller/BdFormController.swift +721 -0
  1491. package/templates/vapor/Sources/BdForms/Engine/BdCalculation.swift +177 -0
  1492. package/templates/vapor/Sources/BdForms/Engine/BdFormRules+Client.swift +204 -0
  1493. package/templates/vapor/Sources/BdForms/Engine/BdFormRules.swift +953 -0
  1494. package/templates/vapor/Sources/BdForms/Engine/BdFormula.swift +787 -0
  1495. package/templates/vapor/Sources/BdForms/Engine/BdUnits.swift +175 -0
  1496. package/templates/vapor/Sources/BdForms/Generated/BdFormsData.generated.swift +298 -0
  1497. package/templates/vapor/Sources/BdForms/Model/BdFormSchema.swift +513 -0
  1498. package/templates/vapor/Sources/BdForms/Model/BdJSON.swift +306 -0
  1499. package/templates/vapor/Sources/BdForms/Quiz/BdQuizBackend.swift +317 -0
  1500. package/templates/vapor/Sources/BdForms/Quiz/BdQuizController.swift +275 -0
  1501. package/templates/vapor/Sources/BdForms/Quiz/BdQuizEngine.swift +761 -0
  1502. package/templates/vapor/Sources/BdForms/Quiz/BdQuizPage.swift +128 -0
  1503. package/templates/vapor/Sources/BdForms/Quiz/BdQuizScoring.swift +449 -0
  1504. package/templates/vapor/Sources/BdForms/Quiz/BdQuizScreen.swift +465 -0
  1505. package/templates/vapor/Sources/BdForms/Quiz/BdQuizWords.swift +114 -0
  1506. package/templates/vapor/_gitignore +9 -0
  1507. package/templates/vapor/bd-records/README.md +50 -0
  1508. package/templates/vapor/bd-records/todo-images.json +14 -0
  1509. package/templates/vapor/bd-records/todos.json +20 -0
  1510. package/templates/vapor/bd.config.ts +331 -0
  1511. package/templates/vapor/bd.data-model.config.ts +89 -0
  1512. package/templates/vapor/package.json +20 -0
  1513. package/templates/vapor/pnpm-lock.yaml +347 -0
  1514. package/templates/vapor/tsconfig.json +19 -0
@@ -0,0 +1,781 @@
1
+ import 'package:businessdash_sdk/forms.dart';
2
+ // ignore: deprecated_member_use
3
+ import 'package:flutter/cupertino.dart';
4
+ // ignore: deprecated_member_use
5
+ import 'package:flutter/material.dart';
6
+
7
+ import 'icons.dart';
8
+ import 'primitives.dart';
9
+ import 'style.dart';
10
+ import 'tree.dart';
11
+
12
+ /// A BusinessDash form, drawn with native widgets: Material on Android,
13
+ /// Cupertino on iOS. Validation, conditions, steps, calculations, uploads
14
+ /// and submit all run through [BdFormController], the same rules as every
15
+ /// web binding.
16
+ ///
17
+ /// ```dart
18
+ /// BdForm(form: 'contact', publishableKey: 'pk_live_…')
19
+ /// ```
20
+ class BdForm extends StatefulWidget {
21
+ /// Fetches [form] from BusinessDash with a publishable key.
22
+ const BdForm({
23
+ super.key,
24
+ required String this.form,
25
+ required String this.publishableKey,
26
+ this.host = bdDefaultHost,
27
+ this.submitOptions = const BdSubmitOptions(),
28
+ this.style = const BdFormStyle(),
29
+ this.strings = const BdFormStrings(),
30
+ this.renderers = const BdFieldRenderers(),
31
+ this.pickFiles,
32
+ this.collectPayment,
33
+ this.openLink,
34
+ this.timeZone,
35
+ this.scrollable = true,
36
+ this.onSubmitted,
37
+ this.onSubmitError,
38
+ this.successBuilder,
39
+ }) : backend = null,
40
+ controller = null,
41
+ schema = null;
42
+
43
+ /// Fetches and submits [form] through your own backend.
44
+ const BdForm.backend({
45
+ super.key,
46
+ required String this.form,
47
+ required BdFormsBackend this.backend,
48
+ this.host = bdDefaultHost,
49
+ this.submitOptions = const BdSubmitOptions(),
50
+ this.style = const BdFormStyle(),
51
+ this.strings = const BdFormStrings(),
52
+ this.renderers = const BdFieldRenderers(),
53
+ this.pickFiles,
54
+ this.collectPayment,
55
+ this.openLink,
56
+ this.timeZone,
57
+ this.scrollable = true,
58
+ this.onSubmitted,
59
+ this.onSubmitError,
60
+ this.successBuilder,
61
+ }) : publishableKey = null,
62
+ controller = null,
63
+ schema = null;
64
+
65
+ /// A form you already have (prefetched, bundled, or built in code). Pass
66
+ /// a backend to be able to submit it.
67
+ const BdForm.schema({
68
+ super.key,
69
+ required BdFormSchema this.schema,
70
+ this.backend,
71
+ this.host = bdDefaultHost,
72
+ this.submitOptions = const BdSubmitOptions(),
73
+ this.style = const BdFormStyle(),
74
+ this.strings = const BdFormStrings(),
75
+ this.renderers = const BdFieldRenderers(),
76
+ this.pickFiles,
77
+ this.collectPayment,
78
+ this.openLink,
79
+ this.timeZone,
80
+ this.scrollable = true,
81
+ this.onSubmitted,
82
+ this.onSubmitError,
83
+ this.successBuilder,
84
+ }) : form = null,
85
+ publishableKey = null,
86
+ controller = null;
87
+
88
+ /// Draws a controller you own: read and write its answers from outside,
89
+ /// keep it across screens. You dispose it.
90
+ const BdForm.controller({
91
+ super.key,
92
+ required BdFormController this.controller,
93
+ this.host = bdDefaultHost,
94
+ this.style = const BdFormStyle(),
95
+ this.strings = const BdFormStrings(),
96
+ this.renderers = const BdFieldRenderers(),
97
+ this.pickFiles,
98
+ this.collectPayment,
99
+ this.openLink,
100
+ this.timeZone,
101
+ this.scrollable = true,
102
+ this.onSubmitted,
103
+ this.onSubmitError,
104
+ this.successBuilder,
105
+ }) : form = null,
106
+ publishableKey = null,
107
+ backend = null,
108
+ schema = null,
109
+ submitOptions = const BdSubmitOptions();
110
+
111
+ /// The form's slug (Forms → Share in BusinessDash).
112
+ final String? form;
113
+
114
+ /// A publishable `pk_…` key. Never a secret (`bd_…`) key: it ships in the app.
115
+ final String? publishableKey;
116
+ final BdFormsBackend? backend;
117
+ final BdFormController? controller;
118
+ final BdFormSchema? schema;
119
+
120
+ /// BusinessDash's address, for the form and its icons.
121
+ final String host;
122
+
123
+ /// Provenance and recipient passthrough merged into the submission.
124
+ final BdSubmitOptions submitOptions;
125
+ final BdFormStyle style;
126
+ final BdFormStrings strings;
127
+ final BdFieldRenderers renderers;
128
+
129
+ /// Opens the document or photo picker for file and image fields.
130
+ final BdFilePicker? pickFiles;
131
+
132
+ /// Collects a card for `credit_card` fields: present Stripe's sheet with
133
+ /// the intent and return its id.
134
+ final BdPaymentHandler? collectPayment;
135
+
136
+ /// Opens links (choice cards' "View", links in rich text).
137
+ final BdLinkOpener? openLink;
138
+
139
+ /// The visitor's IANA time zone (`America/Chicago`), sent with a booked
140
+ /// time so confirmations read in their zone. Dart can't read it on its
141
+ /// own; `flutter_timezone` can. Without it, BusinessDash uses UTC.
142
+ final String? timeZone;
143
+
144
+ /// The form scrolls itself (default). Pass false inside your own
145
+ /// scrolling view.
146
+ final bool scrollable;
147
+ final void Function(BdSubmitSuccess result)? onSubmitted;
148
+ final void Function(BdSubmitFailure result)? onSubmitError;
149
+
150
+ /// Replaces the thank-you screen. Call `reset` to start a new response.
151
+ final Widget Function(BuildContext context, BdSubmitSuccess result, VoidCallback reset)? successBuilder;
152
+
153
+ @override
154
+ State<BdForm> createState() => _BdFormState();
155
+ }
156
+
157
+ class _BdFormState extends State<BdForm> {
158
+ late BdFormController _controller;
159
+ var _owns = false;
160
+ final _scrollTargets = <String, GlobalKey>{};
161
+
162
+ @override
163
+ void initState() {
164
+ super.initState();
165
+ _attach();
166
+ }
167
+
168
+ BdFormController _make() {
169
+ final w = widget;
170
+ if (w.controller case final c?) return c;
171
+ if (w.schema case final s?) return BdFormController.fromSchema(s, backend: w.backend, submitOptions: w.submitOptions);
172
+ final backend = w.backend ?? BdPackageFormsBackend(publishableKey: w.publishableKey!, host: w.host);
173
+ return BdFormController(w.form!, backend: backend, submitOptions: w.submitOptions);
174
+ }
175
+
176
+ void _attach() {
177
+ _controller = _make();
178
+ _owns = widget.controller == null;
179
+ _controller.addListener(_changed);
180
+ _controller.onSuccess = (r) => widget.onSubmitted?.call(r);
181
+ _controller.onFailure = (r) => widget.onSubmitError?.call(r);
182
+ _controller.paymentHandler = widget.collectPayment;
183
+ _controller.messages = widget.strings.messages;
184
+ if (_controller.phase is! BdPhaseReady) {
185
+ // After this frame: loading publishes a new state.
186
+ WidgetsBinding.instance.addPostFrameCallback((_) {
187
+ if (mounted) _controller.load();
188
+ });
189
+ }
190
+ }
191
+
192
+ void _detach() {
193
+ _controller.removeListener(_changed);
194
+ if (_owns) _controller.dispose();
195
+ }
196
+
197
+ bool _sameSource(BdForm a, BdForm b) =>
198
+ a.controller == b.controller &&
199
+ a.form == b.form &&
200
+ a.publishableKey == b.publishableKey &&
201
+ a.host == b.host &&
202
+ a.backend == b.backend &&
203
+ a.schema == b.schema;
204
+
205
+ @override
206
+ void didUpdateWidget(BdForm old) {
207
+ super.didUpdateWidget(old);
208
+ if (!_sameSource(old, widget)) {
209
+ _detach();
210
+ _attach();
211
+ } else {
212
+ _controller.paymentHandler = widget.collectPayment;
213
+ _controller.messages = widget.strings.messages;
214
+ if (_owns) _controller.submitOptions = widget.submitOptions;
215
+ }
216
+ }
217
+
218
+ @override
219
+ void dispose() {
220
+ _detach();
221
+ super.dispose();
222
+ }
223
+
224
+ void _changed() {
225
+ if (mounted) setState(() {});
226
+ }
227
+
228
+ bool _cupertino(BuildContext context) => switch (widget.style.controls) {
229
+ BdControlStyle.material => false,
230
+ BdControlStyle.cupertino => true,
231
+ BdControlStyle.adaptive => switch (Theme.of(context).platform) {
232
+ TargetPlatform.iOS || TargetPlatform.macOS => true,
233
+ _ => false,
234
+ },
235
+ };
236
+
237
+ ThemeData _tinted(ThemeData theme) {
238
+ final tint = widget.style.tint;
239
+ if (tint == null) return theme;
240
+ final onTint = tint.computeLuminance() > 0.5 ? Colors.black : Colors.white;
241
+ return theme.copyWith(
242
+ colorScheme: theme.colorScheme.copyWith(primary: tint, onPrimary: onTint, surfaceTint: tint),
243
+ cupertinoOverrideTheme: CupertinoThemeData(primaryColor: tint),
244
+ );
245
+ }
246
+
247
+ @override
248
+ Widget build(BuildContext context) {
249
+ final state = _controller.state;
250
+ final Widget body = switch (state.phase) {
251
+ BdPhaseIdle() || BdPhaseLoading() => _Centered(scrollable: widget.scrollable, child: const _Loading()),
252
+ BdPhaseFailed(:final message) => _Centered(
253
+ scrollable: widget.scrollable,
254
+ child: _Failed(message, onRetry: _controller.load),
255
+ ),
256
+ BdPhaseReady() => switch (state.result) {
257
+ final BdSubmitSuccess success => widget.successBuilder?.call(context, success, _controller.reset) ??
258
+ _Centered(scrollable: widget.scrollable, child: const _Success()),
259
+ _ => _Body(scrollable: widget.scrollable),
260
+ },
261
+ };
262
+
263
+ Widget tree = Theme(
264
+ data: _tinted(Theme.of(context)),
265
+ child: BdFormScope(
266
+ controller: _controller,
267
+ state: state,
268
+ style: widget.style,
269
+ strings: widget.strings,
270
+ renderers: widget.renderers,
271
+ cupertino: _cupertino(context),
272
+ iconBaseUrl: widget.host.replaceFirst(RegExp(r'/+$'), ''),
273
+ pickFiles: widget.pickFiles,
274
+ openLink: widget.openLink,
275
+ timeZone: widget.timeZone,
276
+ scrollTargets: _scrollTargets,
277
+ // Material widgets need a Material above them, which a Cupertino
278
+ // app doesn't give.
279
+ child: Material(type: MaterialType.transparency, child: body),
280
+ ),
281
+ );
282
+ // Date formats and pickers read MaterialLocalizations, which a
283
+ // Cupertino app doesn't provide.
284
+ if (Localizations.of<MaterialLocalizations>(context, MaterialLocalizations) == null) {
285
+ tree = Localizations.override(
286
+ context: context,
287
+ delegates: const [DefaultMaterialLocalizations.delegate],
288
+ child: tree,
289
+ );
290
+ }
291
+ return tree;
292
+ }
293
+ }
294
+
295
+ /// A [Listenable] over a [BdFormController], for `ListenableBuilder` and
296
+ /// `AnimatedBuilder` when you draw your own form.
297
+ extension BdFormControllerListenable on BdFormController {
298
+ Listenable get listenable => _ControllerListenable(this);
299
+ }
300
+
301
+ class _ControllerListenable implements Listenable {
302
+ const _ControllerListenable(this.controller);
303
+
304
+ final BdFormController controller;
305
+
306
+ @override
307
+ void addListener(VoidCallback listener) => controller.addListener(listener);
308
+
309
+ @override
310
+ void removeListener(VoidCallback listener) => controller.removeListener(listener);
311
+
312
+ @override
313
+ bool operator ==(Object other) => other is _ControllerListenable && other.controller == controller;
314
+
315
+ @override
316
+ int get hashCode => controller.hashCode;
317
+ }
318
+
319
+ // ── Phases ───────────────────────────────────────────────────────────────
320
+
321
+ class _Centered extends StatelessWidget {
322
+ const _Centered({required this.scrollable, required this.child});
323
+
324
+ final bool scrollable;
325
+ final Widget child;
326
+
327
+ @override
328
+ Widget build(BuildContext context) {
329
+ final content = Padding(padding: const EdgeInsets.all(32), child: child);
330
+ if (!scrollable) return content;
331
+ return Center(child: SingleChildScrollView(child: content));
332
+ }
333
+ }
334
+
335
+ class _Loading extends StatelessWidget {
336
+ const _Loading();
337
+
338
+ @override
339
+ Widget build(BuildContext context) {
340
+ final scope = BdFormScope.of(context);
341
+ return Column(
342
+ mainAxisSize: MainAxisSize.min,
343
+ spacing: 12,
344
+ children: [
345
+ const BdSpinner(size: 32),
346
+ Text(scope.strings.loading, style: TextStyle(color: BdColors.of(context).muted)),
347
+ ],
348
+ );
349
+ }
350
+ }
351
+
352
+ class _Failed extends StatelessWidget {
353
+ const _Failed(this.message, {required this.onRetry});
354
+
355
+ final String message;
356
+ final VoidCallback onRetry;
357
+
358
+ @override
359
+ Widget build(BuildContext context) {
360
+ final scope = BdFormScope.of(context);
361
+ final colors = BdColors.of(context);
362
+ return Column(
363
+ mainAxisSize: MainAxisSize.min,
364
+ spacing: 12,
365
+ children: [
366
+ Icon(scope.cupertino ? CupertinoIcons.exclamationmark_triangle_fill : Icons.warning_rounded, color: colors.error, size: 40),
367
+ Text(scope.strings.loadFailed, textAlign: TextAlign.center, style: Theme.of(context).textTheme.titleMedium),
368
+ Text(message, textAlign: TextAlign.center, style: TextStyle(color: colors.muted)),
369
+ BdButton(label: scope.strings.retry, onPressed: onRetry),
370
+ ],
371
+ );
372
+ }
373
+ }
374
+
375
+ /// The thank-you screen.
376
+ class _Success extends StatelessWidget {
377
+ const _Success();
378
+
379
+ @override
380
+ Widget build(BuildContext context) {
381
+ final scope = BdFormScope.of(context);
382
+ final colors = BdColors.of(context);
383
+ final theme = Theme.of(context);
384
+ return Column(
385
+ mainAxisSize: MainAxisSize.min,
386
+ spacing: 12,
387
+ children: [
388
+ Container(
389
+ width: 72,
390
+ height: 72,
391
+ decoration: BoxDecoration(shape: BoxShape.circle, color: theme.colorScheme.primaryContainer),
392
+ child: Icon(
393
+ scope.cupertino ? CupertinoIcons.check_mark_circled_solid : Icons.check_circle,
394
+ size: 44,
395
+ color: colors.primary,
396
+ ),
397
+ ),
398
+ Semantics(
399
+ header: true,
400
+ child: Text(scope.strings.successTitle, textAlign: TextAlign.center, style: theme.textTheme.headlineSmall),
401
+ ),
402
+ Text(scope.strings.successMessage, textAlign: TextAlign.center, style: TextStyle(color: colors.muted)),
403
+ BdButton(label: scope.strings.submitAnother, onPressed: scope.controller.reset),
404
+ ],
405
+ );
406
+ }
407
+ }
408
+
409
+ // ── Body ─────────────────────────────────────────────────────────────────
410
+
411
+ class _Body extends StatefulWidget {
412
+ const _Body({required this.scrollable});
413
+
414
+ final bool scrollable;
415
+
416
+ @override
417
+ State<_Body> createState() => _BodyState();
418
+ }
419
+
420
+ class _BodyState extends State<_Body> {
421
+ final _scroll = ScrollController();
422
+ final _top = GlobalKey();
423
+ int? _shownStep;
424
+ var _errorToken = 0;
425
+
426
+ @override
427
+ void dispose() {
428
+ _scroll.dispose();
429
+ super.dispose();
430
+ }
431
+
432
+ /// The first field with an error, in the order the visitor sees them.
433
+ String? _firstErrorKey(BdFormController c) {
434
+ final order = <String>[];
435
+ void walk(List<BdFormField> nodes, String prefix) {
436
+ for (final n in nodes) {
437
+ order.add(prefix + n.id);
438
+ if (n.type == 'multi_populator') {
439
+ final count = c.value(n.id)?.arrayValue?.length ?? 1;
440
+ for (var i = 0; i < (count < 1 ? 1 : count); i++) {
441
+ walk(n.children ?? const [], '$prefix${n.id}[$i].');
442
+ }
443
+ } else {
444
+ walk(n.children ?? const [], prefix);
445
+ }
446
+ }
447
+ }
448
+
449
+ walk(c.visibleFields, '');
450
+ final errors = c.errors;
451
+ for (final key in order) {
452
+ if (errors[key] != null) return key;
453
+ }
454
+ return null;
455
+ }
456
+
457
+ void _reveal(GlobalKey key) {
458
+ final target = key.currentContext;
459
+ if (target == null) return;
460
+ Scrollable.ensureVisible(
461
+ target,
462
+ duration: const Duration(milliseconds: 300),
463
+ curve: Curves.easeInOut,
464
+ alignment: 0.1,
465
+ );
466
+ }
467
+
468
+ @override
469
+ Widget build(BuildContext context) {
470
+ final scope = BdFormScope.of(context);
471
+ final c = scope.controller;
472
+ final state = scope.state;
473
+ final style = scope.style;
474
+
475
+ // An attempt that surfaced errors: bring the first one into view.
476
+ if (state.errorScrollToken != _errorToken) {
477
+ _errorToken = state.errorScrollToken;
478
+ if (_errorToken != 0) {
479
+ WidgetsBinding.instance.addPostFrameCallback((_) {
480
+ final key = _firstErrorKey(c);
481
+ final target = key == null ? null : scope.scrollTargets[key];
482
+ if (target != null) _reveal(target);
483
+ });
484
+ }
485
+ }
486
+ // A new step starts at its top.
487
+ final step = c.currentStep;
488
+ if (_shownStep != null && _shownStep != step) {
489
+ WidgetsBinding.instance.addPostFrameCallback((_) {
490
+ if (widget.scrollable && _scroll.hasClients) {
491
+ _scroll.animateTo(0, duration: const Duration(milliseconds: 250), curve: Curves.easeOut);
492
+ } else {
493
+ _reveal(_top);
494
+ }
495
+ });
496
+ }
497
+ _shownStep = step;
498
+
499
+ final content = Padding(
500
+ key: _top,
501
+ padding: style.padding,
502
+ child: AutofillGroup(
503
+ child: Column(
504
+ crossAxisAlignment: CrossAxisAlignment.stretch,
505
+ spacing: style.spacing,
506
+ children: const [_Header(), _Steps(), _Footer()],
507
+ ),
508
+ ),
509
+ );
510
+
511
+ final guarded = _ExitGuard(child: content);
512
+ if (!widget.scrollable) return guarded;
513
+ return SingleChildScrollView(
514
+ controller: _scroll,
515
+ keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
516
+ child: guarded,
517
+ );
518
+ }
519
+ }
520
+
521
+ class _Header extends StatelessWidget {
522
+ const _Header();
523
+
524
+ @override
525
+ Widget build(BuildContext context) {
526
+ final scope = BdFormScope.of(context);
527
+ final c = scope.controller;
528
+ final style = scope.style;
529
+ final theme = Theme.of(context);
530
+ final title = style.showsTitle ? c.schema?.title.nonEmpty : null;
531
+ final description = style.showsDescription ? c.schema?.description.nonEmpty : null;
532
+ final showProgress = style.showsProgress && c.isConsecutive && c.settings.showProgress != false && c.stepCount > 1;
533
+ if (title == null && description == null && !showProgress) return const SizedBox.shrink();
534
+ return Column(
535
+ crossAxisAlignment: CrossAxisAlignment.stretch,
536
+ spacing: 8,
537
+ children: [
538
+ if (title != null) Semantics(header: true, child: Text(title, style: theme.textTheme.headlineSmall)),
539
+ if (description != null)
540
+ Text(description, style: theme.textTheme.bodyLarge?.copyWith(color: BdColors.of(context).muted)),
541
+ if (showProgress) const _Progress(),
542
+ ],
543
+ );
544
+ }
545
+ }
546
+
547
+ class _Progress extends StatelessWidget {
548
+ const _Progress();
549
+
550
+ @override
551
+ Widget build(BuildContext context) {
552
+ final scope = BdFormScope.of(context);
553
+ final c = scope.controller;
554
+ final colors = BdColors.of(context);
555
+ final current = c.currentStep;
556
+ final count = c.stepCount;
557
+ final caption = '${scope.strings.format(scope.strings.stepOf, [current + 1, count])} · ${c.stepTitle(current)}';
558
+ return MergeSemantics(
559
+ child: Column(
560
+ crossAxisAlignment: CrossAxisAlignment.stretch,
561
+ spacing: 6,
562
+ children: [
563
+ if (c.settings.progressStyle == 'steps')
564
+ Row(
565
+ spacing: 6,
566
+ children: [
567
+ for (var i = 0; i < count; i++)
568
+ Expanded(
569
+ child: AnimatedContainer(
570
+ duration: const Duration(milliseconds: 200),
571
+ height: 4,
572
+ decoration: BoxDecoration(
573
+ borderRadius: BorderRadius.circular(2),
574
+ color: i <= current ? colors.primary : colors.fill,
575
+ ),
576
+ ),
577
+ ),
578
+ ],
579
+ )
580
+ else
581
+ ClipRRect(
582
+ borderRadius: BorderRadius.circular(2),
583
+ child: TweenAnimationBuilder<double>(
584
+ tween: Tween(end: c.progress),
585
+ duration: const Duration(milliseconds: 250),
586
+ builder: (context, v, _) => LinearProgressIndicator(
587
+ value: v,
588
+ minHeight: 4,
589
+ color: colors.primary,
590
+ backgroundColor: colors.fill,
591
+ ),
592
+ ),
593
+ ),
594
+ Text(caption, style: Theme.of(context).textTheme.labelMedium?.copyWith(color: colors.muted)),
595
+ ],
596
+ ),
597
+ );
598
+ }
599
+ }
600
+
601
+ class _Steps extends StatelessWidget {
602
+ const _Steps();
603
+
604
+ @override
605
+ Widget build(BuildContext context) {
606
+ final scope = BdFormScope.of(context);
607
+ final c = scope.controller;
608
+ if (!scope.style.animated || !c.isConsecutive) return BdFieldTree(c.visibleFields, const []);
609
+ final forward = scope.state.movingForward;
610
+ return AnimatedSwitcher(
611
+ duration: const Duration(milliseconds: 250),
612
+ layoutBuilder: (current, previous) => Stack(
613
+ alignment: Alignment.topCenter,
614
+ children: [...previous, ?current],
615
+ ),
616
+ transitionBuilder: (child, animation) {
617
+ final incoming = child.key == ValueKey(c.currentStep);
618
+ final dx = (incoming == forward) ? 0.2 : -0.2;
619
+ return FadeTransition(
620
+ opacity: animation,
621
+ child: SlideTransition(
622
+ position: Tween(begin: Offset(dx, 0), end: Offset.zero).animate(animation),
623
+ child: child,
624
+ ),
625
+ );
626
+ },
627
+ child: KeyedSubtree(key: ValueKey(c.currentStep), child: BdFieldTree(c.visibleFields, const [])),
628
+ );
629
+ }
630
+ }
631
+
632
+ class _Footer extends StatelessWidget {
633
+ const _Footer();
634
+
635
+ @override
636
+ Widget build(BuildContext context) {
637
+ final scope = BdFormScope.of(context);
638
+ final c = scope.controller;
639
+ final state = scope.state;
640
+ final strings = scope.strings;
641
+ final colors = BdColors.of(context);
642
+ final theme = Theme.of(context);
643
+ String? failure;
644
+ if (state.result case final BdSubmitFailure f when !state.isSubmitting) {
645
+ failure = switch (f.reason) {
646
+ BdSubmitFailureReason.clientValidationFailed || BdSubmitFailureReason.validationFailed =>
647
+ state.errors.isEmpty ? f.message : strings.errorNotice,
648
+ _ => f.message,
649
+ };
650
+ }
651
+ BdCoupon? coupon;
652
+ if (c.isLastStep) {
653
+ for (final a in c.schema?.actions ?? const <BdFormAction>[]) {
654
+ if ((a.coupon?.code ?? '').isNotEmpty) {
655
+ coupon = a.coupon;
656
+ break;
657
+ }
658
+ }
659
+ }
660
+
661
+ return Column(
662
+ crossAxisAlignment: CrossAxisAlignment.stretch,
663
+ spacing: 12,
664
+ children: [
665
+ if (failure != null)
666
+ Semantics(
667
+ liveRegion: true,
668
+ child: Row(
669
+ spacing: 8,
670
+ children: [
671
+ Icon(scope.cupertino ? CupertinoIcons.exclamationmark_triangle_fill : Icons.warning_rounded, size: 18, color: colors.error),
672
+ Expanded(child: Text(failure, style: theme.textTheme.bodyMedium?.copyWith(color: colors.error))),
673
+ ],
674
+ ),
675
+ ),
676
+ if (coupon != null)
677
+ Row(
678
+ crossAxisAlignment: CrossAxisAlignment.start,
679
+ spacing: 8,
680
+ children: [
681
+ BdGlyph(BdGlyphs.tag, size: 18, color: colors.primary),
682
+ Expanded(
683
+ child: Column(
684
+ crossAxisAlignment: CrossAxisAlignment.start,
685
+ spacing: 4,
686
+ children: [
687
+ Text(
688
+ coupon.notice?.replaceAll('{code}', coupon.code ?? '') ??
689
+ strings.format(strings.couponApplied, [coupon.code ?? '']),
690
+ style: theme.textTheme.bodyMedium,
691
+ ),
692
+ if (coupon.finePrint.nonEmpty case final fine?)
693
+ Text(fine, style: theme.textTheme.bodySmall?.copyWith(color: colors.muted)),
694
+ ],
695
+ ),
696
+ ),
697
+ ],
698
+ ),
699
+ const _Navigation(),
700
+ ],
701
+ );
702
+ }
703
+ }
704
+
705
+ class _Navigation extends StatelessWidget {
706
+ const _Navigation();
707
+
708
+ @override
709
+ Widget build(BuildContext context) {
710
+ final scope = BdFormScope.of(context);
711
+ final c = scope.controller;
712
+ final strings = scope.strings;
713
+ final submitting = scope.state.isSubmitting;
714
+ final isSubmit = !c.isConsecutive || c.isLastStep;
715
+ final kind = switch (scope.style.submitButton) {
716
+ BdButtonProminence.filled => BdButtonKind.filled,
717
+ BdButtonProminence.tonal => BdButtonKind.tonal,
718
+ BdButtonProminence.outlined => BdButtonKind.outlined,
719
+ };
720
+ void primary() {
721
+ if (submitting) return;
722
+ FocusScope.of(context).unfocus();
723
+ if (isSubmit) {
724
+ c.submit();
725
+ } else {
726
+ c.next();
727
+ }
728
+ }
729
+
730
+ return Row(
731
+ spacing: 12,
732
+ children: [
733
+ if (c.isConsecutive && !c.isFirstStep)
734
+ BdButton(label: strings.back, onPressed: submitting ? null : c.back),
735
+ Expanded(
736
+ child: BdButton(
737
+ label: isSubmit ? (submitting ? strings.sending : strings.submit) : strings.next,
738
+ kind: kind,
739
+ busy: submitting,
740
+ expand: true,
741
+ onPressed: primary,
742
+ ),
743
+ ),
744
+ ],
745
+ );
746
+ }
747
+ }
748
+
749
+ /// Back asks before discarding answers, when the form turns that on and
750
+ /// the visitor has typed something.
751
+ class _ExitGuard extends StatelessWidget {
752
+ const _ExitGuard({required this.child});
753
+
754
+ final Widget child;
755
+
756
+ @override
757
+ Widget build(BuildContext context) {
758
+ final scope = BdFormScope.of(context);
759
+ final c = scope.controller;
760
+ final confirm = c.settings.exitConfirm;
761
+ final guard = confirm?.enabled == true && c.isDirty && !c.isSubmitted;
762
+ return PopScope<Object?>(
763
+ canPop: !guard,
764
+ onPopInvokedWithResult: (didPop, _) async {
765
+ if (didPop) return;
766
+ final strings = scope.strings;
767
+ final navigator = Navigator.of(context);
768
+ final leave = await bdConfirm(
769
+ context,
770
+ title: strings.exitTitle,
771
+ message: confirm?.message.nonEmpty ?? strings.exitMessage,
772
+ confirm: strings.exitLeave,
773
+ cancel: strings.exitStay,
774
+ destructive: true,
775
+ );
776
+ if (leave && navigator.mounted) navigator.pop();
777
+ },
778
+ child: child,
779
+ );
780
+ }
781
+ }