@primestyleai/tryon 5.6.5 → 5.6.7

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.
@@ -4148,6 +4148,22 @@ const STYLES = `
4148
4148
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
4149
4149
  gap: 24px;
4150
4150
  }
4151
+
4152
+ /* Two-column split: inputs stacked left, photo right */
4153
+ .ps-cpw-split {
4154
+ display: grid;
4155
+ grid-template-columns: 1fr 280px;
4156
+ gap: 28px;
4157
+ align-items: start;
4158
+ }
4159
+ .ps-cpw-split-left {
4160
+ display: flex; flex-direction: column; gap: 22px;
4161
+ min-width: 0;
4162
+ }
4163
+ .ps-cpw-split-right {
4164
+ display: flex; flex-direction: column; gap: 8px;
4165
+ min-width: 0;
4166
+ }
4151
4167
  .ps-cpw-error {
4152
4168
  font-size: 12px;
4153
4169
  color: var(--ps-error-color);
@@ -4185,14 +4201,17 @@ const STYLES = `
4185
4201
  }
4186
4202
  .ps-cpw-photo-preview {
4187
4203
  position: relative;
4188
- width: 100%; max-width: 220px;
4204
+ width: 100%;
4189
4205
  border-radius: 12px; overflow: hidden;
4190
4206
  background: var(--ps-bg-secondary);
4191
4207
  border: 1px solid var(--ps-border-subtle);
4192
- aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
4208
+ aspect-ratio: 3 / 4;
4209
+ display: flex; align-items: center; justify-content: center;
4193
4210
  }
4194
4211
  .ps-cpw-photo-preview img {
4195
- width: 100%; height: 100%; object-fit: cover;
4212
+ max-width: 100%; max-height: 100%;
4213
+ width: auto; height: 100%;
4214
+ object-fit: contain;
4196
4215
  }
4197
4216
  .ps-cpw-photo-remove {
4198
4217
  position: absolute; top: 8px; right: 8px;
@@ -4301,6 +4320,8 @@ const STYLES = `
4301
4320
  .ps-cpw-progress { min-width: 0; width: 100%; align-items: flex-start; margin-top: 0; }
4302
4321
  .ps-cpw-step-title { font-size: 22px; }
4303
4322
  .ps-cpw-field-grid { grid-template-columns: 1fr; gap: 18px; }
4323
+ .ps-cpw-split { grid-template-columns: 1fr; gap: 18px; }
4324
+ .ps-cpw-photo-preview { max-width: 220px; }
4304
4325
  .ps-cpw-card-row { gap: 8px; }
4305
4326
  .ps-cpw-card { padding: 10px 6px 8px; }
4306
4327
  .ps-cpw-card-thumb { height: 80px; }
@@ -4385,6 +4406,29 @@ const STYLES = `
4385
4406
  letter-spacing: 0.14em; text-transform: uppercase;
4386
4407
  color: var(--ps-text-primary);
4387
4408
  }
4409
+ .ps-pmv-section-title-row {
4410
+ display: flex; align-items: center; justify-content: space-between;
4411
+ gap: 12px;
4412
+ }
4413
+ .ps-pmv-loading-pill {
4414
+ display: inline-flex; align-items: center; gap: 8px;
4415
+ padding: 6px 12px;
4416
+ background: rgba(33, 84, 239, 0.08);
4417
+ color: var(--ps-accent);
4418
+ border-radius: 999px;
4419
+ font-size: 10px; font-weight: 700;
4420
+ letter-spacing: 0.1em; text-transform: uppercase;
4421
+ }
4422
+ .ps-pmv-loading-spinner {
4423
+ width: 12px; height: 12px;
4424
+ border: 2px solid rgba(33, 84, 239, 0.25);
4425
+ border-top-color: var(--ps-accent);
4426
+ border-radius: 50%;
4427
+ animation: ps-pmv-spin 0.8s linear infinite;
4428
+ }
4429
+ @keyframes ps-pmv-spin {
4430
+ to { transform: rotate(360deg); }
4431
+ }
4388
4432
  .ps-pmv-section-sub {
4389
4433
  font-size: 12px; font-weight: 400;
4390
4434
  color: var(--ps-text-muted);
@@ -4417,10 +4461,24 @@ const STYLES = `
4417
4461
  color: var(--ps-border-color);
4418
4462
  animation: ps-pmv-shimmer 1.4s ease-in-out infinite;
4419
4463
  }
4464
+ .ps-pmv-measure.ps-loading {
4465
+ background: linear-gradient(
4466
+ 90deg,
4467
+ var(--ps-bg-primary) 0%,
4468
+ var(--ps-bg-secondary) 50%,
4469
+ var(--ps-bg-primary) 100%
4470
+ );
4471
+ background-size: 200% 100%;
4472
+ animation: ps-pmv-skeleton 1.6s ease-in-out infinite;
4473
+ }
4420
4474
  @keyframes ps-pmv-shimmer {
4421
4475
  0%, 100% { opacity: 0.5; }
4422
4476
  50% { opacity: 1; }
4423
4477
  }
4478
+ @keyframes ps-pmv-skeleton {
4479
+ 0% { background-position: 200% 0; }
4480
+ 100% { background-position: -200% 0; }
4481
+ }
4424
4482
 
4425
4483
  /* Saved sizes history (per-product cache) */
4426
4484
  .ps-pmv-history {
@@ -4501,11 +4559,26 @@ const STYLES = `
4501
4559
  font-family: inherit; font-size: 11px; font-weight: 700;
4502
4560
  letter-spacing: 0.12em; text-transform: uppercase;
4503
4561
  cursor: pointer;
4504
- transition: opacity 0.15s, transform 0.15s;
4562
+ transition: opacity 0.15s, transform 0.15s, background 0.2s;
4505
4563
  box-shadow: 0 4px 14px rgba(33, 84, 239, 0.18);
4564
+ display: inline-flex; align-items: center; gap: 8px;
4565
+ justify-content: center;
4566
+ }
4567
+ .ps-pmv-btn-primary:hover:not(:disabled) { opacity: 0.92; }
4568
+ .ps-pmv-btn-primary:active:not(:disabled) { transform: scale(0.98); }
4569
+ .ps-pmv-btn-primary:disabled {
4570
+ background: var(--ps-text-muted);
4571
+ cursor: not-allowed;
4572
+ box-shadow: none;
4573
+ opacity: 0.65;
4574
+ }
4575
+ .ps-pmv-btn-spinner {
4576
+ width: 12px; height: 12px;
4577
+ border: 2px solid rgba(255, 255, 255, 0.35);
4578
+ border-top-color: #FFFFFF;
4579
+ border-radius: 50%;
4580
+ animation: ps-pmv-spin 0.8s linear infinite;
4506
4581
  }
4507
- .ps-pmv-btn-primary:hover { opacity: 0.92; }
4508
- .ps-pmv-btn-primary:active { transform: scale(0.98); }
4509
4582
 
4510
4583
  @media (max-width: 768px) {
4511
4584
  .ps-pmv-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
@@ -5262,7 +5335,10 @@ function LangSwitcher({ activeLocale: current, onSelect }) {
5262
5335
  position: "fixed",
5263
5336
  top: pos.top,
5264
5337
  right: pos.right,
5265
- zIndex: 9999999
5338
+ // Match the overlay's z-index (2147483647) so the dropdown sits
5339
+ // above it. With equal z-index, document order wins — and the
5340
+ // dropdown is portaled later than the overlay so it stacks on top.
5341
+ zIndex: 2147483647
5266
5342
  },
5267
5343
  children: /* @__PURE__ */ jsx("div", { className: "ps-tryon-lang-list", children: SUPPORTED_LOCALES.map((code) => /* @__PURE__ */ jsxs(
5268
5344
  "button",
@@ -7758,116 +7834,118 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
7758
7834
  /* @__PURE__ */ jsx("button", { type: "button", className: `ps-cpw-pill${unit === "in" ? " ps-active" : ""}`, onClick: () => setUnit("in"), children: "in" })
7759
7835
  ] })
7760
7836
  ] }),
7761
- /* @__PURE__ */ jsxs("div", { className: "ps-cpw-field-grid", children: [
7762
- /* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
7763
- /* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
7764
- t("HEIGHT"),
7765
- " (",
7766
- unit,
7767
- ")"
7837
+ /* @__PURE__ */ jsxs("div", { className: "ps-cpw-split", children: [
7838
+ /* @__PURE__ */ jsxs("div", { className: "ps-cpw-split-left", children: [
7839
+ /* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
7840
+ /* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
7841
+ t("HEIGHT"),
7842
+ " (",
7843
+ unit,
7844
+ ")"
7845
+ ] }),
7846
+ /* @__PURE__ */ jsx(
7847
+ "input",
7848
+ {
7849
+ type: "number",
7850
+ inputMode: "numeric",
7851
+ className: "ps-cpw-input",
7852
+ value: heightVal,
7853
+ placeholder: unit === "cm" ? t("e.g. 173") : t("e.g. 68 in"),
7854
+ onChange: (e) => {
7855
+ setHeightVal(e.target.value);
7856
+ setError("");
7857
+ }
7858
+ }
7859
+ )
7768
7860
  ] }),
7769
- /* @__PURE__ */ jsx(
7770
- "input",
7771
- {
7772
- type: "number",
7773
- inputMode: "numeric",
7774
- className: "ps-cpw-input",
7775
- value: heightVal,
7776
- placeholder: unit === "cm" ? t("e.g. 173") : t("e.g. 68 in"),
7777
- onChange: (e) => {
7778
- setHeightVal(e.target.value);
7779
- setError("");
7861
+ /* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
7862
+ /* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
7863
+ t("WEIGHT"),
7864
+ " (",
7865
+ unit === "in" ? "lbs" : "kg",
7866
+ ")"
7867
+ ] }),
7868
+ /* @__PURE__ */ jsx(
7869
+ "input",
7870
+ {
7871
+ type: "number",
7872
+ inputMode: "numeric",
7873
+ className: "ps-cpw-input",
7874
+ value: weightVal,
7875
+ placeholder: unit === "in" ? t("e.g. 154") : t("e.g. 70"),
7876
+ onChange: (e) => {
7877
+ setWeightVal(e.target.value);
7878
+ setError("");
7879
+ }
7780
7880
  }
7781
- }
7782
- )
7783
- ] }),
7784
- /* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
7785
- /* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
7786
- t("WEIGHT"),
7787
- " (",
7788
- unit === "in" ? "lbs" : "kg",
7789
- ")"
7881
+ )
7790
7882
  ] }),
7791
- /* @__PURE__ */ jsx(
7792
- "input",
7793
- {
7794
- type: "number",
7795
- inputMode: "numeric",
7796
- className: "ps-cpw-input",
7797
- value: weightVal,
7798
- placeholder: unit === "in" ? t("e.g. 154") : t("e.g. 70"),
7799
- onChange: (e) => {
7800
- setWeightVal(e.target.value);
7801
- setError("");
7883
+ /* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
7884
+ /* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
7885
+ t("AGE"),
7886
+ " (",
7887
+ t("years"),
7888
+ ")"
7889
+ ] }),
7890
+ /* @__PURE__ */ jsx(
7891
+ "input",
7892
+ {
7893
+ type: "number",
7894
+ inputMode: "numeric",
7895
+ className: "ps-cpw-input",
7896
+ value: ageVal,
7897
+ placeholder: t("e.g. 30"),
7898
+ onChange: (e) => {
7899
+ setAgeVal(e.target.value);
7900
+ setError("");
7901
+ }
7802
7902
  }
7803
- }
7804
- )
7903
+ )
7904
+ ] })
7805
7905
  ] }),
7806
- /* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
7807
- /* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
7808
- t("AGE"),
7809
- " (",
7810
- t("years"),
7811
- ")"
7812
- ] }),
7906
+ /* @__PURE__ */ jsxs("div", { className: "ps-cpw-split-right", children: [
7907
+ /* @__PURE__ */ jsx("div", { className: "ps-cpw-field-label", children: t("PROFILE PHOTO (OPTIONAL)") }),
7813
7908
  /* @__PURE__ */ jsx(
7814
7909
  "input",
7815
7910
  {
7816
- type: "number",
7817
- inputMode: "numeric",
7818
- className: "ps-cpw-input",
7819
- value: ageVal,
7820
- placeholder: t("e.g. 30"),
7821
- onChange: (e) => {
7822
- setAgeVal(e.target.value);
7823
- setError("");
7824
- }
7911
+ ref: photoInputRef,
7912
+ type: "file",
7913
+ accept: "image/*",
7914
+ onChange: handlePhotoSelect,
7915
+ style: { display: "none" }
7825
7916
  }
7826
- )
7827
- ] })
7828
- ] }),
7829
- /* @__PURE__ */ jsxs("div", { className: "ps-cpw-photo", children: [
7830
- /* @__PURE__ */ jsx("div", { className: "ps-cpw-field-label", children: t("PROFILE PHOTO (OPTIONAL)") }),
7831
- /* @__PURE__ */ jsx(
7832
- "input",
7833
- {
7834
- ref: photoInputRef,
7835
- type: "file",
7836
- accept: "image/*",
7837
- onChange: handlePhotoSelect,
7838
- style: { display: "none" }
7839
- }
7840
- ),
7841
- photoBase64 ? /* @__PURE__ */ jsxs("div", { className: "ps-cpw-photo-preview", children: [
7842
- /* @__PURE__ */ jsx("img", { src: photoBase64, alt: t("Profile photo") }),
7843
- /* @__PURE__ */ jsx(
7917
+ ),
7918
+ photoBase64 ? /* @__PURE__ */ jsxs("div", { className: "ps-cpw-photo-preview", children: [
7919
+ /* @__PURE__ */ jsx("img", { src: photoBase64, alt: t("Profile photo") }),
7920
+ /* @__PURE__ */ jsx(
7921
+ "button",
7922
+ {
7923
+ type: "button",
7924
+ className: "ps-cpw-photo-remove",
7925
+ onClick: handleRemovePhoto,
7926
+ "aria-label": t("Remove photo"),
7927
+ children: "×"
7928
+ }
7929
+ )
7930
+ ] }) : /* @__PURE__ */ jsxs(
7844
7931
  "button",
7845
7932
  {
7846
7933
  type: "button",
7847
- className: "ps-cpw-photo-remove",
7848
- onClick: handleRemovePhoto,
7849
- "aria-label": t("Remove photo"),
7850
- children: "×"
7934
+ className: "ps-cpw-photo-upload",
7935
+ onClick: () => photoInputRef.current?.click(),
7936
+ disabled: photoUploading,
7937
+ children: [
7938
+ /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", width: "22", height: "22", children: [
7939
+ /* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
7940
+ /* @__PURE__ */ jsx("polyline", { points: "17 8 12 3 7 8" }),
7941
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
7942
+ ] }),
7943
+ /* @__PURE__ */ jsx("span", { className: "ps-cpw-photo-upload-title", children: photoUploading ? t("Uploading...") : t("Upload a photo") }),
7944
+ /* @__PURE__ */ jsx("span", { className: "ps-cpw-photo-upload-hint", children: t("Helps refine your AI sizing — JPEG, PNG up to 10MB") })
7945
+ ]
7851
7946
  }
7852
7947
  )
7853
- ] }) : /* @__PURE__ */ jsxs(
7854
- "button",
7855
- {
7856
- type: "button",
7857
- className: "ps-cpw-photo-upload",
7858
- onClick: () => photoInputRef.current?.click(),
7859
- disabled: photoUploading,
7860
- children: [
7861
- /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", width: "22", height: "22", children: [
7862
- /* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
7863
- /* @__PURE__ */ jsx("polyline", { points: "17 8 12 3 7 8" }),
7864
- /* @__PURE__ */ jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
7865
- ] }),
7866
- /* @__PURE__ */ jsx("span", { className: "ps-cpw-photo-upload-title", children: photoUploading ? t("Uploading...") : t("Upload a photo") }),
7867
- /* @__PURE__ */ jsx("span", { className: "ps-cpw-photo-upload-hint", children: t("Helps refine your AI sizing — JPEG, PNG up to 10MB") })
7868
- ]
7869
- }
7870
- )
7948
+ ] })
7871
7949
  ] }),
7872
7950
  error && /* @__PURE__ */ jsx("div", { className: "ps-cpw-error", children: error })
7873
7951
  ] }) : /* @__PURE__ */ jsxs("div", { className: "ps-cpw-silhouette", children: [
@@ -7953,6 +8031,7 @@ function ProfileMeasurementsView({
7953
8031
  onEdit,
7954
8032
  onDelete,
7955
8033
  onBack,
8034
+ onSave,
7956
8035
  t
7957
8036
  }) {
7958
8037
  const fields = profile.gender === "female" ? FIELDS_WOMEN : FIELDS_MEN;
@@ -8002,12 +8081,18 @@ function ProfileMeasurementsView({
8002
8081
  ] }),
8003
8082
  /* @__PURE__ */ jsxs("div", { className: "ps-pmv-section", children: [
8004
8083
  /* @__PURE__ */ jsxs("div", { className: "ps-pmv-section-head", children: [
8005
- /* @__PURE__ */ jsx("div", { className: "ps-pmv-section-title", children: t("BODY MEASUREMENTS") }),
8006
- /* @__PURE__ */ jsx("div", { className: "ps-pmv-section-sub", children: hasMeasurements ? t("Calculated from your basics. Used to recommend the perfect size for any product.") : t("Calculating your full body measurements...") })
8084
+ /* @__PURE__ */ jsxs("div", { className: "ps-pmv-section-title-row", children: [
8085
+ /* @__PURE__ */ jsx("div", { className: "ps-pmv-section-title", children: t("BODY MEASUREMENTS") }),
8086
+ !hasMeasurements && /* @__PURE__ */ jsxs("div", { className: "ps-pmv-loading-pill", children: [
8087
+ /* @__PURE__ */ jsx("span", { className: "ps-pmv-loading-spinner" }),
8088
+ /* @__PURE__ */ jsx("span", { children: t("Calculating...") })
8089
+ ] })
8090
+ ] }),
8091
+ /* @__PURE__ */ jsx("div", { className: "ps-pmv-section-sub", children: hasMeasurements ? t("Calculated from your basics. Used to recommend the perfect size for any product.") : t("Our AI is computing your full body proportions — this usually takes a few seconds.") })
8007
8092
  ] }),
8008
8093
  /* @__PURE__ */ jsx("div", { className: "ps-pmv-measure-grid", children: fields.map((f) => {
8009
8094
  const v = measurements[f.key];
8010
- return /* @__PURE__ */ jsxs("div", { className: "ps-pmv-measure", children: [
8095
+ return /* @__PURE__ */ jsxs("div", { className: `ps-pmv-measure${v == null ? " ps-loading" : ""}`, children: [
8011
8096
  /* @__PURE__ */ jsx("div", { className: "ps-pmv-measure-label", children: t(f.label) }),
8012
8097
  /* @__PURE__ */ jsx("div", { className: `ps-pmv-measure-value${v == null ? " ps-loading" : ""}`, children: v != null ? `${Math.round(v * 10) / 10} ${unit}` : "—" })
8013
8098
  ] }, f.key);
@@ -8032,7 +8117,20 @@ function ProfileMeasurementsView({
8032
8117
  /* @__PURE__ */ jsxs("div", { className: "ps-pmv-actions-right", children: [
8033
8118
  /* @__PURE__ */ jsx("button", { type: "button", className: "ps-pmv-btn-edit", onClick: onEdit, children: t("Edit") }),
8034
8119
  /* @__PURE__ */ jsx("button", { type: "button", className: "ps-pmv-btn-delete", onClick: onDelete, children: t("Delete") }),
8035
- !isActive && /* @__PURE__ */ jsx("button", { type: "button", className: "ps-pmv-btn-primary", onClick: onSelect, children: t("USE THIS PROFILE") })
8120
+ !isActive && /* @__PURE__ */ jsx("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: onSelect, children: t("USE THIS PROFILE") }),
8121
+ /* @__PURE__ */ jsx(
8122
+ "button",
8123
+ {
8124
+ type: "button",
8125
+ className: "ps-pmv-btn-primary",
8126
+ onClick: onSave,
8127
+ disabled: !hasMeasurements,
8128
+ children: hasMeasurements ? t("SAVE") : /* @__PURE__ */ jsxs(Fragment, { children: [
8129
+ /* @__PURE__ */ jsx("span", { className: "ps-pmv-btn-spinner" }),
8130
+ t("CALCULATING")
8131
+ ] })
8132
+ }
8133
+ )
8036
8134
  ] })
8037
8135
  ] })
8038
8136
  ] });
@@ -8189,6 +8287,7 @@ function MySizingProfilesView({
8189
8287
  setViewingId(null);
8190
8288
  },
8191
8289
  onBack: () => setViewingId(null),
8290
+ onSave: () => setViewingId(null),
8192
8291
  t
8193
8292
  }
8194
8293
  )