@wix/headless-restaurants-olo 0.0.10 → 0.0.11
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.
|
@@ -170,9 +170,7 @@ export declare const ModifiersMultiSelect: React.ForwardRefExoticComponent<ItemD
|
|
|
170
170
|
*/
|
|
171
171
|
export interface ItemDetailsVariantsProps {
|
|
172
172
|
children?: AsChildChildren<{
|
|
173
|
-
variant: EnhancedVariant;
|
|
174
173
|
variants: EnhancedVariant[];
|
|
175
|
-
hasVariants: boolean;
|
|
176
174
|
selectedVariantId?: string;
|
|
177
175
|
onVariantChange?: (variantId: string) => void;
|
|
178
176
|
}>;
|
|
@@ -180,7 +178,6 @@ export interface ItemDetailsVariantsProps {
|
|
|
180
178
|
asChild?: boolean;
|
|
181
179
|
variantNameClassName?: string;
|
|
182
180
|
variantPriceClassName?: string;
|
|
183
|
-
emptyState?: React.ReactNode;
|
|
184
181
|
}
|
|
185
182
|
export declare const Variants: React.ForwardRefExoticComponent<ItemDetailsVariantsProps & React.RefAttributes<HTMLElement>>;
|
|
186
183
|
export interface AddToCartActionProps {
|
|
@@ -74,14 +74,13 @@ export const ModifiersMultiSelect = React.forwardRef(({ children, className, asC
|
|
|
74
74
|
} }));
|
|
75
75
|
});
|
|
76
76
|
ModifiersMultiSelect.displayName = 'ItemDetails.ModifiersMultiSelect';
|
|
77
|
-
export const Variants = React.forwardRef(({ children, className, asChild, variantNameClassName, variantPriceClassName,
|
|
77
|
+
export const Variants = React.forwardRef(({ children, className, asChild, variantNameClassName, variantPriceClassName, }, ref) => {
|
|
78
78
|
return (_jsx(CoreItemDetails.VariantsComponent, { children: ({ variants, hasVariants, selectedVariantId, onVariantChange }) => {
|
|
79
79
|
if (!hasVariants) {
|
|
80
|
-
return
|
|
80
|
+
return null;
|
|
81
81
|
}
|
|
82
82
|
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, testId: TestIds.itemVariants, className: className, customElement: children, customElementProps: {
|
|
83
83
|
variants,
|
|
84
|
-
hasVariants,
|
|
85
84
|
selectedVariantId,
|
|
86
85
|
onVariantChange,
|
|
87
86
|
}, children: _jsx(RadioGroupPrimitive.Root, { value: selectedVariantId, onValueChange: onVariantChange, children: variants.map((variant) => (_jsx(RadioGroupPrimitive.Item, { value: variant._id ?? '', children: _jsxs("div", { children: [_jsx("div", { className: variantNameClassName, children: variant.name }), _jsx("div", { className: variantPriceClassName, children: variant.priceInfo?.formattedPrice ||
|
|
@@ -170,9 +170,7 @@ export declare const ModifiersMultiSelect: React.ForwardRefExoticComponent<ItemD
|
|
|
170
170
|
*/
|
|
171
171
|
export interface ItemDetailsVariantsProps {
|
|
172
172
|
children?: AsChildChildren<{
|
|
173
|
-
variant: EnhancedVariant;
|
|
174
173
|
variants: EnhancedVariant[];
|
|
175
|
-
hasVariants: boolean;
|
|
176
174
|
selectedVariantId?: string;
|
|
177
175
|
onVariantChange?: (variantId: string) => void;
|
|
178
176
|
}>;
|
|
@@ -180,7 +178,6 @@ export interface ItemDetailsVariantsProps {
|
|
|
180
178
|
asChild?: boolean;
|
|
181
179
|
variantNameClassName?: string;
|
|
182
180
|
variantPriceClassName?: string;
|
|
183
|
-
emptyState?: React.ReactNode;
|
|
184
181
|
}
|
|
185
182
|
export declare const Variants: React.ForwardRefExoticComponent<ItemDetailsVariantsProps & React.RefAttributes<HTMLElement>>;
|
|
186
183
|
export interface AddToCartActionProps {
|
|
@@ -74,14 +74,13 @@ export const ModifiersMultiSelect = React.forwardRef(({ children, className, asC
|
|
|
74
74
|
} }));
|
|
75
75
|
});
|
|
76
76
|
ModifiersMultiSelect.displayName = 'ItemDetails.ModifiersMultiSelect';
|
|
77
|
-
export const Variants = React.forwardRef(({ children, className, asChild, variantNameClassName, variantPriceClassName,
|
|
77
|
+
export const Variants = React.forwardRef(({ children, className, asChild, variantNameClassName, variantPriceClassName, }, ref) => {
|
|
78
78
|
return (_jsx(CoreItemDetails.VariantsComponent, { children: ({ variants, hasVariants, selectedVariantId, onVariantChange }) => {
|
|
79
79
|
if (!hasVariants) {
|
|
80
|
-
return
|
|
80
|
+
return null;
|
|
81
81
|
}
|
|
82
82
|
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, testId: TestIds.itemVariants, className: className, customElement: children, customElementProps: {
|
|
83
83
|
variants,
|
|
84
|
-
hasVariants,
|
|
85
84
|
selectedVariantId,
|
|
86
85
|
onVariantChange,
|
|
87
86
|
}, children: _jsx(RadioGroupPrimitive.Root, { value: selectedVariantId, onValueChange: onVariantChange, children: variants.map((variant) => (_jsx(RadioGroupPrimitive.Item, { value: variant._id ?? '', children: _jsxs("div", { children: [_jsx("div", { className: variantNameClassName, children: variant.name }), _jsx("div", { className: variantPriceClassName, children: variant.priceInfo?.formattedPrice ||
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-restaurants-olo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"scripts": {
|
|
7
|
+
"prebuild": "cd ../components && yarn build && cd ../ecom && yarn build",
|
|
6
8
|
"build": "npm run build:esm && npm run build:cjs",
|
|
7
9
|
"build:esm": "tsc -p tsconfig.json",
|
|
8
10
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -52,9 +54,10 @@
|
|
|
52
54
|
"@radix-ui/react-radio-group": "^1.1.3",
|
|
53
55
|
"@radix-ui/react-slot": "^1.1.0",
|
|
54
56
|
"@wix/auto_sdk_restaurants_items": "^1.0.48",
|
|
55
|
-
"@wix/
|
|
56
|
-
"@wix/headless-
|
|
57
|
-
"@wix/headless-
|
|
57
|
+
"@wix/ecom": "^1.0.1461",
|
|
58
|
+
"@wix/headless-media": "0.0.16",
|
|
59
|
+
"@wix/headless-restaurants-menus": "0.0.16",
|
|
60
|
+
"@wix/headless-utils": "0.0.5",
|
|
58
61
|
"@wix/redirects": "^1.0.0",
|
|
59
62
|
"@wix/restaurants": "^1.0.396",
|
|
60
63
|
"@wix/sdk": "^1.15.24",
|
|
@@ -62,6 +65,17 @@
|
|
|
62
65
|
"@wix/services-manager-react": "^0.1.26"
|
|
63
66
|
},
|
|
64
67
|
"peerDependencies": {
|
|
65
|
-
"@wix/headless-components": "
|
|
66
|
-
}
|
|
68
|
+
"@wix/headless-components": "workspace:*"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"registry": "https://registry.npmjs.org/",
|
|
72
|
+
"access": "public"
|
|
73
|
+
},
|
|
74
|
+
"wix": {
|
|
75
|
+
"artifact": {
|
|
76
|
+
"artifactId": "headless-restaurants-olo",
|
|
77
|
+
"groupId": "com.wixpress.headless-components"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"falconPackageHash": "2d2558a11db850641d49ff82441dcc3602297af366ec993cc9b50d7e"
|
|
67
81
|
}
|