@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.
- package/dist/react/index.js +123 -71
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -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
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
/* @__PURE__ */ jsx("
|
|
4148
|
-
|
|
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__ */
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
/* @__PURE__ */ jsx("
|
|
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) =>
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
" ",
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
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
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
"
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
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
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
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__ */
|
|
4217
|
-
/* @__PURE__ */
|
|
4218
|
-
|
|
4219
|
-
|
|
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({
|