@primestyleai/tryon 5.4.4 → 5.4.5

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