@sonordev/site-kit 7.3.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/AGENTS.md +40 -12
  2. package/CHANGELOG.md +73 -0
  3. package/README.md +44 -18
  4. package/agent-manifest.json +111 -56
  5. package/dist/AnalyticsProvider-LYFDQRRJ.js +13 -0
  6. package/dist/{ArticleViewTracker-GFOAXFV7.js → ArticleViewTracker-HG7IIRJY.js} +6 -5
  7. package/dist/{BlocksPopup-AHDU34TL.js → BlocksPopup-GFX3GZIK.js} +6 -5
  8. package/dist/{ChatWidget-FHBAHFZX.js → ChatWidget-DVS7MLBN.js} +8 -5
  9. package/dist/{FileField-J5W5MIAZ.js → FileField-DVN7NUBI.js} +5 -5
  10. package/dist/{FormSpotlight-PE5YZBFZ.js → FormSpotlight-W4SXKKO6.js} +3 -3
  11. package/dist/{FormStage-OOPQC27J.js → FormStage-JTEE5MZD.js} +3 -3
  12. package/dist/ManagedForm-ZAUHIHGP.js +19 -0
  13. package/dist/{ManagedNewsletterForm-TC5542ZG.js → ManagedNewsletterForm-DQIB5Z4Y.js} +9 -6
  14. package/dist/{SignalCore-2YP5FCAS.js → SignalCore-W5PYYMGX.js} +7 -7
  15. package/dist/SiteChat-MY2GATWC.js +6 -0
  16. package/dist/SiteDesignReporter-ICZWEGCY.js +12 -0
  17. package/dist/SitePopups-TGULLAER.js +13 -0
  18. package/dist/SitemapSync-AN2OBJE6.js +9 -0
  19. package/dist/_client/booking-widget.js +6 -5
  20. package/dist/_client/testimonial-section.d.ts +1 -1
  21. package/dist/_client/testimonial-section.js +4 -2
  22. package/dist/affiliates/index.js +6 -6
  23. package/dist/analytics/index.js +73 -7
  24. package/dist/articles/index.js +2 -2
  25. package/dist/articles/server-ui.js +3 -3
  26. package/dist/articles/server.js +2 -2
  27. package/dist/brand.css +1 -1
  28. package/dist/chat/index.d.ts +1 -1
  29. package/dist/chat/index.js +39 -8
  30. package/dist/chunk-3G7YABRA.js +25 -0
  31. package/dist/{chunk-CGWUXUYZ.js → chunk-3RDJKIYO.js} +2 -2
  32. package/dist/{chunk-J4FSB4OG.js → chunk-3YKQLC7J.js} +5 -2
  33. package/dist/{chunk-BEBR4OJD.js → chunk-56VDS2RP.js} +2 -2
  34. package/dist/chunk-5ROTTMBL.js +19 -0
  35. package/dist/{chunk-56KNHB4U.js → chunk-5S2XDG5O.js} +1 -1
  36. package/dist/chunk-5TM3WPCI.js +7 -0
  37. package/dist/{chunk-BR4ZKUHH.js → chunk-6CJGZFOU.js} +18 -2
  38. package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
  39. package/dist/{chunk-XLSQTTUE.js → chunk-6QFINXLH.js} +3 -3
  40. package/dist/{chunk-CYUFBKJQ.js → chunk-6ZXJ3SXR.js} +1 -1
  41. package/dist/{chunk-NI2XNEMR.js → chunk-7YEEOIWI.js} +1 -1
  42. package/dist/{chunk-DNPNYWVL.js → chunk-BQ2CXKTQ.js} +5 -20
  43. package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
  44. package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
  45. package/dist/chunk-CAT235HY.js +13 -0
  46. package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
  47. package/dist/{chunk-O5RGXTWU.js → chunk-GNSXOTIK.js} +6 -4
  48. package/dist/{chunk-UPRSH6Q4.js → chunk-ICAVVF6D.js} +3 -3
  49. package/dist/{chunk-2ECWEUHP.js → chunk-IJQ767JS.js} +3 -5
  50. package/dist/{chunk-MKMD2HJW.js → chunk-J65N34YM.js} +3 -3
  51. package/dist/{chunk-6U3VLV2C.js → chunk-JIH32RH2.js} +4 -4
  52. package/dist/{chunk-T4DLETKR.js → chunk-K22OLAPC.js} +2 -2
  53. package/dist/{chunk-I2YX3HVD.js → chunk-KRBBH64S.js} +3 -3
  54. package/dist/{chunk-VF4F5WXZ.js → chunk-LBIQ5LTC.js} +1 -1
  55. package/dist/{chunk-WGIDC6QP.js → chunk-LKH44GI3.js} +5 -5
  56. package/dist/{chunk-ZTLMPUO6.js → chunk-LNSF6BJC.js} +1 -1
  57. package/dist/{chunk-WDQB4OXY.js → chunk-M62U7TJF.js} +1 -1
  58. package/dist/{chunk-EDYHROQ7.js → chunk-NFRJTOTB.js} +3 -3
  59. package/dist/chunk-OD2ULW5Z.js +57 -0
  60. package/dist/{chunk-Y6LP36UW.js → chunk-OE3NXEOF.js} +2 -2
  61. package/dist/{chunk-L7U23XI2.js → chunk-OGK7OL3T.js} +5 -4
  62. package/dist/{chunk-RDPW4D33.js → chunk-PD7K54EQ.js} +2 -2
  63. package/dist/{chunk-MVR4FY5R.js → chunk-PIX7FAMX.js} +2 -2
  64. package/dist/{chunk-2AD3CDRR.js → chunk-ROAOI6GG.js} +10 -10
  65. package/dist/{chunk-YJLS6JBI.js → chunk-S7SSYGUJ.js} +6 -5
  66. package/dist/{chunk-ZKHI4E2B.js → chunk-SBPAXWLF.js} +1 -1
  67. package/dist/{chunk-ZHS2XFLV.js → chunk-TOSZGJEQ.js} +1 -1
  68. package/dist/{chunk-4NTBQNHA.js → chunk-TYAVHRWH.js} +80 -81
  69. package/dist/{chunk-Z65DHMTW.js → chunk-TZ5RTANX.js} +3 -3
  70. package/dist/{chunk-VX5CMNMM.js → chunk-UAYAJPEP.js} +7 -1
  71. package/dist/{chunk-4YTYGG2C.js → chunk-URJN75ZG.js} +29 -16
  72. package/dist/{chunk-EPT6FJUY.js → chunk-UUWUAMUC.js} +13 -16
  73. package/dist/{chunk-PKGN32AU.js → chunk-XPTJRVL2.js} +1 -1
  74. package/dist/{chunk-662ILEZ6.js → chunk-Y35BWW2C.js} +3 -7
  75. package/dist/{chunk-MRQ2U4LZ.js → chunk-ZHNQFNO3.js} +2 -2
  76. package/dist/chunk-ZKADJNR2.js +52 -0
  77. package/dist/{chunk-WGG6GTKW.js → chunk-ZLFGXKLG.js} +1 -1
  78. package/dist/client/index.js +6 -5
  79. package/dist/contracts/entries.d.ts +1 -1
  80. package/dist/contracts/sentences.d.ts +46 -0
  81. package/dist/contracts/site-cache.d.ts +2 -0
  82. package/dist/cta-bar/index.js +1 -1
  83. package/dist/fleet/index.js +6 -5
  84. package/dist/forms/field-autocomplete.d.ts +16 -8
  85. package/dist/forms/index.d.ts +5 -0
  86. package/dist/forms/index.js +17 -17
  87. package/dist/forms/server.js +7 -7
  88. package/dist/forms/static.js +2 -2
  89. package/dist/forms/submitForm.d.ts +5 -0
  90. package/dist/images/index.js +4 -4
  91. package/dist/index.d.ts +3 -7
  92. package/dist/index.js +1 -1
  93. package/dist/layout/SiteKitLayout.d.ts +2 -1
  94. package/dist/layout/client.js +11 -9
  95. package/dist/layout/index.js +14 -12
  96. package/dist/llms/index.js +8 -7
  97. package/dist/maps/index.js +6 -6
  98. package/dist/mcp/sonor.d.ts +47 -3
  99. package/dist/mcp/sonor.js +31 -21
  100. package/dist/proxy/index.d.ts +3 -3
  101. package/dist/proxy/index.js +1 -1
  102. package/dist/reputation/TestimonialSection.d.ts +1 -1
  103. package/dist/reputation/VisualReviewCard.d.ts +6 -0
  104. package/dist/reputation/index.d.ts +2 -1
  105. package/dist/reputation/index.js +5 -2
  106. package/dist/reputation/review-photo.d.ts +2 -0
  107. package/dist/reputation/server.d.ts +3 -2
  108. package/dist/reputation/server.js +4 -1
  109. package/dist/reputation/types.d.ts +22 -0
  110. package/dist/revalidate/index.js +3 -3
  111. package/dist/robots/indexnow.js +2 -2
  112. package/dist/runtime/index.d.ts +32 -0
  113. package/dist/runtime/index.js +7 -0
  114. package/dist/seo/api.d.ts +0 -4
  115. package/dist/seo/client.js +6 -5
  116. package/dist/seo/getManagedMetadata.d.ts +24 -0
  117. package/dist/seo/index.d.ts +2 -3
  118. package/dist/seo/index.js +14 -132
  119. package/dist/seo/indexnow.js +2 -2
  120. package/dist/seo/llms.js +8 -7
  121. package/dist/seo/register-sitemap-cli.js +2 -2
  122. package/dist/seo/server-api.d.ts +0 -6
  123. package/dist/seo/server.d.ts +1 -1
  124. package/dist/seo/server.js +4 -4
  125. package/dist/seo/sitemap.js +5 -4
  126. package/dist/seo/types.d.ts +9 -30
  127. package/dist/server/index.d.ts +8 -1
  128. package/dist/server/index.js +5 -4
  129. package/dist/server/mint-site-token.d.ts +1 -13
  130. package/dist/server/server-fetch.d.ts +19 -0
  131. package/dist/server-api-EGOKC7Q3.js +9 -0
  132. package/dist/shared/build-entries.d.ts +21 -9
  133. package/dist/shared/clientApiConfig.d.ts +56 -0
  134. package/dist/shared/fresh-fetch.d.ts +9 -3
  135. package/dist/shared/identity-reader.d.ts +26 -0
  136. package/dist/shared/identity-storage.d.ts +30 -0
  137. package/dist/shared/identity.d.ts +13 -13
  138. package/dist/shared/import-specifiers.d.ts +26 -0
  139. package/dist/shared/sonorFetch.d.ts +4 -3
  140. package/dist/shared/version.d.ts +1 -1
  141. package/dist/signal/index.js +2 -2
  142. package/dist/sitemap/index.js +5 -4
  143. package/dist/slots/index.js +3 -3
  144. package/dist/sync/index.js +6 -5
  145. package/dist/types.d.ts +0 -1
  146. package/dist/website/cta-bar.js +1 -1
  147. package/dist/website/images.js +4 -4
  148. package/dist/website/index.js +7 -6
  149. package/dist/website/popups.js +10 -7
  150. package/dist/website/slots.js +3 -3
  151. package/dist/{writeLLMsTxt-2NQVDGYI.js → writeLLMsTxt-UZGN6IBU.js} +4 -3
  152. package/docs/MIGRATING-TO-7.md +5 -2
  153. package/docs/MIGRATING-TO-8.md +183 -0
  154. package/docs.json +4 -8
  155. package/package.json +15 -44
  156. package/skills/site-kit/SKILL.md +41 -11
  157. package/src/analytics/README.md +14 -14
  158. package/src/chat/README.md +7 -7
  159. package/src/forms/README.md +61 -6
  160. package/src/mcp/README.md +61 -20
  161. package/src/proxy/README.md +5 -4
  162. package/src/reputation/README.md +25 -0
  163. package/src/revalidate/README.md +2 -2
  164. package/src/runtime/README.md +51 -0
  165. package/src/seo/README.md +24 -8
  166. package/src/sync/README.md +2 -2
  167. package/src/website/README.md +3 -2
  168. package/dist/AnalyticsProvider-DJQA66AG.js +0 -11
  169. package/dist/ManagedForm-JRZAJ7SZ.js +0 -16
  170. package/dist/SiteChat-EGEZJJVV.js +0 -5
  171. package/dist/SiteDesignReporter-YEEWJKWN.js +0 -11
  172. package/dist/SitePopups-LQBIXIFV.js +0 -10
  173. package/dist/SitemapSync-LSZ2EYOF.js +0 -8
  174. package/dist/chunk-24QZEO3Q.js +0 -41
  175. package/dist/chunk-BU66S5B7.js +0 -1
  176. package/dist/chunk-G3NHWMP5.js +0 -233
  177. package/dist/chunk-HODO5BX5.js +0 -28
  178. package/dist/chunk-L3AQCDCY.js +0 -386
  179. package/dist/chunk-P5GB6NEO.js +0 -66
  180. package/dist/chunk-SWKE6FWH.js +0 -47
  181. package/dist/cms/CmsPage.d.ts +0 -17
  182. package/dist/cms/CmsPreview.d.ts +0 -37
  183. package/dist/cms/CmsSection.d.ts +0 -8
  184. package/dist/cms/PortableTextRenderer.d.ts +0 -7
  185. package/dist/cms/index.d.ts +0 -37
  186. package/dist/cms/index.js +0 -5
  187. package/dist/cms/sanity-image.d.ts +0 -47
  188. package/dist/cms/sections/CtaSection.d.ts +0 -3
  189. package/dist/cms/sections/CustomSection.d.ts +0 -7
  190. package/dist/cms/sections/FaqSection.d.ts +0 -3
  191. package/dist/cms/sections/FormSection.d.ts +0 -8
  192. package/dist/cms/sections/GallerySection.d.ts +0 -3
  193. package/dist/cms/sections/HeroSection.d.ts +0 -3
  194. package/dist/cms/sections/RichTextSection.d.ts +0 -3
  195. package/dist/cms/sections/TestimonialsSection.d.ts +0 -3
  196. package/dist/cms/sections/index.d.ts +0 -8
  197. package/dist/cms/server-api.d.ts +0 -49
  198. package/dist/cms/server.d.ts +0 -1
  199. package/dist/cms/server.js +0 -5
  200. package/dist/cms/types.d.ts +0 -104
  201. package/dist/commerce/CalendarView.d.ts +0 -43
  202. package/dist/commerce/CheckoutForm.d.ts +0 -11
  203. package/dist/commerce/EventCalendar.d.ts +0 -26
  204. package/dist/commerce/EventCheckout.d.ts +0 -42
  205. package/dist/commerce/EventEmbed.d.ts +0 -11
  206. package/dist/commerce/EventModal.d.ts +0 -43
  207. package/dist/commerce/EventTile.d.ts +0 -10
  208. package/dist/commerce/EventsAgenda.d.ts +0 -38
  209. package/dist/commerce/EventsWidget.d.ts +0 -84
  210. package/dist/commerce/OfferingCard.d.ts +0 -9
  211. package/dist/commerce/OfferingList.d.ts +0 -9
  212. package/dist/commerce/ProductDetail.d.ts +0 -38
  213. package/dist/commerce/ProductEmbed.d.ts +0 -11
  214. package/dist/commerce/ProductGrid.d.ts +0 -41
  215. package/dist/commerce/ProductPage.d.ts +0 -39
  216. package/dist/commerce/RegistrationForm.d.ts +0 -9
  217. package/dist/commerce/SizeChart.d.ts +0 -8
  218. package/dist/commerce/UpcomingEvents.d.ts +0 -9
  219. package/dist/commerce/api.d.ts +0 -179
  220. package/dist/commerce/events-extras.d.ts +0 -60
  221. package/dist/commerce/index.d.ts +0 -33
  222. package/dist/commerce/index.js +0 -8022
  223. package/dist/commerce/server.d.ts +0 -161
  224. package/dist/commerce/server.js +0 -2
  225. package/dist/commerce/types.d.ts +0 -340
  226. package/dist/commerce/useEventModal.d.ts +0 -20
  227. package/dist/commerce/utils.d.ts +0 -17
  228. package/dist/engage/EngageWidget.d.ts +0 -21
  229. package/dist/engage/index.d.ts +0 -14
  230. package/dist/engage/index.js +0 -45
  231. package/dist/engage/types.d.ts +0 -33
  232. package/dist/seo/ManagedContent.d.ts +0 -14
  233. package/dist/server-api-BVCBLJKL.js +0 -9
  234. package/dist/website/cms/server.d.ts +0 -2
  235. package/dist/website/cms/server.js +0 -5
  236. package/dist/website/cms-server.d.ts +0 -2
  237. package/dist/website/cms.d.ts +0 -2
  238. package/dist/website/cms.js +0 -5
  239. package/src/commerce/README.md +0 -109
@@ -1,43 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - EventModal
3
- *
4
- * Modal popup for event registration and checkout.
5
- * Handles both free registration and paid tickets via Stripe/Square.
6
- */
7
- import React from 'react';
8
- import type { CommerceOffering, CommerceSchedule, CheckoutResult } from './types';
9
- export interface EventModalProps {
10
- /** Event to display */
11
- event: CommerceOffering | null;
12
- /** Specific schedule (optional - uses first upcoming if not provided) */
13
- schedule?: CommerceSchedule | null;
14
- /** Whether modal is open */
15
- isOpen: boolean;
16
- /** Close modal callback */
17
- onClose: () => void;
18
- /** Success callback */
19
- onSuccess?: (result: CheckoutResult) => void;
20
- /** Error callback */
21
- onError?: (error: string) => void;
22
- /** Collect phone number */
23
- collectPhone?: boolean;
24
- /** Additional form fields */
25
- additionalFields?: AdditionalField[];
26
- /** Custom class names */
27
- className?: string;
28
- overlayClassName?: string;
29
- contentClassName?: string;
30
- }
31
- export interface AdditionalField {
32
- name: string;
33
- label: string;
34
- type?: 'text' | 'email' | 'tel' | 'textarea' | 'select' | 'number';
35
- required?: boolean;
36
- placeholder?: string;
37
- options?: {
38
- value: string;
39
- label: string;
40
- }[];
41
- }
42
- export declare function EventModal({ event, schedule: propSchedule, isOpen, onClose, onSuccess, onError, collectPhone, additionalFields, className, overlayClassName, contentClassName, }: EventModalProps): React.JSX.Element | null;
43
- export default EventModal;
@@ -1,10 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - EventTile
3
- *
4
- * Compact tile for displaying an event with date, title, and registration button.
5
- * Great for embedding on homepages or sidebars.
6
- */
7
- import React from 'react';
8
- import type { EventTileProps } from './types';
9
- export declare function EventTile({ event, variant, showDate, showTime, showLocation, showCapacity, showPrice, showCta, ctaText, onRegister, onCtaClick, className, dateClassName, titleClassName, ctaClassName, }: EventTileProps): React.JSX.Element;
10
- export default EventTile;
@@ -1,38 +0,0 @@
1
- /**
2
- * EventsAgenda — month-grouped event list.
3
- *
4
- * For sparse community/event calendars an agenda reads far better than a
5
- * month grid, especially on phones, which is why community sites kept
6
- * forking the grid into one. Headless-first: every element carries
7
- * data-sk-part, rows carry data-category / data-offering-type (same contract
8
- * as CalendarView chips), so two-scheme coloring is site CSS:
9
- *
10
- * [data-sk-part="agenda-date"][data-category="pto"] { background: red }
11
- *
12
- * Handles what the grid historically couldn't: multi-day ranges (an event
13
- * appears once per month it overlaps, "Sep 21-25"), and all-day events
14
- * (schedule.all_day when the API provides it, falling back to the
15
- * offering-level metadata.all_day convention).
16
- *
17
- * No hooks, no browser APIs — renders fully at SSR. Interactivity
18
- * (filter pills etc.) belongs to the site around it.
19
- */
20
- import React from 'react';
21
- import type { CommerceOffering, CommerceSchedule } from './types';
22
- export interface AgendaItem {
23
- offering: CommerceOffering;
24
- schedule: CommerceSchedule;
25
- }
26
- export interface EventsAgendaProps {
27
- events: CommerceOffering[];
28
- /** IANA zone for grouping/formatting. Default: each schedule's own timezone, else UTC. */
29
- timeZone?: string;
30
- locale?: string;
31
- /** Hide events that already ended. Default true. */
32
- upcomingOnly?: boolean;
33
- className?: string;
34
- emptyLabel?: string;
35
- /** Replace a row's meta line (time · location · blurb). */
36
- renderMeta?: (item: AgendaItem) => React.ReactNode;
37
- }
38
- export declare function EventsAgenda({ events, timeZone, locale, upcomingOnly, className, emptyLabel, renderMeta, }: EventsAgendaProps): React.JSX.Element;
@@ -1,84 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - EventsWidget
3
- *
4
- * Comprehensive events widget with calendar/list toggle and integrated booking.
5
- * Plug-and-play component for displaying commerce events.
6
- *
7
- * @example
8
- * ```tsx
9
- * // Basic usage - automatically fetches events
10
- * <EventsWidget />
11
- *
12
- * // With calendar view as default
13
- * <EventsWidget defaultView="calendar" />
14
- *
15
- * // Custom styling
16
- * <EventsWidget
17
- * className="my-events-section"
18
- * title="Upcoming Events"
19
- * showViewToggle={true}
20
- * onRegistrationSuccess={(result) => console.log('Registered!', result)}
21
- * />
22
- * ```
23
- */
24
- import React from 'react';
25
- import type { CommerceOffering, CommerceSchedule, CheckoutResult } from './types';
26
- export type EventsViewMode = 'list' | 'grid' | 'calendar';
27
- export interface EventsWidgetProps {
28
- /** Pre-loaded events (optional - will fetch if not provided) */
29
- events?: CommerceOffering[];
30
- /** Initial view mode */
31
- defaultView?: EventsViewMode;
32
- /** Which view modes to show in the toggle (e.g. ['list', 'grid'] when calendar is embedded above) */
33
- availableViews?: EventsViewMode[];
34
- /** Show view toggle buttons */
35
- showViewToggle?: boolean;
36
- /** Section title */
37
- title?: string;
38
- /** Subtitle or description */
39
- subtitle?: string;
40
- /** Category filter */
41
- category?: string;
42
- /** Maximum events to show in list view */
43
- limit?: number;
44
- /** Show "View All" link */
45
- showViewAll?: boolean;
46
- /** URL for "View All" link */
47
- viewAllUrl?: string;
48
- /** Text for "View All" link */
49
- viewAllText?: string;
50
- /** Message when no events */
51
- emptyMessage?: string;
52
- /** Show empty state with icon */
53
- showEmptyIcon?: boolean;
54
- /** Collect phone number in registration */
55
- collectPhone?: boolean;
56
- /** Additional form fields */
57
- additionalFields?: AdditionalField[];
58
- /** Called when registration/checkout succeeds */
59
- onRegistrationSuccess?: (result: CheckoutResult) => void;
60
- /** Called when registration/checkout fails */
61
- onRegistrationError?: (error: string) => void;
62
- /** Called when event is clicked (before modal opens) */
63
- onEventClick?: (event: CommerceOffering, schedule: CommerceSchedule) => void;
64
- className?: string;
65
- headerClassName?: string;
66
- toggleClassName?: string;
67
- listClassName?: string;
68
- calendarClassName?: string;
69
- eventCardClassName?: string;
70
- modalClassName?: string;
71
- }
72
- export interface AdditionalField {
73
- name: string;
74
- label: string;
75
- type?: 'text' | 'email' | 'tel' | 'textarea' | 'select' | 'number';
76
- required?: boolean;
77
- placeholder?: string;
78
- options?: {
79
- value: string;
80
- label: string;
81
- }[];
82
- }
83
- export declare function EventsWidget({ events: propEvents, defaultView, availableViews, showViewToggle, title, subtitle, category, limit, showViewAll, viewAllUrl, viewAllText, emptyMessage, showEmptyIcon, collectPhone, additionalFields, onRegistrationSuccess, onRegistrationError, onEventClick, className, headerClassName, toggleClassName, listClassName, calendarClassName, eventCardClassName, modalClassName, }: EventsWidgetProps): React.JSX.Element;
84
- export default EventsWidget;
@@ -1,9 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - OfferingCard
3
- *
4
- * Displays a single product, service, event, or class with image, title, price, and CTA.
5
- */
6
- import React from 'react';
7
- import type { OfferingCardProps } from './types';
8
- export declare function OfferingCard({ offering, variant, showImage, showPrice, showDescription, showCta, ctaText, onCtaClick, className, imageClassName, titleClassName, priceClassName, descriptionClassName, ctaClassName, }: OfferingCardProps): React.JSX.Element;
9
- export default OfferingCard;
@@ -1,9 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - OfferingList
3
- *
4
- * Displays a grid or list of offerings with optional filtering.
5
- */
6
- import React from 'react';
7
- import type { OfferingListProps } from './types';
8
- export declare function OfferingList({ offerings: propOfferings, type, category, limit, status, layout, columns, cardVariant, showFilters, emptyMessage, showImage, showPrice, showDescription, showCta, ctaText, onCtaClick, className, cardClassName, filterClassName, renderCard, renderEmpty, }: OfferingListProps): React.JSX.Element;
9
- export default OfferingList;
@@ -1,38 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - ProductDetail
3
- *
4
- * World-class product detail component with full inline checkout.
5
- * Supports products, services, events, and subscriptions.
6
- * Zero external dependencies — Square and Stripe SDKs loaded dynamically.
7
- */
8
- import React from 'react';
9
- import type { CommerceOffering, CommerceVariant, CheckoutResult } from './types';
10
- interface TrustBadge {
11
- icon?: 'lock' | 'truck' | 'return' | 'shield';
12
- label: string;
13
- sublabel?: string;
14
- }
15
- export interface ProductDetailProps {
16
- product?: CommerceOffering;
17
- slug?: string;
18
- successUrl?: string;
19
- cancelUrl?: string;
20
- showGallery?: boolean;
21
- showVariants?: boolean;
22
- showQuantity?: boolean;
23
- showSizeChart?: boolean;
24
- showFeatures?: boolean;
25
- showSpecifications?: boolean;
26
- showDescription?: boolean;
27
- showTrustBadges?: boolean;
28
- showInventory?: boolean;
29
- trustBadges?: TrustBadge[];
30
- onAddToCart?: (product: CommerceOffering, variant?: CommerceVariant, quantity?: number) => void;
31
- onCheckoutSuccess?: (result: CheckoutResult) => void;
32
- onCheckoutError?: (error: string) => void;
33
- className?: string;
34
- style?: React.CSSProperties;
35
- layout?: 'horizontal' | 'stacked';
36
- }
37
- export declare function ProductDetail({ product: propProduct, slug, successUrl, cancelUrl, showGallery, showVariants, showQuantity, showSizeChart, showFeatures, showSpecifications, showDescription, showTrustBadges, showInventory, trustBadges, onAddToCart, onCheckoutSuccess, onCheckoutError, className, style: customStyle, layout, }: ProductDetailProps): React.JSX.Element;
38
- export default ProductDetail;
@@ -1,11 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - ProductEmbed
3
- *
4
- * Embeddable widget for displaying a single product on a homepage or landing page.
5
- * Supports showing latest product, specific product by slug, or a random featured product.
6
- */
7
- import React from 'react';
8
- import type { ProductEmbedProps } from './types';
9
- export declare function ProductEmbed({ product: propProduct, slug, mode, // 'specific', 'latest', 'featured'
10
- category, variant, showImage, showPrice, showDescription, showCta, ctaText, onCtaClick, className, }: ProductEmbedProps): React.JSX.Element | null;
11
- export default ProductEmbed;
@@ -1,41 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - ProductGrid
3
- *
4
- * Grid layout for displaying multiple products with filtering and sorting.
5
- * Ideal for shop pages, category pages, and product listings.
6
- */
7
- import React from 'react';
8
- import type { CommerceOffering } from './types';
9
- export interface ProductGridProps {
10
- /** Pre-loaded products (for SSR) */
11
- products?: CommerceOffering[];
12
- /** Limit number of products */
13
- limit?: number;
14
- /** Category to filter by */
15
- category?: string;
16
- /** Show category filter */
17
- showCategoryFilter?: boolean;
18
- /** Show sort dropdown */
19
- showSort?: boolean;
20
- /** Show search input */
21
- showSearch?: boolean;
22
- /** Number of columns (responsive) */
23
- columns?: 2 | 3 | 4;
24
- /** Loading skeleton count */
25
- skeletonCount?: number;
26
- /** Custom empty state message */
27
- emptyMessage?: string;
28
- /** Callback when product is clicked */
29
- onProductClick?: (product: CommerceOffering) => void;
30
- /** Navigate to product page on click */
31
- linkToProduct?: boolean;
32
- /** Base path for product links */
33
- productBasePath?: string;
34
- /** Additional class names */
35
- className?: string;
36
- /** Card variant style */
37
- cardVariant?: 'card' | 'minimal' | 'horizontal';
38
- /** Custom styles */
39
- style?: React.CSSProperties;
40
- }
41
- export declare function ProductGrid({ products: propProducts, limit, category: propCategory, showCategoryFilter, showSort, showSearch, columns, skeletonCount, emptyMessage, onProductClick, linkToProduct, productBasePath, className, cardVariant, style, }: ProductGridProps): React.JSX.Element;
@@ -1,39 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - ProductPage
3
- *
4
- * Complete product page component with SEO metadata, breadcrumbs, and related products.
5
- * Use this as a drop-in for dynamic [slug] routes.
6
- */
7
- import React from 'react';
8
- import type { CommerceOffering, CommerceVariant } from './types';
9
- export interface ProductPageProps {
10
- /** Pre-loaded product data (for SSR) */
11
- product?: CommerceOffering;
12
- /** Product slug to fetch (if not pre-loaded) */
13
- slug?: string;
14
- /** Show breadcrumbs navigation */
15
- showBreadcrumbs?: boolean;
16
- /** Show related products section */
17
- showRelatedProducts?: boolean;
18
- /** Number of related products to show */
19
- relatedProductsLimit?: number;
20
- /** Show back to shop link */
21
- showBackLink?: boolean;
22
- /** Base path for shop */
23
- shopBasePath?: string;
24
- /** Success URL after checkout */
25
- successUrl?: string;
26
- /** Cancel URL if checkout cancelled */
27
- cancelUrl?: string;
28
- /** Callback when added to cart */
29
- onAddToCart?: (product: CommerceOffering, variant?: CommerceVariant, quantity?: number) => void;
30
- /** Custom breadcrumb renderer */
31
- renderBreadcrumbs?: (product: CommerceOffering) => React.ReactNode;
32
- /** Custom SEO head renderer (for Next.js Head or similar) */
33
- renderHead?: (product: CommerceOffering) => React.ReactNode;
34
- /** Additional class names */
35
- className?: string;
36
- /** Custom styles */
37
- style?: React.CSSProperties;
38
- }
39
- export declare function ProductPage({ product: propProduct, slug, showBreadcrumbs, showRelatedProducts, relatedProductsLimit, showBackLink, shopBasePath, successUrl, cancelUrl, onAddToCart, renderBreadcrumbs, renderHead, className, style, }: ProductPageProps): React.JSX.Element;
@@ -1,9 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - RegistrationForm
3
- *
4
- * Simplified registration form for free events/classes.
5
- */
6
- import React from 'react';
7
- import type { RegistrationFormProps } from './types';
8
- export declare function RegistrationForm({ event, scheduleId, title, submitText, successMessage, collectPhone, additionalFields, onSuccess, onError, className, formClassName, inputClassName, buttonClassName, }: RegistrationFormProps): React.JSX.Element;
9
- export default RegistrationForm;
@@ -1,8 +0,0 @@
1
- import type { SizeChart as SizeChartType } from './types';
2
- interface SizeChartProps {
3
- chart: SizeChartType;
4
- selectedSize?: string;
5
- className?: string;
6
- }
7
- export declare function SizeChart({ chart, selectedSize, className }: SizeChartProps): import("react").JSX.Element | null;
8
- export {};
@@ -1,9 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - UpcomingEvents
3
- *
4
- * Displays a list of upcoming events with date, title, and registration buttons.
5
- */
6
- import React from 'react';
7
- import type { UpcomingEventsProps } from './types';
8
- export declare function UpcomingEvents({ events: propEvents, limit, category, variant, layout, showViewAll, viewAllUrl, viewAllText, emptyMessage, title, onRegister, onCtaClick, className, titleClassName, eventClassName, }: UpcomingEventsProps): React.JSX.Element;
9
- export default UpcomingEvents;
@@ -1,179 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce - Commerce API
3
- *
4
- * API functions for fetching offerings, submitting orders, and registrations.
5
- * All data goes through Sonor API with API key auth - never Supabase directly.
6
- */
7
- import type { CommerceOffering, FetchOfferingsOptions, FetchEventsOptions, CheckoutCustomer, CheckoutResult } from './types';
8
- export declare function fetchOfferings(options?: FetchOfferingsOptions): Promise<CommerceOffering[]>;
9
- export declare function fetchOffering(slug: string): Promise<CommerceOffering | null>;
10
- export declare function fetchLatestOffering(type?: string, category?: string): Promise<CommerceOffering | null>;
11
- export declare function fetchUpcomingEvents(options?: FetchEventsOptions): Promise<CommerceOffering[]>;
12
- export declare function fetchNextEvent(category?: string): Promise<CommerceOffering | null>;
13
- export declare function fetchProducts(options?: Omit<FetchOfferingsOptions, 'type'>): Promise<CommerceOffering[]>;
14
- export declare function fetchServices(options?: Omit<FetchOfferingsOptions, 'type'>): Promise<CommerceOffering[]>;
15
- /**
16
- * Fetch products via public API
17
- */
18
- export declare function fetchProductsPublic(options?: {
19
- category?: string;
20
- limit?: number;
21
- offset?: number;
22
- orderBy?: 'name' | 'price' | 'created_at' | 'sort_order';
23
- order?: 'asc' | 'desc';
24
- search?: string;
25
- }): Promise<{
26
- products: CommerceOffering[];
27
- total: number;
28
- }>;
29
- /**
30
- * Fetch single product by slug
31
- */
32
- export declare function fetchProductBySlug(slug: string): Promise<CommerceOffering | null>;
33
- /**
34
- * Fetch product categories
35
- */
36
- export declare function fetchCategories(): Promise<{
37
- id: string;
38
- name: string;
39
- slug: string;
40
- }[]>;
41
- export interface ShippingAddress {
42
- street1: string;
43
- street2?: string;
44
- city: string;
45
- state: string;
46
- zip: string;
47
- country?: string;
48
- name?: string;
49
- phone?: string;
50
- }
51
- export interface ShippingRate {
52
- carrier: string;
53
- service: string;
54
- amount: string;
55
- currency: string;
56
- estimatedDays?: number;
57
- objectId?: string;
58
- /**
59
- * Signed by the API along with the rate. Checkout charges shipping from it,
60
- * not from `amount`, so send it back as `shippingQuote` (shippingSelection
61
- * does). Absent from APIs that predate quotes.
62
- */
63
- quote?: string;
64
- }
65
- /**
66
- * The chosen rate as checkout options: carrier, service, amount, and the
67
- * signed quote the API charges shipping from. The one place a rate becomes
68
- * checkout fields, for CheckoutForm, ProductDetail and custom checkouts.
69
- */
70
- export declare function shippingSelection(rate: ShippingRate | null | undefined): Pick<CreateCheckoutOptions, 'shippingCarrier' | 'shippingService' | 'shippingCost' | 'shippingQuote'>;
71
- export interface ValidateAddressResult {
72
- isValid: boolean;
73
- normalized?: {
74
- street1: string;
75
- street2?: string;
76
- city: string;
77
- state: string;
78
- zip: string;
79
- country: string;
80
- };
81
- messages?: string[];
82
- }
83
- /**
84
- * Fetch shipping rates for checkout (when shipping is enabled)
85
- */
86
- export declare function fetchShippingRates(shippingAddress: ShippingAddress, offerings: Array<{
87
- offering_id: string;
88
- quantity?: number;
89
- }>): Promise<ShippingRate[]>;
90
- /**
91
- * Validate a shipping address before checkout
92
- */
93
- export declare function validateAddress(address: Omit<ShippingAddress, 'name' | 'phone'>): Promise<ValidateAddressResult>;
94
- /**
95
- * Fetch the active payment processor for the current project.
96
- * Returns 'stripe' | 'square' | null.
97
- */
98
- export declare function fetchActiveProcessor(): Promise<'stripe' | 'square' | null>;
99
- export declare function registerForEvent(eventId: string, scheduleId: string | undefined, customer: CheckoutCustomer): Promise<CheckoutResult>;
100
- export interface CheckoutLineItem {
101
- offeringId: string;
102
- variantId?: string;
103
- scheduleId?: string;
104
- quantity: number;
105
- }
106
- export interface CreateCheckoutOptions {
107
- offeringId?: string;
108
- variantId?: string;
109
- scheduleId?: string;
110
- quantity?: number;
111
- /**
112
- * Multi-line cart (v1: events only, all items must share offeringId + scheduleId).
113
- * When provided, takes precedence over offeringId/variantId/quantity. Requires
114
- * `sourceId` (Square Web Payments SDK nonce) — Square inline only in v1.
115
- */
116
- lineItems?: CheckoutLineItem[];
117
- customer?: CheckoutCustomer;
118
- successUrl?: string;
119
- cancelUrl?: string;
120
- /** Square card nonce from Web Payments SDK for inline card collection (no redirect) */
121
- sourceId?: string;
122
- /** Shipping address (required for physical products when shipping_enabled) */
123
- shippingAddress?: ShippingAddress;
124
- /** Selected shipping carrier from rates */
125
- shippingCarrier?: string;
126
- /** Selected shipping service from rates */
127
- shippingService?: string;
128
- /** Shipping cost in dollars (from selected rate) */
129
- shippingCost?: number;
130
- /** The selected rate's signed quote; the API charges shipping from it. */
131
- shippingQuote?: string;
132
- /** Discount/promo code to apply */
133
- discountCode?: string;
134
- }
135
- export interface DiscountValidationResult {
136
- valid: boolean;
137
- discount_amount?: number;
138
- discount_type?: 'percentage' | 'fixed_amount' | 'free_shipping';
139
- discount_value?: number;
140
- code?: string;
141
- name?: string;
142
- message?: string;
143
- }
144
- /**
145
- * Validate a discount code against the current order.
146
- * Returns the discount amount if valid, or an error message if not.
147
- */
148
- export declare function validateDiscountCode(code: string, subtotal: number, offeringIds?: string[]): Promise<DiscountValidationResult>;
149
- export interface ProcessorConfig {
150
- processor: 'stripe' | 'square' | null;
151
- squareAppId?: string;
152
- squareLocationId?: string;
153
- squareEnvironment?: string;
154
- stripePublishableKey?: string;
155
- /** Whether shipping is enabled for this project */
156
- shipping_enabled?: boolean;
157
- }
158
- /**
159
- * Fetch client-side SDK config for the active payment processor.
160
- * Returns public-safe values (app IDs, location IDs) for SDK initialization.
161
- */
162
- export declare function fetchProcessorConfig(): Promise<ProcessorConfig | null>;
163
- /**
164
- * Create a Stripe PaymentIntent for inline card payment (no redirect).
165
- * Use with Stripe Elements on the frontend to collect and confirm card details directly.
166
- * The existing payment_intent.succeeded webhook handles marking the sale as paid.
167
- */
168
- export declare function createPaymentIntent(options: CreateCheckoutOptions): Promise<{
169
- success: boolean;
170
- clientSecret?: string;
171
- saleId?: string;
172
- confirmationNumber?: string;
173
- error?: string;
174
- }>;
175
- /**
176
- * Create a checkout session for a product or service
177
- * Supports both Stripe and Square based on project configuration
178
- */
179
- export declare function createCheckoutSession(optionsOrOfferingId: CreateCheckoutOptions | string, legacyOptions?: Omit<CreateCheckoutOptions, 'offeringId'>): Promise<CheckoutResult>;
@@ -1,60 +0,0 @@
1
- /**
2
- * Events polish: calendar links, structured data, honest capacity.
3
- *
4
- * - icsForEvent / googleCalendarUrl / createIcsRoute: "Add to calendar"
5
- * without a third-party service.
6
- * - EventJsonLd: schema.org/Event emitted from the offering the site already
7
- * fetched — free rich results.
8
- * - CapacityBadge: renders from spots_remaining/capacity. Per the QCR
9
- * oversell incident, the seat count is the ONLY honest sold-out signal
10
- * (status can stay 'active' during an emergency shutdown), so this badge
11
- * never derives fullness from status.
12
- *
13
- * Server-safe: no hooks, no browser APIs — usable from RSC pages directly.
14
- */
15
- import React from 'react';
16
- import type { CommerceOffering, CommerceSchedule } from './types';
17
- export interface IcsEventInput {
18
- offering: CommerceOffering;
19
- schedule: CommerceSchedule;
20
- /** Absolute URL of the event page, for the ICS URL property. */
21
- url?: string;
22
- }
23
- /** Build a single-event .ics document. */
24
- export declare function icsForEvent({ offering, schedule, url }: IcsEventInput): string;
25
- /** Google Calendar "add event" URL for the same data. */
26
- export declare function googleCalendarUrl({ offering, schedule }: IcsEventInput): string;
27
- /**
28
- * Route handler factory: app/events/[slug]/calendar.ics/route.ts (or any
29
- * route) — resolve the event yourself, delegate the response here.
30
- */
31
- export declare function icsResponse(input: IcsEventInput): Response;
32
- export interface EventJsonLdProps {
33
- offering: CommerceOffering;
34
- schedule: CommerceSchedule;
35
- /** Absolute page URL. */
36
- url?: string;
37
- /** Site origin for offer URLs, e.g. https://example.com */
38
- origin?: string;
39
- }
40
- /** schema.org/Event structured data from data the page already fetched. */
41
- export declare function EventJsonLd({ offering, schedule, url, origin }: EventJsonLdProps): React.JSX.Element;
42
- export interface CapacityBadgeProps {
43
- schedule: CommerceSchedule;
44
- className?: string;
45
- /** Show "N of M spots left" instead of just "N spots left" when capacity known. */
46
- showTotal?: boolean;
47
- /** Below this count the badge gets data-sk-urgency="low-spots". Default 5. */
48
- lowThreshold?: number;
49
- labels?: {
50
- soldOut?: string;
51
- spotsLeft?: (n: number, total?: number | null) => string;
52
- };
53
- }
54
- /**
55
- * Honest capacity, styled by the site via data attributes:
56
- * [data-sk-part="capacity-badge"][data-sk-availability="sold-out" | "open"]
57
- * [data-sk-urgency="low-spots"]
58
- * Renders nothing when the schedule doesn't track capacity.
59
- */
60
- export declare function CapacityBadge({ schedule, className, showTotal, lowThreshold, labels, }: CapacityBadgeProps): React.JSX.Element | null;
@@ -1,33 +0,0 @@
1
- /**
2
- * @sonordev/site-kit/commerce
3
- *
4
- * Commerce module for displaying products, services, events, and classes
5
- * with checkout and registration flows.
6
- */
7
- export * from './types';
8
- export * from './utils';
9
- export { fetchOfferings, fetchOffering, fetchLatestOffering, fetchProducts, fetchProductsPublic, fetchProductBySlug, fetchCategories, fetchServices, fetchUpcomingEvents, fetchNextEvent, fetchShippingRates, shippingSelection, validateAddress, registerForEvent, createCheckoutSession, createPaymentIntent, fetchActiveProcessor, fetchProcessorConfig, validateDiscountCode, } from './api';
10
- export type { ShippingAddress, ShippingRate, ValidateAddressResult, CreateCheckoutOptions, CheckoutLineItem, ProcessorConfig, DiscountValidationResult } from './api';
11
- export { OfferingCard } from './OfferingCard';
12
- export { OfferingList } from './OfferingList';
13
- export { EventTile } from './EventTile';
14
- export { UpcomingEvents } from './UpcomingEvents';
15
- export { ProductEmbed } from './ProductEmbed';
16
- export { ProductDetail } from './ProductDetail';
17
- export { SizeChart } from './SizeChart';
18
- export { ProductGrid } from './ProductGrid';
19
- export { ProductPage } from './ProductPage';
20
- export { EventEmbed } from './EventEmbed';
21
- export { CheckoutForm } from './CheckoutForm';
22
- export { EventCheckout } from './EventCheckout';
23
- export type { EventCheckoutProps } from './EventCheckout';
24
- export { RegistrationForm } from './RegistrationForm';
25
- export { CalendarView } from './CalendarView';
26
- export { EventsAgenda } from './EventsAgenda';
27
- export type { EventsAgendaProps, AgendaItem } from './EventsAgenda';
28
- export { EventModal } from './EventModal';
29
- export { EventCalendar } from './EventCalendar';
30
- export { EventsWidget } from './EventsWidget';
31
- export { useEventModal } from './useEventModal';
32
- export { icsForEvent, icsResponse, googleCalendarUrl, EventJsonLd, CapacityBadge, } from './events-extras';
33
- export type { IcsEventInput, EventJsonLdProps, CapacityBadgeProps } from './events-extras';