@wix/headless-stores 0.0.80 → 0.0.81
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/cjs/dist/react/Product.d.ts +14 -0
- package/cjs/dist/react/Product.js +11 -0
- package/dist/react/Product.d.ts +14 -0
- package/dist/react/Product.js +11 -0
- package/package.json +1 -1
|
@@ -833,6 +833,20 @@ export interface ProductQuantityRawSubComponentProps {
|
|
|
833
833
|
* ```
|
|
834
834
|
*/
|
|
835
835
|
export declare const ProductQuantityRaw: React.ForwardRefExoticComponent<ProductQuantityRawSubComponentProps & React.RefAttributes<HTMLElement>>;
|
|
836
|
+
export interface ProductVariantSelectorResetProps {
|
|
837
|
+
/** Whether to render as a child component */
|
|
838
|
+
asChild?: boolean;
|
|
839
|
+
/** Custom render function when using asChild */
|
|
840
|
+
children?: AsChildChildren<{
|
|
841
|
+
reset: () => void;
|
|
842
|
+
hasSelections: boolean;
|
|
843
|
+
}>;
|
|
844
|
+
/** CSS classes to apply to the default element */
|
|
845
|
+
className?: string;
|
|
846
|
+
/** Label for the reset button */
|
|
847
|
+
label?: string;
|
|
848
|
+
}
|
|
849
|
+
export declare const ProductVariantSelectorReset: React.ForwardRefExoticComponent<ProductVariantSelectorResetProps & React.RefAttributes<HTMLButtonElement>>;
|
|
836
850
|
/**
|
|
837
851
|
* Add to cart action button component following the documented API.
|
|
838
852
|
* Automatically integrates with the selected variant and handles loading states.
|
|
@@ -46,6 +46,7 @@ var TestIds;
|
|
|
46
46
|
TestIds["productStock"] = "product-stock";
|
|
47
47
|
TestIds["productVariants"] = "product-variants";
|
|
48
48
|
TestIds["productVariantOptions"] = "product-variant-options";
|
|
49
|
+
TestIds["productVariantSelectorReset"] = "product-variant-selector-reset";
|
|
49
50
|
TestIds["productVariantOption"] = "product-variant-option";
|
|
50
51
|
TestIds["productVariant"] = "product-variant";
|
|
51
52
|
TestIds["productVariantSku"] = "product-variant-sku";
|
|
@@ -859,6 +860,16 @@ export const ProductQuantityRaw = React.forwardRef((props, ref) => {
|
|
|
859
860
|
return (_jsx(AsChildSlot, { ref: ref, customElement: children, asChild: asChild, className: className, "data-testid": TestIds.productQuantityRaw, customElementProps: renderProps }));
|
|
860
861
|
} }));
|
|
861
862
|
});
|
|
863
|
+
export const ProductVariantSelectorReset = React.forwardRef((props, ref) => {
|
|
864
|
+
const { asChild, children, className } = props;
|
|
865
|
+
return (_jsx(ProductVariantSelector.Reset, { children: (renderProps) => {
|
|
866
|
+
if (!renderProps.hasSelections) {
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
const label = props.label || 'Reset Selections';
|
|
870
|
+
return (_jsx(AsChildSlot, { ref: ref, customElement: children, asChild: asChild, className: className, "data-testid": TestIds.productVariantSelectorReset, customElementProps: renderProps, children: _jsx("button", { onClick: renderProps.reset, children: label }) }));
|
|
871
|
+
} }));
|
|
872
|
+
});
|
|
862
873
|
/**
|
|
863
874
|
* Add to cart action button component following the documented API.
|
|
864
875
|
* Automatically integrates with the selected variant and handles loading states.
|
package/dist/react/Product.d.ts
CHANGED
|
@@ -833,6 +833,20 @@ export interface ProductQuantityRawSubComponentProps {
|
|
|
833
833
|
* ```
|
|
834
834
|
*/
|
|
835
835
|
export declare const ProductQuantityRaw: React.ForwardRefExoticComponent<ProductQuantityRawSubComponentProps & React.RefAttributes<HTMLElement>>;
|
|
836
|
+
export interface ProductVariantSelectorResetProps {
|
|
837
|
+
/** Whether to render as a child component */
|
|
838
|
+
asChild?: boolean;
|
|
839
|
+
/** Custom render function when using asChild */
|
|
840
|
+
children?: AsChildChildren<{
|
|
841
|
+
reset: () => void;
|
|
842
|
+
hasSelections: boolean;
|
|
843
|
+
}>;
|
|
844
|
+
/** CSS classes to apply to the default element */
|
|
845
|
+
className?: string;
|
|
846
|
+
/** Label for the reset button */
|
|
847
|
+
label?: string;
|
|
848
|
+
}
|
|
849
|
+
export declare const ProductVariantSelectorReset: React.ForwardRefExoticComponent<ProductVariantSelectorResetProps & React.RefAttributes<HTMLButtonElement>>;
|
|
836
850
|
/**
|
|
837
851
|
* Add to cart action button component following the documented API.
|
|
838
852
|
* Automatically integrates with the selected variant and handles loading states.
|
package/dist/react/Product.js
CHANGED
|
@@ -46,6 +46,7 @@ var TestIds;
|
|
|
46
46
|
TestIds["productStock"] = "product-stock";
|
|
47
47
|
TestIds["productVariants"] = "product-variants";
|
|
48
48
|
TestIds["productVariantOptions"] = "product-variant-options";
|
|
49
|
+
TestIds["productVariantSelectorReset"] = "product-variant-selector-reset";
|
|
49
50
|
TestIds["productVariantOption"] = "product-variant-option";
|
|
50
51
|
TestIds["productVariant"] = "product-variant";
|
|
51
52
|
TestIds["productVariantSku"] = "product-variant-sku";
|
|
@@ -859,6 +860,16 @@ export const ProductQuantityRaw = React.forwardRef((props, ref) => {
|
|
|
859
860
|
return (_jsx(AsChildSlot, { ref: ref, customElement: children, asChild: asChild, className: className, "data-testid": TestIds.productQuantityRaw, customElementProps: renderProps }));
|
|
860
861
|
} }));
|
|
861
862
|
});
|
|
863
|
+
export const ProductVariantSelectorReset = React.forwardRef((props, ref) => {
|
|
864
|
+
const { asChild, children, className } = props;
|
|
865
|
+
return (_jsx(ProductVariantSelector.Reset, { children: (renderProps) => {
|
|
866
|
+
if (!renderProps.hasSelections) {
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
const label = props.label || 'Reset Selections';
|
|
870
|
+
return (_jsx(AsChildSlot, { ref: ref, customElement: children, asChild: asChild, className: className, "data-testid": TestIds.productVariantSelectorReset, customElementProps: renderProps, children: _jsx("button", { onClick: renderProps.reset, children: label }) }));
|
|
871
|
+
} }));
|
|
872
|
+
});
|
|
862
873
|
/**
|
|
863
874
|
* Add to cart action button component following the documented API.
|
|
864
875
|
* Automatically integrates with the selected variant and handles loading states.
|