@primestyleai/tryon 5.4.3 → 5.4.4

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 +123 -71
  2. package/package.json +1 -1
@@ -4020,7 +4020,6 @@ function SectionDetailView({
4020
4020
  return [...new Set(raw)];
4021
4021
  }, [section, sizeColIdx, sizeHeader]);
4022
4022
  const displaySize = selectedSize || recSize;
4023
- const isRecommended = displaySize === recSize;
4024
4023
  const chartRangeFor = useCallback((measurement, size) => {
4025
4024
  const b = measurement.toLowerCase().trim();
4026
4025
  const preferCm = unitLbl === "cm" || unitLbl === "";
@@ -4137,87 +4136,140 @@ function SectionDetailView({
4137
4136
  return { area: m.measurement, userNum, chartLabel: cleanNumFn(chartLabel), fit, isLength: false };
4138
4137
  });
4139
4138
  }, [sectionResult, lengthEntry, userMeasurements, displaySize, recSize, chartRangeFor, selectedLength, recLength]);
4140
- return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sec-detail", children: [
4141
- /* @__PURE__ */ jsx("div", { style: { marginBottom: "0.3vw" }, children: /* @__PURE__ */ jsxs("button", { className: "ps-bp-back-btn", onClick: onBack, type: "button", children: [
4142
- /* @__PURE__ */ jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
4143
- " ",
4144
- t("Back to sections")
4145
- ] }) }),
4146
- /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sec-detail-header", children: [
4147
- /* @__PURE__ */ jsx("div", { className: "ps-tryon-sec-detail-icon", children: /* @__PURE__ */ jsx(GarmentIcon, { name: sectionName, size: 28 }) }),
4148
- /* @__PURE__ */ jsx("span", { className: "ps-tryon-sec-detail-name", children: sectionName })
4139
+ const displayLength = selectedLength || recLength;
4140
+ const goodCount = fitRows.filter((r) => r.fit === "good").length;
4141
+ const matchPercent = fitRows.length > 0 ? Math.round(goodCount / fitRows.length * 100) : 0;
4142
+ return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sec-detail", style: { padding: "1vw" }, children: [
4143
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "0.55vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: t("Recommended Size") }),
4144
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "baseline", gap: "0.4vw", marginTop: "0.2vw", marginBottom: "0.3vw" }, children: [
4145
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "2.8vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: displaySize }),
4146
+ displayLength && /* @__PURE__ */ jsx("span", { style: { fontSize: "1.1vw", fontWeight: 400, color: "var(--ps-text-secondary)" }, children: displayLength })
4147
+ ] }),
4148
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.3vw", marginBottom: "0.8vw" }, children: [
4149
+ /* @__PURE__ */ jsxs("svg", { width: "0.8vw", height: "0.8vw", viewBox: "0 0 16 16", fill: "none", children: [
4150
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "8", fill: "var(--ps-accent)" }),
4151
+ /* @__PURE__ */ jsx("path", { d: "M4.5 8L7 10.5L11.5 5.5", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
4152
+ ] }),
4153
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-secondary)" }, children: [
4154
+ matchPercent,
4155
+ "% ",
4156
+ t("Match based on your silhouette profile")
4157
+ ] })
4149
4158
  ] }),
4150
- /* @__PURE__ */ jsx("div", { className: "ps-tryon-sr-size-hero", children: (() => {
4151
- const overallFit = fitRows.length > 0 ? fitRows.every((r) => r.fit === "good") ? "good" : fitRows.some((r) => r.fit.includes("tight")) ? "tight" : "loose" : "good";
4152
- const fitLabel = overallFit === "good" ? t("Perfect Fit") : overallFit === "tight" ? t("Tight Fit") : t("Relaxed Fit");
4153
- const fitColor = overallFit === "good" ? "#16a34a" : overallFit === "tight" ? "#dc2626" : "#d97706";
4154
- return /* @__PURE__ */ jsxs(Fragment, { children: [
4155
- /* @__PURE__ */ jsx("span", { style: { fontSize: "0.65vw", fontWeight: 700, color: fitColor, textTransform: "uppercase", letterSpacing: "0.1em" }, children: fitLabel }),
4156
- /* @__PURE__ */ jsx("span", { className: "ps-tryon-sr-size-letter", children: displaySize }),
4157
- /* @__PURE__ */ jsx("div", { className: "ps-tryon-sr-size-meta", children: /* @__PURE__ */ jsx("span", { className: `ps-tryon-sr-size-label${isRecommended ? "" : " ps-not-rec"}`, children: isRecommended ? t("RECOMMENDED SIZE") : t("NOT RECOMMENDED") }) })
4158
- ] });
4159
- })() }),
4160
- fitRows.length > 0 && /* @__PURE__ */ jsxs("table", { className: "ps-tryon-sr-fit-table", children: [
4161
- /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
4162
- /* @__PURE__ */ jsx("th", {}),
4163
- /* @__PURE__ */ jsx("th", { children: t("You") }),
4164
- /* @__PURE__ */ jsx("th", { children: t("Garment") }),
4165
- /* @__PURE__ */ jsx("th", { children: t("Your fit") })
4159
+ fitRows.length > 0 && /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", marginBottom: "0.8vw" }, children: [
4160
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { style: { borderBottom: "1px solid rgba(0,0,0,0.08)" }, children: [
4161
+ /* @__PURE__ */ jsx("th", { style: { textAlign: "left", padding: "0.3vw 0", fontSize: "0.5vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: t("Measurement") }),
4162
+ /* @__PURE__ */ jsx("th", { style: { textAlign: "left", padding: "0.3vw 0", fontSize: "0.5vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: t("Your Body") }),
4163
+ /* @__PURE__ */ jsx("th", { style: { textAlign: "left", padding: "0.3vw 0", fontSize: "0.5vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: t("Garment Spec") }),
4164
+ /* @__PURE__ */ jsx("th", { style: { textAlign: "right", padding: "0.3vw 0", fontSize: "0.5vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: t("Fit Result") })
4166
4165
  ] }) }),
4167
- /* @__PURE__ */ jsx("tbody", { children: fitRows.map((row, i) => /* @__PURE__ */ jsxs("tr", { children: [
4168
- /* @__PURE__ */ jsx("td", { className: "ps-tryon-sr-ft-area", children: row.area }),
4169
- /* @__PURE__ */ jsxs("td", { className: "ps-tryon-sr-ft-you", children: [
4170
- row.userNum,
4171
- " ",
4172
- unitLbl
4173
- ] }),
4174
- /* @__PURE__ */ jsx("td", { className: "ps-tryon-sr-ft-garment", children: row.chartLabel }),
4175
- /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("span", { className: `ps-tryon-sr-fit-status ps-fit-${row.fit}`, children: row.isLength ? lengthFitLabelFn(row.fit, t) : fitLabelFn(row.fit, t) }) })
4176
- ] }, i)) })
4166
+ /* @__PURE__ */ jsx("tbody", { children: fitRows.map((row, i) => {
4167
+ const fitColor = row.fit === "good" ? "#2154EF" : row.fit.includes("tight") ? "#dc2626" : "#d97706";
4168
+ const fitBg = row.fit === "good" ? "rgba(33,84,239,0.08)" : row.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
4169
+ return /* @__PURE__ */ jsxs("tr", { style: { borderBottom: "1px solid rgba(0,0,0,0.04)" }, children: [
4170
+ /* @__PURE__ */ jsx("td", { style: { padding: "0.4vw 0", fontSize: "0.65vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: row.area }),
4171
+ /* @__PURE__ */ jsxs("td", { style: { padding: "0.4vw 0", fontSize: "0.65vw", color: "var(--ps-text-secondary)" }, children: [
4172
+ row.userNum,
4173
+ " ",
4174
+ unitLbl
4175
+ ] }),
4176
+ /* @__PURE__ */ jsx("td", { style: { padding: "0.4vw 0", fontSize: "0.65vw", color: "var(--ps-text-secondary)" }, children: row.chartLabel }),
4177
+ /* @__PURE__ */ jsx("td", { style: { padding: "0.4vw 0", textAlign: "right" }, children: /* @__PURE__ */ jsx("span", { style: { fontSize: "0.5vw", fontWeight: 600, color: fitColor, background: fitBg, borderRadius: "1vw", padding: "0.12vw 0.4vw", whiteSpace: "nowrap" }, children: row.isLength ? lengthFitLabelFn(row.fit, t) : fitLabelFn(row.fit, t) }) })
4178
+ ] }, i);
4179
+ }) })
4177
4180
  ] }),
4178
- allSizes.length > 1 && (() => {
4179
- const recIdx = allSizes.indexOf(recSize);
4180
- const tightSize = recIdx > 0 ? allSizes[recIdx - 1] : null;
4181
- const looseSize = recIdx < allSizes.length - 1 ? allSizes[recIdx + 1] : null;
4182
- const chips = [tightSize, recSize, looseSize].filter(Boolean);
4183
- return /* @__PURE__ */ jsx("div", { className: "ps-tryon-sr-chips", children: chips.map((s) => /* @__PURE__ */ jsxs(
4184
- "button",
4185
- {
4186
- className: `ps-tryon-sr-chip${s === displaySize ? " ps-active" : ""}${s === recSize && s !== displaySize ? " ps-recommended" : ""}`,
4187
- onClick: () => setSelectedSize(s === recSize ? null : s),
4188
- children: [
4189
- s,
4190
- s === recSize && /* @__PURE__ */ jsx("span", { className: "ps-tryon-sr-rec-dot" }),
4191
- s !== recSize && /* @__PURE__ */ jsx("span", { className: "ps-tryon-sr-chip-hint", children: s === tightSize ? t("tighter") : t("looser") })
4192
- ]
4193
- },
4194
- s
4195
- )) });
4196
- })(),
4197
- lengthSizes.length > 0 && /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sec-length-row", children: [
4198
- /* @__PURE__ */ jsx("span", { className: "ps-tryon-sec-length-label", children: t("Length") }),
4199
- /* @__PURE__ */ jsx("div", { className: "ps-tryon-sr-chips", children: lengthSizes.map((s) => {
4200
- const active = (selectedLength || recLength) === s;
4201
- const isRec = s === recLength;
4202
- return /* @__PURE__ */ jsxs(
4181
+ allSizes.length > 1 && /* @__PURE__ */ jsxs("div", { style: { marginBottom: "0.6vw" }, children: [
4182
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.5vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.1em", display: "block", marginBottom: "0.3vw" }, children: [
4183
+ t("Select"),
4184
+ " ",
4185
+ sectionName,
4186
+ " ",
4187
+ t("Size")
4188
+ ] }),
4189
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: "0.25vw", flexWrap: "wrap" }, children: allSizes.map((s) => {
4190
+ const isActive = s === displaySize;
4191
+ return /* @__PURE__ */ jsx(
4192
+ "button",
4193
+ {
4194
+ onClick: () => setSelectedSize(s === recSize ? null : s),
4195
+ style: {
4196
+ padding: "0.25vw 0.6vw",
4197
+ borderRadius: "0.3vw",
4198
+ fontSize: "0.6vw",
4199
+ fontWeight: 600,
4200
+ border: isActive ? "1.5px solid var(--ps-accent)" : "1px solid rgba(0,0,0,0.12)",
4201
+ background: isActive ? "var(--ps-accent)" : "transparent",
4202
+ color: isActive ? "white" : "var(--ps-text-primary)",
4203
+ cursor: "pointer",
4204
+ transition: "all 0.2s",
4205
+ fontFamily: "inherit"
4206
+ },
4207
+ children: s
4208
+ },
4209
+ s
4210
+ );
4211
+ }) })
4212
+ ] }),
4213
+ lengthSizes.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginBottom: "0.6vw" }, children: [
4214
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "0.5vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.1em", display: "block", marginBottom: "0.3vw" }, children: t("Length Adjustment") }),
4215
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: "0.25vw", flexWrap: "wrap" }, children: lengthSizes.map((s) => {
4216
+ const isActive = (selectedLength || recLength) === s;
4217
+ return /* @__PURE__ */ jsx(
4203
4218
  "button",
4204
4219
  {
4205
- className: `ps-tryon-sr-chip${active ? " ps-active" : ""}${isRec && !active ? " ps-recommended" : ""}`,
4206
4220
  onClick: () => setSelectedLength(s === recLength ? null : s),
4207
- children: [
4208
- s,
4209
- isRec && /* @__PURE__ */ jsx("span", { className: "ps-tryon-sr-rec-dot" })
4210
- ]
4221
+ style: {
4222
+ padding: "0.25vw 0.6vw",
4223
+ borderRadius: "0.3vw",
4224
+ fontSize: "0.6vw",
4225
+ fontWeight: 600,
4226
+ border: isActive ? "1.5px solid var(--ps-accent)" : "1px solid rgba(0,0,0,0.12)",
4227
+ background: isActive ? "var(--ps-accent)" : "transparent",
4228
+ color: isActive ? "white" : "var(--ps-text-primary)",
4229
+ cursor: "pointer",
4230
+ transition: "all 0.2s",
4231
+ fontFamily: "inherit"
4232
+ },
4233
+ children: s
4211
4234
  },
4212
4235
  s
4213
4236
  );
4214
4237
  }) })
4215
4238
  ] }),
4216
- /* @__PURE__ */ jsx("div", { style: { marginTop: "0.5vw" }, children: /* @__PURE__ */ jsxs("button", { className: "ps-bp-back-btn", onClick: onBack, type: "button", children: [
4217
- /* @__PURE__ */ jsx("span", { className: "ps-bp-back-arrow", children: "" }),
4218
- " ",
4219
- t("Back to sections")
4220
- ] }) })
4239
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginTop: "0.5vw", paddingTop: "0.4vw", borderTop: "1px solid rgba(0,0,0,0.06)" }, children: [
4240
+ /* @__PURE__ */ jsxs("button", { className: "ps-bp-back-btn", onClick: onBack, type: "button", style: { fontSize: "0.55vw" }, children: [
4241
+ /* @__PURE__ */ jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
4242
+ " ",
4243
+ t("Back to sections")
4244
+ ] }),
4245
+ /* @__PURE__ */ jsxs(
4246
+ "button",
4247
+ {
4248
+ onClick: onBack,
4249
+ style: {
4250
+ padding: "0.35vw 1vw",
4251
+ borderRadius: "0.4vw",
4252
+ fontSize: "0.6vw",
4253
+ fontWeight: 600,
4254
+ background: "var(--ps-accent)",
4255
+ color: "white",
4256
+ border: "none",
4257
+ cursor: "pointer",
4258
+ fontFamily: "inherit",
4259
+ display: "flex",
4260
+ alignItems: "center",
4261
+ gap: "0.3vw",
4262
+ transition: "opacity 0.2s"
4263
+ },
4264
+ onMouseEnter: (e) => e.currentTarget.style.opacity = "0.9",
4265
+ onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
4266
+ children: [
4267
+ t("Save and Continue"),
4268
+ " →"
4269
+ ]
4270
+ }
4271
+ )
4272
+ ] })
4221
4273
  ] });
4222
4274
  }
4223
4275
  function SizeResultView({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.4.3",
3
+ "version": "5.4.4",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",