@primestyleai/tryon 3.2.0 → 3.2.1
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/react/index.js +17 -17
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -434,8 +434,6 @@ function PrimeStyleTryonInner({
|
|
|
434
434
|
if (sizeGuide?.found) payload.sizeGuide = sizeGuide;
|
|
435
435
|
if (sizingMethod === "exact") {
|
|
436
436
|
const m = { gender: formRef.current.gender || "male" };
|
|
437
|
-
if (formRef.current.height) m.heightCm = heightUnit === "ft" ? ftInToCm(parseFloat(formRef.current.heightFeet || "0"), parseFloat(formRef.current.heightInches || "0")) : parseFloat(formRef.current.height);
|
|
438
|
-
if (formRef.current.weight) m.weightKg = weightUnit === "lbs" ? lbsToKg(parseFloat(formRef.current.weight)) : parseFloat(formRef.current.weight);
|
|
439
437
|
const keys = ["chest", "bust", "waist", "hips", "shoulderWidth", "sleeveLength", "inseam", "neckCircumference", "footLengthCm"];
|
|
440
438
|
for (const k of keys) {
|
|
441
439
|
if (formRef.current[k]) m[k] = sizingUnit === "in" ? inToCm(parseFloat(formRef.current[k])) : parseFloat(formRef.current[k]);
|
|
@@ -886,16 +884,6 @@ function PrimeStyleTryonInner({
|
|
|
886
884
|
setHeightUnit(v === "cm" ? "cm" : "ft");
|
|
887
885
|
setWeightUnit(v === "cm" ? "kg" : "lbs");
|
|
888
886
|
} }) }),
|
|
889
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
890
|
-
/* @__PURE__ */ jsx("label", { children: "Height" }),
|
|
891
|
-
heightUnit === "ft" ? /* @__PURE__ */ jsxs("div", { className: "ps-tryon-height-ft", children: [
|
|
892
|
-
/* @__PURE__ */ jsx("input", { type: "number", placeholder: "5", defaultValue: formRef.current.heightFeet || "", onInput: (e) => updateField("heightFeet", e.target.value) }),
|
|
893
|
-
/* @__PURE__ */ jsx("span", { children: "ft" }),
|
|
894
|
-
/* @__PURE__ */ jsx("input", { type: "number", placeholder: "4", defaultValue: formRef.current.heightInches || "", onInput: (e) => updateField("heightInches", e.target.value) }),
|
|
895
|
-
/* @__PURE__ */ jsx("span", { children: "in" })
|
|
896
|
-
] }) : /* @__PURE__ */ jsx("input", { type: "number", placeholder: "e.g. 175", defaultValue: formRef.current.height || "", onInput: (e) => updateField("height", e.target.value) }),
|
|
897
|
-
/* @__PURE__ */ jsx(UnitToggle, { options: [{ label: "cm", value: "cm" }, { label: "ft", value: "ft" }], value: heightUnit, onChange: setHeightUnit })
|
|
898
|
-
] }),
|
|
899
887
|
sizingMethod === "exact" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
900
888
|
isFemale ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
901
889
|
/* @__PURE__ */ jsx(InputRow, { label: "Bust *", fieldKey: "bust", placeholder: isCm ? "e.g. 88" : "e.g. 35", type: "number", unit: sizingUnit }),
|
|
@@ -931,11 +919,23 @@ function PrimeStyleTryonInner({
|
|
|
931
919
|
/* @__PURE__ */ jsx(InputRow, { label: "Foot length", fieldKey: "footLengthCm", placeholder: isCm ? "e.g. 27" : "e.g. 10.5", type: "number", unit: sizingUnit }),
|
|
932
920
|
/* @__PURE__ */ jsx(InputRow, { label: shoeField.label, fieldKey: shoeField.key, placeholder: shoeField.ph })
|
|
933
921
|
] })
|
|
934
|
-
] }) : /* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
922
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
923
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
924
|
+
/* @__PURE__ */ jsx("label", { children: "Height *" }),
|
|
925
|
+
heightUnit === "ft" ? /* @__PURE__ */ jsxs("div", { className: "ps-tryon-height-ft", children: [
|
|
926
|
+
/* @__PURE__ */ jsx("input", { type: "number", placeholder: "5", defaultValue: formRef.current.heightFeet || "", onInput: (e) => updateField("heightFeet", e.target.value) }),
|
|
927
|
+
/* @__PURE__ */ jsx("span", { children: "ft" }),
|
|
928
|
+
/* @__PURE__ */ jsx("input", { type: "number", placeholder: "4", defaultValue: formRef.current.heightInches || "", onInput: (e) => updateField("heightInches", e.target.value) }),
|
|
929
|
+
/* @__PURE__ */ jsx("span", { children: "in" })
|
|
930
|
+
] }) : /* @__PURE__ */ jsx("input", { type: "number", placeholder: "e.g. 175", defaultValue: formRef.current.height || "", onInput: (e) => updateField("height", e.target.value) }),
|
|
931
|
+
/* @__PURE__ */ jsx(UnitToggle, { options: [{ label: "cm", value: "cm" }, { label: "ft", value: "ft" }], value: heightUnit, onChange: setHeightUnit })
|
|
932
|
+
] }),
|
|
933
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
934
|
+
/* @__PURE__ */ jsx("label", { children: "Weight *" }),
|
|
935
|
+
/* @__PURE__ */ jsx("input", { type: "number", placeholder: weightUnit === "lbs" ? "e.g. 170" : "e.g. 75", defaultValue: formRef.current.weight || "", onInput: (e) => updateField("weight", e.target.value) }),
|
|
936
|
+
/* @__PURE__ */ jsx(UnitToggle, { options: [{ label: "kg", value: "kg" }, { label: "lbs", value: "lbs" }], value: weightUnit, onChange: setWeightUnit })
|
|
937
|
+
] })
|
|
938
|
+
] }),
|
|
939
939
|
/* @__PURE__ */ jsx("p", { className: "ps-tryon-disclaimer", children: "Fill in what you know — more measurements = better accuracy." }),
|
|
940
940
|
/* @__PURE__ */ jsxs("button", { className: "ps-tryon-submit", onClick: handleSubmit, children: [
|
|
941
941
|
"Get My Size & Try On ",
|