@primestyleai/tryon 5.7.8 → 5.7.10
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.
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vanilla JS size-guide button + modal for the Shopify storefront.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the prime-main SizeGuideModal design but built without React
|
|
5
|
+
* so it can attach next to (not inside) the React-mounted SDK root.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* createSizeGuideButton(parentEl, sizeGuide, { buttonStyles, ... });
|
|
9
|
+
*
|
|
10
|
+
* The button is inserted as a sibling above the React root. Clicking
|
|
11
|
+
* it appends a modal to <body> with a size-chart table, cm/in toggle,
|
|
12
|
+
* and "How to measure" hints.
|
|
13
|
+
*/
|
|
14
|
+
interface RawSection {
|
|
15
|
+
name: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
headers: string[];
|
|
18
|
+
rows: Array<Record<string, string>>;
|
|
19
|
+
}
|
|
20
|
+
interface RawSizeGuide {
|
|
21
|
+
title?: string;
|
|
22
|
+
headers?: string[];
|
|
23
|
+
rows?: Array<Record<string, string>>;
|
|
24
|
+
unit?: "cm" | "in";
|
|
25
|
+
sections?: RawSection[];
|
|
26
|
+
howToMeasure?: string[];
|
|
27
|
+
}
|
|
28
|
+
interface ButtonOptions {
|
|
29
|
+
label?: string;
|
|
30
|
+
accentColor?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a "Size Guide" button and insert it as a sibling above the
|
|
34
|
+
* given parent element. Returns a teardown function that removes the
|
|
35
|
+
* button + any open modal.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createSizeGuideButton(parent: Element, sizeGuide: RawSizeGuide, options?: ButtonOptions): () => void;
|
|
38
|
+
export {};
|