@primestyleai/tryon 5.4.4 → 5.4.6
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 +108 -97
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -4139,105 +4139,116 @@ function SectionDetailView({
|
|
|
4139
4139
|
const displayLength = selectedLength || recLength;
|
|
4140
4140
|
const goodCount = fitRows.filter((r) => r.fit === "good").length;
|
|
4141
4141
|
const matchPercent = fitRows.length > 0 ? Math.round(goodCount / fitRows.length * 100) : 0;
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4142
|
+
const secAny = sectionResult;
|
|
4143
|
+
const backendLength = secAny?.length || displayLength;
|
|
4144
|
+
const backendSize = secAny?.size || displaySize;
|
|
4145
|
+
const backendAvailableSizes = secAny?.availableSizes || [];
|
|
4146
|
+
const backendAvailableLengths = secAny?.availableLengths || [];
|
|
4147
|
+
const finalDisplayLength = selectedLength || backendLength;
|
|
4148
|
+
const finalAllSizes = backendAvailableSizes.length > 0 ? backendAvailableSizes : allSizes;
|
|
4149
|
+
return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sec-detail", style: { padding: "1.5vw", display: "flex", flexDirection: "column", height: "100%", background: "#F8F9FA" }, children: [
|
|
4150
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
|
|
4151
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "0.75vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: t("Recommended Size") }),
|
|
4152
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "baseline", gap: "0.5vw", marginTop: "0.3vw", marginBottom: "0.4vw" }, children: [
|
|
4153
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: backendSize }),
|
|
4154
|
+
finalDisplayLength && /* @__PURE__ */ jsx("span", { style: { fontSize: "1.4vw", fontWeight: 400, color: "var(--ps-text-secondary)" }, children: finalDisplayLength })
|
|
4152
4155
|
] }),
|
|
4153
|
-
/* @__PURE__ */ jsxs("
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
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") })
|
|
4165
|
-
] }) }),
|
|
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
|
-
}) })
|
|
4180
|
-
] }),
|
|
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")
|
|
4156
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.4vw", marginBottom: "1.2vw" }, children: [
|
|
4157
|
+
/* @__PURE__ */ jsxs("svg", { width: "1vw", height: "1vw", viewBox: "0 0 16 16", fill: "none", children: [
|
|
4158
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "8", fill: "var(--ps-accent)" }),
|
|
4159
|
+
/* @__PURE__ */ jsx("path", { d: "M4.5 8L7 10.5L11.5 5.5", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
4160
|
+
] }),
|
|
4161
|
+
/* @__PURE__ */ jsxs("span", { style: { fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: [
|
|
4162
|
+
matchPercent,
|
|
4163
|
+
"% ",
|
|
4164
|
+
t("Match based on your silhouette profile")
|
|
4165
|
+
] })
|
|
4188
4166
|
] }),
|
|
4189
|
-
/* @__PURE__ */ jsx("div", { style: {
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
"
|
|
4193
|
-
{
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4167
|
+
fitRows.length > 0 && /* @__PURE__ */ jsx("div", { style: { background: "white", borderRadius: "0.5vw", border: "1px solid rgba(0,0,0,0.06)", overflow: "hidden", marginBottom: "1.2vw" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
|
|
4168
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
4169
|
+
/* @__PURE__ */ jsx("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: t("Measurement") }),
|
|
4170
|
+
/* @__PURE__ */ jsx("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: t("Your Body") }),
|
|
4171
|
+
/* @__PURE__ */ jsx("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: t("Garment Spec") }),
|
|
4172
|
+
/* @__PURE__ */ jsx("th", { style: { textAlign: "right", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: t("Fit Result") })
|
|
4173
|
+
] }) }),
|
|
4174
|
+
/* @__PURE__ */ jsx("tbody", { children: fitRows.map((row, i) => {
|
|
4175
|
+
const fitColor = row.fit === "good" ? "#2154EF" : row.fit.includes("tight") ? "#dc2626" : "#d97706";
|
|
4176
|
+
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)";
|
|
4177
|
+
return /* @__PURE__ */ jsxs("tr", { style: { borderBottom: i < fitRows.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
4178
|
+
/* @__PURE__ */ jsx("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: row.area }),
|
|
4179
|
+
/* @__PURE__ */ jsxs("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: [
|
|
4180
|
+
row.userNum,
|
|
4181
|
+
" ",
|
|
4182
|
+
unitLbl
|
|
4183
|
+
] }),
|
|
4184
|
+
/* @__PURE__ */ jsx("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: row.chartLabel }),
|
|
4185
|
+
/* @__PURE__ */ jsx("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ jsx("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: fitColor, background: fitBg, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: row.isLength ? lengthFitLabelFn(row.fit, t) : fitLabelFn(row.fit, t) }) })
|
|
4186
|
+
] }, i);
|
|
4187
|
+
}) })
|
|
4188
|
+
] }) }),
|
|
4189
|
+
finalAllSizes.length > 1 && /* @__PURE__ */ jsxs("div", { style: { marginBottom: "0.8vw" }, children: [
|
|
4190
|
+
/* @__PURE__ */ jsxs("span", { style: { fontSize: "0.6vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.1em", display: "block", marginBottom: "0.4vw" }, children: [
|
|
4191
|
+
t("Select"),
|
|
4192
|
+
" ",
|
|
4193
|
+
sectionName,
|
|
4194
|
+
" ",
|
|
4195
|
+
t("Size")
|
|
4196
|
+
] }),
|
|
4197
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: finalAllSizes.map((s) => {
|
|
4198
|
+
const isActive = s === displaySize;
|
|
4199
|
+
return /* @__PURE__ */ jsx(
|
|
4200
|
+
"button",
|
|
4201
|
+
{
|
|
4202
|
+
onClick: () => setSelectedSize(s === recSize ? null : s),
|
|
4203
|
+
style: {
|
|
4204
|
+
padding: "0.35vw 0.7vw",
|
|
4205
|
+
borderRadius: "0.35vw",
|
|
4206
|
+
fontSize: "0.7vw",
|
|
4207
|
+
fontWeight: 600,
|
|
4208
|
+
border: isActive ? "2px solid var(--ps-accent)" : "1.5px solid rgba(0,0,0,0.12)",
|
|
4209
|
+
background: isActive ? "var(--ps-accent)" : "transparent",
|
|
4210
|
+
color: isActive ? "white" : "var(--ps-text-primary)",
|
|
4211
|
+
cursor: "pointer",
|
|
4212
|
+
transition: "all 0.2s",
|
|
4213
|
+
fontFamily: "inherit",
|
|
4214
|
+
minWidth: "2vw",
|
|
4215
|
+
textAlign: "center"
|
|
4216
|
+
},
|
|
4217
|
+
children: s
|
|
4206
4218
|
},
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4219
|
+
s
|
|
4220
|
+
);
|
|
4221
|
+
}) })
|
|
4222
|
+
] }),
|
|
4223
|
+
(backendAvailableLengths.length > 0 || lengthSizes.length > 0) && /* @__PURE__ */ jsxs("div", { style: { marginBottom: "0.8vw" }, children: [
|
|
4224
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "0.6vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.1em", display: "block", marginBottom: "0.4vw" }, children: t("Length Adjustment") }),
|
|
4225
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: (backendAvailableLengths.length > 0 ? backendAvailableLengths : lengthSizes).map((s) => {
|
|
4226
|
+
const isActive = finalDisplayLength === s;
|
|
4227
|
+
return /* @__PURE__ */ jsx(
|
|
4228
|
+
"button",
|
|
4229
|
+
{
|
|
4230
|
+
onClick: () => setSelectedLength(s === backendLength ? null : s),
|
|
4231
|
+
style: {
|
|
4232
|
+
padding: "0.35vw 0.7vw",
|
|
4233
|
+
borderRadius: "0.35vw",
|
|
4234
|
+
fontSize: "0.7vw",
|
|
4235
|
+
fontWeight: 600,
|
|
4236
|
+
border: isActive ? "2px solid var(--ps-accent)" : "1.5px solid rgba(0,0,0,0.12)",
|
|
4237
|
+
background: isActive ? "var(--ps-accent)" : "transparent",
|
|
4238
|
+
color: isActive ? "white" : "var(--ps-text-primary)",
|
|
4239
|
+
cursor: "pointer",
|
|
4240
|
+
transition: "all 0.2s",
|
|
4241
|
+
fontFamily: "inherit"
|
|
4242
|
+
},
|
|
4243
|
+
children: s
|
|
4232
4244
|
},
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
}) })
|
|
4245
|
+
s
|
|
4246
|
+
);
|
|
4247
|
+
}) })
|
|
4248
|
+
] })
|
|
4238
4249
|
] }),
|
|
4239
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between",
|
|
4240
|
-
/* @__PURE__ */ jsxs("button", { className: "ps-bp-back-btn", onClick: onBack, type: "button", style: { fontSize: "0.
|
|
4250
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", paddingTop: "0.6vw", borderTop: "1px solid rgba(0,0,0,0.06)", marginTop: "auto" }, children: [
|
|
4251
|
+
/* @__PURE__ */ jsxs("button", { className: "ps-bp-back-btn", onClick: onBack, type: "button", style: { fontSize: "0.7vw" }, children: [
|
|
4241
4252
|
/* @__PURE__ */ jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
4242
4253
|
" ",
|
|
4243
4254
|
t("Back to sections")
|
|
@@ -4247,9 +4258,9 @@ function SectionDetailView({
|
|
|
4247
4258
|
{
|
|
4248
4259
|
onClick: onBack,
|
|
4249
4260
|
style: {
|
|
4250
|
-
padding: "0.
|
|
4261
|
+
padding: "0.45vw 1.2vw",
|
|
4251
4262
|
borderRadius: "0.4vw",
|
|
4252
|
-
fontSize: "0.
|
|
4263
|
+
fontSize: "0.7vw",
|
|
4253
4264
|
fontWeight: 600,
|
|
4254
4265
|
background: "var(--ps-accent)",
|
|
4255
4266
|
color: "white",
|
|
@@ -4264,7 +4275,7 @@ function SectionDetailView({
|
|
|
4264
4275
|
onMouseEnter: (e) => e.currentTarget.style.opacity = "0.9",
|
|
4265
4276
|
onMouseLeave: (e) => e.currentTarget.style.opacity = "1",
|
|
4266
4277
|
children: [
|
|
4267
|
-
t("
|
|
4278
|
+
t("Continue"),
|
|
4268
4279
|
" →"
|
|
4269
4280
|
]
|
|
4270
4281
|
}
|