@opensite/ui 1.9.8 → 2.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 (131) hide show
  1. package/dist/contact-demo.cjs +106 -406
  2. package/dist/contact-demo.d.cts +36 -111
  3. package/dist/contact-demo.d.ts +36 -111
  4. package/dist/contact-demo.js +108 -405
  5. package/dist/contact-emergency.cjs +129 -158
  6. package/dist/contact-emergency.d.cts +23 -12
  7. package/dist/contact-emergency.d.ts +23 -12
  8. package/dist/contact-emergency.js +131 -159
  9. package/dist/contact-event.cjs +106 -147
  10. package/dist/contact-event.d.cts +36 -66
  11. package/dist/contact-event.d.ts +36 -66
  12. package/dist/contact-event.js +108 -148
  13. package/dist/contact-feedback.cjs +109 -102
  14. package/dist/contact-feedback.d.cts +36 -63
  15. package/dist/contact-feedback.d.ts +36 -63
  16. package/dist/contact-feedback.js +111 -103
  17. package/dist/contact-fitness.cjs +107 -148
  18. package/dist/contact-fitness.d.cts +36 -66
  19. package/dist/contact-fitness.d.ts +36 -66
  20. package/dist/contact-fitness.js +109 -149
  21. package/dist/contact-guest.cjs +107 -148
  22. package/dist/contact-guest.d.cts +35 -65
  23. package/dist/contact-guest.d.ts +35 -65
  24. package/dist/contact-guest.js +109 -149
  25. package/dist/contact-image.cjs +108 -149
  26. package/dist/contact-image.d.cts +35 -65
  27. package/dist/contact-image.d.ts +35 -65
  28. package/dist/contact-image.js +110 -150
  29. package/dist/contact-insurance.cjs +107 -148
  30. package/dist/contact-insurance.d.cts +36 -66
  31. package/dist/contact-insurance.d.ts +36 -66
  32. package/dist/contact-insurance.js +109 -149
  33. package/dist/contact-interview.cjs +106 -147
  34. package/dist/contact-interview.d.cts +20 -12
  35. package/dist/contact-interview.d.ts +20 -12
  36. package/dist/contact-interview.js +108 -148
  37. package/dist/contact-locations.cjs +106 -147
  38. package/dist/contact-locations.d.cts +21 -13
  39. package/dist/contact-locations.d.ts +21 -13
  40. package/dist/contact-locations.js +108 -148
  41. package/dist/contact-maintenance.cjs +103 -143
  42. package/dist/contact-maintenance.d.cts +21 -13
  43. package/dist/contact-maintenance.d.ts +21 -13
  44. package/dist/contact-maintenance.js +105 -144
  45. package/dist/contact-map.cjs +103 -143
  46. package/dist/contact-map.d.cts +20 -12
  47. package/dist/contact-map.d.ts +20 -12
  48. package/dist/contact-map.js +105 -144
  49. package/dist/contact-minimal.cjs +126 -242
  50. package/dist/contact-minimal.d.cts +36 -70
  51. package/dist/contact-minimal.d.ts +36 -70
  52. package/dist/contact-minimal.js +128 -243
  53. package/dist/contact-moving.cjs +103 -143
  54. package/dist/contact-moving.d.cts +20 -12
  55. package/dist/contact-moving.d.ts +20 -12
  56. package/dist/contact-moving.js +105 -144
  57. package/dist/contact-multistep.cjs +104 -144
  58. package/dist/contact-multistep.d.cts +21 -13
  59. package/dist/contact-multistep.d.ts +21 -13
  60. package/dist/contact-multistep.js +106 -145
  61. package/dist/contact-partnership.cjs +103 -143
  62. package/dist/contact-partnership.d.cts +19 -11
  63. package/dist/contact-partnership.d.ts +19 -11
  64. package/dist/contact-partnership.js +105 -144
  65. package/dist/contact-press.cjs +144 -150
  66. package/dist/contact-press.d.cts +21 -13
  67. package/dist/contact-press.d.ts +21 -13
  68. package/dist/contact-press.js +146 -151
  69. package/dist/contact-quote.cjs +144 -150
  70. package/dist/contact-quote.d.cts +19 -11
  71. package/dist/contact-quote.d.ts +19 -11
  72. package/dist/contact-quote.js +146 -151
  73. package/dist/contact-referral.cjs +144 -150
  74. package/dist/contact-referral.d.cts +20 -12
  75. package/dist/contact-referral.d.ts +20 -12
  76. package/dist/contact-referral.js +146 -151
  77. package/dist/contact-report.cjs +144 -150
  78. package/dist/contact-report.d.cts +21 -13
  79. package/dist/contact-report.d.ts +21 -13
  80. package/dist/contact-report.js +146 -151
  81. package/dist/contact-reservation.cjs +144 -150
  82. package/dist/contact-reservation.d.cts +20 -12
  83. package/dist/contact-reservation.d.ts +20 -12
  84. package/dist/contact-reservation.js +146 -151
  85. package/dist/contact-retreat.cjs +144 -150
  86. package/dist/contact-retreat.d.cts +21 -13
  87. package/dist/contact-retreat.d.ts +21 -13
  88. package/dist/contact-retreat.js +146 -151
  89. package/dist/contact-rsvp.cjs +144 -150
  90. package/dist/contact-rsvp.d.cts +20 -12
  91. package/dist/contact-rsvp.d.ts +20 -12
  92. package/dist/contact-rsvp.js +146 -151
  93. package/dist/contact-sales.cjs +131 -146
  94. package/dist/contact-sales.d.cts +34 -65
  95. package/dist/contact-sales.d.ts +34 -65
  96. package/dist/contact-sales.js +133 -147
  97. package/dist/contact-schedule.cjs +144 -150
  98. package/dist/contact-schedule.d.cts +20 -12
  99. package/dist/contact-schedule.d.ts +20 -12
  100. package/dist/contact-schedule.js +146 -151
  101. package/dist/contact-sponsorship.cjs +144 -150
  102. package/dist/contact-sponsorship.d.cts +21 -13
  103. package/dist/contact-sponsorship.d.ts +21 -13
  104. package/dist/contact-sponsorship.js +146 -151
  105. package/dist/contact-support.cjs +147 -120
  106. package/dist/contact-support.d.cts +21 -12
  107. package/dist/contact-support.d.ts +21 -12
  108. package/dist/contact-support.js +149 -121
  109. package/dist/contact-tenant.cjs +144 -150
  110. package/dist/contact-tenant.d.cts +20 -12
  111. package/dist/contact-tenant.d.ts +20 -12
  112. package/dist/contact-tenant.js +146 -151
  113. package/dist/contact-vendor.cjs +144 -150
  114. package/dist/contact-vendor.d.cts +20 -12
  115. package/dist/contact-vendor.d.ts +20 -12
  116. package/dist/contact-vendor.js +146 -151
  117. package/dist/contact-volunteer.cjs +144 -150
  118. package/dist/contact-volunteer.d.cts +20 -12
  119. package/dist/contact-volunteer.d.ts +20 -12
  120. package/dist/contact-volunteer.js +146 -151
  121. package/dist/contact-warranty.cjs +144 -150
  122. package/dist/contact-warranty.d.cts +20 -12
  123. package/dist/contact-warranty.d.ts +20 -12
  124. package/dist/contact-warranty.js +146 -151
  125. package/dist/contact-wedding.cjs +144 -150
  126. package/dist/contact-wedding.d.cts +20 -12
  127. package/dist/contact-wedding.d.ts +20 -12
  128. package/dist/contact-wedding.js +146 -151
  129. package/dist/registry.cjs +5791 -5883
  130. package/dist/registry.js +4527 -4619
  131. package/package.json +2 -2
@@ -3,15 +3,11 @@
3
3
 
4
4
  var React = require('react');
5
5
  var forms = require('@page-speed/forms');
6
- var inputs = require('@page-speed/forms/inputs');
6
+ var integration = require('@page-speed/forms/integration');
7
7
  var clsx = require('clsx');
8
8
  var tailwindMerge = require('tailwind-merge');
9
9
  var classVarianceAuthority = require('class-variance-authority');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
- var CheckboxPrimitive = require('@radix-ui/react-checkbox');
12
- var LabelPrimitive = require('@radix-ui/react-label');
13
- var SeparatorPrimitive = require('@radix-ui/react-separator');
14
- var integration = require('@page-speed/forms/integration');
15
11
 
16
12
  function _interopNamespace(e) {
17
13
  if (e && e.__esModule) return e;
@@ -32,12 +28,8 @@ function _interopNamespace(e) {
32
28
  }
33
29
 
34
30
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
35
- var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
36
- var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
37
- var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
38
31
 
39
32
  // components/blocks/contact/contact-demo.tsx
40
- var TextInput = inputs.TextInput;
41
33
  function cn(...inputs) {
42
34
  return tailwindMerge.twMerge(clsx.clsx(inputs));
43
35
  }
@@ -459,111 +451,6 @@ var Pressable = React__namespace.forwardRef(
459
451
  }
460
452
  );
461
453
  Pressable.displayName = "Pressable";
462
- var svgCache = /* @__PURE__ */ new Map();
463
- function DynamicIcon({
464
- name,
465
- size = 28,
466
- color,
467
- className,
468
- alt
469
- }) {
470
- const [svgContent, setSvgContent] = React__namespace.useState(null);
471
- const [isLoading, setIsLoading] = React__namespace.useState(true);
472
- const [error, setError] = React__namespace.useState(null);
473
- const { url, iconName } = React__namespace.useMemo(() => {
474
- const separator = name.includes("/") ? "/" : ":";
475
- const [prefix, iconName2] = name.split(separator);
476
- const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}&key=au382bi7fsh96w9h9xlrnat2jglx`;
477
- return {
478
- url: baseUrl,
479
- iconName: iconName2
480
- };
481
- }, [name, size]);
482
- React__namespace.useEffect(() => {
483
- let isMounted = true;
484
- const fetchSvg = async () => {
485
- const cached = svgCache.get(url);
486
- if (cached) {
487
- if (isMounted) {
488
- setSvgContent(cached);
489
- setIsLoading(false);
490
- }
491
- return;
492
- }
493
- try {
494
- setIsLoading(true);
495
- setError(null);
496
- const response = await fetch(url);
497
- if (!response.ok) {
498
- throw new Error(`Failed to fetch icon: ${response.status}`);
499
- }
500
- let svg = await response.text();
501
- svg = processSvgForCurrentColor(svg);
502
- svgCache.set(url, svg);
503
- if (isMounted) {
504
- setSvgContent(svg);
505
- setIsLoading(false);
506
- }
507
- } catch (err) {
508
- if (isMounted) {
509
- setError(err instanceof Error ? err.message : "Failed to load icon");
510
- setIsLoading(false);
511
- }
512
- }
513
- };
514
- fetchSvg();
515
- return () => {
516
- isMounted = false;
517
- };
518
- }, [url]);
519
- if (isLoading) {
520
- return /* @__PURE__ */ jsxRuntime.jsx(
521
- "span",
522
- {
523
- className: cn("inline-block", className),
524
- style: { width: size, height: size },
525
- "aria-hidden": "true"
526
- }
527
- );
528
- }
529
- if (error || !svgContent) {
530
- return /* @__PURE__ */ jsxRuntime.jsx(
531
- "span",
532
- {
533
- className: cn("inline-block", className),
534
- style: { width: size, height: size },
535
- role: "img",
536
- "aria-label": alt || iconName
537
- }
538
- );
539
- }
540
- return /* @__PURE__ */ jsxRuntime.jsx(
541
- "span",
542
- {
543
- className: cn("inline-flex items-center justify-center", className),
544
- style: {
545
- width: size,
546
- height: size,
547
- color: color || "inherit"
548
- },
549
- role: "img",
550
- "aria-label": alt || iconName,
551
- dangerouslySetInnerHTML: { __html: svgContent }
552
- }
553
- );
554
- }
555
- function processSvgForCurrentColor(svg) {
556
- let processed = svg;
557
- processed = processed.replace(
558
- /stroke=["'](#000000|#000|black)["']/gi,
559
- 'stroke="currentColor"'
560
- );
561
- processed = processed.replace(
562
- /fill=["'](#000000|#000|black)["']/gi,
563
- 'fill="currentColor"'
564
- );
565
- return processed;
566
- }
567
454
  function Card({ className, ...props }) {
568
455
  return /* @__PURE__ */ jsxRuntime.jsx(
569
456
  "div",
@@ -587,66 +474,6 @@ function CardContent({ className, ...props }) {
587
474
  }
588
475
  );
589
476
  }
590
- function Checkbox({
591
- className,
592
- ...props
593
- }) {
594
- return /* @__PURE__ */ jsxRuntime.jsx(
595
- CheckboxPrimitive__namespace.Root,
596
- {
597
- "data-slot": "checkbox",
598
- className: cn(
599
- "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
600
- className
601
- ),
602
- ...props,
603
- children: /* @__PURE__ */ jsxRuntime.jsx(
604
- CheckboxPrimitive__namespace.Indicator,
605
- {
606
- "data-slot": "checkbox-indicator",
607
- className: "grid place-content-center text-current transition-none",
608
- children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/check", size: 14 })
609
- }
610
- )
611
- }
612
- );
613
- }
614
- function Label({
615
- className,
616
- ...props
617
- }) {
618
- return /* @__PURE__ */ jsxRuntime.jsx(
619
- LabelPrimitive__namespace.Root,
620
- {
621
- "data-slot": "label",
622
- className: cn(
623
- "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
624
- className
625
- ),
626
- ...props
627
- }
628
- );
629
- }
630
- function Separator({
631
- className,
632
- orientation = "horizontal",
633
- decorative = true,
634
- ...props
635
- }) {
636
- return /* @__PURE__ */ jsxRuntime.jsx(
637
- SeparatorPrimitive__namespace.Root,
638
- {
639
- "data-slot": "separator",
640
- decorative,
641
- orientation,
642
- className: cn(
643
- "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
644
- className
645
- ),
646
- ...props
647
- }
648
- );
649
- }
650
477
  var maxWidthStyles = {
651
478
  sm: "max-w-screen-sm",
652
479
  md: "max-w-screen-md",
@@ -1022,36 +849,60 @@ var Section = React__namespace.default.forwardRef(
1022
849
  }
1023
850
  );
1024
851
  Section.displayName = "Section";
1025
- var USE_CASES = [
1026
- { value: "automation", label: "Workflow Automation", icon: "lucide/zap" },
852
+ var DEFAULT_FORM_FIELDS = [
1027
853
  {
1028
- value: "analytics",
1029
- label: "Analytics & Reporting",
1030
- icon: "lucide/bar-chart-3"
854
+ name: "first_name",
855
+ type: "text",
856
+ label: "First Name",
857
+ placeholder: "John",
858
+ required: true,
859
+ columnSpan: 6
1031
860
  },
1032
- { value: "collaboration", label: "Team Collaboration", icon: "lucide/users" }
1033
- ];
1034
- var TEAM_SIZES = [
1035
- { value: "1-10", label: "1-10" },
1036
- { value: "11-50", label: "11-50" },
1037
- { value: "51-200", label: "51-200" },
1038
- { value: "201-500", label: "201-500" },
1039
- { value: "500+", label: "500+" }
1040
- ];
1041
- var TIMELINES = [
1042
- { value: "asap", label: "As soon as possible" },
1043
- { value: "this-week", label: "This week" },
1044
- { value: "this-month", label: "This month" },
1045
- { value: "exploring", label: "Just exploring" }
861
+ {
862
+ name: "last_name",
863
+ type: "text",
864
+ label: "Last Name",
865
+ placeholder: "Doe",
866
+ required: true,
867
+ columnSpan: 6
868
+ },
869
+ {
870
+ name: "email",
871
+ type: "email",
872
+ label: "Email",
873
+ placeholder: "john@example.com",
874
+ required: true,
875
+ columnSpan: 12
876
+ },
877
+ {
878
+ name: "phone",
879
+ type: "tel",
880
+ label: "Phone",
881
+ placeholder: "+1 (555) 000-0000",
882
+ required: true,
883
+ columnSpan: 12
884
+ },
885
+ {
886
+ name: "message",
887
+ type: "textarea",
888
+ label: "Message",
889
+ placeholder: "Your message...",
890
+ required: true,
891
+ rows: 4,
892
+ columnSpan: 12
893
+ }
1046
894
  ];
1047
895
  function ContactDemo({
1048
896
  heading,
1049
897
  description,
1050
- buttonText,
898
+ buttonText = "Submit",
1051
899
  buttonIcon,
1052
900
  actions,
1053
901
  actionsSlot,
902
+ formFields = DEFAULT_FORM_FIELDS,
903
+ successMessage = "Thank you! Your message has been sent successfully.",
1054
904
  className,
905
+ containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
1055
906
  headerClassName,
1056
907
  headingClassName,
1057
908
  descriptionClassName,
@@ -1059,72 +910,38 @@ function ContactDemo({
1059
910
  cardContentClassName,
1060
911
  formClassName,
1061
912
  submitClassName,
1062
- spacing = "py-8 md:py-32",
1063
- containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
1064
- background,
913
+ successMessageClassName,
914
+ errorMessageClassName,
915
+ background = "white",
916
+ spacing = "xl",
1065
917
  pattern,
1066
- patternOpacity,
918
+ patternOpacity = 0.1,
1067
919
  formConfig,
1068
920
  onSubmit,
1069
921
  onSuccess,
1070
922
  onError
1071
923
  }) {
1072
- const form = forms.useForm({
1073
- initialValues: {
1074
- useCase: "",
1075
- teamSize: "",
1076
- timeline: "",
1077
- firstName: "",
1078
- lastName: "",
1079
- email: "",
1080
- company: "",
1081
- jobTitle: "",
1082
- updates: false
1083
- },
1084
- validationSchema: {
1085
- useCase: (value) => !value ? "Please select a use case" : void 0,
1086
- teamSize: (value) => !value ? "Please select team size" : void 0,
1087
- timeline: (value) => !value ? "Please select a timeline" : void 0,
1088
- firstName: (value) => !value ? "First name is required" : void 0,
1089
- lastName: (value) => !value ? "Last name is required" : void 0,
1090
- email: (value) => {
1091
- if (!value) return "Email is required";
1092
- if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value))
1093
- return "Please enter a valid email address";
1094
- return void 0;
1095
- },
1096
- company: (value) => !value ? "Company is required" : void 0
924
+ const {
925
+ uploadTokens,
926
+ uploadProgress,
927
+ isUploading,
928
+ uploadFiles,
929
+ removeFile,
930
+ resetUpload
931
+ } = integration.useFileUpload({ onError });
932
+ const { form, submissionError, formMethod, resetSubmissionState } = integration.useContactForm({
933
+ formFields,
934
+ formConfig,
935
+ onSubmit,
936
+ onSuccess: (data) => {
937
+ resetUpload();
938
+ onSuccess?.(data);
1097
939
  },
1098
- onSubmit: async (values, helpers) => {
1099
- const shouldAutoSubmit = Boolean(formConfig?.endpoint);
1100
- if (!shouldAutoSubmit && !onSubmit) {
1101
- return;
1102
- }
1103
- try {
1104
- let result;
1105
- if (shouldAutoSubmit) {
1106
- result = await integration.submitPageSpeedForm(values, formConfig);
1107
- }
1108
- if (onSubmit) {
1109
- await onSubmit(values);
1110
- }
1111
- if (shouldAutoSubmit || onSubmit) {
1112
- if (formConfig?.resetOnSuccess !== false) {
1113
- helpers.resetForm();
1114
- }
1115
- onSuccess?.(result);
1116
- }
1117
- } catch (error) {
1118
- if (error instanceof integration.PageSpeedFormSubmissionError && error.formErrors) {
1119
- helpers.setErrors(error.formErrors);
1120
- }
1121
- onError?.(error);
1122
- throw error;
1123
- }
1124
- }
940
+ onError,
941
+ resetOnSuccess: formConfig?.resetOnSuccess !== false,
942
+ uploadTokens
1125
943
  });
1126
- const formMethod = formConfig?.method?.toLowerCase() === "get" ? "get" : "post";
1127
- const actionsContent = React__namespace.useMemo(() => {
944
+ const actionsContent = React.useMemo(() => {
1128
945
  if (actionsSlot) return actionsSlot;
1129
946
  if (actions && actions.length > 0) {
1130
947
  return actions.map((action, index) => {
@@ -1161,9 +978,9 @@ function ContactDemo({
1161
978
  spacing,
1162
979
  pattern,
1163
980
  patternOpacity,
1164
- className,
981
+ className: cn("py-12", className),
1165
982
  containerClassName,
1166
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
983
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto max-w-4xl", children: [
1167
984
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mb-10 text-center", headerClassName), children: [
1168
985
  heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1169
986
  "h2",
@@ -1186,174 +1003,57 @@ function ContactDemo({
1186
1003
  }
1187
1004
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description }))
1188
1005
  ] }),
1189
- /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cardClassName, children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: /* @__PURE__ */ jsxRuntime.jsxs(
1006
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("mx-auto max-w-xl", cardClassName), children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: /* @__PURE__ */ jsxRuntime.jsxs(
1190
1007
  forms.Form,
1191
1008
  {
1192
1009
  form,
1193
- action: formConfig?.endpoint,
1194
- method: formMethod,
1195
- className: cn("space-y-8", formClassName),
1010
+ notificationConfig: {
1011
+ submissionError,
1012
+ successMessage
1013
+ },
1014
+ styleConfig: {
1015
+ formClassName: cn("space-y-4", formClassName),
1016
+ successMessageClassName,
1017
+ errorMessageClassName
1018
+ },
1019
+ formConfig: {
1020
+ endpoint: formConfig?.endpoint,
1021
+ method: formMethod,
1022
+ submissionConfig: formConfig?.submissionConfig
1023
+ },
1024
+ onNewSubmission: () => {
1025
+ resetUpload();
1026
+ resetSubmissionState();
1027
+ },
1196
1028
  children: [
1197
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
1198
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold", children: "What's your primary use case?" }),
1199
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "useCase", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
1200
- inputs.Select,
1201
- {
1202
- ...field,
1203
- id: "use-case",
1204
- error: meta.touched && !!meta.error,
1205
- "aria-label": "Use Case",
1206
- children: [
1207
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select a use case" }),
1208
- USE_CASES.map((useCase) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: useCase.value, children: useCase.label }, useCase.value))
1209
- ]
1210
- }
1211
- ) }) })
1212
- ] }),
1213
- /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
1214
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-6 sm:grid-cols-2", children: [
1215
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "teamSize", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1216
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "team-size", children: "Team Size" }),
1217
- /* @__PURE__ */ jsxRuntime.jsxs(
1218
- inputs.Select,
1219
- {
1220
- ...field,
1221
- id: "team-size",
1222
- error: meta.touched && !!meta.error,
1223
- "aria-label": "Team Size",
1224
- children: [
1225
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select team size" }),
1226
- TEAM_SIZES.map((size) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: size.value, children: size.label }, size.value))
1227
- ]
1228
- }
1229
- )
1230
- ] }) }),
1231
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "timeline", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1232
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "timeline", children: "When do you need this?" }),
1233
- /* @__PURE__ */ jsxRuntime.jsxs(
1234
- inputs.Select,
1235
- {
1236
- ...field,
1237
- id: "timeline",
1238
- error: meta.touched && !!meta.error,
1239
- "aria-label": "Timeline",
1240
- children: [
1241
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: "Select timeline" }),
1242
- TIMELINES.map((time) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: time.value, children: time.label }, time.value))
1243
- ]
1244
- }
1245
- )
1246
- ] }) })
1247
- ] }),
1248
- /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
1249
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
1250
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold", children: "Your Information" }),
1251
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1252
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "firstName", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1253
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "first-name", children: "First Name" }),
1254
- /* @__PURE__ */ jsxRuntime.jsx(
1255
- TextInput,
1256
- {
1257
- ...field,
1258
- id: "first-name",
1259
- placeholder: "John",
1260
- error: meta.touched && !!meta.error,
1261
- "aria-label": "First Name"
1262
- }
1263
- )
1264
- ] }) }),
1265
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "lastName", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1266
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "last-name", children: "Last Name" }),
1267
- /* @__PURE__ */ jsxRuntime.jsx(
1268
- TextInput,
1269
- {
1270
- ...field,
1271
- id: "last-name",
1272
- placeholder: "Doe",
1273
- error: meta.touched && !!meta.error,
1274
- "aria-label": "Last Name"
1275
- }
1276
- )
1277
- ] }) })
1278
- ] }),
1279
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "email", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1280
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "email", children: "Work Email" }),
1281
- /* @__PURE__ */ jsxRuntime.jsx(
1282
- TextInput,
1283
- {
1284
- ...field,
1285
- id: "email",
1286
- type: "email",
1287
- placeholder: "john@company.com",
1288
- error: meta.touched && !!meta.error,
1289
- "aria-label": "Work Email"
1290
- }
1291
- )
1292
- ] }) }),
1293
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1294
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "company", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1295
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "company", children: "Company" }),
1296
- /* @__PURE__ */ jsxRuntime.jsx(
1297
- TextInput,
1298
- {
1299
- ...field,
1300
- id: "company",
1301
- placeholder: "Acme Inc.",
1302
- error: meta.touched && !!meta.error,
1303
- "aria-label": "Company"
1304
- }
1305
- )
1306
- ] }) }),
1307
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "jobTitle", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1308
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "job-title", children: "Job Title (Optional)" }),
1309
- /* @__PURE__ */ jsxRuntime.jsx(
1310
- TextInput,
1311
- {
1312
- ...field,
1313
- id: "job-title",
1314
- placeholder: "Product Manager",
1315
- error: meta.touched && !!meta.error,
1316
- "aria-label": "Job Title"
1317
- }
1318
- )
1319
- ] }) })
1320
- ] }),
1321
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "updates", children: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1322
- /* @__PURE__ */ jsxRuntime.jsx(
1323
- Checkbox,
1324
- {
1325
- id: "updates",
1326
- checked: field.value,
1327
- onCheckedChange: (checked) => field.onChange(checked === true)
1328
- }
1329
- ),
1330
- /* @__PURE__ */ jsxRuntime.jsx(
1331
- Label,
1029
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-12 gap-6", children: formFields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
1030
+ "div",
1031
+ {
1032
+ className: integration.getColumnSpanClass(field.columnSpan),
1033
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1034
+ integration.DynamicFormField,
1332
1035
  {
1333
- htmlFor: "updates",
1334
- className: "cursor-pointer text-sm font-normal",
1335
- children: "Send me product updates and announcements"
1036
+ field,
1037
+ uploadProgress,
1038
+ onFileUpload: uploadFiles,
1039
+ onFileRemove: removeFile,
1040
+ isUploading
1336
1041
  }
1337
1042
  )
1338
- ] }) })
1339
- ] }),
1043
+ },
1044
+ field.name
1045
+ )) }),
1340
1046
  actionsSlot || actions && actions.length > 0 ? actionsContent : /* @__PURE__ */ jsxRuntime.jsxs(
1341
1047
  Pressable,
1342
1048
  {
1343
1049
  componentType: "button",
1344
1050
  type: "submit",
1345
1051
  className: cn("w-full", submitClassName),
1052
+ size: "lg",
1346
1053
  asButton: true,
1347
1054
  disabled: form.isSubmitting,
1348
1055
  children: [
1349
- buttonIcon ?? /* @__PURE__ */ jsxRuntime.jsx(
1350
- DynamicIcon,
1351
- {
1352
- name: "lucide/calendar",
1353
- size: 16,
1354
- className: "mr-2"
1355
- }
1356
- ),
1056
+ buttonIcon,
1357
1057
  buttonText
1358
1058
  ]
1359
1059
  }