@primestyleai/tryon 5.5.18 → 5.5.20

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.
@@ -3366,7 +3366,11 @@ const STYLES = `
3366
3366
  .ps-msr-root {
3367
3367
  display: flex; flex-direction: column;
3368
3368
  gap: 14px; padding: 4px 4px 100px;
3369
- /* No flex:1 let content size naturally so the modal can scroll */
3369
+ /* Fill the modal body and create a self-scrolling region the
3370
+ outer .ps-bp-root flex chain doesn't propagate scroll past the
3371
+ child level on mobile, so we own scrolling here. */
3372
+ height: 100%; min-height: 0;
3373
+ overflow-y: auto; -webkit-overflow-scrolling: touch;
3370
3374
  }
3371
3375
  .ps-msr-eyebrow {
3372
3376
  font-size: 10px; font-weight: 600;
@@ -3375,15 +3379,15 @@ const STYLES = `
3375
3379
  text-align: center; margin: 4px 0 -4px;
3376
3380
  }
3377
3381
 
3378
- /* Product hero — centered image + title */
3382
+ /* Product hero — big centered image + title */
3379
3383
  .ps-msr-product {
3380
3384
  display: flex; flex-direction: column; align-items: center;
3381
- gap: 10px;
3385
+ gap: 14px;
3382
3386
  }
3383
3387
  .ps-msr-product-img-wrap {
3384
3388
  position: relative; flex-shrink: 0;
3385
- width: 130px; height: 130px;
3386
- border-radius: 10px; overflow: hidden;
3389
+ width: 220px; height: 220px;
3390
+ border-radius: 12px; overflow: hidden;
3387
3391
  background: var(--ps-bg-secondary);
3388
3392
  display: flex; align-items: center; justify-content: center;
3389
3393
  }
@@ -3393,18 +3397,18 @@ const STYLES = `
3393
3397
  object-fit: contain; display: block;
3394
3398
  }
3395
3399
  .ps-msr-bookmark {
3396
- position: absolute; top: 8px; right: 8px;
3397
- width: 26px; height: 26px; border-radius: 6px;
3400
+ position: absolute; top: 10px; right: 10px;
3401
+ width: 30px; height: 30px; border-radius: 7px;
3398
3402
  background: rgba(255,255,255,0.92); border: none;
3399
3403
  color: var(--ps-text-primary); cursor: pointer;
3400
3404
  display: flex; align-items: center; justify-content: center;
3401
3405
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
3402
3406
  }
3403
3407
  .ps-msr-product-name {
3404
- font-size: 17px; font-weight: 700;
3408
+ font-size: 19px; font-weight: 700;
3405
3409
  color: var(--ps-text-primary);
3406
3410
  text-align: center; margin: 0;
3407
- letter-spacing: -0.005em;
3411
+ letter-spacing: -0.01em;
3408
3412
  }
3409
3413
 
3410
3414
  /* Match badge row */
@@ -3437,48 +3441,37 @@ const STYLES = `
3437
3441
  color: var(--ps-text-muted);
3438
3442
  }
3439
3443
 
3440
- /* Section cards — stacked, full-width, white bg with subtle border,
3441
- tappable. Modal scrolls if there are many of them. */
3444
+ /* Section cards — TALL, label small on top, BIG centered size value */
3442
3445
  .ps-msr-sections {
3443
- display: flex; flex-direction: column; gap: 10px;
3444
- margin-top: 6px;
3446
+ display: flex; flex-direction: column;
3447
+ margin-top: 8px;
3448
+ border-top: 1px solid var(--ps-border-subtle);
3445
3449
  }
3446
3450
  .ps-msr-section-card {
3447
- display: flex; align-items: center; justify-content: space-between;
3448
- background: var(--ps-bg-primary);
3449
- border: 1px solid var(--ps-border-subtle);
3450
- border-radius: 12px;
3451
- padding: 18px 20px;
3451
+ display: flex; flex-direction: column;
3452
+ align-items: center; justify-content: center;
3453
+ gap: 14px;
3454
+ background: none; border: none;
3455
+ border-bottom: 1px solid var(--ps-border-subtle);
3456
+ padding: 28px 20px;
3452
3457
  font-family: inherit; cursor: pointer;
3453
- text-align: left; width: 100%;
3454
- transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
3455
- box-shadow: 0 1px 3px rgba(0,0,0,0.04);
3456
- }
3457
- .ps-msr-section-card:hover {
3458
- border-color: var(--ps-accent);
3459
- box-shadow: 0 4px 12px rgba(0,0,0,0.06);
3460
- }
3461
- .ps-msr-section-card:active { transform: scale(0.985); }
3462
- .ps-msr-section-text {
3463
- display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0;
3458
+ width: 100%;
3459
+ transition: background 0.15s, transform 0.15s;
3464
3460
  }
3461
+ .ps-msr-section-card:active { transform: scale(0.99); background: var(--ps-bg-secondary); }
3465
3462
  .ps-msr-section-name {
3466
- font-size: 11px; font-weight: 700;
3467
- letter-spacing: 0.1em; text-transform: uppercase;
3468
- color: var(--ps-text-secondary);
3469
- }
3470
- .ps-msr-section-rec {
3471
- font-size: 10px; font-weight: 500;
3472
- letter-spacing: 0.04em;
3463
+ font-size: 11px; font-weight: 600;
3464
+ letter-spacing: 0.14em; text-transform: uppercase;
3473
3465
  color: var(--ps-text-muted);
3466
+ text-align: center;
3474
3467
  }
3475
3468
  .ps-msr-section-size {
3476
- font-size: 28px; font-weight: 700;
3469
+ font-size: 56px; font-weight: 700;
3477
3470
  color: var(--ps-text-primary);
3478
3471
  font-feature-settings: "tnum" 1;
3479
3472
  line-height: 1;
3480
- flex-shrink: 0;
3481
- margin-left: 16px;
3473
+ text-align: center;
3474
+ letter-spacing: -0.01em;
3482
3475
  }
3483
3476
 
3484
3477
  /* Bottom CTA: sticky to the modal bottom so it's always accessible
@@ -3507,6 +3500,178 @@ const STYLES = `
3507
3500
  .ps-msr-tryon-cta:disabled { opacity: 0.4; cursor: not-allowed; }
3508
3501
  .ps-msr-tryon-cta svg { flex-shrink: 0; }
3509
3502
 
3503
+ /* ════════════════════════════════════════════════════════════════
3504
+ MobileSectionDetail (.ps-msd-*) — section detail view on mobile.
3505
+ Big product image, big size value, match%, MEASUREMENT BLUEPRINT
3506
+ rows with PERFECT FIT badges, TRY ANOTHER SIZE picker.
3507
+ Self-scrolling — content can be long.
3508
+ ════════════════════════════════════════════════════════════════ */
3509
+ .ps-msd-root {
3510
+ display: flex; flex-direction: column;
3511
+ gap: 14px; padding: 4px 4px 60px;
3512
+ height: 100%; min-height: 0;
3513
+ overflow-y: auto; -webkit-overflow-scrolling: touch;
3514
+ }
3515
+ .ps-msd-back {
3516
+ background: none; border: none;
3517
+ color: var(--ps-text-secondary);
3518
+ font-family: inherit; font-size: 12px; font-weight: 500;
3519
+ padding: 6px 0; margin-bottom: 4px;
3520
+ cursor: pointer; align-self: flex-start;
3521
+ display: flex; align-items: center; gap: 6px;
3522
+ transition: color 0.15s;
3523
+ }
3524
+ .ps-msd-back:hover { color: var(--ps-text-primary); }
3525
+ .ps-msd-back-arrow { font-size: 16px; line-height: 1; }
3526
+
3527
+ /* Big product image */
3528
+ .ps-msd-image {
3529
+ width: 100%; height: 240px;
3530
+ border-radius: 12px; overflow: hidden;
3531
+ background: var(--ps-bg-secondary);
3532
+ display: flex; align-items: center; justify-content: center;
3533
+ flex-shrink: 0;
3534
+ }
3535
+ .ps-msd-image-img {
3536
+ max-width: 100%; max-height: 100%;
3537
+ width: auto; height: 100%;
3538
+ object-fit: contain; display: block;
3539
+ }
3540
+
3541
+ /* Header: section name + big size + match */
3542
+ .ps-msd-header {
3543
+ display: flex; flex-direction: column; align-items: center;
3544
+ gap: 6px; padding: 14px 0 18px;
3545
+ border-bottom: 1px solid var(--ps-border-subtle);
3546
+ }
3547
+ .ps-msd-section-name {
3548
+ font-size: 11px; font-weight: 700;
3549
+ letter-spacing: 0.14em; text-transform: uppercase;
3550
+ color: var(--ps-text-muted);
3551
+ }
3552
+ .ps-msd-size-row {
3553
+ display: flex; align-items: baseline; gap: 8px;
3554
+ }
3555
+ .ps-msd-size-num {
3556
+ font-size: 64px; font-weight: 700;
3557
+ color: var(--ps-text-primary);
3558
+ line-height: 1; letter-spacing: -0.02em;
3559
+ font-feature-settings: "tnum" 1;
3560
+ }
3561
+ .ps-msd-size-len {
3562
+ font-size: 16px; font-weight: 500;
3563
+ color: var(--ps-text-secondary);
3564
+ }
3565
+ .ps-msd-match {
3566
+ display: flex; align-items: baseline; gap: 5px;
3567
+ }
3568
+ .ps-msd-match-pct {
3569
+ font-size: 13px; font-weight: 700;
3570
+ color: var(--ps-accent);
3571
+ font-feature-settings: "tnum" 1;
3572
+ }
3573
+ .ps-msd-match-label {
3574
+ font-size: 10px; font-weight: 600;
3575
+ letter-spacing: 0.12em; text-transform: uppercase;
3576
+ color: var(--ps-text-muted);
3577
+ }
3578
+
3579
+ /* MEASUREMENT BLUEPRINT */
3580
+ .ps-msd-blueprint {
3581
+ display: flex; flex-direction: column; gap: 8px;
3582
+ padding-top: 16px;
3583
+ }
3584
+ .ps-msd-blueprint-title {
3585
+ font-size: 11px; font-weight: 700;
3586
+ letter-spacing: 0.16em; text-transform: uppercase;
3587
+ color: var(--ps-text-muted);
3588
+ text-align: center; margin-bottom: 4px;
3589
+ }
3590
+ .ps-msd-rows {
3591
+ display: flex; flex-direction: column;
3592
+ }
3593
+ .ps-msd-row {
3594
+ padding: 16px 4px;
3595
+ border-bottom: 1px solid var(--ps-border-subtle);
3596
+ }
3597
+ .ps-msd-row:last-child { border-bottom: none; }
3598
+ .ps-msd-row-top {
3599
+ display: flex; align-items: center; justify-content: space-between;
3600
+ margin-bottom: 8px;
3601
+ }
3602
+ .ps-msd-row-label {
3603
+ font-size: 10px; font-weight: 700;
3604
+ letter-spacing: 0.12em; text-transform: uppercase;
3605
+ color: var(--ps-text-muted);
3606
+ }
3607
+ .ps-msd-row-badge {
3608
+ font-size: 9px; font-weight: 700;
3609
+ letter-spacing: 0.12em; text-transform: uppercase;
3610
+ padding: 4px 9px; border-radius: 999px;
3611
+ }
3612
+ .ps-msd-row-badge.ps-good {
3613
+ background: rgba(33, 84, 239, 0.1);
3614
+ color: var(--ps-accent);
3615
+ }
3616
+ .ps-msd-row-badge.ps-tight {
3617
+ background: rgba(220, 38, 38, 0.1);
3618
+ color: #dc2626;
3619
+ }
3620
+ .ps-msd-row-badge.ps-loose {
3621
+ background: rgba(217, 119, 6, 0.1);
3622
+ color: #d97706;
3623
+ }
3624
+ .ps-msd-row-values {
3625
+ display: flex; gap: 16px;
3626
+ }
3627
+ .ps-msd-row-cell {
3628
+ flex: 1; display: flex; flex-direction: column; gap: 3px;
3629
+ }
3630
+ .ps-msd-cell-label {
3631
+ font-size: 9px; font-weight: 600;
3632
+ letter-spacing: 0.1em; text-transform: uppercase;
3633
+ color: var(--ps-text-muted);
3634
+ }
3635
+ .ps-msd-cell-value {
3636
+ font-size: 16px; font-weight: 600;
3637
+ color: var(--ps-text-primary);
3638
+ font-feature-settings: "tnum" 1;
3639
+ }
3640
+
3641
+ /* TRY ANOTHER SIZE picker */
3642
+ .ps-msd-sizes {
3643
+ display: flex; flex-direction: column; gap: 10px;
3644
+ padding-top: 18px;
3645
+ }
3646
+ .ps-msd-sizes-label {
3647
+ font-size: 11px; font-weight: 700;
3648
+ letter-spacing: 0.14em; text-transform: uppercase;
3649
+ color: var(--ps-text-muted);
3650
+ text-align: center;
3651
+ }
3652
+ .ps-msd-sizes-pills {
3653
+ display: flex; flex-wrap: wrap; gap: 8px;
3654
+ justify-content: center;
3655
+ }
3656
+ .ps-msd-size-pill {
3657
+ min-width: 48px;
3658
+ padding: 10px 16px;
3659
+ background: transparent;
3660
+ border: 1.5px solid var(--ps-border-color);
3661
+ border-radius: 8px;
3662
+ font-family: inherit; font-size: 13px; font-weight: 600;
3663
+ color: var(--ps-text-primary);
3664
+ cursor: pointer;
3665
+ transition: all 0.15s;
3666
+ }
3667
+ .ps-msd-size-pill:hover {
3668
+ border-color: var(--ps-accent);
3669
+ }
3670
+ .ps-msd-size-pill.ps-active {
3671
+ background: var(--ps-accent); color: #FFFFFF;
3672
+ border-color: var(--ps-accent);
3673
+ }
3674
+
3510
3675
  /* Bottom action area — Next button + tab bar grouped together,
3511
3676
  pushed to the bottom of the modal body by .ps-bpm-spacer above. */
3512
3677
  .ps-bpm-bottom {
@@ -4785,10 +4950,7 @@ function MultiSectionMobile({
4785
4950
  className: "ps-msr-section-card",
4786
4951
  onClick: () => onSelectSection(name),
4787
4952
  children: [
4788
- /* @__PURE__ */ jsxs("div", { className: "ps-msr-section-text", children: [
4789
- /* @__PURE__ */ jsx("span", { className: "ps-msr-section-name", children: cleanName.toUpperCase() }),
4790
- /* @__PURE__ */ jsx("span", { className: "ps-msr-section-rec", children: t("recommended size") })
4791
- ] }),
4953
+ /* @__PURE__ */ jsx("span", { className: "ps-msr-section-name", children: cleanName.toUpperCase() }),
4792
4954
  /* @__PURE__ */ jsx("span", { className: "ps-msr-section-size", children: sizeValue })
4793
4955
  ]
4794
4956
  },
@@ -5020,7 +5182,10 @@ function SectionDetailView({
5020
5182
  unitLbl,
5021
5183
  lengthEntry,
5022
5184
  onBack,
5023
- t
5185
+ t,
5186
+ productImage,
5187
+ productTitle,
5188
+ isMobile: isMobileProp
5024
5189
  }) {
5025
5190
  const recSize = sectionResult?.recommendedSize || "";
5026
5191
  const [selectedSize, setSelectedSize] = useState(null);
@@ -5177,6 +5342,90 @@ function SectionDetailView({
5177
5342
  const backendAvailableLengths = secAny?.availableLengths || [];
5178
5343
  const finalDisplayLength = selectedLength || backendLength;
5179
5344
  const finalAllSizes = backendAvailableSizes.length > 0 ? backendAvailableSizes : allSizes;
5345
+ if (isMobileProp) {
5346
+ const cleanSectionName = sectionName.replace(/\s*[—–-]\s*.*/g, "");
5347
+ const fitBadgeLabel = (fit) => fit === "good" ? t("PERFECT FIT") : fit.includes("a-bit-tight") ? t("SLIGHTLY TIGHT") : fit.includes("a-bit-loose") ? t("SLIGHTLY LOOSE") : fit.includes("tight") ? t("TIGHT") : fit.includes("loose") ? t("LOOSE") : t("FIT");
5348
+ return /* @__PURE__ */ jsxs("div", { className: "ps-msd-root", children: [
5349
+ /* @__PURE__ */ jsxs("button", { type: "button", className: "ps-msd-back", onClick: onBack, children: [
5350
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-back-arrow", children: "←" }),
5351
+ " ",
5352
+ t("Back to sections")
5353
+ ] }),
5354
+ productImage && /* @__PURE__ */ jsx("div", { className: "ps-msd-image", children: /* @__PURE__ */ jsx("img", { src: productImage, alt: productTitle || "", className: "ps-msd-image-img" }) }),
5355
+ /* @__PURE__ */ jsxs("div", { className: "ps-msd-header", children: [
5356
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-section-name", children: cleanSectionName.toUpperCase() }),
5357
+ /* @__PURE__ */ jsxs("div", { className: "ps-msd-size-row", children: [
5358
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-size-num", children: backendSize }),
5359
+ finalDisplayLength && /* @__PURE__ */ jsx("span", { className: "ps-msd-size-len", children: finalDisplayLength })
5360
+ ] }),
5361
+ /* @__PURE__ */ jsxs("div", { className: "ps-msd-match", children: [
5362
+ /* @__PURE__ */ jsxs("span", { className: "ps-msd-match-pct", children: [
5363
+ matchPercent,
5364
+ "%"
5365
+ ] }),
5366
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-match-label", children: t("FIT MATCH") })
5367
+ ] })
5368
+ ] }),
5369
+ fitRows.length > 0 && /* @__PURE__ */ jsxs("div", { className: "ps-msd-blueprint", children: [
5370
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-blueprint-title", children: t("MEASUREMENT BLUEPRINT") }),
5371
+ /* @__PURE__ */ jsx("div", { className: "ps-msd-rows", children: fitRows.map((row, i) => {
5372
+ const fitClass = row.fit === "good" ? "ps-good" : row.fit.includes("tight") ? "ps-tight" : "ps-loose";
5373
+ return /* @__PURE__ */ jsxs("div", { className: "ps-msd-row", children: [
5374
+ /* @__PURE__ */ jsxs("div", { className: "ps-msd-row-top", children: [
5375
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-row-label", children: row.area.toUpperCase() }),
5376
+ /* @__PURE__ */ jsx("span", { className: `ps-msd-row-badge ${fitClass}`, children: row.isLength ? lengthFitLabelFn(row.fit, t) : fitBadgeLabel(row.fit) })
5377
+ ] }),
5378
+ /* @__PURE__ */ jsxs("div", { className: "ps-msd-row-values", children: [
5379
+ /* @__PURE__ */ jsxs("div", { className: "ps-msd-row-cell", children: [
5380
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-cell-label", children: t("YOU") }),
5381
+ /* @__PURE__ */ jsxs("span", { className: "ps-msd-cell-value", children: [
5382
+ row.userNum,
5383
+ " ",
5384
+ unitLbl
5385
+ ] })
5386
+ ] }),
5387
+ /* @__PURE__ */ jsxs("div", { className: "ps-msd-row-cell", children: [
5388
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-cell-label", children: t("GARMENT") }),
5389
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-cell-value", children: row.chartLabel })
5390
+ ] })
5391
+ ] })
5392
+ ] }, i);
5393
+ }) })
5394
+ ] }),
5395
+ finalAllSizes.length > 1 && /* @__PURE__ */ jsxs("div", { className: "ps-msd-sizes", children: [
5396
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-sizes-label", children: t("TRY ANOTHER SIZE") }),
5397
+ /* @__PURE__ */ jsx("div", { className: "ps-msd-sizes-pills", children: finalAllSizes.map((s) => {
5398
+ const isActive = s === displaySize;
5399
+ return /* @__PURE__ */ jsx(
5400
+ "button",
5401
+ {
5402
+ type: "button",
5403
+ className: `ps-msd-size-pill${isActive ? " ps-active" : ""}`,
5404
+ onClick: () => setSelectedSize(s === recSize ? null : s),
5405
+ children: s
5406
+ },
5407
+ s
5408
+ );
5409
+ }) })
5410
+ ] }),
5411
+ (backendAvailableLengths.length > 0 || lengthSizes.length > 0) && /* @__PURE__ */ jsxs("div", { className: "ps-msd-sizes", children: [
5412
+ /* @__PURE__ */ jsx("span", { className: "ps-msd-sizes-label", children: t("LENGTH ADJUSTMENT") }),
5413
+ /* @__PURE__ */ jsx("div", { className: "ps-msd-sizes-pills", children: (backendAvailableLengths.length > 0 ? backendAvailableLengths : lengthSizes).map((s) => {
5414
+ const isActive = finalDisplayLength === s;
5415
+ return /* @__PURE__ */ jsx(
5416
+ "button",
5417
+ {
5418
+ type: "button",
5419
+ className: `ps-msd-size-pill${isActive ? " ps-active" : ""}`,
5420
+ onClick: () => setSelectedLength(s === backendLength ? null : s),
5421
+ children: s
5422
+ },
5423
+ s
5424
+ );
5425
+ }) })
5426
+ ] })
5427
+ ] });
5428
+ }
5180
5429
  return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sec-detail", style: { padding: "1.5vw", display: "flex", flexDirection: "column", height: "100%", background: "#F8F9FA" }, children: [
5181
5430
  /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
5182
5431
  /* @__PURE__ */ jsx("span", { style: { fontSize: "0.75vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: isRecommended ? t("Recommended Size") : t("Not Recommended") }),
@@ -5595,10 +5844,28 @@ function SizeResultView({
5595
5844
  ] }),
5596
5845
  (allDone || sizingResult && !isSnapProcessing) && /* @__PURE__ */ jsxs(Fragment, { children: [
5597
5846
  isMultiSection ? activeSection ? (
5598
- /* ── Detail view for a single section — v2 layout ── */
5847
+ /* ── Detail view for a single section ── */
5599
5848
  (() => {
5600
5849
  const entry = sectionEntries.find((e) => e.name === activeSection);
5601
5850
  if (!entry) return null;
5851
+ if (isMobile) {
5852
+ return /* @__PURE__ */ jsx(
5853
+ SectionDetailView,
5854
+ {
5855
+ sectionName: entry.name,
5856
+ section: entry.section,
5857
+ sectionResult: entry.secResult,
5858
+ userMeasurements: entry.userMeasurements,
5859
+ unitLbl,
5860
+ lengthEntry: findLengthForSection(entry.name, lengthEntries),
5861
+ onBack: () => setActiveSection(null),
5862
+ productImage: resultImageUrl || productImage,
5863
+ productTitle,
5864
+ isMobile: true,
5865
+ t
5866
+ }
5867
+ );
5868
+ }
5602
5869
  return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-v2", children: [
5603
5870
  /* @__PURE__ */ jsx("div", { className: "ps-tryon-v2-bg", children: /* @__PURE__ */ jsx("img", { src: resultImageUrl || productImage, alt: productTitle, className: "ps-tryon-v2-bg-img" }) }),
5604
5871
  /* @__PURE__ */ jsx("div", { className: "ps-tryon-v2-panel", children: /* @__PURE__ */ jsx(