@kurbo/dkit 0.4.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 (241) hide show
  1. package/README.md +24 -0
  2. package/dist/bin.js +8066 -0
  3. package/dist/bin.js.map +1 -0
  4. package/package.json +58 -0
  5. package/vendor/registry/blocks/blog-detail/module.json +27 -0
  6. package/vendor/registry/blocks/blog-detail/ui/minimal/next/blog-detail.tsx +26 -0
  7. package/vendor/registry/blocks/blog-detail/ui/minimal/nuxt/BlogDetail.vue +27 -0
  8. package/vendor/registry/blocks/blog-detail/ui/shadcn/next/blog-detail.tsx +106 -0
  9. package/vendor/registry/blocks/blog-detail/ui/shadcn/nuxt/BlogDetail.vue +116 -0
  10. package/vendor/registry/blocks/blog-list/module.json +26 -0
  11. package/vendor/registry/blocks/blog-list/ui/minimal/next/blog-list.tsx +130 -0
  12. package/vendor/registry/blocks/blog-list/ui/minimal/nuxt/BlogList.vue +62 -0
  13. package/vendor/registry/blocks/blog-list/ui/shadcn/next/blog-list.tsx +109 -0
  14. package/vendor/registry/blocks/blog-list/ui/shadcn/nuxt/BlogList.vue +100 -0
  15. package/vendor/registry/blocks/blog-list-cards/module.json +27 -0
  16. package/vendor/registry/blocks/blog-list-cards/ui/minimal/next/blog-list-cards.tsx +130 -0
  17. package/vendor/registry/blocks/blog-list-cards/ui/minimal/nuxt/BlogListCards.vue +114 -0
  18. package/vendor/registry/blocks/blog-list-cards/ui/shadcn/next/blog-list-cards.tsx +119 -0
  19. package/vendor/registry/blocks/blog-list-cards/ui/shadcn/nuxt/BlogListCards.vue +113 -0
  20. package/vendor/registry/blocks/booking-form-ui/module.json +15 -0
  21. package/vendor/registry/blocks/booking-form-ui/ui/minimal/next/booking-form.tsx +89 -0
  22. package/vendor/registry/blocks/booking-form-ui/ui/shadcn/next/booking-form.tsx +92 -0
  23. package/vendor/registry/blocks/contact-form-ui/module.json +27 -0
  24. package/vendor/registry/blocks/contact-form-ui/ui/minimal/next/contact-form.tsx +45 -0
  25. package/vendor/registry/blocks/contact-form-ui/ui/minimal/nuxt/ContactForm.vue +79 -0
  26. package/vendor/registry/blocks/contact-form-ui/ui/shadcn/next/contact-form.tsx +55 -0
  27. package/vendor/registry/blocks/contact-form-ui/ui/shadcn/nuxt/ContactForm.vue +92 -0
  28. package/vendor/registry/blocks/faq-list/module.json +15 -0
  29. package/vendor/registry/blocks/faq-list/ui/minimal/next/faq-list.tsx +78 -0
  30. package/vendor/registry/blocks/faq-list/ui/shadcn/next/faq-list.tsx +77 -0
  31. package/vendor/registry/blocks/maintenance-gate/module.json +13 -0
  32. package/vendor/registry/blocks/maintenance-gate/ui/minimal/next/maintenance-gate.tsx +135 -0
  33. package/vendor/registry/blocks/maintenance-gate/ui/shadcn/next/maintenance-gate.tsx +87 -0
  34. package/vendor/registry/blocks/nav-footer/module.json +13 -0
  35. package/vendor/registry/blocks/nav-footer/ui/minimal/next/nav-footer.tsx +55 -0
  36. package/vendor/registry/blocks/nav-footer/ui/shadcn/next/nav-footer.tsx +41 -0
  37. package/vendor/registry/blocks/nav-header/module.json +14 -0
  38. package/vendor/registry/blocks/nav-header/ui/minimal/next/nav-header.tsx +244 -0
  39. package/vendor/registry/blocks/nav-header/ui/shadcn/next/nav-header-client.tsx +185 -0
  40. package/vendor/registry/blocks/nav-header/ui/shadcn/next/nav-header.tsx +12 -0
  41. package/vendor/registry/blocks/page-detail/module.json +26 -0
  42. package/vendor/registry/blocks/page-detail/ui/minimal/next/page-detail.tsx +26 -0
  43. package/vendor/registry/blocks/page-detail/ui/minimal/nuxt/PageDetail.vue +26 -0
  44. package/vendor/registry/blocks/page-detail/ui/shadcn/next/page-detail.tsx +61 -0
  45. package/vendor/registry/blocks/page-detail/ui/shadcn/nuxt/PageDetail.vue +62 -0
  46. package/vendor/registry/blocks/project-detail/module.json +15 -0
  47. package/vendor/registry/blocks/project-detail/ui/minimal/next/project-detail.tsx +58 -0
  48. package/vendor/registry/blocks/project-detail/ui/shadcn/next/project-detail.tsx +91 -0
  49. package/vendor/registry/blocks/project-list/module.json +14 -0
  50. package/vendor/registry/blocks/project-list/ui/minimal/next/project-list.tsx +104 -0
  51. package/vendor/registry/blocks/project-list/ui/shadcn/next/project-list.tsx +81 -0
  52. package/vendor/registry/blocks/project-list-cards/module.json +15 -0
  53. package/vendor/registry/blocks/project-list-cards/ui/minimal/next/project-list-cards.tsx +125 -0
  54. package/vendor/registry/blocks/project-list-cards/ui/shadcn/next/project-list-cards.tsx +94 -0
  55. package/vendor/registry/blocks/projects-carousel/module.json +15 -0
  56. package/vendor/registry/blocks/projects-carousel/ui/minimal/next/projects-carousel-client.tsx +239 -0
  57. package/vendor/registry/blocks/projects-carousel/ui/minimal/next/projects-carousel.tsx +24 -0
  58. package/vendor/registry/blocks/projects-carousel/ui/shadcn/next/projects-carousel-client.tsx +102 -0
  59. package/vendor/registry/blocks/projects-carousel/ui/shadcn/next/projects-carousel.tsx +24 -0
  60. package/vendor/registry/blocks/service-detail/module.json +15 -0
  61. package/vendor/registry/blocks/service-detail/ui/minimal/next/service-detail.tsx +49 -0
  62. package/vendor/registry/blocks/service-detail/ui/shadcn/next/service-detail.tsx +75 -0
  63. package/vendor/registry/blocks/service-list/module.json +14 -0
  64. package/vendor/registry/blocks/service-list/ui/minimal/next/service-list.tsx +103 -0
  65. package/vendor/registry/blocks/service-list/ui/shadcn/next/service-list.tsx +80 -0
  66. package/vendor/registry/blocks/service-list-cards/module.json +15 -0
  67. package/vendor/registry/blocks/service-list-cards/ui/minimal/next/service-list-cards.tsx +124 -0
  68. package/vendor/registry/blocks/service-list-cards/ui/shadcn/next/service-list-cards.tsx +92 -0
  69. package/vendor/registry/blocks/site-brand/module.json +13 -0
  70. package/vendor/registry/blocks/site-brand/ui/minimal/next/site-brand.tsx +61 -0
  71. package/vendor/registry/blocks/site-brand/ui/shadcn/next/site-brand.tsx +48 -0
  72. package/vendor/registry/blocks/site-logo/module.json +13 -0
  73. package/vendor/registry/blocks/site-logo/ui/minimal/next/site-logo.tsx +37 -0
  74. package/vendor/registry/blocks/site-logo/ui/shadcn/next/site-logo.tsx +34 -0
  75. package/vendor/registry/blocks/social-links/module.json +13 -0
  76. package/vendor/registry/blocks/social-links/ui/minimal/next/social-links.tsx +55 -0
  77. package/vendor/registry/blocks/social-links/ui/shadcn/next/social-links.tsx +46 -0
  78. package/vendor/registry/blocks/team-detail/module.json +15 -0
  79. package/vendor/registry/blocks/team-detail/ui/minimal/next/team-detail.tsx +113 -0
  80. package/vendor/registry/blocks/team-detail/ui/shadcn/next/team-detail.tsx +77 -0
  81. package/vendor/registry/blocks/team-list/module.json +14 -0
  82. package/vendor/registry/blocks/team-list/ui/minimal/next/team-list.tsx +113 -0
  83. package/vendor/registry/blocks/team-list/ui/shadcn/next/team-list.tsx +77 -0
  84. package/vendor/registry/blocks/team-list-cards/module.json +15 -0
  85. package/vendor/registry/blocks/team-list-cards/ui/minimal/next/team-list-cards.tsx +111 -0
  86. package/vendor/registry/blocks/team-list-cards/ui/shadcn/next/team-list-cards.tsx +83 -0
  87. package/vendor/registry/blocks/testimonials-carousel/module.json +15 -0
  88. package/vendor/registry/blocks/testimonials-carousel/ui/minimal/next/testimonials-carousel-client.tsx +230 -0
  89. package/vendor/registry/blocks/testimonials-carousel/ui/minimal/next/testimonials-carousel.tsx +23 -0
  90. package/vendor/registry/blocks/testimonials-carousel/ui/shadcn/next/testimonials-carousel-client.tsx +91 -0
  91. package/vendor/registry/blocks/testimonials-carousel/ui/shadcn/next/testimonials-carousel.tsx +23 -0
  92. package/vendor/registry/blocks/testimonials-list/module.json +14 -0
  93. package/vendor/registry/blocks/testimonials-list/ui/minimal/next/testimonials-list.tsx +109 -0
  94. package/vendor/registry/blocks/testimonials-list/ui/shadcn/next/testimonials-list.tsx +72 -0
  95. package/vendor/registry/blocks/testimonials-list-cards/module.json +15 -0
  96. package/vendor/registry/blocks/testimonials-list-cards/ui/minimal/next/testimonials-list-cards.tsx +114 -0
  97. package/vendor/registry/blocks/testimonials-list-cards/ui/shadcn/next/testimonials-list-cards.tsx +72 -0
  98. package/vendor/registry/core/languages/policies.json +25 -0
  99. package/vendor/registry/core/languages/seed.json +16 -0
  100. package/vendor/registry/core/languages/snapshot.json +94 -0
  101. package/vendor/registry/modules/blog/access/policies.json +49 -0
  102. package/vendor/registry/modules/blog/access/policies.multilocale.json +67 -0
  103. package/vendor/registry/modules/blog/lib.multilocale.ts +552 -0
  104. package/vendor/registry/modules/blog/lib.ts +346 -0
  105. package/vendor/registry/modules/blog/module.json +50 -0
  106. package/vendor/registry/modules/blog/schema/snapshot.json +701 -0
  107. package/vendor/registry/modules/blog/schema/snapshot.multilocale.json +884 -0
  108. package/vendor/registry/modules/blog/services/ATTRIBUTION.md +8 -0
  109. package/vendor/registry/modules/blog/services/assets/ada-lovelace-avatar.jpg +0 -0
  110. package/vendor/registry/modules/blog/services/assets/hello-from-dkit-cover.jpg +0 -0
  111. package/vendor/registry/modules/blog/services/seed.json +70 -0
  112. package/vendor/registry/modules/blog/services/seed.multilocale.json +90 -0
  113. package/vendor/registry/modules/blog/types.multilocale.ts +96 -0
  114. package/vendor/registry/modules/blog/types.ts +62 -0
  115. package/vendor/registry/modules/booking-form/access/policies.json +25 -0
  116. package/vendor/registry/modules/booking-form/access/policies.multilocale.json +27 -0
  117. package/vendor/registry/modules/booking-form/lib.multilocale.ts +71 -0
  118. package/vendor/registry/modules/booking-form/lib.ts +77 -0
  119. package/vendor/registry/modules/booking-form/module.json +32 -0
  120. package/vendor/registry/modules/booking-form/schema/snapshot.json +294 -0
  121. package/vendor/registry/modules/booking-form/schema/snapshot.multilocale.json +467 -0
  122. package/vendor/registry/modules/booking-form/services/flows.json +19 -0
  123. package/vendor/registry/modules/booking-form/types.multilocale.ts +29 -0
  124. package/vendor/registry/modules/booking-form/types.ts +27 -0
  125. package/vendor/registry/modules/contact-form/access/policies.json +25 -0
  126. package/vendor/registry/modules/contact-form/access/policies.multilocale.json +27 -0
  127. package/vendor/registry/modules/contact-form/lib.multilocale.ts +65 -0
  128. package/vendor/registry/modules/contact-form/lib.ts +67 -0
  129. package/vendor/registry/modules/contact-form/module.json +32 -0
  130. package/vendor/registry/modules/contact-form/schema/snapshot.json +193 -0
  131. package/vendor/registry/modules/contact-form/schema/snapshot.multilocale.json +293 -0
  132. package/vendor/registry/modules/contact-form/services/flows.json +19 -0
  133. package/vendor/registry/modules/contact-form/types.multilocale.ts +21 -0
  134. package/vendor/registry/modules/contact-form/types.ts +19 -0
  135. package/vendor/registry/modules/faq/access/policies.json +25 -0
  136. package/vendor/registry/modules/faq/access/policies.multilocale.json +18 -0
  137. package/vendor/registry/modules/faq/lib.multilocale.ts +120 -0
  138. package/vendor/registry/modules/faq/lib.ts +73 -0
  139. package/vendor/registry/modules/faq/module.json +31 -0
  140. package/vendor/registry/modules/faq/schema/snapshot.json +180 -0
  141. package/vendor/registry/modules/faq/schema/snapshot.multilocale.json +116 -0
  142. package/vendor/registry/modules/faq/services/seed.json +38 -0
  143. package/vendor/registry/modules/faq/services/seed.multilocale.json +32 -0
  144. package/vendor/registry/modules/faq/types.multilocale.ts +31 -0
  145. package/vendor/registry/modules/faq/types.ts +17 -0
  146. package/vendor/registry/modules/navigation/access/policies.json +31 -0
  147. package/vendor/registry/modules/navigation/access/policies.multilocale.json +51 -0
  148. package/vendor/registry/modules/navigation/lib.multilocale.ts +198 -0
  149. package/vendor/registry/modules/navigation/lib.ts +252 -0
  150. package/vendor/registry/modules/navigation/module.json +46 -0
  151. package/vendor/registry/modules/navigation/schema/snapshot.json +453 -0
  152. package/vendor/registry/modules/navigation/schema/snapshot.multilocale.json +864 -0
  153. package/vendor/registry/modules/navigation/services/seed.json +103 -0
  154. package/vendor/registry/modules/navigation/services/seed.multilocale.json +88 -0
  155. package/vendor/registry/modules/navigation/types.multilocale.ts +60 -0
  156. package/vendor/registry/modules/navigation/types.ts +44 -0
  157. package/vendor/registry/modules/pages/access/policies.json +25 -0
  158. package/vendor/registry/modules/pages/access/policies.multilocale.json +18 -0
  159. package/vendor/registry/modules/pages/lib.multilocale.ts +166 -0
  160. package/vendor/registry/modules/pages/lib.ts +123 -0
  161. package/vendor/registry/modules/pages/module.json +39 -0
  162. package/vendor/registry/modules/pages/schema/snapshot.json +247 -0
  163. package/vendor/registry/modules/pages/schema/snapshot.multilocale.json +187 -0
  164. package/vendor/registry/modules/pages/services/seed.json +24 -0
  165. package/vendor/registry/modules/pages/services/seed.multilocale.json +34 -0
  166. package/vendor/registry/modules/pages/types.multilocale.ts +37 -0
  167. package/vendor/registry/modules/pages/types.ts +21 -0
  168. package/vendor/registry/modules/projects/access/policies.json +31 -0
  169. package/vendor/registry/modules/projects/access/policies.multilocale.json +43 -0
  170. package/vendor/registry/modules/projects/lib.multilocale.ts +111 -0
  171. package/vendor/registry/modules/projects/lib.ts +138 -0
  172. package/vendor/registry/modules/projects/module.json +48 -0
  173. package/vendor/registry/modules/projects/schema/snapshot.json +348 -0
  174. package/vendor/registry/modules/projects/schema/snapshot.multilocale.json +577 -0
  175. package/vendor/registry/modules/projects/services/ATTRIBUTION.md +7 -0
  176. package/vendor/registry/modules/projects/services/assets/brand-identity-cover.jpg +0 -0
  177. package/vendor/registry/modules/projects/services/seed.json +40 -0
  178. package/vendor/registry/modules/projects/services/seed.multilocale.json +31 -0
  179. package/vendor/registry/modules/projects/types.multilocale.ts +38 -0
  180. package/vendor/registry/modules/projects/types.ts +28 -0
  181. package/vendor/registry/modules/services/access/policies.json +31 -0
  182. package/vendor/registry/modules/services/access/policies.multilocale.json +43 -0
  183. package/vendor/registry/modules/services/lib.multilocale.ts +109 -0
  184. package/vendor/registry/modules/services/lib.ts +134 -0
  185. package/vendor/registry/modules/services/module.json +47 -0
  186. package/vendor/registry/modules/services/schema/snapshot.json +305 -0
  187. package/vendor/registry/modules/services/schema/snapshot.multilocale.json +510 -0
  188. package/vendor/registry/modules/services/services/ATTRIBUTION.md +8 -0
  189. package/vendor/registry/modules/services/services/assets/design-development.jpg +0 -0
  190. package/vendor/registry/modules/services/services/assets/strategy-consulting.jpg +0 -0
  191. package/vendor/registry/modules/services/services/seed.json +44 -0
  192. package/vendor/registry/modules/services/services/seed.multilocale.json +31 -0
  193. package/vendor/registry/modules/services/types.multilocale.ts +36 -0
  194. package/vendor/registry/modules/services/types.ts +26 -0
  195. package/vendor/registry/modules/settings/access/policies.json +31 -0
  196. package/vendor/registry/modules/settings/access/policies.multilocale.json +43 -0
  197. package/vendor/registry/modules/settings/lib.multilocale.ts +158 -0
  198. package/vendor/registry/modules/settings/lib.ts +259 -0
  199. package/vendor/registry/modules/settings/module.json +33 -0
  200. package/vendor/registry/modules/settings/schema/snapshot.json +315 -0
  201. package/vendor/registry/modules/settings/schema/snapshot.multilocale.json +586 -0
  202. package/vendor/registry/modules/settings/services/assets/dkit-logo.svg +4 -0
  203. package/vendor/registry/modules/settings/services/seed.json +31 -0
  204. package/vendor/registry/modules/settings/services/seed.multilocale.json +42 -0
  205. package/vendor/registry/modules/settings/types.multilocale.ts +72 -0
  206. package/vendor/registry/modules/settings/types.ts +94 -0
  207. package/vendor/registry/modules/team/access/policies.json +31 -0
  208. package/vendor/registry/modules/team/access/policies.multilocale.json +43 -0
  209. package/vendor/registry/modules/team/lib.multilocale.ts +88 -0
  210. package/vendor/registry/modules/team/lib.ts +120 -0
  211. package/vendor/registry/modules/team/module.json +47 -0
  212. package/vendor/registry/modules/team/schema/snapshot.json +295 -0
  213. package/vendor/registry/modules/team/schema/snapshot.multilocale.json +525 -0
  214. package/vendor/registry/modules/team/services/ATTRIBUTION.md +8 -0
  215. package/vendor/registry/modules/team/services/assets/morgan-lee-photo.jpg +0 -0
  216. package/vendor/registry/modules/team/services/assets/taylor-kim-photo.jpg +0 -0
  217. package/vendor/registry/modules/team/services/seed.json +52 -0
  218. package/vendor/registry/modules/team/services/seed.multilocale.json +30 -0
  219. package/vendor/registry/modules/team/types.multilocale.ts +33 -0
  220. package/vendor/registry/modules/team/types.ts +27 -0
  221. package/vendor/registry/modules/testimonials/access/policies.json +31 -0
  222. package/vendor/registry/modules/testimonials/access/policies.multilocale.json +43 -0
  223. package/vendor/registry/modules/testimonials/lib.multilocale.ts +93 -0
  224. package/vendor/registry/modules/testimonials/lib.ts +85 -0
  225. package/vendor/registry/modules/testimonials/module.json +41 -0
  226. package/vendor/registry/modules/testimonials/schema/snapshot.json +248 -0
  227. package/vendor/registry/modules/testimonials/schema/snapshot.multilocale.json +462 -0
  228. package/vendor/registry/modules/testimonials/services/ATTRIBUTION.md +8 -0
  229. package/vendor/registry/modules/testimonials/services/assets/jane-doe-avatar.jpg +0 -0
  230. package/vendor/registry/modules/testimonials/services/assets/sample-author-avatar.jpg +0 -0
  231. package/vendor/registry/modules/testimonials/services/seed.json +49 -0
  232. package/vendor/registry/modules/testimonials/services/seed.multilocale.json +30 -0
  233. package/vendor/registry/modules/testimonials/types.multilocale.ts +27 -0
  234. package/vendor/registry/modules/testimonials/types.ts +22 -0
  235. package/vendor/registry/registry.json +832 -0
  236. package/vendor/registry/shared/helpers.ts +16 -0
  237. package/vendor/registry/shared/i18n.ts +74 -0
  238. package/vendor/registry/shared/minimal.css +83 -0
  239. package/vendor/registry/shared/paths.ts +50 -0
  240. package/vendor/registry/shared/prose.css +113 -0
  241. package/vendor/registry/tsconfig.json +49 -0
@@ -0,0 +1,89 @@
1
+ "use client";
2
+
3
+ import { useActionState } from "react";
4
+ import {
5
+ submitBookingForm,
6
+ type BookingFormState,
7
+ } from "@/lib/dkit/booking-form";
8
+
9
+ const initial: BookingFormState = { ok: false };
10
+
11
+ /** Minimal kit — semantic form markup only. */
12
+ export function BookingForm() {
13
+ const [state, action, pending] = useActionState(submitBookingForm, initial);
14
+
15
+ if (state.ok) {
16
+ return (
17
+ <p>
18
+ Thanks — your booking request has been received. We&apos;ll be in touch
19
+ soon.
20
+ </p>
21
+ );
22
+ }
23
+
24
+ return (
25
+ <form action={action}>
26
+ <p>Fill out the form below to request a booking.</p>
27
+
28
+ <fieldset>
29
+ <legend>Contact details</legend>
30
+ <p>
31
+ <label htmlFor="name">
32
+ Name <abbr title="required">*</abbr>
33
+ </label>
34
+ <br />
35
+ <input id="name" name="name" required />
36
+ </p>
37
+ <p>
38
+ <label htmlFor="email">
39
+ Email <abbr title="required">*</abbr>
40
+ </label>
41
+ <br />
42
+ <input id="email" name="email" type="email" required />
43
+ </p>
44
+ <p>
45
+ <label htmlFor="phone">Phone</label>
46
+ <br />
47
+ <input id="phone" name="phone" type="tel" />
48
+ </p>
49
+ </fieldset>
50
+
51
+ <fieldset>
52
+ <legend>Booking details</legend>
53
+ <p>
54
+ <label htmlFor="service">Service</label>
55
+ <br />
56
+ <input id="service" name="service" />
57
+ </p>
58
+ <p>
59
+ <label htmlFor="preferred_date">Preferred date</label>
60
+ <br />
61
+ <input id="preferred_date" name="preferred_date" type="date" />
62
+ </p>
63
+ <p>
64
+ <label htmlFor="preferred_time">Preferred time</label>
65
+ <br />
66
+ <input
67
+ id="preferred_time"
68
+ name="preferred_time"
69
+ placeholder="e.g. 10:00 AM"
70
+ />
71
+ </p>
72
+ </fieldset>
73
+
74
+ <p>
75
+ <label htmlFor="message">Message</label>
76
+ <br />
77
+ <textarea id="message" name="message" rows={4} />
78
+ </p>
79
+
80
+ {state.error ? <p>{state.error}</p> : null}
81
+
82
+ <p>
83
+ <button type="submit" disabled={pending}>
84
+ {pending ? "Sending…" : "Request booking"}
85
+ </button>
86
+ </p>
87
+ </form>
88
+ );
89
+ }
@@ -0,0 +1,92 @@
1
+ "use client";
2
+
3
+ import { useActionState } from "react";
4
+ import {
5
+ submitBookingForm,
6
+ type BookingFormState,
7
+ } from "@/lib/dkit/booking-form";
8
+ import { Button } from "@/components/ui/button";
9
+ import { Card, CardContent } from "@/components/ui/card";
10
+ import { Input } from "@/components/ui/input";
11
+ import { Label } from "@/components/ui/label";
12
+ import { Textarea } from "@/components/ui/textarea";
13
+
14
+ const initial: BookingFormState = { ok: false };
15
+
16
+ /** Uses your project's shadcn/ui components. */
17
+ export function BookingForm() {
18
+ const [state, action, pending] = useActionState(submitBookingForm, initial);
19
+
20
+ if (state.ok) {
21
+ return (
22
+ <Card className="max-w-lg bg-muted/40">
23
+ <CardContent className="pt-6 text-foreground">
24
+ Thanks — your booking request has been received. We&apos;ll be in
25
+ touch soon.
26
+ </CardContent>
27
+ </Card>
28
+ );
29
+ }
30
+
31
+ return (
32
+ <form action={action} className="max-w-lg space-y-4">
33
+ <p className="text-sm text-muted-foreground">
34
+ Fill out the form below to request a booking.
35
+ </p>
36
+
37
+ <div className="grid gap-4 sm:grid-cols-2">
38
+ <div className="space-y-2">
39
+ <Label htmlFor="name">
40
+ Name <span className="text-destructive">*</span>
41
+ </Label>
42
+ <Input id="name" name="name" required />
43
+ </div>
44
+ <div className="space-y-2">
45
+ <Label htmlFor="email">
46
+ Email <span className="text-destructive">*</span>
47
+ </Label>
48
+ <Input id="email" name="email" type="email" required />
49
+ </div>
50
+ </div>
51
+
52
+ <div className="grid gap-4 sm:grid-cols-2">
53
+ <div className="space-y-2">
54
+ <Label htmlFor="phone">Phone</Label>
55
+ <Input id="phone" name="phone" type="tel" />
56
+ </div>
57
+ <div className="space-y-2">
58
+ <Label htmlFor="service">Service</Label>
59
+ <Input id="service" name="service" />
60
+ </div>
61
+ </div>
62
+
63
+ <div className="grid gap-4 sm:grid-cols-2">
64
+ <div className="space-y-2">
65
+ <Label htmlFor="preferred_date">Preferred date</Label>
66
+ <Input id="preferred_date" name="preferred_date" type="date" />
67
+ </div>
68
+ <div className="space-y-2">
69
+ <Label htmlFor="preferred_time">Preferred time</Label>
70
+ <Input
71
+ id="preferred_time"
72
+ name="preferred_time"
73
+ placeholder="e.g. 10:00 AM"
74
+ />
75
+ </div>
76
+ </div>
77
+
78
+ <div className="space-y-2">
79
+ <Label htmlFor="message">Message</Label>
80
+ <Textarea id="message" name="message" rows={4} />
81
+ </div>
82
+
83
+ {state.error ? (
84
+ <p className="text-sm text-destructive">{state.error}</p>
85
+ ) : null}
86
+
87
+ <Button type="submit" disabled={pending}>
88
+ {pending ? "Sending…" : "Request booking"}
89
+ </Button>
90
+ </form>
91
+ );
92
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "type": "dkit:block",
3
+ "id": "contact-form-ui",
4
+ "title": "Contact form UI",
5
+ "description": "Validated contact form (Next Server Action / Nuxt client submit)",
6
+ "version": "0.1.0",
7
+ "frameworks": [
8
+ "next",
9
+ "nuxt"
10
+ ],
11
+ "uiKits": [
12
+ "shadcn",
13
+ "minimal"
14
+ ],
15
+ "shadcnComponents": ["button", "input", "label", "textarea"],
16
+ "slot": "form",
17
+ "route": { "kind": "static" },
18
+ "registryDependencies": [
19
+ "contact-form"
20
+ ],
21
+ "dependencies": [
22
+ "@directus/sdk"
23
+ ],
24
+ "layers": [
25
+ "ui"
26
+ ]
27
+ }
@@ -0,0 +1,45 @@
1
+ "use client";
2
+
3
+ import { useActionState } from "react";
4
+ import {
5
+ submitContactForm,
6
+ type ContactFormState,
7
+ } from "@/lib/dkit/contact-form";
8
+
9
+ const initial: ContactFormState = { ok: false };
10
+
11
+ /** Minimal kit — semantic form markup only. */
12
+ export function ContactForm() {
13
+ const [state, action, pending] = useActionState(submitContactForm, initial);
14
+
15
+ if (state.ok) {
16
+ return <p>Thanks — we received your message.</p>;
17
+ }
18
+
19
+ return (
20
+ <form action={action}>
21
+ <p>Send a message and we&apos;ll get back to you.</p>
22
+ <p>
23
+ <label htmlFor="name">Name</label>
24
+ <br />
25
+ <input id="name" name="name" required />
26
+ </p>
27
+ <p>
28
+ <label htmlFor="email">Email</label>
29
+ <br />
30
+ <input id="email" name="email" type="email" required />
31
+ </p>
32
+ <p>
33
+ <label htmlFor="message">Message</label>
34
+ <br />
35
+ <textarea id="message" name="message" required rows={5} />
36
+ </p>
37
+ {state.error ? <p>{state.error}</p> : null}
38
+ <p>
39
+ <button type="submit" disabled={pending}>
40
+ {pending ? "Sending…" : "Send"}
41
+ </button>
42
+ </p>
43
+ </form>
44
+ );
45
+ }
@@ -0,0 +1,79 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ createContactSubmission,
4
+ type ContactFormState,
5
+ } from '@/lib/dkit/contact-form'
6
+
7
+ /** Minimal kit — semantic form markup only. */
8
+ const state = ref<ContactFormState>({ ok: false })
9
+ const pending = ref(false)
10
+
11
+ async function onSubmit(event: Event) {
12
+ event.preventDefault()
13
+ const form = event.target as HTMLFormElement
14
+ const data = new FormData(form)
15
+ pending.value = true
16
+ state.value = { ok: false }
17
+ try {
18
+ const result = await createContactSubmission({
19
+ name: String(data.get('name') ?? ''),
20
+ email: String(data.get('email') ?? ''),
21
+ message: String(data.get('message') ?? ''),
22
+ })
23
+ state.value = result.ok
24
+ ? { ok: true }
25
+ : { ok: false, error: result.error }
26
+ } finally {
27
+ pending.value = false
28
+ }
29
+ }
30
+ </script>
31
+
32
+ <template>
33
+ <p v-if="state.ok">Thanks — we received your message.</p>
34
+
35
+ <form
36
+ v-else
37
+ @submit="onSubmit"
38
+ >
39
+ <p>Send a message and we'll get back to you.</p>
40
+ <p>
41
+ <label for="name">Name</label>
42
+ <br />
43
+ <input
44
+ id="name"
45
+ name="name"
46
+ required
47
+ />
48
+ </p>
49
+ <p>
50
+ <label for="email">Email</label>
51
+ <br />
52
+ <input
53
+ id="email"
54
+ name="email"
55
+ type="email"
56
+ required
57
+ />
58
+ </p>
59
+ <p>
60
+ <label for="message">Message</label>
61
+ <br />
62
+ <textarea
63
+ id="message"
64
+ name="message"
65
+ required
66
+ rows="5"
67
+ />
68
+ </p>
69
+ <p v-if="state.error">{{ state.error }}</p>
70
+ <p>
71
+ <button
72
+ type="submit"
73
+ :disabled="pending"
74
+ >
75
+ {{ pending ? 'Sending…' : 'Send' }}
76
+ </button>
77
+ </p>
78
+ </form>
79
+ </template>
@@ -0,0 +1,55 @@
1
+ "use client";
2
+
3
+ import { useActionState } from "react";
4
+ import {
5
+ submitContactForm,
6
+ type ContactFormState,
7
+ } from "@/lib/dkit/contact-form";
8
+ import { Button } from "@/components/ui/button";
9
+ import { Card, CardContent } from "@/components/ui/card";
10
+ import { Input } from "@/components/ui/input";
11
+ import { Label } from "@/components/ui/label";
12
+ import { Textarea } from "@/components/ui/textarea";
13
+
14
+ const initial: ContactFormState = { ok: false };
15
+
16
+ /** Uses your project's shadcn/ui components. */
17
+ export function ContactForm() {
18
+ const [state, action, pending] = useActionState(submitContactForm, initial);
19
+
20
+ if (state.ok) {
21
+ return (
22
+ <Card className="max-w-md bg-muted/40">
23
+ <CardContent className="pt-6 text-foreground">
24
+ Thanks — we received your message.
25
+ </CardContent>
26
+ </Card>
27
+ );
28
+ }
29
+
30
+ return (
31
+ <form action={action} className="max-w-md space-y-4">
32
+ <p className="text-sm text-muted-foreground">
33
+ Send a message and we&apos;ll get back to you.
34
+ </p>
35
+ <div className="space-y-2">
36
+ <Label htmlFor="name">Name</Label>
37
+ <Input id="name" name="name" required />
38
+ </div>
39
+ <div className="space-y-2">
40
+ <Label htmlFor="email">Email</Label>
41
+ <Input id="email" name="email" type="email" required />
42
+ </div>
43
+ <div className="space-y-2">
44
+ <Label htmlFor="message">Message</Label>
45
+ <Textarea id="message" name="message" required rows={5} />
46
+ </div>
47
+ {state.error ? (
48
+ <p className="text-sm text-destructive">{state.error}</p>
49
+ ) : null}
50
+ <Button type="submit" disabled={pending}>
51
+ {pending ? "Sending…" : "Send"}
52
+ </Button>
53
+ </form>
54
+ );
55
+ }
@@ -0,0 +1,92 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ createContactSubmission,
4
+ type ContactFormState,
5
+ } from '@/lib/dkit/contact-form'
6
+ import { Button } from '@/components/ui/button'
7
+ import { Input } from '@/components/ui/input'
8
+ import { Label } from '@/components/ui/label'
9
+ import { Textarea } from '@/components/ui/textarea'
10
+
11
+ /** Uses your project's shadcn-vue components. */
12
+ const state = ref<ContactFormState>({ ok: false })
13
+ const pending = ref(false)
14
+ const name = ref('')
15
+ const email = ref('')
16
+ const message = ref('')
17
+
18
+ async function onSubmit(event: Event) {
19
+ event.preventDefault()
20
+ pending.value = true
21
+ state.value = { ok: false }
22
+ try {
23
+ const result = await createContactSubmission({
24
+ name: name.value,
25
+ email: email.value,
26
+ message: message.value,
27
+ })
28
+ state.value = result.ok
29
+ ? { ok: true }
30
+ : { ok: false, error: result.error }
31
+ } finally {
32
+ pending.value = false
33
+ }
34
+ }
35
+ </script>
36
+
37
+ <template>
38
+ <div
39
+ v-if="state.ok"
40
+ class="rounded-lg border border-border bg-muted/40 p-6 text-foreground"
41
+ >
42
+ Thanks — we received your message.
43
+ </div>
44
+
45
+ <form
46
+ v-else
47
+ class="max-w-md space-y-4"
48
+ @submit="onSubmit"
49
+ >
50
+ <p class="text-sm text-muted-foreground">
51
+ Send a message and we'll get back to you.
52
+ </p>
53
+ <div class="space-y-2">
54
+ <Label for="name">Name</Label>
55
+ <Input
56
+ id="name"
57
+ v-model="name"
58
+ required
59
+ />
60
+ </div>
61
+ <div class="space-y-2">
62
+ <Label for="email">Email</Label>
63
+ <Input
64
+ id="email"
65
+ v-model="email"
66
+ type="email"
67
+ required
68
+ />
69
+ </div>
70
+ <div class="space-y-2">
71
+ <Label for="message">Message</Label>
72
+ <Textarea
73
+ id="message"
74
+ v-model="message"
75
+ required
76
+ :rows="5"
77
+ />
78
+ </div>
79
+ <p
80
+ v-if="state.error"
81
+ class="text-sm text-destructive"
82
+ >
83
+ {{ state.error }}
84
+ </p>
85
+ <Button
86
+ type="submit"
87
+ :disabled="pending"
88
+ >
89
+ {{ pending ? 'Sending…' : 'Send' }}
90
+ </Button>
91
+ </form>
92
+ </template>
@@ -0,0 +1,15 @@
1
+ {
2
+ "type": "dkit:block",
3
+ "id": "faq-list",
4
+ "title": "FAQ list",
5
+ "description": "Accordion-style FAQ list grouped by category",
6
+ "version": "0.1.0",
7
+ "frameworks": ["next"],
8
+ "uiKits": ["shadcn", "minimal"],
9
+ "shadcnComponents": ["accordion"],
10
+ "slot": "list",
11
+ "route": { "kind": "static" },
12
+ "registryDependencies": ["faq"],
13
+ "dependencies": ["@directus/sdk"],
14
+ "layers": ["ui"]
15
+ }
@@ -0,0 +1,78 @@
1
+ import { getFaqItems, type FaqItem } from "@/lib/dkit/faq";
2
+
3
+ function groupByCategory(items: FaqItem[]): Map<string, FaqItem[]> {
4
+ const map = new Map<string, FaqItem[]>();
5
+ for (const item of items) {
6
+ const key = item.category ?? "";
7
+ const group = map.get(key);
8
+ if (group) {
9
+ group.push(item);
10
+ } else {
11
+ map.set(key, [item]);
12
+ }
13
+ }
14
+ return map;
15
+ }
16
+
17
+ /** Minimal kit — semantic HTML + native details/summary (no Tailwind). */
18
+ export async function FaqList() {
19
+ const items = await getFaqItems();
20
+
21
+ if (items.length === 0) {
22
+ return (
23
+ <section>
24
+ <p>No FAQ items published yet.</p>
25
+ </section>
26
+ );
27
+ }
28
+
29
+ const groups = groupByCategory(items);
30
+ const hasCategories = !(groups.size === 1 && groups.has(""));
31
+
32
+ return (
33
+ <section>
34
+ <style>{`
35
+ .dkit-faq-list details {
36
+ border-bottom: 1px solid #ddd;
37
+ }
38
+ .dkit-faq-list details:last-child {
39
+ border-bottom: 0;
40
+ }
41
+ .dkit-faq-list summary {
42
+ cursor: pointer;
43
+ padding: 0.75rem 0;
44
+ font-weight: 600;
45
+ }
46
+ .dkit-faq-list .dkit-faq-answer {
47
+ padding: 0 0 1rem;
48
+ margin: 0;
49
+ }
50
+ .dkit-faq-category {
51
+ margin: 1.5rem 0 0.5rem;
52
+ font-size: 0.875rem;
53
+ text-transform: uppercase;
54
+ letter-spacing: 0.1em;
55
+ }
56
+ `}</style>
57
+
58
+ <header>
59
+ <h1>Frequently asked questions</h1>
60
+ <p>Find answers to common questions below.</p>
61
+ </header>
62
+
63
+ {Array.from(groups.entries()).map(([category, groupItems]) => (
64
+ <div key={category} className="dkit-faq-list">
65
+ {hasCategories && category ? (
66
+ <h2 className="dkit-faq-category">{category}</h2>
67
+ ) : null}
68
+ {groupItems.map((item) => (
69
+ <details key={item.id}>
70
+ <summary>{item.question}</summary>
71
+ <p className="dkit-faq-answer">{item.answer}</p>
72
+ </details>
73
+ ))}
74
+ </div>
75
+ ))}
76
+ </section>
77
+ );
78
+ }
@@ -0,0 +1,77 @@
1
+ import { getFaqItems, type FaqItem } from "@/lib/dkit/faq";
2
+ import {
3
+ Accordion,
4
+ AccordionContent,
5
+ AccordionItem,
6
+ AccordionTrigger,
7
+ } from "@/components/ui/accordion";
8
+
9
+ function groupByCategory(items: FaqItem[]): Map<string, FaqItem[]> {
10
+ const map = new Map<string, FaqItem[]>();
11
+ for (const item of items) {
12
+ const key = item.category ?? "";
13
+ const group = map.get(key);
14
+ if (group) {
15
+ group.push(item);
16
+ } else {
17
+ map.set(key, [item]);
18
+ }
19
+ }
20
+ return map;
21
+ }
22
+
23
+ /** Uses your project's shadcn/ui accordion. */
24
+ export async function FaqList() {
25
+ const items = await getFaqItems();
26
+
27
+ if (items.length === 0) {
28
+ return (
29
+ <div className="mx-auto max-w-2xl px-6 py-16">
30
+ <p className="rounded-xl border border-dashed border-border px-6 py-12 text-center text-muted-foreground">
31
+ No FAQ items published yet.
32
+ </p>
33
+ </div>
34
+ );
35
+ }
36
+
37
+ const groups = groupByCategory(items);
38
+ const hasCategories = !(groups.size === 1 && groups.has(""));
39
+
40
+ return (
41
+ <div className="mx-auto max-w-2xl px-6 py-16 sm:py-20">
42
+ <header className="mb-12 border-b border-border pb-10">
43
+ <h1 className="text-4xl font-semibold tracking-tight text-foreground sm:text-5xl">
44
+ Frequently asked questions
45
+ </h1>
46
+ <p className="mt-4 max-w-md text-base leading-relaxed text-muted-foreground">
47
+ Find answers to common questions below.
48
+ </p>
49
+ </header>
50
+
51
+ {Array.from(groups.entries()).map(([category, groupItems]) => (
52
+ <section key={category || "all"} className="mb-10 last:mb-0">
53
+ {hasCategories && category ? (
54
+ <h2 className="mb-4 text-xs font-medium tracking-[0.2em] text-primary uppercase">
55
+ {category}
56
+ </h2>
57
+ ) : null}
58
+ <Accordion
59
+ type="multiple"
60
+ className="rounded-xl border border-border px-5"
61
+ >
62
+ {groupItems.map((item) => (
63
+ <AccordionItem key={item.id} value={String(item.id)}>
64
+ <AccordionTrigger className="text-base">
65
+ {item.question}
66
+ </AccordionTrigger>
67
+ <AccordionContent className="text-muted-foreground">
68
+ {item.answer}
69
+ </AccordionContent>
70
+ </AccordionItem>
71
+ ))}
72
+ </Accordion>
73
+ </section>
74
+ ))}
75
+ </div>
76
+ );
77
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "type": "dkit:block",
3
+ "id": "maintenance-gate",
4
+ "title": "Maintenance gate",
5
+ "description": "Wraps the app — shows a maintenance screen when settings.maintenance_mode is on",
6
+ "version": "0.1.0",
7
+ "frameworks": ["next"],
8
+ "uiKits": ["shadcn", "minimal"],
9
+ "slot": "gate",
10
+ "registryDependencies": ["settings"],
11
+ "dependencies": ["@directus/sdk"],
12
+ "layers": ["ui"]
13
+ }