@wix/headless-restaurants-olo 0.0.30 → 0.0.32
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/ClickableItem.d.ts +18 -3
- package/cjs/dist/react/ClickableItem.js +16 -9
- package/cjs/dist/react/FulfillmentDetails.d.ts +233 -0
- package/cjs/dist/react/FulfillmentDetails.js +255 -0
- package/cjs/dist/react/ItemDetails.d.ts +233 -36
- package/cjs/dist/react/ItemDetails.js +208 -0
- package/cjs/dist/react/ModifierGroup.js +0 -3
- package/cjs/dist/react/OLO.d.ts +5 -160
- package/cjs/dist/react/OLO.js +6 -122
- package/cjs/dist/react/OLOMenus.d.ts +8 -2
- package/cjs/dist/react/OLOMenus.js +3 -4
- package/cjs/dist/react/Settings.d.ts +176 -48
- package/cjs/dist/react/Settings.js +276 -26
- package/cjs/dist/react/core/ClickableItem.d.ts +12 -5
- package/cjs/dist/react/core/ClickableItem.js +13 -14
- package/cjs/dist/react/core/FulfillmentDetails.d.ts +78 -0
- package/cjs/dist/react/core/FulfillmentDetails.js +177 -0
- package/cjs/dist/react/core/ItemDetails.js +2 -4
- package/cjs/dist/react/core/OLO.d.ts +6 -74
- package/cjs/dist/react/core/OLO.js +5 -44
- package/cjs/dist/react/core/OLOMenus.d.ts +1 -1
- package/cjs/dist/react/core/OLOMenus.js +2 -3
- package/cjs/dist/react/core/Settings.d.ts +138 -22
- package/cjs/dist/react/core/Settings.js +157 -34
- package/cjs/dist/react/core/index.d.ts +1 -0
- package/cjs/dist/react/core/index.js +1 -0
- package/cjs/dist/react/index.d.ts +2 -0
- package/cjs/dist/react/index.js +1 -0
- package/cjs/dist/services/fulfillments-service.js +80 -22
- package/cjs/dist/types/fulfillments-types.d.ts +49 -2
- package/cjs/dist/types/operation.d.ts +1 -1
- package/cjs/dist/utils/fulfillments-utils.d.ts +34 -1
- package/cjs/dist/utils/fulfillments-utils.js +209 -1
- package/dist/react/ClickableItem.d.ts +18 -3
- package/dist/react/ClickableItem.js +16 -9
- package/dist/react/FulfillmentDetails.d.ts +233 -0
- package/dist/react/FulfillmentDetails.js +255 -0
- package/dist/react/ItemDetails.d.ts +233 -36
- package/dist/react/ItemDetails.js +208 -0
- package/dist/react/ModifierGroup.js +0 -3
- package/dist/react/OLO.d.ts +5 -160
- package/dist/react/OLO.js +6 -122
- package/dist/react/OLOMenus.d.ts +8 -2
- package/dist/react/OLOMenus.js +3 -4
- package/dist/react/Settings.d.ts +176 -48
- package/dist/react/Settings.js +276 -26
- package/dist/react/core/ClickableItem.d.ts +12 -5
- package/dist/react/core/ClickableItem.js +13 -14
- package/dist/react/core/FulfillmentDetails.d.ts +78 -0
- package/dist/react/core/FulfillmentDetails.js +177 -0
- package/dist/react/core/ItemDetails.js +2 -4
- package/dist/react/core/OLO.d.ts +6 -74
- package/dist/react/core/OLO.js +5 -44
- package/dist/react/core/OLOMenus.d.ts +1 -1
- package/dist/react/core/OLOMenus.js +2 -3
- package/dist/react/core/Settings.d.ts +138 -22
- package/dist/react/core/Settings.js +157 -34
- package/dist/react/core/index.d.ts +1 -0
- package/dist/react/core/index.js +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +1 -0
- package/dist/services/fulfillments-service.js +80 -22
- package/dist/types/fulfillments-types.d.ts +49 -2
- package/dist/types/operation.d.ts +1 -1
- package/dist/utils/fulfillments-utils.d.ts +34 -1
- package/dist/utils/fulfillments-utils.js +209 -1
- package/package.json +2 -2
package/dist/react/OLO.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ItemServiceConfig } from '../services/item-details-service.js';
|
|
3
2
|
import { OLOSettingsServiceConfig } from '../services/olo-settings-service.js';
|
|
4
3
|
interface OLORootProps {
|
|
5
|
-
/** Pre-loaded item service config (optional) */
|
|
6
|
-
itemServiceConfig?: ItemServiceConfig;
|
|
7
4
|
/** Pre-loaded OLO settings service config (optional) */
|
|
8
5
|
oloSettingsServiceConfig?: OLOSettingsServiceConfig;
|
|
9
|
-
/** Children
|
|
6
|
+
/** Children components */
|
|
10
7
|
children: React.ReactNode;
|
|
11
8
|
}
|
|
12
9
|
/**
|
|
@@ -15,164 +12,12 @@ interface OLORootProps {
|
|
|
15
12
|
*
|
|
16
13
|
* @example
|
|
17
14
|
* ```tsx
|
|
18
|
-
* <OLO.Root
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* ) : error ? (
|
|
23
|
-
* <ErrorMessage error={error} onRetry={retry} />
|
|
24
|
-
* ) : hasServices ? (
|
|
25
|
-
* <ItemDetailsComponents />
|
|
26
|
-
* ) : null
|
|
27
|
-
* )}
|
|
15
|
+
* <OLO.Root oloSettingsServiceConfig={config}>
|
|
16
|
+
* <Settings.Root>
|
|
17
|
+
* <SettingsComponents />
|
|
18
|
+
* </Settings.Root>
|
|
28
19
|
* </OLO.Root>
|
|
29
20
|
* ```
|
|
30
21
|
*/
|
|
31
22
|
export declare const Root: React.FC<OLORootProps>;
|
|
32
|
-
interface OLOProviderProps {
|
|
33
|
-
/** The ID of the item to load */
|
|
34
|
-
itemId?: string;
|
|
35
|
-
/** Pre-loaded configurations (optional) */
|
|
36
|
-
configs?: {
|
|
37
|
-
itemServiceConfig?: ItemServiceConfig;
|
|
38
|
-
};
|
|
39
|
-
/** Loading component to show while services are initializing */
|
|
40
|
-
loading?: React.ReactNode;
|
|
41
|
-
/** Error component to show if service initialization fails */
|
|
42
|
-
error?: (props: {
|
|
43
|
-
error: string;
|
|
44
|
-
retry: () => void;
|
|
45
|
-
}) => React.ReactNode;
|
|
46
|
-
/** Children that will receive the services context */
|
|
47
|
-
children: React.ReactNode;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Convenience provider that handles loading and error states automatically
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```tsx
|
|
54
|
-
* <OLO.Provider
|
|
55
|
-
* itemId="item-123"
|
|
56
|
-
* loading={<Spinner />}
|
|
57
|
-
* error={({ error, retry }) => <ErrorBanner message={error} onRetry={retry} />}
|
|
58
|
-
* >
|
|
59
|
-
* <ItemDetailsComponents />
|
|
60
|
-
* </OLO.Provider>
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
export declare const Provider: React.FC<OLOProviderProps>;
|
|
64
|
-
interface OLOItemDetailsProps {
|
|
65
|
-
/** The ID of the item to load */
|
|
66
|
-
itemId: string;
|
|
67
|
-
/** Pre-loaded configurations (optional) */
|
|
68
|
-
configs?: {
|
|
69
|
-
itemServiceConfig?: ItemServiceConfig;
|
|
70
|
-
cartServiceConfig?: any;
|
|
71
|
-
};
|
|
72
|
-
/** Custom loading component */
|
|
73
|
-
loading?: React.ReactNode;
|
|
74
|
-
/** Custom error component */
|
|
75
|
-
error?: (props: {
|
|
76
|
-
error: string;
|
|
77
|
-
retry: () => void;
|
|
78
|
-
}) => React.ReactNode;
|
|
79
|
-
/** Custom not found component */
|
|
80
|
-
notFound?: React.ReactNode;
|
|
81
|
-
/** Children that will have access to item services */
|
|
82
|
-
children: React.ReactNode;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Specialized headless component for item details
|
|
86
|
-
* Includes item-specific error handling (like 404 not found)
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```tsx
|
|
90
|
-
* <OLO.ItemDetails
|
|
91
|
-
* itemId="item-123"
|
|
92
|
-
* notFound={<NotFoundPage />}
|
|
93
|
-
* >
|
|
94
|
-
* <ItemDetailsUI />
|
|
95
|
-
* </OLO.ItemDetails>
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
export declare const ItemDetails: React.FC<OLOItemDetailsProps>;
|
|
99
|
-
interface OLOCartProps {
|
|
100
|
-
/** Pre-loaded cart service config (optional) */
|
|
101
|
-
cartServiceConfig?: any;
|
|
102
|
-
/** Loading component */
|
|
103
|
-
loading?: React.ReactNode;
|
|
104
|
-
/** Error component */
|
|
105
|
-
error?: (props: {
|
|
106
|
-
error: string;
|
|
107
|
-
retry: () => void;
|
|
108
|
-
}) => React.ReactNode;
|
|
109
|
-
/** Children that will have access to cart services */
|
|
110
|
-
children: React.ReactNode;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Headless component for cart-only functionality
|
|
114
|
-
* Doesn't load item services, only cart services
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```tsx
|
|
118
|
-
* <OLO.Cart>
|
|
119
|
-
* <CartComponents />
|
|
120
|
-
* </OLO.Cart>
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
export declare const Cart: React.FC<OLOCartProps>;
|
|
124
|
-
interface OLOServicesStatusProps {
|
|
125
|
-
/** The ID of the item to check */
|
|
126
|
-
itemId?: string;
|
|
127
|
-
/** Children render prop that receives service status */
|
|
128
|
-
children: React.ReactNode;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Headless component for checking service status
|
|
132
|
-
* Useful for debugging or conditional rendering
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* ```tsx
|
|
136
|
-
* <OLO.ServicesStatus itemId="item-123">
|
|
137
|
-
* {({ hasItemService, hasCartService, error }) => (
|
|
138
|
-
* <div>
|
|
139
|
-
* Item Service: {hasItemService ? '✅' : '❌'}
|
|
140
|
-
* Cart Service: {hasCartService ? '✅' : '❌'}
|
|
141
|
-
* {error && <div>Error: {error}</div>}
|
|
142
|
-
* </div>
|
|
143
|
-
* )}
|
|
144
|
-
* </OLO.ServicesStatus>
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
|
-
export declare const ServicesStatus: React.FC<OLOServicesStatusProps>;
|
|
148
|
-
/**
|
|
149
|
-
* Headless component for Menus service management.
|
|
150
|
-
* Wraps CoreOLO.Menus and provides render props for UI.
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* ```tsx
|
|
154
|
-
* <OLO.Menus>
|
|
155
|
-
* {({ menus, isLoading, error }) => (
|
|
156
|
-
* isLoading ? (
|
|
157
|
-
* <div>Loading...</div>
|
|
158
|
-
* ) : error ? (
|
|
159
|
-
* <div className="text-destructive">{error}</div>
|
|
160
|
-
* ) : (
|
|
161
|
-
* <ul>
|
|
162
|
-
* {menus.map(menu => (
|
|
163
|
-
* <li key={menu.id} className="text-foreground font-paragraph">{menu.name}</li>
|
|
164
|
-
* ))}
|
|
165
|
-
* </ul>
|
|
166
|
-
* )
|
|
167
|
-
* )}
|
|
168
|
-
* </OLO.Menus>
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
|
-
interface OLOMenusProps {
|
|
172
|
-
/** Optional menu service config */
|
|
173
|
-
menuServiceConfig?: any;
|
|
174
|
-
/** Children render prop that receives menus state */
|
|
175
|
-
children?: React.ReactNode;
|
|
176
|
-
}
|
|
177
|
-
export declare const Menus: React.FC<OLOMenusProps>;
|
|
178
23
|
export {};
|
package/dist/react/OLO.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { CoreOLO } from './core/index.js';
|
|
4
3
|
/**
|
|
5
4
|
* Root headless component for OLO service management
|
|
@@ -7,128 +6,13 @@ import { CoreOLO } from './core/index.js';
|
|
|
7
6
|
*
|
|
8
7
|
* @example
|
|
9
8
|
* ```tsx
|
|
10
|
-
* <OLO.Root
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* ) : error ? (
|
|
15
|
-
* <ErrorMessage error={error} onRetry={retry} />
|
|
16
|
-
* ) : hasServices ? (
|
|
17
|
-
* <ItemDetailsComponents />
|
|
18
|
-
* ) : null
|
|
19
|
-
* )}
|
|
9
|
+
* <OLO.Root oloSettingsServiceConfig={config}>
|
|
10
|
+
* <Settings.Root>
|
|
11
|
+
* <SettingsComponents />
|
|
12
|
+
* </Settings.Root>
|
|
20
13
|
* </OLO.Root>
|
|
21
14
|
* ```
|
|
22
15
|
*/
|
|
23
16
|
export const Root = ({ oloSettingsServiceConfig, children, }) => {
|
|
24
|
-
|
|
25
|
-
// const retry = React.useCallback(() => {
|
|
26
|
-
// setRetryKey(prev => prev + 1);
|
|
27
|
-
// }, []);
|
|
28
|
-
return (_jsx(CoreOLO.Root, { oloSettingsServiceConfig: oloSettingsServiceConfig, children: children }, retryKey));
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Convenience provider that handles loading and error states automatically
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```tsx
|
|
35
|
-
* <OLO.Provider
|
|
36
|
-
* itemId="item-123"
|
|
37
|
-
* loading={<Spinner />}
|
|
38
|
-
* error={({ error, retry }) => <ErrorBanner message={error} onRetry={retry} />}
|
|
39
|
-
* >
|
|
40
|
-
* <ItemDetailsComponents />
|
|
41
|
-
* </OLO.Provider>
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export const Provider = ({ configs,
|
|
45
|
-
// loading = (
|
|
46
|
-
// <div className="flex items-center justify-center p-8">
|
|
47
|
-
// <div className="text-secondary-foreground">Loading services...</div>
|
|
48
|
-
// </div>
|
|
49
|
-
// ),
|
|
50
|
-
// error: errorComponent = ({ error, retry }) => (
|
|
51
|
-
// <div className="flex flex-col items-center justify-center p-8 space-y-4">
|
|
52
|
-
// <div className="text-destructive">Error: {error}</div>
|
|
53
|
-
// <button
|
|
54
|
-
// onClick={retry}
|
|
55
|
-
// className="px-4 py-2 bg-primary text-primary-foreground rounded hover:bg-primary/90"
|
|
56
|
-
// >
|
|
57
|
-
// Retry
|
|
58
|
-
// </button>
|
|
59
|
-
// </div>
|
|
60
|
-
// ),
|
|
61
|
-
children, }) => {
|
|
62
|
-
return _jsx(Root, { itemServiceConfig: configs?.itemServiceConfig, children: children });
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Specialized headless component for item details
|
|
66
|
-
* Includes item-specific error handling (like 404 not found)
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```tsx
|
|
70
|
-
* <OLO.ItemDetails
|
|
71
|
-
* itemId="item-123"
|
|
72
|
-
* notFound={<NotFoundPage />}
|
|
73
|
-
* >
|
|
74
|
-
* <ItemDetailsUI />
|
|
75
|
-
* </OLO.ItemDetails>
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export const ItemDetails = ({ itemId, configs, loading, error, notFound = (_jsx("div", { className: "flex items-center justify-center p-8", children: _jsx("div", { className: "text-secondary-foreground", children: "Item not found" }) })), children, }) => {
|
|
79
|
-
return (_jsx(Provider, { itemId: itemId, configs: configs, loading: loading, error: ({ error: errorMessage, retry }) => {
|
|
80
|
-
// Handle item not found specifically
|
|
81
|
-
if (errorMessage === 'Item not found') {
|
|
82
|
-
return _jsx(_Fragment, { children: notFound });
|
|
83
|
-
}
|
|
84
|
-
// Use custom error component if provided
|
|
85
|
-
if (error) {
|
|
86
|
-
return _jsx(_Fragment, { children: error({ error: errorMessage, retry }) });
|
|
87
|
-
}
|
|
88
|
-
// Default error handling
|
|
89
|
-
return (_jsxs("div", { className: "flex flex-col items-center justify-center p-8 space-y-4", children: [_jsxs("div", { className: "text-destructive", children: ["Error: ", errorMessage] }), _jsx("button", { onClick: retry, className: "px-4 py-2 bg-primary text-primary-foreground rounded hover:bg-primary/90", children: "Retry" })] }));
|
|
90
|
-
}, children: children }));
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* Headless component for cart-only functionality
|
|
94
|
-
* Doesn't load item services, only cart services
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* ```tsx
|
|
98
|
-
* <OLO.Cart>
|
|
99
|
-
* <CartComponents />
|
|
100
|
-
* </OLO.Cart>
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
export const Cart = ({ loading, error, children }) => {
|
|
104
|
-
return (_jsx(Provider, { loading: loading, error: error, children: children }));
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Headless component for checking service status
|
|
108
|
-
* Useful for debugging or conditional rendering
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* ```tsx
|
|
112
|
-
* <OLO.ServicesStatus itemId="item-123">
|
|
113
|
-
* {({ hasItemService, hasCartService, error }) => (
|
|
114
|
-
* <div>
|
|
115
|
-
* Item Service: {hasItemService ? '✅' : '❌'}
|
|
116
|
-
* Cart Service: {hasCartService ? '✅' : '❌'}
|
|
117
|
-
* {error && <div>Error: {error}</div>}
|
|
118
|
-
* </div>
|
|
119
|
-
* )}
|
|
120
|
-
* </OLO.ServicesStatus>
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
export const ServicesStatus = ({ children, }) => {
|
|
124
|
-
return (_jsx(Root, { children: children }));
|
|
125
|
-
};
|
|
126
|
-
export const Menus = ({
|
|
127
|
-
// menuServiceConfig,
|
|
128
|
-
children, }) => {
|
|
129
|
-
// const [retryKey, setRetryKey] = React.useState(0);
|
|
130
|
-
// const [menus, setMenus] = React.useState<any[]>([]);
|
|
131
|
-
// const [isLoading, setIsLoading] = React.useState(true);
|
|
132
|
-
// const [error, setError] = React.useState<string | undefined>(undefined);
|
|
133
|
-
return _jsx(_Fragment, { children: children });
|
|
17
|
+
return (_jsx(CoreOLO.Root, { oloSettingsServiceConfig: oloSettingsServiceConfig, children: children }));
|
|
134
18
|
};
|
package/dist/react/OLOMenus.d.ts
CHANGED
|
@@ -12,9 +12,15 @@ export interface MenusRootProps {
|
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
config: MenusServiceConfig;
|
|
14
14
|
}
|
|
15
|
-
export declare const Root:
|
|
15
|
+
export declare const Root: {
|
|
16
|
+
(props: MenusRootProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
16
19
|
export declare const OLOMenus: {
|
|
17
|
-
Root:
|
|
20
|
+
Root: {
|
|
21
|
+
(props: MenusRootProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
18
24
|
TestIds: typeof TestIds;
|
|
19
25
|
};
|
|
20
26
|
export {};
|
package/dist/react/OLOMenus.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { Menus } from '@wix/headless-restaurants-menus/react';
|
|
4
3
|
import * as CoreOLOMenus from './core/OLOMenus.js';
|
|
5
4
|
// =======================
|
|
@@ -10,10 +9,10 @@ var TestIds;
|
|
|
10
9
|
// Container Level
|
|
11
10
|
TestIds["menusRoot"] = "menus-root";
|
|
12
11
|
})(TestIds || (TestIds = {}));
|
|
13
|
-
export const Root =
|
|
12
|
+
export const Root = function MenusRoot(props) {
|
|
14
13
|
const { children, config } = props;
|
|
15
|
-
return (_jsx(CoreOLOMenus.Root, {
|
|
16
|
-
}
|
|
14
|
+
return (_jsx(CoreOLOMenus.Root, { config: config, children: (updatedConfig) => (_jsx(Menus.Root, { "data-testid": TestIds.menusRoot, config: updatedConfig, children: children })) }));
|
|
15
|
+
};
|
|
17
16
|
Root.displayName = 'Menus.Root';
|
|
18
17
|
// Compose Menus namespace
|
|
19
18
|
export const OLOMenus = {
|
package/dist/react/Settings.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FulfillmentsServiceConfig } from '../types/fulfillments-types.js';
|
|
2
|
+
import { DispatchType, FulfillmentsServiceConfig } from '../types/fulfillments-types.js';
|
|
3
3
|
import { AsChildChildren } from '@wix/headless-utils/react';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the Settings Root component
|
|
@@ -37,30 +37,84 @@ interface CurrentTimeSlotProps {
|
|
|
37
37
|
className?: string;
|
|
38
38
|
/** Whether to render as a child component */
|
|
39
39
|
asChild?: boolean;
|
|
40
|
+
deliveryTypeText: string;
|
|
41
|
+
pickupTypeText: string;
|
|
42
|
+
asapTimeText: string;
|
|
43
|
+
asapTimeRangeText: string;
|
|
44
|
+
preorderTodayText: string;
|
|
45
|
+
preorderTomorrowText: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const CurrentTimeSlot: React.ForwardRefExoticComponent<CurrentTimeSlotProps & React.RefAttributes<HTMLElement>>;
|
|
48
|
+
interface DispatchTypeSelectorProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
49
|
+
/** Child components that will have access to dispatch type context */
|
|
50
|
+
children: React.ReactNode;
|
|
40
51
|
}
|
|
41
52
|
/**
|
|
42
|
-
*
|
|
43
|
-
* Provides
|
|
53
|
+
* Container component for dispatch type selection (pickup or delivery)
|
|
54
|
+
* Provides context for child components to access dispatch type data
|
|
55
|
+
* Does not render if no dispatch types are available
|
|
44
56
|
*
|
|
45
57
|
* @example
|
|
46
58
|
* ```tsx
|
|
47
|
-
* <Settings.
|
|
48
|
-
* {
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* <
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
+
* <Settings.DispatchTypeSelector>
|
|
60
|
+
* <Settings.DispatchTypeOptions emptyState={<div>No options</div>}>
|
|
61
|
+
* <Settings.DispatchTypeOptionRepeater>
|
|
62
|
+
* {({ type, isSelected, selectDispatchType }) => (
|
|
63
|
+
* <button onClick={() => selectDispatchType(type)}>
|
|
64
|
+
* {type} {isSelected && '✓'}
|
|
65
|
+
* </button>
|
|
66
|
+
* )}
|
|
67
|
+
* </Settings.DispatchTypeOptionRepeater>
|
|
68
|
+
* </Settings.DispatchTypeOptions>
|
|
69
|
+
* </Settings.DispatchTypeSelector>
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare const DispatchTypeSelector: React.ForwardRefExoticComponent<DispatchTypeSelectorProps & React.RefAttributes<HTMLDivElement>>;
|
|
73
|
+
interface DispatchTypeOptionsProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
74
|
+
/** Child components to render when dispatch types are available */
|
|
75
|
+
children: React.ReactNode;
|
|
76
|
+
/** Optional content to display when no dispatch types are available */
|
|
77
|
+
emptyState?: React.ReactNode;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Container for dispatch type options list with empty state support
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <Settings.DispatchTypeOptions emptyState={<div>No options available</div>}>
|
|
85
|
+
* <Settings.DispatchTypeOptionRepeater>
|
|
86
|
+
* {({ type }) => <div>{type}</div>}
|
|
87
|
+
* </Settings.DispatchTypeOptionRepeater>
|
|
88
|
+
* </Settings.DispatchTypeOptions>
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare const DispatchTypeOptions: React.ForwardRefExoticComponent<DispatchTypeOptionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
92
|
+
interface DispatchTypeOptionRepeaterProps {
|
|
93
|
+
/** Render prop that receives each dispatch type option data */
|
|
94
|
+
children: (props: {
|
|
95
|
+
type: DispatchType;
|
|
96
|
+
isSelected: boolean;
|
|
97
|
+
selectDispatchType: (type: DispatchType) => void;
|
|
98
|
+
}) => React.ReactNode;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Repeater component that renders children for each available dispatch type
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```tsx
|
|
105
|
+
* <Settings.DispatchTypeOptionRepeater>
|
|
106
|
+
* {({ type, isSelected, selectDispatchType }) => (
|
|
107
|
+
* <button
|
|
108
|
+
* onClick={() => selectDispatchType(type)}
|
|
109
|
+
* data-selected={isSelected}
|
|
110
|
+
* >
|
|
111
|
+
* {type}
|
|
112
|
+
* </button>
|
|
59
113
|
* )}
|
|
60
|
-
* </Settings.
|
|
114
|
+
* </Settings.DispatchTypeOptionRepeater>
|
|
61
115
|
* ```
|
|
62
116
|
*/
|
|
63
|
-
export declare const
|
|
117
|
+
export declare const DispatchTypeOptionRepeater: React.FC<DispatchTypeOptionRepeaterProps>;
|
|
64
118
|
/**
|
|
65
119
|
* Headless component for current fulfillment options
|
|
66
120
|
* Provides access to pickup, delivery, and dine-in options
|
|
@@ -116,48 +170,122 @@ interface CurrentLocationProps {
|
|
|
116
170
|
* ```
|
|
117
171
|
*/
|
|
118
172
|
export declare const CurrentLocation: React.FC<CurrentLocationProps>;
|
|
119
|
-
interface
|
|
173
|
+
interface MinOrderAmountProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
120
174
|
asChild?: boolean;
|
|
121
|
-
/** Children render prop that receives the
|
|
175
|
+
/** Children render prop that receives the minimum order amount data */
|
|
122
176
|
children?: AsChildChildren<{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
177
|
+
minOrderAmount: number | undefined;
|
|
178
|
+
hasMinOrderAmount: boolean;
|
|
179
|
+
}> | React.ReactNode;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Headless component for minimum order amount information
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```tsx
|
|
186
|
+
* <Settings.MinOrderAmount>
|
|
187
|
+
* {({ minOrderAmount, hasMinOrderAmount }) => (
|
|
188
|
+
* hasMinOrderAmount ? (
|
|
189
|
+
* <div>Minimum order: ${minOrderAmount}</div>
|
|
190
|
+
* ) : null
|
|
191
|
+
* )}
|
|
192
|
+
* </Settings.MinOrderAmount>
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
export declare const MinOrderAmount: React.FC<MinOrderAmountProps>;
|
|
196
|
+
interface AcceptingOrdersProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
197
|
+
asChild?: boolean;
|
|
198
|
+
/** Children render prop that receives the accepting orders status */
|
|
199
|
+
children?: AsChildChildren<{
|
|
200
|
+
acceptingOrders: boolean;
|
|
134
201
|
}> | React.ReactNode;
|
|
135
202
|
}
|
|
136
203
|
/**
|
|
137
|
-
* Headless component for
|
|
138
|
-
* Provides access to ordering status, fees, and thresholds
|
|
204
|
+
* Headless component for accepting orders status
|
|
139
205
|
*
|
|
140
206
|
* @example
|
|
141
207
|
* ```tsx
|
|
142
|
-
* <Settings.
|
|
143
|
-
* {({
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
208
|
+
* <Settings.AcceptingOrders>
|
|
209
|
+
* {({ acceptingOrders }) => (
|
|
210
|
+
* <div>
|
|
211
|
+
* Status: {acceptingOrders ? 'Accepting Orders' : 'Not Accepting Orders'}
|
|
212
|
+
* </div>
|
|
213
|
+
* )}
|
|
214
|
+
* </Settings.AcceptingOrders>
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
export declare const AcceptingOrders: React.FC<AcceptingOrdersProps>;
|
|
218
|
+
interface SelectedAddressProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
219
|
+
asChild?: boolean;
|
|
220
|
+
/** Children render prop that receives the selected address data */
|
|
221
|
+
children?: AsChildChildren<{
|
|
222
|
+
formattedAddress: string | null;
|
|
223
|
+
selectedType: DispatchType | null;
|
|
224
|
+
hasAddress: boolean;
|
|
225
|
+
}> | React.ReactNode;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Headless component for selected address information
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* ```tsx
|
|
232
|
+
* <Settings.SelectedAddress>
|
|
233
|
+
* {({ formattedAddress, selectedType, hasAddress }) => (
|
|
234
|
+
* <div>
|
|
235
|
+
* <p>{formattedAddress}</p>
|
|
236
|
+
* <p>{selectedType}</p>
|
|
237
|
+
* </div>
|
|
238
|
+
* )}
|
|
239
|
+
* </Settings.SelectedAddress>
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
export declare const SelectedAddress: React.FC<SelectedAddressProps>;
|
|
243
|
+
interface DeliveryFeeProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
244
|
+
asChild?: boolean;
|
|
245
|
+
/** Children render prop that receives the delivery fee data */
|
|
246
|
+
children?: AsChildChildren<{
|
|
247
|
+
deliveryFee: string | undefined;
|
|
248
|
+
hasDeliveryFee: boolean;
|
|
249
|
+
}> | React.ReactNode;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Headless component for delivery fee information
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* ```tsx
|
|
256
|
+
* <Settings.DeliveryFee>
|
|
257
|
+
* {({ deliveryFee, hasDeliveryFee }) => (
|
|
258
|
+
* hasDeliveryFee ? (
|
|
259
|
+
* <div>Delivery Fee: ${deliveryFee}</div>
|
|
155
260
|
* ) : (
|
|
156
|
-
* <div>
|
|
261
|
+
* <div>Free Delivery</div>
|
|
157
262
|
* )
|
|
158
263
|
* )}
|
|
159
|
-
* </Settings.
|
|
264
|
+
* </Settings.DeliveryFee>
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
export declare const DeliveryFee: React.FC<DeliveryFeeProps>;
|
|
268
|
+
interface FreeDeliveryThresholdProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
269
|
+
asChild?: boolean;
|
|
270
|
+
/** Children render prop that receives the free delivery threshold data */
|
|
271
|
+
children?: AsChildChildren<{
|
|
272
|
+
freeDeliveryThreshold: string | undefined;
|
|
273
|
+
hasFreeDeliveryThreshold: boolean;
|
|
274
|
+
}> | React.ReactNode;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Headless component for free delivery threshold information
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```tsx
|
|
281
|
+
* <Settings.FreeDeliveryThreshold>
|
|
282
|
+
* {({ freeDeliveryThreshold, hasFreeDeliveryThreshold }) => (
|
|
283
|
+
* hasFreeDeliveryThreshold ? (
|
|
284
|
+
* <div>Free delivery on orders over ${freeDeliveryThreshold}</div>
|
|
285
|
+
* ) : null
|
|
286
|
+
* )}
|
|
287
|
+
* </Settings.FreeDeliveryThreshold>
|
|
160
288
|
* ```
|
|
161
289
|
*/
|
|
162
|
-
export declare const
|
|
290
|
+
export declare const FreeDeliveryThreshold: React.FC<FreeDeliveryThresholdProps>;
|
|
163
291
|
export {};
|