@primestyleai/tryon 5.8.25 → 5.8.27

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.
@@ -4483,13 +4483,16 @@ const STYLES = `
4483
4483
 
4484
4484
  .ps-cpw-body {
4485
4485
  display: flex; flex-direction: column;
4486
- gap: 12px;
4486
+ gap: 14px;
4487
4487
  flex: 1; min-height: 0;
4488
4488
  width: 100%; max-width: 100%;
4489
4489
  box-sizing: border-box;
4490
- /* Hard cap every step is sized to fit. NO scrolling. */
4491
- overflow: hidden;
4492
- padding: 12px 16px 12px;
4490
+ /* Modal height is fixed by the parent don't grow it. If a step
4491
+ happens to be taller (rare), let it scroll inside the body
4492
+ instead of forcing the modal to expand. */
4493
+ overflow-y: auto; overflow-x: hidden;
4494
+ -webkit-overflow-scrolling: touch;
4495
+ padding: 14px 16px;
4493
4496
  }
4494
4497
 
4495
4498
  /* Step 1 — Identity form (compact) */
@@ -4773,17 +4776,18 @@ const STYLES = `
4773
4776
  justify-content: center;
4774
4777
  }
4775
4778
  .ps-cpw-method-intro { display: none; }
4779
+ /* Two cards side by side. Each card stacks the illustration on top
4780
+ and the text below — keeps the cards short and lets the picker fit
4781
+ inside the wizard body without changing the modal height. */
4776
4782
  .ps-cpw-method-grid {
4777
- display: flex; flex-direction: column;
4778
- gap: 10px;
4783
+ display: grid;
4784
+ grid-template-columns: 1fr 1fr;
4785
+ gap: 12px;
4779
4786
  width: 100%; max-width: 100%;
4780
4787
  box-sizing: border-box;
4781
4788
  }
4782
- /* Horizontal card: small square image on the left, text on the right.
4783
- Total card height ≈ 84px so two cards + the header + footer all fit
4784
- well inside the modal viewport. */
4785
4789
  .ps-cpw-method-card {
4786
- display: flex; align-items: stretch;
4790
+ display: flex; flex-direction: column; align-items: stretch;
4787
4791
  gap: 0;
4788
4792
  min-width: 0;
4789
4793
  width: 100%; max-width: 100%;
@@ -4800,25 +4804,24 @@ const STYLES = `
4800
4804
  transform: translateY(-1px);
4801
4805
  box-shadow: 0 6px 18px rgba(33, 84, 239, 0.10);
4802
4806
  }
4803
- /* AI illustration small square slot on the LEFT */
4807
+ /* Square-ish illustration slot at the top of each card */
4804
4808
  .ps-cpw-method-img {
4805
- width: 84px; height: 84px;
4809
+ width: 100%;
4810
+ aspect-ratio: 1 / 1;
4806
4811
  flex-shrink: 0;
4807
4812
  background: var(--ps-bg-secondary);
4808
4813
  display: flex; align-items: center; justify-content: center;
4809
- border-right: 1px solid var(--ps-border-subtle);
4814
+ border-bottom: 1px solid var(--ps-border-subtle);
4810
4815
  }
4811
4816
  .ps-cpw-method-img img {
4812
4817
  width: 100%; height: 100%;
4813
4818
  object-fit: contain;
4814
4819
  display: block;
4815
4820
  }
4816
- /* Text — to the right of the illustration */
4817
4821
  .ps-cpw-method-text {
4818
- display: flex; flex-direction: column; gap: 3px; justify-content: center;
4819
- padding: 10px 14px;
4820
- flex: 1; min-width: 0;
4821
- box-sizing: border-box;
4822
+ display: flex; flex-direction: column; gap: 3px;
4823
+ padding: 10px 12px 12px;
4824
+ width: 100%; box-sizing: border-box;
4822
4825
  }
4823
4826
  .ps-cpw-method-title {
4824
4827
  font-size: 13px; font-weight: 700;
@@ -4834,10 +4837,14 @@ const STYLES = `
4834
4837
  them inside the wizard body so all rows fit without scrolling. */
4835
4838
  .ps-cpw-inline-fields {
4836
4839
  width: 100%;
4837
- margin-top: 0;
4840
+ margin-top: 4px;
4841
+ /* Generous breathing room between rows so the inputs don't feel
4842
+ cramped together — each row owns its own divider. */
4843
+ display: flex; flex-direction: column;
4844
+ gap: 6px;
4838
4845
  }
4839
4846
  .ps-cpw-inline-fields .ps-bp-inline-row {
4840
- padding: 8px 0;
4847
+ padding: 14px 2px;
4841
4848
  border-bottom: 1px solid var(--ps-border-subtle);
4842
4849
  }
4843
4850
  .ps-cpw-inline-fields .ps-bp-inline-row:last-child { border-bottom: none; }
@@ -4849,7 +4856,7 @@ const STYLES = `
4849
4856
  letter-spacing: 0.08em;
4850
4857
  }
4851
4858
  .ps-cpw-inline-fields .ps-bp-inline-input {
4852
- font-size: 13px;
4859
+ font-size: 14px;
4853
4860
  padding-bottom: 0;
4854
4861
  border-bottom: none; /* parent row owns the divider */
4855
4862
  color: var(--ps-text-primary);
@@ -8790,6 +8797,27 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
8790
8797
  }
8791
8798
  setManualStep(manualStepOrder[manualStepIdx + 1]);
8792
8799
  };
8800
+ const pickShape = (step, value) => {
8801
+ setError("");
8802
+ if (step === "chest") setChestProfile(value);
8803
+ else if (step === "stomach") setMidsectionProfile(value);
8804
+ else if (step === "seat") setSeatProfile(value);
8805
+ else if (step === "hips") setHipProfile(value);
8806
+ const idx = manualStepOrder.indexOf(step);
8807
+ const isLast = idx === manualStepCount - 1;
8808
+ setTimeout(() => {
8809
+ if (isLast) {
8810
+ const payload = buildManualPayload();
8811
+ if (step === "chest") payload.chestProfile = value;
8812
+ else if (step === "stomach") payload.midsectionProfile = value;
8813
+ else if (step === "seat") payload.hipProfile = value;
8814
+ else if (step === "hips") payload.hipProfile = value;
8815
+ onSave(payload);
8816
+ } else {
8817
+ setManualStep(manualStepOrder[idx + 1]);
8818
+ }
8819
+ }, 220);
8820
+ };
8793
8821
  const goBackManual = () => {
8794
8822
  setError("");
8795
8823
  if (manualStep === "identity") {
@@ -8798,6 +8826,7 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
8798
8826
  }
8799
8827
  setManualStep(manualStepOrder[Math.max(0, manualStepIdx - 1)]);
8800
8828
  };
8829
+ const isAutoAdvanceStep = mode === "manual" && (manualStep === "chest" || manualStep === "stomach" || manualStep === "seat" || manualStep === "hips");
8801
8830
  const advanceImage = () => {
8802
8831
  if (!validateNameOnly()) return;
8803
8832
  if (!photoBase64) {
@@ -8977,18 +9006,9 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
8977
9006
  title: t("CHEST PROFILE"),
8978
9007
  subtitle: t("Select the profile that best matches your chest breadth"),
8979
9008
  children: [
8980
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.chest?.narrow ?? null, label: t("NARROW"), selected: chestProfile === "narrow", onSelect: () => {
8981
- setChestProfile("narrow");
8982
- setError("");
8983
- } }),
8984
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.chest?.average ?? null, label: t("AVERAGE"), selected: chestProfile === "average", onSelect: () => {
8985
- setChestProfile("average");
8986
- setError("");
8987
- } }),
8988
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.chest?.broad ?? null, label: t("BROAD"), selected: chestProfile === "broad", onSelect: () => {
8989
- setChestProfile("broad");
8990
- setError("");
8991
- } })
9009
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.chest?.narrow ?? null, label: t("NARROW"), selected: chestProfile === "narrow", onSelect: () => pickShape("chest", "narrow") }),
9010
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.chest?.average ?? null, label: t("AVERAGE"), selected: chestProfile === "average", onSelect: () => pickShape("chest", "average") }),
9011
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.chest?.broad ?? null, label: t("BROAD"), selected: chestProfile === "broad", onSelect: () => pickShape("chest", "broad") })
8992
9012
  ]
8993
9013
  }
8994
9014
  ),
@@ -8999,18 +9019,9 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
8999
9019
  title: t("STOMACH PROFILE"),
9000
9020
  subtitle: t("Describe your mid-section silhouette"),
9001
9021
  children: [
9002
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.stomach?.flat ?? null, label: t("FLAT"), selected: midsectionProfile === "flat", onSelect: () => {
9003
- setMidsectionProfile("flat");
9004
- setError("");
9005
- } }),
9006
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.stomach?.average ?? null, label: t("AVERAGE"), selected: midsectionProfile === "average", onSelect: () => {
9007
- setMidsectionProfile("average");
9008
- setError("");
9009
- } }),
9010
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.stomach?.round ?? null, label: t("ROUND"), selected: midsectionProfile === "round", onSelect: () => {
9011
- setMidsectionProfile("round");
9012
- setError("");
9013
- } })
9022
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.stomach?.flat ?? null, label: t("FLAT"), selected: midsectionProfile === "flat", onSelect: () => pickShape("stomach", "flat") }),
9023
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.stomach?.average ?? null, label: t("AVERAGE"), selected: midsectionProfile === "average", onSelect: () => pickShape("stomach", "average") }),
9024
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.stomach?.round ?? null, label: t("ROUND"), selected: midsectionProfile === "round", onSelect: () => pickShape("stomach", "round") })
9014
9025
  ]
9015
9026
  }
9016
9027
  ),
@@ -9021,18 +9032,9 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
9021
9032
  title: t("BACK & SEAT"),
9022
9033
  subtitle: t("The curvature of your lower spine and seat profile"),
9023
9034
  children: [
9024
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.seat?.narrow ?? null, label: t("STRAIGHT"), selected: seatProfile === "narrow", onSelect: () => {
9025
- setSeatProfile("narrow");
9026
- setError("");
9027
- } }),
9028
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.seat?.average ?? null, label: t("CURVED"), selected: seatProfile === "average", onSelect: () => {
9029
- setSeatProfile("average");
9030
- setError("");
9031
- } }),
9032
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.seat?.full ?? null, label: t("DEEP"), selected: seatProfile === "full", onSelect: () => {
9033
- setSeatProfile("full");
9034
- setError("");
9035
- } })
9035
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.seat?.narrow ?? null, label: t("STRAIGHT"), selected: seatProfile === "narrow", onSelect: () => pickShape("seat", "narrow") }),
9036
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.seat?.average ?? null, label: t("CURVED"), selected: seatProfile === "average", onSelect: () => pickShape("seat", "average") }),
9037
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.seat?.full ?? null, label: t("DEEP"), selected: seatProfile === "full", onSelect: () => pickShape("seat", "full") })
9036
9038
  ]
9037
9039
  }
9038
9040
  ),
@@ -9043,18 +9045,9 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
9043
9045
  title: t("HIP PROFILE"),
9044
9046
  subtitle: t("The curvature of your hips and thighs"),
9045
9047
  children: [
9046
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.hips.narrow ?? null, label: t("NARROW"), selected: hipProfile === "narrow", onSelect: () => {
9047
- setHipProfile("narrow");
9048
- setError("");
9049
- } }),
9050
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.hips.average ?? null, label: t("AVERAGE"), selected: hipProfile === "average", onSelect: () => {
9051
- setHipProfile("average");
9052
- setError("");
9053
- } }),
9054
- /* @__PURE__ */ jsx(ShapeCard, { img: imgs.hips.full ?? null, label: t("FULL"), selected: hipProfile === "full", onSelect: () => {
9055
- setHipProfile("full");
9056
- setError("");
9057
- } })
9048
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.hips.narrow ?? null, label: t("NARROW"), selected: hipProfile === "narrow", onSelect: () => pickShape("hips", "narrow") }),
9049
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.hips.average ?? null, label: t("AVERAGE"), selected: hipProfile === "average", onSelect: () => pickShape("hips", "average") }),
9050
+ /* @__PURE__ */ jsx(ShapeCard, { img: imgs.hips.full ?? null, label: t("FULL"), selected: hipProfile === "full", onSelect: () => pickShape("hips", "full") })
9058
9051
  ]
9059
9052
  }
9060
9053
  ),
@@ -9169,7 +9162,7 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
9169
9162
  ] }),
9170
9163
  /* @__PURE__ */ jsxs("div", { className: "ps-cpw-footer", children: [
9171
9164
  /* @__PURE__ */ jsx("button", { type: "button", className: "ps-cpw-back-btn", onClick: handleBack, children: mode == null ? t("Cancel") : `← ${t("Back")}` }),
9172
- mode === "manual" && /* @__PURE__ */ jsx("button", { type: "button", className: "ps-cpw-next-btn", onClick: advanceManual, children: isLastManualStep ? t("CALCULATE MY FIT") : t("Continue") }),
9165
+ mode === "manual" && !isAutoAdvanceStep && /* @__PURE__ */ jsx("button", { type: "button", className: "ps-cpw-next-btn", onClick: advanceManual, children: isLastManualStep ? t("CALCULATE MY FIT") : t("Continue") }),
9173
9166
  mode === "image" && /* @__PURE__ */ jsx(
9174
9167
  "button",
9175
9168
  {
@@ -12218,7 +12211,7 @@ function PrimeStyleTryonInner({
12218
12211
  }
12219
12212
  ),
12220
12213
  view !== "idle" && typeof document !== "undefined" && createPortal(
12221
- /* @__PURE__ */ jsx("div", { className: cx("ps-tryon-overlay", cn.overlay), style: cssVars, "data-ps-tryon-portal": true, children: /* @__PURE__ */ jsxs("div", { className: cx(`ps-tryon-modal${view === "result" && resultImageUrl && sizingResult || view === "size-result" || view === "estimation-review" || view === "body-profile" || view === "profiles" ? " ps-tryon-modal-wide" : ""}${view === "profiles" ? " ps-tryon-modal-tall" : ""}`, cn.modal), onClick: (e) => e.stopPropagation(), children: [
12214
+ /* @__PURE__ */ jsx("div", { className: cx("ps-tryon-overlay", cn.overlay), style: cssVars, "data-ps-tryon-portal": true, children: /* @__PURE__ */ jsxs("div", { className: cx(`ps-tryon-modal${view === "result" && resultImageUrl && sizingResult || view === "size-result" || view === "estimation-review" || view === "body-profile" || view === "profiles" ? " ps-tryon-modal-wide" : ""}`, cn.modal), onClick: (e) => e.stopPropagation(), children: [
12222
12215
  /* @__PURE__ */ jsxs("div", { className: cx("ps-tryon-header ps-tryon-header-minimal", cn.header), children: [
12223
12216
  /* @__PURE__ */ jsx(LangSwitcher, { activeLocale, onSelect: setActiveLocale }),
12224
12217
  /* @__PURE__ */ jsx("button", { className: "ps-tryon-header-icon", title: t("Profiles"), onClick: () => {