@primestyleai/tryon 5.5.2 → 5.5.3

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.
@@ -5276,9 +5276,11 @@ function BodyProfileView({
5276
5276
  const [heightInches, setHeightInches] = useState(formRef.current.heightInches || "");
5277
5277
  const [weight, setWeight] = useState(formRef.current.weight || "");
5278
5278
  const [age, setAge] = useState(formRef.current.age || "");
5279
- const [hUnit, setHUnit] = useState(heightUnit || (imperial ? "ft" : "cm"));
5279
+ const [hUnit, setHUnit] = useState(
5280
+ heightUnit === "ft" ? "in" : heightUnit || (imperial ? "in" : "cm")
5281
+ );
5280
5282
  const [wUnit, setWUnit] = useState(weightUnit || (imperial ? "lbs" : "kg"));
5281
- const isImperialMode = hUnit === "ft" || wUnit === "lbs";
5283
+ const isImperialMode = hUnit === "in" || wUnit === "lbs";
5282
5284
  const [photoFile, setPhotoFile] = useState(null);
5283
5285
  const [photoPreview, setPhotoPreview] = useState(null);
5284
5286
  const [photoBase64, setPhotoBase64] = useState(null);
@@ -5335,7 +5337,7 @@ function BodyProfileView({
5335
5337
  if (fileInputRef.current) fileInputRef.current.value = "";
5336
5338
  }, [photoPreview]);
5337
5339
  const validateBasics = useCallback(() => {
5338
- if (hUnit === "ft") {
5340
+ if (hUnit === "in") {
5339
5341
  const ft = parseFloat(heightFeet);
5340
5342
  if (!ft || ft < 3 || ft > 8) {
5341
5343
  setError(t("Please enter a valid height"));
@@ -5365,7 +5367,7 @@ function BodyProfileView({
5365
5367
  }, [hUnit, wUnit, height, heightFeet, weight, t]);
5366
5368
  const getValues = () => {
5367
5369
  let heightVal;
5368
- if (hUnit === "ft") {
5370
+ if (hUnit === "in") {
5369
5371
  const ft = parseFloat(heightFeet) || 0;
5370
5372
  const inc = parseFloat(heightInches) || 0;
5371
5373
  heightVal = ft * 12 + inc;
@@ -5593,9 +5595,9 @@ function BodyProfileView({
5593
5595
  setSizingUnit?.("cm");
5594
5596
  }, type: "button", children: t("Metric") }),
5595
5597
  /* @__PURE__ */ jsx("button", { className: `ps-bp-system-btn${isImperialMode ? " ps-bp-system-active" : ""}`, onClick: () => {
5596
- setHUnit("ft");
5598
+ setHUnit("in");
5597
5599
  setWUnit("lbs");
5598
- setHeightUnit("ft");
5600
+ setHeightUnit("in");
5599
5601
  setWeightUnit("lbs");
5600
5602
  setSizingUnit?.("in");
5601
5603
  }, type: "button", children: t("Imperial") })
@@ -5603,7 +5605,7 @@ function BodyProfileView({
5603
5605
  /* @__PURE__ */ jsxs("div", { className: "ps-bp-inline-fields", children: [
5604
5606
  /* @__PURE__ */ jsxs("div", { className: "ps-bp-inline-row", children: [
5605
5607
  /* @__PURE__ */ jsx("span", { className: "ps-bp-inline-label", children: t("HEIGHT") }),
5606
- hUnit === "ft" ? /* @__PURE__ */ jsxs("div", { className: "ps-bp-inline-input-group", children: [
5608
+ hUnit === "in" ? /* @__PURE__ */ jsxs("div", { className: "ps-bp-inline-input-group", children: [
5607
5609
  /* @__PURE__ */ jsx("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: heightFeet, onChange: (e) => setHeightFeet(e.target.value), min: 3, max: 8 }),
5608
5610
  /* @__PURE__ */ jsx("span", { className: "ps-bp-inline-unit", children: "ft" }),
5609
5611
  /* @__PURE__ */ jsx("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: heightInches, onChange: (e) => setHeightInches(e.target.value), min: 0, max: 11 }),
@@ -5839,7 +5841,7 @@ function PrimeStyleTryonInner({
5839
5841
  const [sizingCountry, setSizingCountry] = useState(detectLocale);
5840
5842
  const imperial = isImperial(sizingCountry);
5841
5843
  const [sizingUnit, setSizingUnit] = useState(imperial ? "in" : "cm");
5842
- const [heightUnit, setHeightUnit] = useState(imperial ? "ft" : "cm");
5844
+ const [heightUnit, setHeightUnit] = useState(imperial ? "in" : "cm");
5843
5845
  const [weightUnit, setWeightUnit] = useState(imperial ? "lbs" : "kg");
5844
5846
  const formRef = useRef({});
5845
5847
  const [formGender, setFormGender] = useState("male");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.5.2",
3
+ "version": "5.5.3",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",