@primestyleai/tryon 3.13.0 → 3.14.0

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.
Files changed (2) hide show
  1. package/dist/react/index.js +40 -34
  2. package/package.json +1 -1
@@ -406,6 +406,20 @@ const FALLBACK_FIELDS_MALE = [
406
406
  { key: "inseam", label: "Inseam", required: false, unit: "cm", placeholder: "e.g. 81", category: "body" },
407
407
  { key: "footLengthCm", label: "Foot length", required: false, unit: "cm", placeholder: "e.g. 27", category: "shoe" }
408
408
  ];
409
+ const SIZING_COUNTRIES = [
410
+ { code: "US", label: "United States" },
411
+ { code: "UK", label: "United Kingdom" },
412
+ { code: "EU", label: "Europe (EU)" },
413
+ { code: "FR", label: "France" },
414
+ { code: "IT", label: "Italy" },
415
+ { code: "DE", label: "Germany" },
416
+ { code: "ES", label: "Spain" },
417
+ { code: "JP", label: "Japan" },
418
+ { code: "CN", label: "China" },
419
+ { code: "KR", label: "South Korea" },
420
+ { code: "AU", label: "Australia" },
421
+ { code: "BR", label: "Brazil" }
422
+ ];
409
423
  const STEP_LABELS = ["", "Welcome", "Size", "Your Fit", "Try On"];
410
424
  const TOTAL_STEPS = 4;
411
425
  function detectLocale() {
@@ -1322,23 +1336,21 @@ function PrimeStyleTryonInner({
1322
1336
  ")"
1323
1337
  ] }, p.id))
1324
1338
  ] }) }),
1325
- sizingMethod === "exact" && /* @__PURE__ */ jsxs("div", { className: "ps-tryon-unit-switch", children: [
1326
- /* @__PURE__ */ jsxs("button", { className: `ps-tryon-unit-switch-btn${isCm ? " ps-active" : ""}`, onClick: () => {
1339
+ /* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
1340
+ /* @__PURE__ */ jsx("label", { children: t("Sizing region") }),
1341
+ /* @__PURE__ */ jsx("select", { className: "ps-tryon-country-select", value: sizingCountry, onChange: (e) => setSizingCountry(e.target.value), children: SIZING_COUNTRIES.map((c) => /* @__PURE__ */ jsx("option", { value: c.code, children: t(c.label) }, c.code)) })
1342
+ ] }),
1343
+ sizingMethod === "exact" && /* @__PURE__ */ jsxs("div", { className: "ps-tryon-unit-tabs", children: [
1344
+ /* @__PURE__ */ jsx("button", { className: `ps-tryon-unit-tab${isCm ? " ps-active" : ""}`, onClick: () => {
1327
1345
  setSizingUnit("cm");
1328
1346
  setHeightUnit("cm");
1329
1347
  setWeightUnit("kg");
1330
- }, children: [
1331
- /* @__PURE__ */ jsx("span", { className: "ps-tryon-unit-switch-label", children: t("cm") }),
1332
- /* @__PURE__ */ jsx("span", { className: "ps-tryon-unit-switch-sub", children: "cm / kg" })
1333
- ] }),
1334
- /* @__PURE__ */ jsxs("button", { className: `ps-tryon-unit-switch-btn${!isCm ? " ps-active" : ""}`, onClick: () => {
1348
+ }, children: "CM" }),
1349
+ /* @__PURE__ */ jsx("button", { className: `ps-tryon-unit-tab${!isCm ? " ps-active" : ""}`, onClick: () => {
1335
1350
  setSizingUnit("in");
1336
1351
  setHeightUnit("ft");
1337
1352
  setWeightUnit("lbs");
1338
- }, children: [
1339
- /* @__PURE__ */ jsx("span", { className: "ps-tryon-unit-switch-label", children: t("in") }),
1340
- /* @__PURE__ */ jsx("span", { className: "ps-tryon-unit-switch-sub", children: "in / lbs" })
1341
- ] })
1353
+ }, children: "Inches" })
1342
1354
  ] }),
1343
1355
  sizingMethod === "exact" ? /* @__PURE__ */ jsx(Fragment, { children: (() => {
1344
1356
  const reqFields = dynamicFields.filter((f) => f.required);
@@ -1462,13 +1474,13 @@ function PrimeStyleTryonInner({
1462
1474
  }
1463
1475
  )
1464
1476
  ] }),
1465
- /* @__PURE__ */ jsxs("button", { className: "ps-tryon-submit", onClick: () => {
1477
+ /* @__PURE__ */ jsxs("button", { className: "ps-tryon-submit", onClick: async () => {
1466
1478
  if (saveToggle && saveFormName.trim()) {
1467
1479
  saveProfile(saveFormName.trim());
1468
1480
  }
1469
1481
  setSizingLoading(true);
1470
- submitSizing();
1471
1482
  setView("size-result");
1483
+ await submitSizing();
1472
1484
  }, children: [
1473
1485
  t("Get My Size"),
1474
1486
  " ",
@@ -2093,27 +2105,21 @@ const STYLES = `
2093
2105
  }
2094
2106
  .ps-tryon-unit-btn.ps-active { background: #bb945c; color: #111; }
2095
2107
 
2096
- /* Prominent unit switch (cm/in) */
2097
- .ps-tryon-unit-switch {
2098
- display: flex; gap: 0.42vw; margin-bottom: 0.83vw;
2099
- }
2100
- .ps-tryon-unit-switch-btn {
2101
- flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.16vw;
2102
- padding: 0.73vw 0.57vw;
2103
- border: 2px solid #333; border-radius: 0.73vw;
2104
- background: transparent; color: #666; cursor: pointer;
2105
- transition: all 0.25s ease; font-family: inherit;
2106
- }
2107
- .ps-tryon-unit-switch-btn:hover { border-color: #555; color: #999; }
2108
- .ps-tryon-unit-switch-btn.ps-active {
2109
- border-color: #bb945c; background: rgba(187,148,92,0.08); color: #bb945c;
2110
- box-shadow: 0 0 0 0.21vw rgba(187,148,92,0.08);
2111
- }
2112
- .ps-tryon-unit-switch-label {
2113
- font-size: 1.04vw; font-weight: 700; letter-spacing: 0.02em;
2114
- }
2115
- .ps-tryon-unit-switch-sub {
2116
- font-size: 0.52vw; font-weight: 500; opacity: 0.6;
2108
+ /* Unit tabs (cm / inches) */
2109
+ .ps-tryon-unit-tabs {
2110
+ display: flex; gap: 0; background: #1a1b1a; border: 1.5px solid #333;
2111
+ border-radius: 0.63vw; overflow: hidden; margin-bottom: 0.83vw;
2112
+ }
2113
+ .ps-tryon-unit-tab {
2114
+ flex: 1; padding: 0.57vw 0.83vw; background: transparent; border: none;
2115
+ color: #666; font-size: 0.78vw; font-weight: 700; cursor: pointer;
2116
+ transition: all 0.2s ease; font-family: inherit; letter-spacing: 0.04em;
2117
+ position: relative;
2118
+ }
2119
+ .ps-tryon-unit-tab:first-child { border-right: 1px solid #333; }
2120
+ .ps-tryon-unit-tab:hover { color: #999; background: rgba(255,255,255,0.03); }
2121
+ .ps-tryon-unit-tab.ps-active {
2122
+ background: #bb945c; color: #111;
2117
2123
  }
2118
2124
  .ps-tryon-section-label { font-size: 0.57vw; font-weight: 700; color: #bb945c; text-transform: uppercase; letter-spacing: 0.08em; margin: 0.21vw 0 0.1vw; }
2119
2125
  .ps-tryon-optional-section { border-top: 1px solid #333; padding-top: 0.52vw; margin-top: 0.31vw; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "3.13.0",
3
+ "version": "3.14.0",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",