@forms.expert/sdk 0.2.9 → 0.2.11

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.
@@ -161,7 +161,7 @@ var FormsApiClient = class {
161
161
  */
162
162
  async trackView(slug) {
163
163
  const url = this.buildUrl(`/f/${this.resourceId}/${slug}/view`);
164
- await fetch(url, { method: "POST", headers: { "Content-Type": "application/json" } }).catch(() => {
164
+ await fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: "{}" }).catch(() => {
165
165
  });
166
166
  }
167
167
  /**
@@ -996,7 +996,7 @@ function FormsExpertForm({
996
996
  }
997
997
  }
998
998
  ),
999
- form.config.settings?.showFormName !== false && form.config.name && /* @__PURE__ */ jsx2("h1", { style: {
999
+ form.config.settings?.showFormName !== false && form.config.name && /* @__PURE__ */ jsx2("div", { style: {
1000
1000
  fontSize: styling.formNameFontSize != null ? `${styling.formNameFontSize}px` : "1.5rem",
1001
1001
  fontWeight: styling.formNameFontWeight === "normal" ? 400 : styling.formNameFontWeight === "medium" ? 500 : styling.formNameFontWeight === "semibold" ? 600 : 700,
1002
1002
  marginBottom: "0.5rem",
@@ -1064,6 +1064,7 @@ function FormsExpertForm({
1064
1064
  {
1065
1065
  type: "submit",
1066
1066
  disabled: form.isLoading,
1067
+ className: styling.buttonClassName,
1067
1068
  style: {
1068
1069
  ...styling.buttonFullWidth ? { width: "100%" } : styling.buttonAlign ? {} : { width: "100%" },
1069
1070
  padding: `${btnPy} ${btnPx}`,
@@ -1207,7 +1208,7 @@ function FormFieldInput({
1207
1208
  style: { width: "1rem", height: "1rem", accentColor: styling.primaryColor }
1208
1209
  }
1209
1210
  ),
1210
- (field.label || field.type === "consent" && field.consentText) && /* @__PURE__ */ jsxs("label", { htmlFor: field.name, children: [
1211
+ (field.label || field.type === "consent" && field.consentText) && /* @__PURE__ */ jsxs("label", { htmlFor: field.name, className: styling.labelClassName, children: [
1211
1212
  field.type === "consent" && field.consentText ? field.consentUrl ? /* @__PURE__ */ jsxs("span", { children: [
1212
1213
  field.consentText,
1213
1214
  " ",
@@ -1222,6 +1223,7 @@ function FormFieldInput({
1222
1223
  "label",
1223
1224
  {
1224
1225
  htmlFor: field.name,
1226
+ className: styling.labelClassName,
1225
1227
  style: {
1226
1228
  display: "block",
1227
1229
  fontWeight: 500,
@@ -1245,11 +1247,12 @@ function FormFieldInput({
1245
1247
  onChange,
1246
1248
  placeholder: field.placeholder,
1247
1249
  required: field.required,
1248
- style: { ...inputStyle, minHeight: "100px", resize: "vertical" }
1250
+ style: { ...inputStyle, minHeight: "100px", resize: "vertical" },
1251
+ className: styling.fieldClassName
1249
1252
  }
1250
1253
  );
1251
1254
  } else if (field.type === "select" || field.type === "dropdown") {
1252
- fieldEl = /* @__PURE__ */ jsxs("select", { id: field.name, name: field.name, value: String(value || ""), onChange, required: field.required, style: inputStyle, children: [
1255
+ fieldEl = /* @__PURE__ */ jsxs("select", { id: field.name, name: field.name, value: String(value || ""), onChange, required: field.required, style: inputStyle, className: styling.fieldClassName, children: [
1253
1256
  /* @__PURE__ */ jsx2("option", { value: "", children: "Select an option..." }),
1254
1257
  getOpts().map((opt) => /* @__PURE__ */ jsx2("option", { value: opt.value, children: opt.label }, opt.value))
1255
1258
  ] });
@@ -1393,7 +1396,8 @@ function FormFieldInput({
1393
1396
  required: field.required,
1394
1397
  accept: field.allowedMimeTypes?.join(","),
1395
1398
  multiple: field.multiple,
1396
- style: inputStyle
1399
+ style: inputStyle,
1400
+ className: styling.fieldClassName
1397
1401
  }
1398
1402
  );
1399
1403
  } else if (field.type === "name") {
@@ -1406,7 +1410,8 @@ function FormFieldInput({
1406
1410
  placeholder: labels[nf] || nf,
1407
1411
  value: nameVal[nf] || "",
1408
1412
  onChange: (e) => onValueChange(field.name, { ...nameVal, [nf]: e.target.value }),
1409
- style: { ...inputStyle, flex: 1, minWidth: "120px" }
1413
+ style: { ...inputStyle, flex: 1, minWidth: "120px" },
1414
+ className: styling.fieldClassName
1410
1415
  },
1411
1416
  nf
1412
1417
  )) });
@@ -1420,7 +1425,8 @@ function FormFieldInput({
1420
1425
  placeholder: labels[af] || af,
1421
1426
  value: addr[af] || "",
1422
1427
  onChange: (e) => onValueChange(field.name, { ...addr, [af]: e.target.value }),
1423
- style: inputStyle
1428
+ style: inputStyle,
1429
+ className: styling.fieldClassName
1424
1430
  },
1425
1431
  af
1426
1432
  )) });
@@ -1439,7 +1445,8 @@ function FormFieldInput({
1439
1445
  min: field.min,
1440
1446
  max: field.max,
1441
1447
  required: field.required,
1442
- style: inputStyle
1448
+ style: inputStyle,
1449
+ className: styling.fieldClassName
1443
1450
  }
1444
1451
  )
1445
1452
  ] });
@@ -1462,16 +1469,17 @@ function FormFieldInput({
1462
1469
  value: String(value || ""),
1463
1470
  onChange: (e) => onValueChange(field.name, e.target.value),
1464
1471
  placeholder: "#000000",
1465
- style: { ...inputStyle, flex: 1 }
1472
+ style: { ...inputStyle, flex: 1 },
1473
+ className: styling.fieldClassName
1466
1474
  }
1467
1475
  )
1468
1476
  ] });
1469
1477
  } else if (field.type === "dateRange") {
1470
1478
  const range = value || {};
1471
1479
  fieldEl = /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "0.5rem", alignItems: "center" }, children: [
1472
- /* @__PURE__ */ jsx2("input", { type: "date", value: range.start || "", onChange: (e) => onValueChange(field.name, { ...range, start: e.target.value }), style: { ...inputStyle, flex: 1 } }),
1480
+ /* @__PURE__ */ jsx2("input", { type: "date", value: range.start || "", onChange: (e) => onValueChange(field.name, { ...range, start: e.target.value }), style: { ...inputStyle, flex: 1 }, className: styling.fieldClassName }),
1473
1481
  /* @__PURE__ */ jsx2("span", { children: "to" }),
1474
- /* @__PURE__ */ jsx2("input", { type: "date", value: range.end || "", onChange: (e) => onValueChange(field.name, { ...range, end: e.target.value }), style: { ...inputStyle, flex: 1 } })
1482
+ /* @__PURE__ */ jsx2("input", { type: "date", value: range.end || "", onChange: (e) => onValueChange(field.name, { ...range, end: e.target.value }), style: { ...inputStyle, flex: 1 }, className: styling.fieldClassName })
1475
1483
  ] });
1476
1484
  } else {
1477
1485
  const typeMap = {
@@ -1498,7 +1506,8 @@ function FormFieldInput({
1498
1506
  max: field.max,
1499
1507
  step: field.step,
1500
1508
  maxLength: field.maxLength,
1501
- style: inputStyle
1509
+ style: inputStyle,
1510
+ className: styling.fieldClassName
1502
1511
  }
1503
1512
  );
1504
1513
  }