@primestyleai/tryon 3.6.0 → 3.6.2
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.d.ts +4 -0
- package/dist/react/index.js +9 -6
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export interface PrimeStyleTryonProps {
|
|
|
6
6
|
buttonText?: string;
|
|
7
7
|
apiUrl?: string;
|
|
8
8
|
showPoweredBy?: boolean;
|
|
9
|
+
/** Show the default camera icon in the button. Defaults to true. Set to false to hide it. */
|
|
10
|
+
showIcon?: boolean;
|
|
11
|
+
/** Custom icon element to replace the default camera icon. Pass any React node (e.g. an <svg> or <img>). */
|
|
12
|
+
buttonIcon?: React.ReactNode;
|
|
9
13
|
buttonStyles?: ButtonStyles;
|
|
10
14
|
modalStyles?: ModalStyles;
|
|
11
15
|
classNames?: PrimeStyleClassNames;
|
package/dist/react/index.js
CHANGED
|
@@ -94,7 +94,7 @@ function SvgIcon({ d, size = 18, strokeWidth = 2 }) {
|
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
|
-
function CameraIcon({ size
|
|
97
|
+
function CameraIcon({ size }) {
|
|
98
98
|
return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
99
99
|
/* @__PURE__ */ jsx("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }),
|
|
100
100
|
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "13", r: "4" })
|
|
@@ -184,6 +184,8 @@ function PrimeStyleTryonInner({
|
|
|
184
184
|
buttonText = "Virtual Try-On",
|
|
185
185
|
apiUrl,
|
|
186
186
|
showPoweredBy = true,
|
|
187
|
+
showIcon = true,
|
|
188
|
+
buttonIcon,
|
|
187
189
|
buttonStyles: btnS = {},
|
|
188
190
|
modalStyles: mdlS = {},
|
|
189
191
|
classNames: cn = {},
|
|
@@ -1299,7 +1301,7 @@ function PrimeStyleTryonInner({
|
|
|
1299
1301
|
}
|
|
1300
1302
|
return /* @__PURE__ */ jsxs("div", { className: cx("ps-tryon-root", cn.root || className), style: { ...cssVars, ...style }, "data-ps-tryon": true, children: [
|
|
1301
1303
|
/* @__PURE__ */ jsxs("button", { onClick: handleOpen, className: cx("ps-tryon-btn", cn.button), children: [
|
|
1302
|
-
/* @__PURE__ */ jsx(CameraIcon, {
|
|
1304
|
+
showIcon !== false && (buttonIcon || /* @__PURE__ */ jsx(CameraIcon, {})),
|
|
1303
1305
|
/* @__PURE__ */ jsx("span", { children: buttonText })
|
|
1304
1306
|
] }),
|
|
1305
1307
|
view !== "idle" && /* @__PURE__ */ jsx("div", { className: cx("ps-tryon-overlay", cn.overlay), onClick: (e) => {
|
|
@@ -1331,16 +1333,17 @@ const STYLES = `
|
|
|
1331
1333
|
.ps-tryon-root { display: inline-block; }
|
|
1332
1334
|
|
|
1333
1335
|
.ps-tryon-btn {
|
|
1334
|
-
display: inline-flex; align-items: center; gap: 8px;
|
|
1335
|
-
padding: var(--ps-btn-padding, 12px 24px);
|
|
1336
|
+
display: inline-flex; align-items: center; gap: clamp(5px, 0.42vw, 8px);
|
|
1337
|
+
padding: var(--ps-btn-padding, clamp(8px, 0.63vw, 12px) clamp(14px, 1.25vw, 24px));
|
|
1336
1338
|
background: var(--ps-btn-bg, #bb945c); color: var(--ps-btn-color, #111211);
|
|
1337
1339
|
font-family: var(--ps-btn-font, system-ui, -apple-system, sans-serif);
|
|
1338
|
-
font-size: var(--ps-btn-font-size, 14px); font-weight: var(--ps-btn-font-weight, 600);
|
|
1339
|
-
border: var(--ps-btn-border, none); border-radius: var(--ps-btn-radius, 8px);
|
|
1340
|
+
font-size: var(--ps-btn-font-size, clamp(10px, 0.73vw, 14px)); font-weight: var(--ps-btn-font-weight, 600);
|
|
1341
|
+
border: var(--ps-btn-border, none); border-radius: var(--ps-btn-radius, clamp(5px, 0.42vw, 8px));
|
|
1340
1342
|
cursor: pointer; transition: all 0.2s ease;
|
|
1341
1343
|
width: var(--ps-btn-width, auto); height: var(--ps-btn-height, auto);
|
|
1342
1344
|
box-shadow: var(--ps-btn-shadow, none); line-height: 1; white-space: nowrap;
|
|
1343
1345
|
}
|
|
1346
|
+
.ps-tryon-btn svg { width: var(--ps-btn-icon-size, clamp(14px, 0.94vw, 18px)); height: var(--ps-btn-icon-size, clamp(14px, 0.94vw, 18px)); flex-shrink: 0; }
|
|
1344
1347
|
.ps-tryon-btn:hover { background: var(--ps-btn-hover-bg, #a07d4e); transform: translateY(-1px); }
|
|
1345
1348
|
.ps-tryon-btn:active { transform: translateY(0); }
|
|
1346
1349
|
|