@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,13 @@
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 LabelPrimitive = require('@radix-ui/react-label');
12
11
  var SeparatorPrimitive = require('@radix-ui/react-separator');
13
12
  var reactSlot = require('@radix-ui/react-slot');
14
- var integration = require('@page-speed/forms/integration');
15
13
 
16
14
  function _interopNamespace(e) {
17
15
  if (e && e.__esModule) return e;
@@ -32,12 +30,9 @@ function _interopNamespace(e) {
32
30
  }
33
31
 
34
32
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
35
- var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
36
33
  var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
37
34
 
38
35
  // components/blocks/contact/contact-emergency.tsx
39
- var TextInput = inputs.TextInput;
40
- var TextArea = inputs.TextArea;
41
36
  function cn(...inputs) {
42
37
  return tailwindMerge.twMerge(clsx.clsx(inputs));
43
38
  }
@@ -587,22 +582,6 @@ function CardContent({ className, ...props }) {
587
582
  }
588
583
  );
589
584
  }
590
- function Label({
591
- className,
592
- ...props
593
- }) {
594
- return /* @__PURE__ */ jsxRuntime.jsx(
595
- LabelPrimitive__namespace.Root,
596
- {
597
- "data-slot": "label",
598
- className: cn(
599
- "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",
600
- className
601
- ),
602
- ...props
603
- }
604
- );
605
- }
606
585
  function Separator({
607
586
  className,
608
587
  orientation = "horizontal",
@@ -1050,13 +1029,66 @@ var PRIORITIES = [
1050
1029
  response: "24 hours"
1051
1030
  }
1052
1031
  ];
1032
+ var DEFAULT_FORM_FIELDS = [
1033
+ {
1034
+ name: "priority",
1035
+ type: "radio",
1036
+ label: "Priority Level",
1037
+ required: true,
1038
+ columnSpan: 12,
1039
+ options: PRIORITIES.map((p) => ({ value: p.value, label: p.label }))
1040
+ },
1041
+ {
1042
+ name: "name",
1043
+ type: "text",
1044
+ label: "Name",
1045
+ placeholder: "Your name",
1046
+ required: true,
1047
+ columnSpan: 6
1048
+ },
1049
+ {
1050
+ name: "email",
1051
+ type: "email",
1052
+ label: "Email",
1053
+ placeholder: "you@company.com",
1054
+ required: true,
1055
+ columnSpan: 6
1056
+ },
1057
+ {
1058
+ name: "phone",
1059
+ type: "tel",
1060
+ label: "Phone (Optional)",
1061
+ placeholder: "+1 (555) 000-0000",
1062
+ required: false,
1063
+ columnSpan: 12
1064
+ },
1065
+ {
1066
+ name: "subject",
1067
+ type: "text",
1068
+ label: "Subject",
1069
+ placeholder: "Brief summary of the issue",
1070
+ required: true,
1071
+ columnSpan: 12
1072
+ },
1073
+ {
1074
+ name: "description",
1075
+ type: "textarea",
1076
+ label: "Description",
1077
+ placeholder: "Describe the issue, what you've tried, and the impact...",
1078
+ required: true,
1079
+ rows: 4,
1080
+ columnSpan: 12
1081
+ }
1082
+ ];
1053
1083
  function ContactEmergency({
1054
1084
  heading,
1055
1085
  description,
1056
- buttonText,
1086
+ buttonText = "Submit Emergency Request",
1057
1087
  buttonIcon,
1058
1088
  actions,
1059
1089
  actionsSlot,
1090
+ formFields = DEFAULT_FORM_FIELDS,
1091
+ successMessage = "Thank you! Your emergency request has been received.",
1060
1092
  className,
1061
1093
  headerClassName,
1062
1094
  headingClassName,
@@ -1065,6 +1097,8 @@ function ContactEmergency({
1065
1097
  cardContentClassName,
1066
1098
  formClassName,
1067
1099
  submitClassName,
1100
+ successMessageClassName,
1101
+ errorMessageClassName,
1068
1102
  spacing = "py-8 md:py-32",
1069
1103
  containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
1070
1104
  background,
@@ -1075,60 +1109,32 @@ function ContactEmergency({
1075
1109
  onSuccess,
1076
1110
  onError
1077
1111
  }) {
1078
- const form = forms.useForm({
1079
- initialValues: {
1080
- priority: "normal",
1081
- name: "",
1082
- email: "",
1083
- phone: "",
1084
- subject: "",
1085
- description: ""
1086
- },
1087
- validationSchema: {
1088
- priority: (value) => !value ? "Priority is required" : void 0,
1089
- name: (value) => !value ? "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
- subject: (value) => !value ? "Subject is required" : void 0,
1097
- description: (value) => !value ? "Description is required" : void 0
1112
+ const {
1113
+ uploadTokens,
1114
+ uploadProgress,
1115
+ isUploading,
1116
+ uploadFiles,
1117
+ removeFile,
1118
+ resetUpload
1119
+ } = integration.useFileUpload({ onError });
1120
+ const { form, submissionError, formMethod, resetSubmissionState } = integration.useContactForm({
1121
+ formFields,
1122
+ formConfig,
1123
+ onSubmit,
1124
+ onSuccess: (data) => {
1125
+ resetUpload();
1126
+ onSuccess?.(data);
1098
1127
  },
1099
- onSubmit: async (values, helpers) => {
1100
- const shouldAutoSubmit = Boolean(formConfig?.endpoint);
1101
- if (!shouldAutoSubmit && !onSubmit) {
1102
- return;
1103
- }
1104
- try {
1105
- let result;
1106
- if (shouldAutoSubmit) {
1107
- result = await integration.submitPageSpeedForm(values, formConfig);
1108
- }
1109
- if (onSubmit) {
1110
- await onSubmit(values);
1111
- }
1112
- if (shouldAutoSubmit || onSubmit) {
1113
- if (formConfig?.resetOnSuccess !== false) {
1114
- helpers.resetForm();
1115
- }
1116
- onSuccess?.(result);
1117
- }
1118
- } catch (error) {
1119
- if (error instanceof integration.PageSpeedFormSubmissionError && error.formErrors) {
1120
- helpers.setErrors(error.formErrors);
1121
- }
1122
- onError?.(error);
1123
- throw error;
1124
- }
1125
- }
1128
+ onError,
1129
+ resetOnSuccess: formConfig?.resetOnSuccess !== false,
1130
+ uploadTokens
1126
1131
  });
1127
- const formMethod = formConfig?.method?.toLowerCase() === "get" ? "get" : "post";
1132
+ const priorityField = formFields.find((f) => f.name === "priority");
1133
+ const otherFields = formFields.filter((f) => f.name !== "priority");
1128
1134
  PRIORITIES.find(
1129
1135
  (p) => p.value === form.values.priority
1130
1136
  );
1131
- const actionsContent = React__namespace.useMemo(() => {
1137
+ const actionsContent = React.useMemo(() => {
1132
1138
  if (actionsSlot) return actionsSlot;
1133
1139
  if (actions && actions.length > 0) {
1134
1140
  return actions.map((action, index) => {
@@ -1185,16 +1191,27 @@ function ContactEmergency({
1185
1191
  forms.Form,
1186
1192
  {
1187
1193
  form,
1188
- action: formConfig?.endpoint,
1189
- method: formMethod,
1190
- className: formClassName,
1194
+ notificationConfig: {
1195
+ submissionError,
1196
+ successMessage
1197
+ },
1198
+ styleConfig: {
1199
+ formClassName,
1200
+ successMessageClassName,
1201
+ errorMessageClassName
1202
+ },
1203
+ formConfig: {
1204
+ endpoint: formConfig?.endpoint,
1205
+ method: formMethod,
1206
+ submissionConfig: formConfig?.submissionConfig
1207
+ },
1208
+ onNewSubmission: () => {
1209
+ resetUpload();
1210
+ resetSubmissionState();
1211
+ },
1191
1212
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid md:grid-cols-2", children: [
1192
1213
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b p-6 md:border-b-0 md:border-r", children: [
1193
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6 flex items-center gap-2", children: [
1194
- /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/alert-triangle", size: 20 }),
1195
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "Priority Level" })
1196
- ] }),
1197
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "priority", children: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: PRIORITIES.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
1214
+ priorityField && /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "priority", children: ({ field }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: PRIORITIES.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
1198
1215
  "label",
1199
1216
  {
1200
1217
  htmlFor: `priority-${item.value}`,
@@ -1218,17 +1235,24 @@ function ContactEmergency({
1218
1235
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
1219
1236
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
1220
1237
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: item.label }),
1221
- /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "text-xs", children: [
1222
- /* @__PURE__ */ jsxRuntime.jsx(
1223
- DynamicIcon,
1224
- {
1225
- name: "lucide/clock",
1226
- size: 12,
1227
- className: "mr-1"
1228
- }
1229
- ),
1230
- item.response
1231
- ] })
1238
+ /* @__PURE__ */ jsxRuntime.jsxs(
1239
+ Badge,
1240
+ {
1241
+ variant: "secondary",
1242
+ className: "text-xs",
1243
+ children: [
1244
+ /* @__PURE__ */ jsxRuntime.jsx(
1245
+ DynamicIcon,
1246
+ {
1247
+ name: "lucide/clock",
1248
+ size: 12,
1249
+ className: "mr-1"
1250
+ }
1251
+ ),
1252
+ item.response
1253
+ ]
1254
+ }
1255
+ )
1232
1256
  ] }),
1233
1257
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: item.description })
1234
1258
  ] })
@@ -1254,76 +1278,23 @@ function ContactEmergency({
1254
1278
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "Describe Your Issue" })
1255
1279
  ] }),
1256
1280
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
1257
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1258
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "name", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1259
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "name", children: "Name" }),
1260
- /* @__PURE__ */ jsxRuntime.jsx(
1261
- TextInput,
1262
- {
1263
- ...field,
1264
- id: "name",
1265
- placeholder: "Your name",
1266
- error: meta.touched && !!meta.error,
1267
- "aria-label": "Name"
1268
- }
1269
- )
1270
- ] }) }),
1271
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "email", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1272
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "email", children: "Email" }),
1273
- /* @__PURE__ */ jsxRuntime.jsx(
1274
- TextInput,
1281
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-12 gap-4", children: otherFields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
1282
+ "div",
1283
+ {
1284
+ className: integration.getColumnSpanClass(field.columnSpan),
1285
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1286
+ integration.DynamicFormField,
1275
1287
  {
1276
- ...field,
1277
- id: "email",
1278
- type: "email",
1279
- placeholder: "you@company.com",
1280
- error: meta.touched && !!meta.error,
1281
- "aria-label": "Email"
1288
+ field,
1289
+ uploadProgress,
1290
+ onFileUpload: uploadFiles,
1291
+ onFileRemove: removeFile,
1292
+ isUploading
1282
1293
  }
1283
1294
  )
1284
- ] }) })
1285
- ] }),
1286
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "phone", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1287
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "phone", children: "Phone (Optional)" }),
1288
- /* @__PURE__ */ jsxRuntime.jsx(
1289
- TextInput,
1290
- {
1291
- ...field,
1292
- id: "phone",
1293
- type: "tel",
1294
- placeholder: "+1 (555) 000-0000",
1295
- error: meta.touched && !!meta.error,
1296
- "aria-label": "Phone"
1297
- }
1298
- )
1299
- ] }) }),
1300
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "subject", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1301
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "subject", children: "Subject" }),
1302
- /* @__PURE__ */ jsxRuntime.jsx(
1303
- TextInput,
1304
- {
1305
- ...field,
1306
- id: "subject",
1307
- placeholder: "Brief summary of the issue",
1308
- error: meta.touched && !!meta.error,
1309
- "aria-label": "Subject"
1310
- }
1311
- )
1312
- ] }) }),
1313
- /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "description", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
1314
- /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "description", children: "Description" }),
1315
- /* @__PURE__ */ jsxRuntime.jsx(
1316
- TextArea,
1317
- {
1318
- ...field,
1319
- id: "description",
1320
- placeholder: "Describe the issue, what you've tried, and the impact...",
1321
- rows: 4,
1322
- error: meta.touched && !!meta.error,
1323
- "aria-label": "Description"
1324
- }
1325
- )
1326
- ] }) }),
1295
+ },
1296
+ field.name
1297
+ )) }),
1327
1298
  /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
1328
1299
  actionsSlot || actions && actions.length > 0 ? actionsContent : /* @__PURE__ */ jsxRuntime.jsxs(
1329
1300
  Pressable,
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { PageSpeedFormConfig } from '@page-speed/forms/integration';
2
+ import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
3
3
  import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-Bz_A5vLU.cjs';
4
4
  import { A as ActionConfig } from './blocks-Cohq4eio.cjs';
5
5
  import 'react/jsx-runtime';
@@ -7,14 +7,6 @@ import 'class-variance-authority';
7
7
  import './button-variants-lRElsmTc.cjs';
8
8
  import 'class-variance-authority/types';
9
9
 
10
- interface EmergencyFormValues {
11
- priority: string;
12
- name: string;
13
- email: string;
14
- phone: string;
15
- subject: string;
16
- description: string;
17
- }
18
10
  interface ContactEmergencyProps {
19
11
  /**
20
12
  * Main heading text
@@ -40,6 +32,16 @@ interface ContactEmergencyProps {
40
32
  * Custom slot for rendering actions (overrides actions array)
41
33
  */
42
34
  actionsSlot?: React.ReactNode;
35
+ /**
36
+ * Array of form field configurations
37
+ * If not provided, defaults to: priority, name, email, phone, subject, description
38
+ */
39
+ formFields?: FormFieldConfig[];
40
+ /**
41
+ * Success message to display after form submission
42
+ * @default "Thank you! Your emergency request has been received."
43
+ */
44
+ successMessage?: React.ReactNode;
43
45
  /**
44
46
  * Additional CSS classes for the section
45
47
  */
@@ -75,7 +77,16 @@ interface ContactEmergencyProps {
75
77
  /**
76
78
  * Additional CSS classes for the submit button
77
79
  */
78
- submitClassName?: string; /**
80
+ submitClassName?: string;
81
+ /**
82
+ * Additional CSS classes for the success message
83
+ */
84
+ successMessageClassName?: string;
85
+ /**
86
+ * Additional CSS classes for the error message
87
+ */
88
+ errorMessageClassName?: string;
89
+ /**
79
90
  * Background style for the section
80
91
  */
81
92
  background?: SectionBackground;
@@ -98,7 +109,7 @@ interface ContactEmergencyProps {
98
109
  /**
99
110
  * Custom submit handler
100
111
  */
101
- onSubmit?: (values: EmergencyFormValues) => void | Promise<void>;
112
+ onSubmit?: (values: Record<string, any>) => void | Promise<void>;
102
113
  /**
103
114
  * Success callback
104
115
  */
@@ -120,6 +131,6 @@ interface ContactEmergencyProps {
120
131
  * />
121
132
  * ```
122
133
  */
123
- declare function ContactEmergency({ heading, description, buttonText, buttonIcon, actions, actionsSlot, className, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, spacing, containerClassName, background, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactEmergencyProps): React.JSX.Element;
134
+ declare function ContactEmergency({ heading, description, buttonText, buttonIcon, actions, actionsSlot, formFields, successMessage, className, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, successMessageClassName, errorMessageClassName, spacing, containerClassName, background, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactEmergencyProps): React.JSX.Element;
124
135
 
125
136
  export { ContactEmergency, type ContactEmergencyProps };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { PageSpeedFormConfig } from '@page-speed/forms/integration';
2
+ import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
3
3
  import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-Bi_ClKrO.js';
4
4
  import { A as ActionConfig } from './blocks-k17uluAz.js';
5
5
  import 'react/jsx-runtime';
@@ -7,14 +7,6 @@ import 'class-variance-authority';
7
7
  import './button-variants-lRElsmTc.js';
8
8
  import 'class-variance-authority/types';
9
9
 
10
- interface EmergencyFormValues {
11
- priority: string;
12
- name: string;
13
- email: string;
14
- phone: string;
15
- subject: string;
16
- description: string;
17
- }
18
10
  interface ContactEmergencyProps {
19
11
  /**
20
12
  * Main heading text
@@ -40,6 +32,16 @@ interface ContactEmergencyProps {
40
32
  * Custom slot for rendering actions (overrides actions array)
41
33
  */
42
34
  actionsSlot?: React.ReactNode;
35
+ /**
36
+ * Array of form field configurations
37
+ * If not provided, defaults to: priority, name, email, phone, subject, description
38
+ */
39
+ formFields?: FormFieldConfig[];
40
+ /**
41
+ * Success message to display after form submission
42
+ * @default "Thank you! Your emergency request has been received."
43
+ */
44
+ successMessage?: React.ReactNode;
43
45
  /**
44
46
  * Additional CSS classes for the section
45
47
  */
@@ -75,7 +77,16 @@ interface ContactEmergencyProps {
75
77
  /**
76
78
  * Additional CSS classes for the submit button
77
79
  */
78
- submitClassName?: string; /**
80
+ submitClassName?: string;
81
+ /**
82
+ * Additional CSS classes for the success message
83
+ */
84
+ successMessageClassName?: string;
85
+ /**
86
+ * Additional CSS classes for the error message
87
+ */
88
+ errorMessageClassName?: string;
89
+ /**
79
90
  * Background style for the section
80
91
  */
81
92
  background?: SectionBackground;
@@ -98,7 +109,7 @@ interface ContactEmergencyProps {
98
109
  /**
99
110
  * Custom submit handler
100
111
  */
101
- onSubmit?: (values: EmergencyFormValues) => void | Promise<void>;
112
+ onSubmit?: (values: Record<string, any>) => void | Promise<void>;
102
113
  /**
103
114
  * Success callback
104
115
  */
@@ -120,6 +131,6 @@ interface ContactEmergencyProps {
120
131
  * />
121
132
  * ```
122
133
  */
123
- declare function ContactEmergency({ heading, description, buttonText, buttonIcon, actions, actionsSlot, className, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, spacing, containerClassName, background, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactEmergencyProps): React.JSX.Element;
134
+ declare function ContactEmergency({ heading, description, buttonText, buttonIcon, actions, actionsSlot, formFields, successMessage, className, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, successMessageClassName, errorMessageClassName, spacing, containerClassName, background, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactEmergencyProps): React.JSX.Element;
124
135
 
125
136
  export { ContactEmergency, type ContactEmergencyProps };