@primestyleai/tryon 2.0.2 → 2.0.3
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 +90 -79
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -187,7 +187,8 @@ function PrimeStyleTryon({
|
|
|
187
187
|
const [sizingUnit, setSizingUnit] = useState(imperial ? "in" : "cm");
|
|
188
188
|
const [heightUnit, setHeightUnit] = useState(imperial ? "ft" : "cm");
|
|
189
189
|
const [weightUnit, setWeightUnit] = useState(imperial ? "lbs" : "kg");
|
|
190
|
-
const
|
|
190
|
+
const formRef = useRef({});
|
|
191
|
+
const [formGender, setFormGender] = useState("male");
|
|
191
192
|
const [profiles, setProfiles] = useState(() => lsGet("profiles", []));
|
|
192
193
|
const [history, setHistory] = useState(() => lsGet("history", []));
|
|
193
194
|
const [activeProfileId, setActiveProfileId] = useState(null);
|
|
@@ -290,7 +291,8 @@ function PrimeStyleTryon({
|
|
|
290
291
|
setSizingResult(null);
|
|
291
292
|
setSizeGuide(null);
|
|
292
293
|
setProfileSaved(false);
|
|
293
|
-
|
|
294
|
+
formRef.current = {};
|
|
295
|
+
setFormGender("male");
|
|
294
296
|
unsubRef.current?.();
|
|
295
297
|
unsubRef.current = null;
|
|
296
298
|
if (pollingRef.current) {
|
|
@@ -364,23 +366,23 @@ function PrimeStyleTryon({
|
|
|
364
366
|
};
|
|
365
367
|
if (sizeGuide?.found) payload.sizeGuide = sizeGuide;
|
|
366
368
|
if (sizingMethod === "exact") {
|
|
367
|
-
const m = { gender:
|
|
368
|
-
if (
|
|
369
|
-
if (
|
|
369
|
+
const m = { gender: formRef.current.gender || "male" };
|
|
370
|
+
if (formRef.current.height) m.heightCm = heightUnit === "ft" ? ftInToCm(parseFloat(formRef.current.heightFeet || "0"), parseFloat(formRef.current.heightInches || "0")) : parseFloat(formRef.current.height);
|
|
371
|
+
if (formRef.current.weight) m.weightKg = weightUnit === "lbs" ? lbsToKg(parseFloat(formRef.current.weight)) : parseFloat(formRef.current.weight);
|
|
370
372
|
const keys = ["chest", "bust", "waist", "hips", "shoulderWidth", "sleeveLength", "inseam", "neckCircumference", "footLengthCm"];
|
|
371
373
|
for (const k of keys) {
|
|
372
|
-
if (
|
|
374
|
+
if (formRef.current[k]) m[k] = sizingUnit === "in" ? inToCm(parseFloat(formRef.current[k])) : parseFloat(formRef.current[k]);
|
|
373
375
|
}
|
|
374
|
-
if (
|
|
375
|
-
if (
|
|
376
|
-
if (
|
|
377
|
-
if (
|
|
376
|
+
if (formRef.current.shoeEU) m.shoeEU = formRef.current.shoeEU;
|
|
377
|
+
if (formRef.current.shoeUS) m.shoeUS = formRef.current.shoeUS;
|
|
378
|
+
if (formRef.current.shoeUK) m.shoeUK = formRef.current.shoeUK;
|
|
379
|
+
if (formRef.current.fitPreference) m.fitPreference = formRef.current.fitPreference;
|
|
378
380
|
payload.measurements = m;
|
|
379
381
|
} else {
|
|
380
382
|
payload.quickEstimate = {
|
|
381
|
-
heightCm: heightUnit === "ft" ? ftInToCm(parseFloat(
|
|
382
|
-
weightKg: weightUnit === "lbs" ? lbsToKg(parseFloat(
|
|
383
|
-
gender:
|
|
383
|
+
heightCm: heightUnit === "ft" ? ftInToCm(parseFloat(formRef.current.heightFeet || "0"), parseFloat(formRef.current.heightInches || "0")) : parseFloat(formRef.current.height || "0"),
|
|
384
|
+
weightKg: weightUnit === "lbs" ? lbsToKg(parseFloat(formRef.current.weight || "0")) : parseFloat(formRef.current.weight || "0"),
|
|
385
|
+
gender: formRef.current.gender || "male"
|
|
384
386
|
};
|
|
385
387
|
}
|
|
386
388
|
try {
|
|
@@ -395,7 +397,7 @@ function PrimeStyleTryon({
|
|
|
395
397
|
}
|
|
396
398
|
} catch {
|
|
397
399
|
}
|
|
398
|
-
}, [apiUrl, sizingMethod, sizingCountry,
|
|
400
|
+
}, [apiUrl, sizingMethod, sizingCountry, heightUnit, weightUnit, sizingUnit, sizeGuide, productTitle]);
|
|
399
401
|
const handleSubmit = useCallback(async () => {
|
|
400
402
|
if (!selectedFile || !apiRef.current || !sseRef.current) {
|
|
401
403
|
const msg = !apiRef.current ? "Missing NEXT_PUBLIC_PRIMESTYLE_API_KEY" : "No file selected";
|
|
@@ -492,29 +494,30 @@ function PrimeStyleTryon({
|
|
|
492
494
|
if (p.shoeUS) fd.shoeUS = p.shoeUS;
|
|
493
495
|
if (p.shoeUK) fd.shoeUK = p.shoeUK;
|
|
494
496
|
if (p.fitPreference) fd.fitPreference = p.fitPreference;
|
|
495
|
-
|
|
497
|
+
formRef.current = fd;
|
|
498
|
+
setFormGender(fd.gender || "male");
|
|
496
499
|
}, [profiles]);
|
|
497
500
|
const saveProfile = useCallback((name) => {
|
|
498
501
|
const id = activeProfileId || `p_${Date.now()}`;
|
|
499
502
|
const p = {
|
|
500
503
|
id,
|
|
501
504
|
name,
|
|
502
|
-
gender:
|
|
503
|
-
heightCm:
|
|
504
|
-
weightKg:
|
|
505
|
-
chest:
|
|
506
|
-
bust:
|
|
507
|
-
waist:
|
|
508
|
-
hips:
|
|
509
|
-
shoulderWidth:
|
|
510
|
-
sleeveLength:
|
|
511
|
-
inseam:
|
|
512
|
-
neckCircumference:
|
|
513
|
-
footLengthCm:
|
|
514
|
-
shoeEU:
|
|
515
|
-
shoeUS:
|
|
516
|
-
shoeUK:
|
|
517
|
-
fitPreference:
|
|
505
|
+
gender: formRef.current.gender || "male",
|
|
506
|
+
heightCm: formRef.current.height ? parseFloat(formRef.current.height) : void 0,
|
|
507
|
+
weightKg: formRef.current.weight ? parseFloat(formRef.current.weight) : void 0,
|
|
508
|
+
chest: formRef.current.chest ? parseFloat(formRef.current.chest) : void 0,
|
|
509
|
+
bust: formRef.current.bust ? parseFloat(formRef.current.bust) : void 0,
|
|
510
|
+
waist: formRef.current.waist ? parseFloat(formRef.current.waist) : void 0,
|
|
511
|
+
hips: formRef.current.hips ? parseFloat(formRef.current.hips) : void 0,
|
|
512
|
+
shoulderWidth: formRef.current.shoulderWidth ? parseFloat(formRef.current.shoulderWidth) : void 0,
|
|
513
|
+
sleeveLength: formRef.current.sleeveLength ? parseFloat(formRef.current.sleeveLength) : void 0,
|
|
514
|
+
inseam: formRef.current.inseam ? parseFloat(formRef.current.inseam) : void 0,
|
|
515
|
+
neckCircumference: formRef.current.neckCircumference ? parseFloat(formRef.current.neckCircumference) : void 0,
|
|
516
|
+
footLengthCm: formRef.current.footLengthCm ? parseFloat(formRef.current.footLengthCm) : void 0,
|
|
517
|
+
shoeEU: formRef.current.shoeEU,
|
|
518
|
+
shoeUS: formRef.current.shoeUS,
|
|
519
|
+
shoeUK: formRef.current.shoeUK,
|
|
520
|
+
fitPreference: formRef.current.fitPreference,
|
|
518
521
|
createdAt: Date.now()
|
|
519
522
|
};
|
|
520
523
|
setProfiles((prev) => {
|
|
@@ -528,7 +531,7 @@ function PrimeStyleTryon({
|
|
|
528
531
|
});
|
|
529
532
|
setActiveProfileId(id);
|
|
530
533
|
setProfileSaved(true);
|
|
531
|
-
}, [activeProfileId
|
|
534
|
+
}, [activeProfileId]);
|
|
532
535
|
const saveHistoryEntry = useCallback(() => {
|
|
533
536
|
const entry = {
|
|
534
537
|
id: `h_${Date.now()}`,
|
|
@@ -554,7 +557,7 @@ function PrimeStyleTryon({
|
|
|
554
557
|
}
|
|
555
558
|
}, [view]);
|
|
556
559
|
const updateField = useCallback((key, val) => {
|
|
557
|
-
|
|
560
|
+
formRef.current[key] = val;
|
|
558
561
|
}, []);
|
|
559
562
|
const shoeField = useMemo(() => {
|
|
560
563
|
const map = {
|
|
@@ -619,8 +622,8 @@ function PrimeStyleTryon({
|
|
|
619
622
|
{
|
|
620
623
|
type,
|
|
621
624
|
placeholder,
|
|
622
|
-
|
|
623
|
-
|
|
625
|
+
defaultValue: formRef.current[fieldKey] || "",
|
|
626
|
+
onInput: (e) => updateField(fieldKey, e.target.value)
|
|
624
627
|
}
|
|
625
628
|
),
|
|
626
629
|
unit && /* @__PURE__ */ jsx("span", { className: "ps-tryon-input-unit", children: unit })
|
|
@@ -754,58 +757,62 @@ function PrimeStyleTryon({
|
|
|
754
757
|
] });
|
|
755
758
|
}
|
|
756
759
|
function SizingFormView() {
|
|
757
|
-
const isFemale =
|
|
760
|
+
const isFemale = formGender === "female";
|
|
761
|
+
const isCm = sizingUnit === "cm";
|
|
758
762
|
return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sizing-form", children: [
|
|
759
763
|
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
760
|
-
/* @__PURE__ */ jsx("label", { children: "
|
|
761
|
-
/* @__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: c.label }, c.code)) })
|
|
762
|
-
] }),
|
|
763
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
764
|
-
/* @__PURE__ */ jsx("label", { children: "Gender" }),
|
|
764
|
+
/* @__PURE__ */ jsx("label", { children: "I'm shopping for" }),
|
|
765
765
|
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-unit-toggle", children: [
|
|
766
|
-
/* @__PURE__ */ jsx("button", { className: `ps-tryon-unit-btn${
|
|
767
|
-
|
|
766
|
+
/* @__PURE__ */ jsx("button", { className: `ps-tryon-unit-btn${!isFemale ? " ps-active" : ""}`, onClick: () => {
|
|
767
|
+
updateField("gender", "male");
|
|
768
|
+
setFormGender("male");
|
|
769
|
+
}, children: "Men's" }),
|
|
770
|
+
/* @__PURE__ */ jsx("button", { className: `ps-tryon-unit-btn${isFemale ? " ps-active" : ""}`, onClick: () => {
|
|
771
|
+
updateField("gender", "female");
|
|
772
|
+
setFormGender("female");
|
|
773
|
+
}, children: "Women's" })
|
|
768
774
|
] })
|
|
769
775
|
] }),
|
|
776
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
777
|
+
/* @__PURE__ */ jsx("label", { children: "Sizing region" }),
|
|
778
|
+
/* @__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: c.label }, c.code)) })
|
|
779
|
+
] }),
|
|
780
|
+
sizingMethod === "exact" && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(UnitToggle, { options: [{ label: "cm", value: "cm" }, { label: "in", value: "in" }], value: sizingUnit, onChange: setSizingUnit }) }),
|
|
770
781
|
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
771
782
|
/* @__PURE__ */ jsx("label", { children: "Height" }),
|
|
772
783
|
heightUnit === "ft" ? /* @__PURE__ */ jsxs("div", { className: "ps-tryon-height-ft", children: [
|
|
773
|
-
/* @__PURE__ */ jsx("input", { type: "number", placeholder: "5",
|
|
784
|
+
/* @__PURE__ */ jsx("input", { type: "number", placeholder: "5", defaultValue: formRef.current.heightFeet || "", onInput: (e) => updateField("heightFeet", e.target.value) }),
|
|
774
785
|
/* @__PURE__ */ jsx("span", { children: "ft" }),
|
|
775
|
-
/* @__PURE__ */ jsx("input", { type: "number", placeholder: "4",
|
|
786
|
+
/* @__PURE__ */ jsx("input", { type: "number", placeholder: "4", defaultValue: formRef.current.heightInches || "", onInput: (e) => updateField("heightInches", e.target.value) }),
|
|
776
787
|
/* @__PURE__ */ jsx("span", { children: "in" })
|
|
777
|
-
] }) : /* @__PURE__ */ jsx("input", { type: "number", placeholder: "e.g. 175",
|
|
788
|
+
] }) : /* @__PURE__ */ jsx("input", { type: "number", placeholder: "e.g. 175", defaultValue: formRef.current.height || "", onInput: (e) => updateField("height", e.target.value) }),
|
|
778
789
|
/* @__PURE__ */ jsx(UnitToggle, { options: [{ label: "cm", value: "cm" }, { label: "ft", value: "ft" }], value: heightUnit, onChange: setHeightUnit })
|
|
779
790
|
] }),
|
|
780
|
-
/* @__PURE__ */ jsxs(
|
|
781
|
-
/* @__PURE__ */ jsx("label", { children: "Weight" }),
|
|
782
|
-
/* @__PURE__ */ jsx("input", { type: "number", placeholder: weightUnit === "lbs" ? "e.g. 170" : "e.g. 75", value: formData.weight || "", onChange: (e) => updateField("weight", e.target.value) }),
|
|
783
|
-
/* @__PURE__ */ jsx(UnitToggle, { options: [{ label: "kg", value: "kg" }, { label: "lbs", value: "lbs" }], value: weightUnit, onChange: setWeightUnit })
|
|
784
|
-
] }),
|
|
785
|
-
sizingMethod === "exact" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
786
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
787
|
-
/* @__PURE__ */ jsx("label", { children: "Measurements" }),
|
|
788
|
-
/* @__PURE__ */ jsx(UnitToggle, { options: [{ label: "cm", value: "cm" }, { label: "in", value: "in" }], value: sizingUnit, onChange: setSizingUnit })
|
|
789
|
-
] }),
|
|
791
|
+
sizingMethod === "exact" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
790
792
|
isFemale ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
791
|
-
/* @__PURE__ */ jsx(InputRow, { label: "Bust", fieldKey: "bust", placeholder: "e.g.
|
|
792
|
-
/* @__PURE__ */ jsx(InputRow, { label: "Waist", fieldKey: "waist", placeholder: "e.g. 70", type: "number", unit: sizingUnit }),
|
|
793
|
-
/* @__PURE__ */ jsx(InputRow, { label: "Hips", fieldKey: "hips", placeholder: "e.g.
|
|
793
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Bust *", fieldKey: "bust", placeholder: isCm ? "e.g. 88" : "e.g. 35", type: "number", unit: sizingUnit }),
|
|
794
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Waist *", fieldKey: "waist", placeholder: isCm ? "e.g. 70" : "e.g. 28", type: "number", unit: sizingUnit }),
|
|
795
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Hips *", fieldKey: "hips", placeholder: isCm ? "e.g. 96" : "e.g. 38", type: "number", unit: sizingUnit }),
|
|
796
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Shoulders", fieldKey: "shoulderWidth", placeholder: isCm ? "e.g. 39" : "e.g. 15", type: "number", unit: sizingUnit }),
|
|
797
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Inseam", fieldKey: "inseam", placeholder: isCm ? "e.g. 76" : "e.g. 30", type: "number", unit: sizingUnit })
|
|
794
798
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
795
|
-
/* @__PURE__ */ jsx(InputRow, { label: "Chest", fieldKey: "chest", placeholder: "e.g.
|
|
796
|
-
/* @__PURE__ */ jsx(InputRow, { label: "Waist", fieldKey: "waist", placeholder: "e.g.
|
|
797
|
-
/* @__PURE__ */ jsx(InputRow, { label: "
|
|
799
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Chest *", fieldKey: "chest", placeholder: isCm ? "e.g. 104" : "e.g. 41", type: "number", unit: sizingUnit }),
|
|
800
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Waist *", fieldKey: "waist", placeholder: isCm ? "e.g. 84" : "e.g. 33", type: "number", unit: sizingUnit }),
|
|
801
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Shoulders", fieldKey: "shoulderWidth", placeholder: isCm ? "e.g. 46" : "e.g. 18", type: "number", unit: sizingUnit }),
|
|
802
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Sleeve", fieldKey: "sleeveLength", placeholder: isCm ? "e.g. 64" : "e.g. 25", type: "number", unit: sizingUnit }),
|
|
803
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Inseam", fieldKey: "inseam", placeholder: isCm ? "e.g. 81" : "e.g. 32", type: "number", unit: sizingUnit })
|
|
798
804
|
] }),
|
|
799
|
-
/* @__PURE__ */ jsx(InputRow, { label: "Shoulder Width", fieldKey: "shoulderWidth", placeholder: "e.g. 45", type: "number", unit: sizingUnit }),
|
|
800
|
-
/* @__PURE__ */ jsx(InputRow, { label: "Sleeve Length", fieldKey: "sleeveLength", placeholder: "e.g. 65", type: "number", unit: sizingUnit }),
|
|
801
|
-
/* @__PURE__ */ jsx(InputRow, { label: "Inseam", fieldKey: "inseam", placeholder: "e.g. 80", type: "number", unit: sizingUnit }),
|
|
802
805
|
isFemale && /* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
803
|
-
/* @__PURE__ */ jsx("label", { children: "Fit
|
|
806
|
+
/* @__PURE__ */ jsx("label", { children: "Fit type" }),
|
|
804
807
|
/* @__PURE__ */ jsx("div", { className: "ps-tryon-unit-toggle", children: ["petite", "standard", "tall", "plus"].map((fp) => /* @__PURE__ */ jsx(
|
|
805
808
|
"button",
|
|
806
809
|
{
|
|
807
|
-
className: `ps-tryon-unit-btn${(
|
|
808
|
-
onClick: () =>
|
|
810
|
+
className: `ps-tryon-unit-btn${(formRef.current.fitPreference || "standard") === fp ? " ps-active" : ""}`,
|
|
811
|
+
onClick: (e) => {
|
|
812
|
+
updateField("fitPreference", fp);
|
|
813
|
+
const btns = e.target.parentElement.querySelectorAll(".ps-tryon-unit-btn");
|
|
814
|
+
btns.forEach((b) => b.classList.toggle("ps-active", b.textContent?.toLowerCase() === fp));
|
|
815
|
+
},
|
|
809
816
|
children: fp.charAt(0).toUpperCase() + fp.slice(1)
|
|
810
817
|
},
|
|
811
818
|
fp
|
|
@@ -813,16 +820,20 @@ function PrimeStyleTryon({
|
|
|
813
820
|
] }),
|
|
814
821
|
/* @__PURE__ */ jsxs("div", { className: "ps-tryon-shoe-section", children: [
|
|
815
822
|
/* @__PURE__ */ jsx("div", { className: "ps-tryon-shoe-title", children: "Shoe sizing (optional)" }),
|
|
816
|
-
/* @__PURE__ */ jsx(InputRow, { label: "Foot length", fieldKey: "footLengthCm", placeholder:
|
|
823
|
+
/* @__PURE__ */ jsx(InputRow, { label: "Foot length", fieldKey: "footLengthCm", placeholder: isCm ? "e.g. 27" : "e.g. 10.5", type: "number", unit: sizingUnit }),
|
|
817
824
|
/* @__PURE__ */ jsx(InputRow, { label: shoeField.label, fieldKey: shoeField.key, placeholder: shoeField.ph })
|
|
818
825
|
] })
|
|
819
|
-
] }),
|
|
826
|
+
] }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "ps-tryon-input-row", children: [
|
|
827
|
+
/* @__PURE__ */ jsx("label", { children: "Weight" }),
|
|
828
|
+
/* @__PURE__ */ jsx("input", { type: "number", placeholder: weightUnit === "lbs" ? "e.g. 170" : "e.g. 75", defaultValue: formRef.current.weight || "", onInput: (e) => updateField("weight", e.target.value) }),
|
|
829
|
+
/* @__PURE__ */ jsx(UnitToggle, { options: [{ label: "kg", value: "kg" }, { label: "lbs", value: "lbs" }], value: weightUnit, onChange: setWeightUnit })
|
|
830
|
+
] }) }),
|
|
820
831
|
/* @__PURE__ */ jsx("p", { className: "ps-tryon-disclaimer", children: "Fill in what you know — more measurements = better accuracy." }),
|
|
821
832
|
/* @__PURE__ */ jsxs("button", { className: "ps-tryon-submit", onClick: handleSubmit, children: [
|
|
822
833
|
"Get My Size & Try On ",
|
|
823
834
|
/* @__PURE__ */ jsx(ArrowRightIcon, {})
|
|
824
835
|
] })
|
|
825
|
-
] });
|
|
836
|
+
] }, `form-${formGender}-${sizingUnit}-${heightUnit}-${sizingCountry}`);
|
|
826
837
|
}
|
|
827
838
|
function ProcessingView() {
|
|
828
839
|
return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-processing", children: [
|
|
@@ -996,19 +1007,19 @@ function PrimeStyleTryon({
|
|
|
996
1007
|
function renderBody() {
|
|
997
1008
|
switch (view) {
|
|
998
1009
|
case "welcome":
|
|
999
|
-
return /* @__PURE__ */ jsx(WelcomeView, {});
|
|
1010
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsx(WelcomeView, {}) }, "v-welcome");
|
|
1000
1011
|
case "upload":
|
|
1001
|
-
return /* @__PURE__ */ jsx(UploadView, {});
|
|
1012
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsx(UploadView, {}) }, "v-upload");
|
|
1002
1013
|
case "sizing-choice":
|
|
1003
|
-
return /* @__PURE__ */ jsx(SizingChoiceView, {});
|
|
1014
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsx(SizingChoiceView, {}) }, "v-choice");
|
|
1004
1015
|
case "sizing-form":
|
|
1005
|
-
return /* @__PURE__ */ jsx(SizingFormView, {});
|
|
1016
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsx(SizingFormView, {}) }, "v-form");
|
|
1006
1017
|
case "processing":
|
|
1007
|
-
return /* @__PURE__ */ jsx(ProcessingView, {});
|
|
1018
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsx(ProcessingView, {}) }, "v-proc");
|
|
1008
1019
|
case "result":
|
|
1009
|
-
return /* @__PURE__ */ jsx(ResultView, {});
|
|
1020
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsx(ResultView, {}) }, "v-result");
|
|
1010
1021
|
case "error":
|
|
1011
|
-
return /* @__PURE__ */ jsx(ErrorView, {});
|
|
1022
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsx(ErrorView, {}) }, "v-error");
|
|
1012
1023
|
default:
|
|
1013
1024
|
return null;
|
|
1014
1025
|
}
|
|
@@ -1125,8 +1136,8 @@ const STYLES = `
|
|
|
1125
1136
|
|
|
1126
1137
|
/* Body */
|
|
1127
1138
|
.ps-tryon-body { padding: 24px; min-height: 300px; }
|
|
1128
|
-
.ps-tryon-body > * { animation: ps-fade-up 0.35s ease both; }
|
|
1129
1139
|
@keyframes ps-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
|
|
1140
|
+
.ps-tryon-view-enter { animation: ps-fade-up 0.35s ease both; }
|
|
1130
1141
|
|
|
1131
1142
|
/* Welcome */
|
|
1132
1143
|
.ps-tryon-welcome { text-align: center; }
|