@burdenoff/website-sdk 2026.817.1 → 2026.817.2

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.
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { createContext, useMemo, useContext, useState, useCallback, useLayoutEffect, useRef, useEffect } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { Instagram, Youtube, Facebook, Github, Linkedin, Twitter, Mail, Phone, MapPin, Clock, Send, CheckCircle, Upload, Globe, ChevronDown, Search, Rocket, ArrowRight, Download, History, ChevronLeft, ChevronRight, FileText } from 'lucide-react';
5
- import ReCAPTCHA3 from 'react-google-recaptcha';
5
+ import ReCAPTCHA4 from 'react-google-recaptcha';
6
6
  import { toast } from 'sonner';
7
7
  import { Helmet } from 'react-helmet-async';
8
8
  import { Slot } from '@radix-ui/react-slot';
@@ -981,7 +981,7 @@ function ContactPage({
981
981
  ] }),
982
982
  /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
983
983
  effectiveRecaptchaSiteKey && /* @__PURE__ */ jsx("div", { className: "flex justify-center sm:justify-start", children: /* @__PURE__ */ jsx(
984
- ReCAPTCHA3,
984
+ ReCAPTCHA4,
985
985
  {
986
986
  ref: recaptchaRef,
987
987
  sitekey: effectiveRecaptchaSiteKey
@@ -1947,7 +1947,7 @@ function CareersApplyForm({
1947
1947
  )
1948
1948
  ] }),
1949
1949
  effectiveRecaptchaSiteKey && /* @__PURE__ */ jsx(
1950
- ReCAPTCHA3,
1950
+ ReCAPTCHA4,
1951
1951
  {
1952
1952
  ref: recaptchaRef,
1953
1953
  sitekey: effectiveRecaptchaSiteKey
@@ -1972,6 +1972,284 @@ function CareersApplyForm({
1972
1972
  )
1973
1973
  ] });
1974
1974
  }
1975
+ var SUBMIT_ASSIGNMENT_RESPONSE_MUTATION = (
1976
+ /* GraphQL */
1977
+ `
1978
+ mutation SubmitAssignmentResponse($input: SubmitAssignmentResponseInput!) {
1979
+ submitAssignmentResponse(input: $input) {
1980
+ success
1981
+ message
1982
+ applicationId
1983
+ roundId
1984
+ }
1985
+ }
1986
+ `
1987
+ );
1988
+ function isValidUrl(value) {
1989
+ try {
1990
+ const url = new URL(value);
1991
+ return url.protocol === "http:" || url.protocol === "https:";
1992
+ } catch {
1993
+ return false;
1994
+ }
1995
+ }
1996
+ async function submitAssignmentResponse(client, data) {
1997
+ try {
1998
+ const result = await client.mutate(SUBMIT_ASSIGNMENT_RESPONSE_MUTATION, {
1999
+ input: {
2000
+ email: data.email.trim().toLowerCase(),
2001
+ repoUrl: data.repoUrl.trim(),
2002
+ videoUrl: data.videoUrl.trim(),
2003
+ recaptchaToken: data.recaptchaToken ?? "",
2004
+ ...data.name ? { name: data.name } : {},
2005
+ ...data.position ? { position: data.position } : {},
2006
+ ...data.jobPostingId ? { jobPostingId: data.jobPostingId } : {},
2007
+ ...data.notes ? { notes: data.notes } : {}
2008
+ }
2009
+ });
2010
+ if (result.errors?.length) {
2011
+ return {
2012
+ success: false,
2013
+ message: result.errors[0]?.message ?? "Failed to submit assignment"
2014
+ };
2015
+ }
2016
+ const response = result.data?.submitAssignmentResponse;
2017
+ return response?.success ? { success: true, message: response.message || "Assignment submitted!" } : {
2018
+ success: false,
2019
+ message: response?.message || "Failed to submit assignment"
2020
+ };
2021
+ } catch (error) {
2022
+ console.error("Assignment submission error:", error);
2023
+ return { success: false, message: "Network error. Please try again." };
2024
+ }
2025
+ }
2026
+ var NO_APPLICATION_HINT = "Please use the same email address you applied with \u2014 or submit an application first.";
2027
+ function isNoApplicationError(message) {
2028
+ return /no application|not found/i.test(message);
2029
+ }
2030
+ function CareersSubmissionForm({
2031
+ productName,
2032
+ recaptchaSiteKey,
2033
+ postings = [],
2034
+ heroTitle = "Submit your assignment",
2035
+ heroDescription = "Share your GitHub repo and a short video walkthrough \u2014 make sure to use the same email you applied with.",
2036
+ headingLevel = 1,
2037
+ className,
2038
+ seo
2039
+ }) {
2040
+ const client = useWebSDK();
2041
+ const config = useWebSDKConfig();
2042
+ const { product } = useProduct();
2043
+ const displayName = productName ?? product?.name ?? config.productId;
2044
+ const effectiveRecaptchaSiteKey = recaptchaSiteKey ?? product?.recaptchaSiteKey ?? config.recaptchaSiteKey ?? "";
2045
+ const recaptchaRef = useRef(null);
2046
+ const [isSubmitting, setIsSubmitting] = useState(false);
2047
+ const [submittedMessage, setSubmittedMessage] = useState(null);
2048
+ const [formError, setFormError] = useState(null);
2049
+ const handleSubmit = async (e) => {
2050
+ e.preventDefault();
2051
+ setFormError(null);
2052
+ const recaptchaToken = recaptchaRef.current?.getValue() ?? "";
2053
+ if (effectiveRecaptchaSiteKey && !recaptchaToken) {
2054
+ toast.error("Please complete the reCAPTCHA verification");
2055
+ return;
2056
+ }
2057
+ const form = e.currentTarget;
2058
+ const formData = new FormData(form);
2059
+ const name = (formData.get("name") ?? "").trim();
2060
+ const email = (formData.get("email") ?? "").trim();
2061
+ const positionValue = (formData.get("position") ?? "").trim();
2062
+ const repoUrl = (formData.get("repoUrl") ?? "").trim();
2063
+ const videoUrl = (formData.get("videoUrl") ?? "").trim();
2064
+ const notes = (formData.get("notes") ?? "").trim();
2065
+ const selectedPosting = postings.length > 0 ? postings.find((p) => p.id === positionValue) : void 0;
2066
+ const position = selectedPosting ? selectedPosting.title : positionValue;
2067
+ if (!email) {
2068
+ setFormError("Please enter the email address you applied with.");
2069
+ return;
2070
+ }
2071
+ if (!position) {
2072
+ setFormError("Please select or enter the position you applied for.");
2073
+ return;
2074
+ }
2075
+ if (!repoUrl || !isValidUrl(repoUrl)) {
2076
+ setFormError(
2077
+ "Please enter a valid GitHub repository URL (e.g. https://github.com/you/project)."
2078
+ );
2079
+ return;
2080
+ }
2081
+ if (!videoUrl || !isValidUrl(videoUrl)) {
2082
+ setFormError(
2083
+ "Please enter a valid video URL (e.g. a Jam or Loom link starting with https://)."
2084
+ );
2085
+ return;
2086
+ }
2087
+ setIsSubmitting(true);
2088
+ try {
2089
+ const result = await submitAssignmentResponse(client, {
2090
+ name: name || void 0,
2091
+ email,
2092
+ position,
2093
+ jobPostingId: selectedPosting?.id,
2094
+ repoUrl,
2095
+ videoUrl,
2096
+ notes: notes || void 0,
2097
+ recaptchaToken
2098
+ });
2099
+ if (result.success) {
2100
+ setSubmittedMessage(result.message ?? "Assignment submitted!");
2101
+ toast.success(result.message ?? "Assignment submitted!");
2102
+ } else {
2103
+ const message = result.message ?? "Failed to submit assignment";
2104
+ setFormError(
2105
+ isNoApplicationError(message) ? `${message} ${NO_APPLICATION_HINT}` : message
2106
+ );
2107
+ toast.error(message);
2108
+ recaptchaRef.current?.reset();
2109
+ }
2110
+ } catch (err) {
2111
+ console.error("Careers submission form error:", err);
2112
+ setFormError("Something went wrong. Please try again.");
2113
+ toast.error("Something went wrong. Please try again.");
2114
+ recaptchaRef.current?.reset();
2115
+ } finally {
2116
+ setIsSubmitting(false);
2117
+ }
2118
+ };
2119
+ const Heading = headingLevel === 2 ? "h2" : "h1";
2120
+ const headingClass = headingLevel === 2 ? "text-2xl md:text-3xl font-bold mb-3" : "text-3xl sm:text-4xl md:text-5xl font-bold mb-4 sm:mb-6";
2121
+ return /* @__PURE__ */ jsxs("div", { className, children: [
2122
+ seo && /* @__PURE__ */ jsx(
2123
+ PageHead,
2124
+ {
2125
+ title: seo.title ?? `Submit your assignment \u2014 ${displayName}`,
2126
+ description: seo.description ?? heroDescription,
2127
+ keywords: seo.keywords
2128
+ }
2129
+ ),
2130
+ /* @__PURE__ */ jsx(
2131
+ "section",
2132
+ {
2133
+ className: headingLevel === 2 ? "py-12 md:py-16" : "bg-gradient-to-b from-background to-muted/20 py-12 sm:py-16 md:py-20 lg:py-24",
2134
+ children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto px-4 sm:px-6 lg:px-8", children: [
2135
+ /* @__PURE__ */ jsxs("div", { className: "text-center mb-8 sm:mb-10", children: [
2136
+ /* @__PURE__ */ jsx(Heading, { className: headingClass, children: heroTitle }),
2137
+ /* @__PURE__ */ jsx("p", { className: "text-lg text-muted-foreground leading-relaxed", children: heroDescription })
2138
+ ] }),
2139
+ submittedMessage ? /* @__PURE__ */ jsxs("div", { className: "text-center rounded-xl border border-border bg-card p-10", children: [
2140
+ /* @__PURE__ */ jsx(CheckCircle, { className: "mx-auto mb-4 h-12 w-12 text-accent" }),
2141
+ /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-foreground mb-2", children: "Assignment received" }),
2142
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: submittedMessage })
2143
+ ] }) : /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "space-y-5", children: [
2144
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-5", children: [
2145
+ /* @__PURE__ */ jsxs("div", { children: [
2146
+ /* @__PURE__ */ jsx(Label, { htmlFor: "name", children: "Name" }),
2147
+ /* @__PURE__ */ jsx(Input, { id: "name", name: "name", placeholder: "Ada Lovelace" })
2148
+ ] }),
2149
+ /* @__PURE__ */ jsxs("div", { children: [
2150
+ /* @__PURE__ */ jsx(Label, { htmlFor: "email", children: "Email *" }),
2151
+ /* @__PURE__ */ jsx(
2152
+ Input,
2153
+ {
2154
+ id: "email",
2155
+ name: "email",
2156
+ type: "email",
2157
+ required: true,
2158
+ placeholder: "ada@example.com"
2159
+ }
2160
+ )
2161
+ ] })
2162
+ ] }),
2163
+ /* @__PURE__ */ jsxs("div", { children: [
2164
+ /* @__PURE__ */ jsx(Label, { htmlFor: "position", children: "Position *" }),
2165
+ postings.length > 0 ? /* @__PURE__ */ jsxs(
2166
+ "select",
2167
+ {
2168
+ id: "position",
2169
+ name: "position",
2170
+ required: true,
2171
+ defaultValue: "",
2172
+ className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
2173
+ children: [
2174
+ /* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Select a role" }),
2175
+ postings.map((p) => /* @__PURE__ */ jsx("option", { value: p.id, children: p.title }, p.id))
2176
+ ]
2177
+ }
2178
+ ) : /* @__PURE__ */ jsx(
2179
+ Input,
2180
+ {
2181
+ id: "position",
2182
+ name: "position",
2183
+ required: true,
2184
+ placeholder: "Role you applied for"
2185
+ }
2186
+ )
2187
+ ] }),
2188
+ /* @__PURE__ */ jsxs("div", { children: [
2189
+ /* @__PURE__ */ jsx(Label, { htmlFor: "repoUrl", children: "GitHub repository URL *" }),
2190
+ /* @__PURE__ */ jsx(
2191
+ Input,
2192
+ {
2193
+ id: "repoUrl",
2194
+ name: "repoUrl",
2195
+ type: "url",
2196
+ required: true,
2197
+ placeholder: "https://github.com/you/assignment"
2198
+ }
2199
+ )
2200
+ ] }),
2201
+ /* @__PURE__ */ jsxs("div", { children: [
2202
+ /* @__PURE__ */ jsx(Label, { htmlFor: "videoUrl", children: "Video walkthrough URL (Jam, Loom, \u2026) *" }),
2203
+ /* @__PURE__ */ jsx(
2204
+ Input,
2205
+ {
2206
+ id: "videoUrl",
2207
+ name: "videoUrl",
2208
+ type: "url",
2209
+ required: true,
2210
+ placeholder: "https://jam.dev/c/\u2026"
2211
+ }
2212
+ )
2213
+ ] }),
2214
+ /* @__PURE__ */ jsxs("div", { children: [
2215
+ /* @__PURE__ */ jsx(Label, { htmlFor: "notes", children: "Notes" }),
2216
+ /* @__PURE__ */ jsx(
2217
+ Textarea,
2218
+ {
2219
+ id: "notes",
2220
+ name: "notes",
2221
+ rows: 4,
2222
+ placeholder: "Anything we should know before reviewing\u2026"
2223
+ }
2224
+ )
2225
+ ] }),
2226
+ formError && /* @__PURE__ */ jsx("p", { role: "alert", className: "text-sm text-destructive", children: formError }),
2227
+ effectiveRecaptchaSiteKey && /* @__PURE__ */ jsx(
2228
+ ReCAPTCHA4,
2229
+ {
2230
+ ref: recaptchaRef,
2231
+ sitekey: effectiveRecaptchaSiteKey
2232
+ }
2233
+ ),
2234
+ /* @__PURE__ */ jsx(
2235
+ Button,
2236
+ {
2237
+ type: "submit",
2238
+ size: "lg",
2239
+ disabled: isSubmitting,
2240
+ className: "w-full sm:w-auto",
2241
+ children: isSubmitting ? "Submitting\u2026" : /* @__PURE__ */ jsxs(Fragment, { children: [
2242
+ /* @__PURE__ */ jsx(Send, { className: "mr-2 h-4 w-4" }),
2243
+ " Submit assignment"
2244
+ ] })
2245
+ }
2246
+ )
2247
+ ] })
2248
+ ] })
2249
+ }
2250
+ )
2251
+ ] });
2252
+ }
1975
2253
  var newsletterSchema = z.object({
1976
2254
  email: z.string().email("Please enter a valid email address")
1977
2255
  });
@@ -2261,7 +2539,7 @@ function NewsletterPage({
2261
2539
  errors.email && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: errors.email.message })
2262
2540
  ] }),
2263
2541
  effectiveRecaptchaSiteKey && /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
2264
- ReCAPTCHA3,
2542
+ ReCAPTCHA4,
2265
2543
  {
2266
2544
  ref: recaptchaRef,
2267
2545
  sitekey: effectiveRecaptchaSiteKey
@@ -2313,7 +2591,7 @@ function NewsletterPage({
2313
2591
  errors.email && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: errors.email.message })
2314
2592
  ] }),
2315
2593
  effectiveRecaptchaSiteKey && /* @__PURE__ */ jsx("div", { className: "flex justify-center sm:justify-start", children: /* @__PURE__ */ jsx(
2316
- ReCAPTCHA3,
2594
+ ReCAPTCHA4,
2317
2595
  {
2318
2596
  ref: recaptchaRef,
2319
2597
  sitekey: effectiveRecaptchaSiteKey
@@ -2491,7 +2769,7 @@ function NewsletterForm({
2491
2769
  justifyContent: "flex-start"
2492
2770
  },
2493
2771
  children: /* @__PURE__ */ jsx(
2494
- ReCAPTCHA3,
2772
+ ReCAPTCHA4,
2495
2773
  {
2496
2774
  ref: recaptchaRef,
2497
2775
  sitekey: effectiveRecaptchaSiteKey,
@@ -9233,6 +9511,6 @@ var ECOSYSTEM_PRODUCTS = [
9233
9511
  }
9234
9512
  ];
9235
9513
 
9236
- export { BlogListPage, BlogPostPage, Button, CareersApplyForm, CaseStudiesListPage, CaseStudyPage, ChangelogPage, ContactPage, ContentRenderer, ContractsPage, DEFAULT_CONTACT_CATEGORIES, ECOSYSTEM_PRODUCTS, ElectronDownloadLink, Input, Label, LaunchCountdown, Markdown, NewsletterForm, NewsletterPage, PageHead, PartnersPage, PressKitPage, PricingPage, PricingSection, ProblemsSolvedSection, ProductCard, ProductProvider, ResourceLinks, RybbitAnalytics, Select, SocialLinks, StarRating, StoreBrowsePage, StoreHomePage, StoreProductDetailPage, Textarea, TypeBadge, UnsubscribePage, WaitlistForm, WaitlistPage, WebSDKClient, WebSDKProvider, WebsiteSwitcher, buttonVariants, cn, detectElectronPlatform, fetchPublicJobPosting, fetchPublicJobPostings, formatDownloads, formatPrice2 as formatPrice, useContentPage, useContentPages, useProduct, useProductConfig, usePublicJobPosting, usePublicJobPostings, useWebSDK, useWebSDKConfig };
9514
+ export { BlogListPage, BlogPostPage, Button, CareersApplyForm, CareersSubmissionForm, CaseStudiesListPage, CaseStudyPage, ChangelogPage, ContactPage, ContentRenderer, ContractsPage, DEFAULT_CONTACT_CATEGORIES, ECOSYSTEM_PRODUCTS, ElectronDownloadLink, Input, Label, LaunchCountdown, Markdown, NewsletterForm, NewsletterPage, PageHead, PartnersPage, PressKitPage, PricingPage, PricingSection, ProblemsSolvedSection, ProductCard, ProductProvider, ResourceLinks, RybbitAnalytics, Select, SocialLinks, StarRating, StoreBrowsePage, StoreHomePage, StoreProductDetailPage, Textarea, TypeBadge, UnsubscribePage, WaitlistForm, WaitlistPage, WebSDKClient, WebSDKProvider, WebsiteSwitcher, buttonVariants, cn, detectElectronPlatform, fetchPublicJobPosting, fetchPublicJobPostings, formatDownloads, formatPrice2 as formatPrice, isValidUrl, useContentPage, useContentPages, useProduct, useProductConfig, usePublicJobPosting, usePublicJobPostings, useWebSDK, useWebSDKConfig };
9237
9515
  //# sourceMappingURL=index.mjs.map
9238
9516
  //# sourceMappingURL=index.mjs.map