@forms.expert/sdk 0.2.2 → 0.2.4

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.
@@ -939,7 +939,13 @@ function FormsExpertForm({
939
939
  ...style
940
940
  },
941
941
  children: [
942
- /* @__PURE__ */ jsx2("style", { dangerouslySetInnerHTML: { __html: `form[data-fe-scope="${formScopeId}"] input::placeholder, form[data-fe-scope="${formScopeId}"] textarea::placeholder { font-size: ${phFontSize}; }` } }),
942
+ /* @__PURE__ */ jsx2("style", { dangerouslySetInnerHTML: { __html: `
943
+ form[data-fe-scope="${formScopeId}"] input::placeholder, form[data-fe-scope="${formScopeId}"] textarea::placeholder { font-size: ${phFontSize}; }
944
+ form[data-fe-scope="${formScopeId}"] button[type="submit"]:hover:not(:disabled) { filter: brightness(0.9); }
945
+ form[data-fe-scope="${formScopeId}"] button[type="submit"]:active:not(:disabled) { filter: brightness(0.85); transform: scale(0.98); }
946
+ form[data-fe-scope="${formScopeId}"] a[href]:hover { filter: brightness(0.9); }
947
+ form[data-fe-scope="${formScopeId}"] a[href]:active { filter: brightness(0.85); }
948
+ ` } }),
943
949
  styling.logoUrl && /* @__PURE__ */ jsx2("div", { style: {
944
950
  textAlign: styling.logoPosition === "top-left" ? "left" : styling.logoPosition === "top-right" ? "right" : "center",
945
951
  marginBottom: "1rem"
@@ -959,8 +965,8 @@ function FormsExpertForm({
959
965
  }
960
966
  ),
961
967
  form.config.settings?.showFormName !== false && form.config.name && /* @__PURE__ */ jsx2("h1", { style: {
962
- fontSize: "1.5rem",
963
- fontWeight: 700,
968
+ fontSize: styling.formNameFontSize != null ? `${styling.formNameFontSize}px` : "1.5rem",
969
+ fontWeight: styling.formNameFontWeight === "normal" ? 400 : styling.formNameFontWeight === "medium" ? 500 : styling.formNameFontWeight === "semibold" ? 600 : 700,
964
970
  marginBottom: "0.5rem",
965
971
  color: styling.textColor
966
972
  }, children: form.config.hostedConfig?.pageTitle || form.config.name }),
@@ -990,6 +996,7 @@ function FormsExpertForm({
990
996
  const btnSize = btnSizeMap[styling.buttonSize || "medium"];
991
997
  const btnPx = styling.buttonPaddingX != null ? `${styling.buttonPaddingX}px` : btnSize.px;
992
998
  const btnPy = styling.buttonPaddingY != null ? `${styling.buttonPaddingY}px` : btnSize.py;
999
+ const btnFs = styling.buttonFontSize != null ? `${styling.buttonFontSize}px` : btnSize.fs;
993
1000
  const btnBg = styling.buttonGradient || (styling.buttonStyle === "filled" ? btnBgColor : "transparent");
994
1001
  const sec = styling.secondaryButton;
995
1002
  const secColor = sec?.color || btnBgColor;
@@ -999,7 +1006,7 @@ function FormsExpertForm({
999
1006
  justifyContent: "center",
1000
1007
  padding: `${btnPy} ${btnPx}`,
1001
1008
  fontWeight: 500,
1002
- fontSize: btnSize.fs,
1009
+ fontSize: sec.fontSize != null ? `${sec.fontSize}px` : btnFs,
1003
1010
  fontFamily: "inherit",
1004
1011
  borderRadius: btnRadius,
1005
1012
  cursor: "pointer",
@@ -1008,7 +1015,14 @@ function FormsExpertForm({
1008
1015
  color: sec.textColor || (sec.style === "filled" ? "#ffffff" : secColor),
1009
1016
  border: sec.style === "outlined" ? `2px solid ${secColor}` : "none",
1010
1017
  marginTop: sec.marginTop != null ? `${sec.marginTop}px` : void 0,
1011
- marginBottom: sec.marginBottom != null ? `${sec.marginBottom}px` : void 0
1018
+ marginBottom: sec.marginBottom != null ? `${sec.marginBottom}px` : void 0,
1019
+ maxWidth: "100%",
1020
+ boxSizing: "border-box",
1021
+ flexShrink: 1,
1022
+ minWidth: 0,
1023
+ whiteSpace: "nowrap",
1024
+ overflow: "hidden",
1025
+ textOverflow: "ellipsis"
1012
1026
  } : void 0;
1013
1027
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1014
1028
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: btnAlign, marginTop: "1rem", gap: "0.5rem", flexWrap: "wrap" }, children: [
@@ -1022,14 +1036,21 @@ function FormsExpertForm({
1022
1036
  ...styling.buttonFullWidth ? { width: "100%" } : styling.buttonAlign ? {} : { width: "100%" },
1023
1037
  padding: `${btnPy} ${btnPx}`,
1024
1038
  fontWeight: 500,
1025
- fontSize: btnSize.fs,
1039
+ fontSize: btnFs,
1026
1040
  fontFamily: "inherit",
1027
1041
  borderRadius: btnRadius,
1028
1042
  cursor: form.isLoading ? "not-allowed" : "pointer",
1029
1043
  opacity: form.isLoading ? 0.5 : 1,
1030
1044
  background: btnBg,
1031
1045
  color: styling.buttonStyle === "filled" ? btnTextColor || "white" : btnBgColor,
1032
- border: styling.buttonStyle === "filled" ? "none" : `2px solid ${btnBgColor}`
1046
+ border: styling.buttonStyle === "filled" ? "none" : `2px solid ${btnBgColor}`,
1047
+ maxWidth: "100%",
1048
+ boxSizing: "border-box",
1049
+ flexShrink: 1,
1050
+ minWidth: 0,
1051
+ whiteSpace: "nowrap",
1052
+ overflow: "hidden",
1053
+ textOverflow: "ellipsis"
1033
1054
  },
1034
1055
  children: form.isLoading ? "Submitting..." : resolvedButtonText
1035
1056
  }