nitrostack 1.0.54 → 1.0.56
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/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +14 -9
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/widgets/hooks/index.d.ts +7 -0
- package/dist/widgets/hooks/index.d.ts.map +1 -0
- package/dist/widgets/hooks/index.js +7 -0
- package/dist/widgets/hooks/index.js.map +1 -0
- package/dist/widgets/hooks/use-display-mode.d.ts +11 -0
- package/dist/widgets/hooks/use-display-mode.d.ts.map +1 -0
- package/dist/widgets/hooks/use-display-mode.js +13 -0
- package/dist/widgets/hooks/use-display-mode.js.map +1 -0
- package/dist/widgets/hooks/use-max-height.d.ts +10 -0
- package/dist/widgets/hooks/use-max-height.d.ts.map +1 -0
- package/dist/widgets/hooks/use-max-height.js +13 -0
- package/dist/widgets/hooks/use-max-height.js.map +1 -0
- package/dist/widgets/hooks/use-openai-global.d.ts +12 -0
- package/dist/widgets/hooks/use-openai-global.d.ts.map +1 -0
- package/dist/widgets/hooks/use-openai-global.js +32 -0
- package/dist/widgets/hooks/use-openai-global.js.map +1 -0
- package/dist/widgets/hooks/use-theme.d.ts +10 -0
- package/dist/widgets/hooks/use-theme.d.ts.map +1 -0
- package/dist/widgets/hooks/use-theme.js +12 -0
- package/dist/widgets/hooks/use-theme.js.map +1 -0
- package/dist/widgets/hooks/use-widget-state.d.ts +18 -0
- package/dist/widgets/hooks/use-widget-state.d.ts.map +1 -0
- package/dist/widgets/hooks/use-widget-state.js +27 -0
- package/dist/widgets/hooks/use-widget-state.js.map +1 -0
- package/dist/widgets/hooks/useWidgetSDK.d.ts +47 -0
- package/dist/widgets/hooks/useWidgetSDK.d.ts.map +1 -0
- package/dist/widgets/hooks/useWidgetSDK.js +67 -0
- package/dist/widgets/hooks/useWidgetSDK.js.map +1 -0
- package/dist/widgets/index.d.ts +7 -1
- package/dist/widgets/index.d.ts.map +1 -1
- package/dist/widgets/index.js +11 -1
- package/dist/widgets/index.js.map +1 -1
- package/dist/widgets/runtime/WidgetLayout.d.ts +32 -0
- package/dist/widgets/runtime/WidgetLayout.d.ts.map +1 -0
- package/dist/widgets/runtime/WidgetLayout.js +143 -0
- package/dist/widgets/runtime/WidgetLayout.js.map +1 -0
- package/dist/widgets/runtime/widget-polyfill.d.ts +1 -0
- package/dist/widgets/runtime/widget-polyfill.d.ts.map +1 -0
- package/dist/widgets/runtime/widget-polyfill.js +28 -0
- package/dist/widgets/runtime/widget-polyfill.js.map +1 -0
- package/dist/widgets/sdk.d.ts +109 -0
- package/dist/widgets/sdk.d.ts.map +1 -0
- package/dist/widgets/sdk.js +221 -0
- package/dist/widgets/sdk.js.map +1 -0
- package/dist/widgets/types.d.ts +89 -0
- package/dist/widgets/types.d.ts.map +1 -0
- package/dist/widgets/types.js +8 -0
- package/dist/widgets/types.js.map +1 -0
- package/dist/widgets/utils/media-queries.d.ts +34 -0
- package/dist/widgets/utils/media-queries.d.ts.map +1 -0
- package/dist/widgets/utils/media-queries.js +42 -0
- package/dist/widgets/utils/media-queries.js.map +1 -0
- package/package.json +2 -2
- package/src/studio/app/chat/page.tsx +274 -137
- package/src/studio/app/globals.css +140 -64
- package/src/studio/branding.md +807 -0
- package/src/studio/components/WidgetRenderer.tsx +222 -16
- package/src/studio/lib/llm-service.ts +39 -39
- package/templates/typescript-oauth/.env.example +27 -0
- package/templates/typescript-oauth/README.md +226 -306
- package/templates/typescript-oauth/package-lock.json +4253 -0
- package/templates/typescript-oauth/package.json +10 -5
- package/templates/typescript-oauth/src/app.module.ts +39 -36
- package/templates/typescript-oauth/src/guards/oauth.guard.ts +0 -1
- package/templates/typescript-oauth/src/index.ts +22 -30
- package/templates/typescript-oauth/src/modules/flights/booking.tools.ts +323 -0
- package/templates/typescript-oauth/src/modules/flights/flights.module.ts +14 -0
- package/templates/typescript-oauth/src/modules/flights/flights.prompts.ts +231 -0
- package/templates/typescript-oauth/src/modules/flights/flights.resources.ts +215 -0
- package/templates/typescript-oauth/src/modules/flights/flights.tools.ts +457 -0
- package/templates/typescript-oauth/src/services/duffel.service.ts +285 -0
- package/templates/typescript-oauth/src/widgets/app/airport-search/page.tsx +270 -0
- package/templates/typescript-oauth/src/widgets/app/flight-details/page.tsx +261 -0
- package/templates/typescript-oauth/src/widgets/app/flight-search-results/page.tsx +378 -0
- package/templates/typescript-oauth/src/widgets/app/globals.css +167 -0
- package/templates/typescript-oauth/src/widgets/app/layout.tsx +6 -2
- package/templates/typescript-oauth/src/widgets/app/order-cancellation/page.tsx +207 -0
- package/templates/typescript-oauth/src/widgets/app/order-summary/page.tsx +245 -0
- package/templates/typescript-oauth/src/widgets/app/payment-confirmation/page.tsx +152 -0
- package/templates/typescript-oauth/src/widgets/app/seat-selection/page.tsx +486 -0
- package/templates/typescript-oauth/src/widgets/next-env.d.ts +5 -0
- package/templates/typescript-oauth/src/widgets/package-lock.json +155 -126
- package/templates/typescript-oauth/src/widgets/widget-manifest.json +374 -27
- package/templates/typescript-pizzaz/IMPLEMENTATION.md +98 -0
- package/templates/typescript-pizzaz/README.md +233 -0
- package/templates/typescript-pizzaz/package.json +31 -0
- package/templates/typescript-pizzaz/src/app.module.ts +28 -0
- package/templates/typescript-pizzaz/src/index.ts +30 -0
- package/templates/typescript-pizzaz/src/modules/pizzaz/pizzaz.data.ts +106 -0
- package/templates/typescript-pizzaz/src/modules/pizzaz/pizzaz.module.ts +11 -0
- package/templates/typescript-pizzaz/src/modules/pizzaz/pizzaz.service.ts +60 -0
- package/templates/typescript-pizzaz/src/modules/pizzaz/pizzaz.tools.ts +197 -0
- package/templates/typescript-pizzaz/src/widgets/app/layout.tsx +18 -0
- package/templates/typescript-pizzaz/src/widgets/app/pizza-list/page.tsx +272 -0
- package/templates/typescript-pizzaz/src/widgets/app/pizza-map/page.tsx +216 -0
- package/templates/typescript-pizzaz/src/widgets/app/pizza-shop/page.tsx +374 -0
- package/templates/typescript-pizzaz/src/widgets/components/CompactShopCard.tsx +144 -0
- package/templates/typescript-pizzaz/src/widgets/components/PizzaCard.tsx +191 -0
- package/templates/typescript-pizzaz/src/widgets/package.json +30 -0
- package/templates/typescript-pizzaz/src/widgets/widget-manifest.json +253 -0
- package/templates/typescript-pizzaz/tsconfig.json +30 -0
- package/templates/typescript-starter/src/modules/calculator/calculator.resources.ts +0 -1
- package/templates/typescript-starter/src/widgets/app/calculator-result/page.tsx +102 -56
- package/templates/typescript-starter/src/widgets/app/layout.tsx +6 -2
- package/templates/typescript-auth/AI_AGENT_CLI_REFERENCE.md +0 -702
- package/templates/typescript-auth/AI_AGENT_SDK_REFERENCE.md +0 -1260
- package/templates/typescript-auth/README.md +0 -402
- package/templates/typescript-auth/package.json +0 -36
- package/templates/typescript-auth/src/app.module.ts +0 -103
- package/templates/typescript-auth/src/db/database.ts +0 -160
- package/templates/typescript-auth/src/db/seed.ts +0 -374
- package/templates/typescript-auth/src/db/setup.ts +0 -87
- package/templates/typescript-auth/src/events/analytics.service.ts +0 -52
- package/templates/typescript-auth/src/events/notification.service.ts +0 -40
- package/templates/typescript-auth/src/filters/global-exception.filter.ts +0 -28
- package/templates/typescript-auth/src/guards/README.md +0 -75
- package/templates/typescript-auth/src/guards/jwt.guard.ts +0 -105
- package/templates/typescript-auth/src/health/database.health.ts +0 -41
- package/templates/typescript-auth/src/index.ts +0 -29
- package/templates/typescript-auth/src/interceptors/transform.interceptor.ts +0 -24
- package/templates/typescript-auth/src/middleware/logging.middleware.ts +0 -42
- package/templates/typescript-auth/src/modules/addresses/addresses.module.ts +0 -16
- package/templates/typescript-auth/src/modules/addresses/addresses.prompts.ts +0 -114
- package/templates/typescript-auth/src/modules/addresses/addresses.resources.ts +0 -40
- package/templates/typescript-auth/src/modules/addresses/addresses.tools.ts +0 -284
- package/templates/typescript-auth/src/modules/auth/auth.module.ts +0 -16
- package/templates/typescript-auth/src/modules/auth/auth.prompts.ts +0 -147
- package/templates/typescript-auth/src/modules/auth/auth.resources.ts +0 -84
- package/templates/typescript-auth/src/modules/auth/auth.tools.ts +0 -139
- package/templates/typescript-auth/src/modules/cart/cart.module.ts +0 -16
- package/templates/typescript-auth/src/modules/cart/cart.prompts.ts +0 -95
- package/templates/typescript-auth/src/modules/cart/cart.resources.ts +0 -44
- package/templates/typescript-auth/src/modules/cart/cart.tools.ts +0 -277
- package/templates/typescript-auth/src/modules/orders/orders.module.ts +0 -16
- package/templates/typescript-auth/src/modules/orders/orders.prompts.ts +0 -88
- package/templates/typescript-auth/src/modules/orders/orders.resources.ts +0 -48
- package/templates/typescript-auth/src/modules/orders/orders.tools.ts +0 -303
- package/templates/typescript-auth/src/modules/products/products.module.ts +0 -16
- package/templates/typescript-auth/src/modules/products/products.prompts.ts +0 -146
- package/templates/typescript-auth/src/modules/products/products.resources.ts +0 -98
- package/templates/typescript-auth/src/modules/products/products.tools.ts +0 -266
- package/templates/typescript-auth/src/pipes/validation.pipe.ts +0 -42
- package/templates/typescript-auth/src/services/database.service.ts +0 -90
- package/templates/typescript-auth/src/widgets/app/add-to-cart/page.tsx +0 -122
- package/templates/typescript-auth/src/widgets/app/address-added/page.tsx +0 -116
- package/templates/typescript-auth/src/widgets/app/address-deleted/page.tsx +0 -105
- package/templates/typescript-auth/src/widgets/app/address-list/page.tsx +0 -139
- package/templates/typescript-auth/src/widgets/app/address-updated/page.tsx +0 -153
- package/templates/typescript-auth/src/widgets/app/cart-cleared/page.tsx +0 -86
- package/templates/typescript-auth/src/widgets/app/cart-updated/page.tsx +0 -116
- package/templates/typescript-auth/src/widgets/app/categories/page.tsx +0 -134
- package/templates/typescript-auth/src/widgets/app/layout.tsx +0 -21
- package/templates/typescript-auth/src/widgets/app/login-result/page.tsx +0 -129
- package/templates/typescript-auth/src/widgets/app/order-confirmation/page.tsx +0 -231
- package/templates/typescript-auth/src/widgets/app/order-details/page.tsx +0 -225
- package/templates/typescript-auth/src/widgets/app/order-history/page.tsx +0 -218
- package/templates/typescript-auth/src/widgets/app/product-card/page.tsx +0 -121
- package/templates/typescript-auth/src/widgets/app/products-grid/page.tsx +0 -198
- package/templates/typescript-auth/src/widgets/app/shopping-cart/page.tsx +0 -187
- package/templates/typescript-auth/src/widgets/app/whoami/page.tsx +0 -165
- package/templates/typescript-auth/src/widgets/next.config.js +0 -38
- package/templates/typescript-auth/src/widgets/package.json +0 -18
- package/templates/typescript-auth/src/widgets/styles/ecommerce.ts +0 -169
- package/templates/typescript-auth/src/widgets/tsconfig.json +0 -28
- package/templates/typescript-auth/src/widgets/types/tool-data.ts +0 -141
- package/templates/typescript-auth/src/widgets/widget-manifest.json +0 -464
- package/templates/typescript-auth/tsconfig.json +0 -27
- package/templates/typescript-auth-api-key/AI_AGENT_CLI_REFERENCE.md +0 -701
- package/templates/typescript-auth-api-key/AI_AGENT_SDK_REFERENCE.md +0 -1260
- package/templates/typescript-auth-api-key/README.md +0 -485
- package/templates/typescript-auth-api-key/package.json +0 -21
- package/templates/typescript-auth-api-key/src/app.module.ts +0 -38
- package/templates/typescript-auth-api-key/src/guards/apikey.guard.ts +0 -47
- package/templates/typescript-auth-api-key/src/guards/multi-auth.guard.ts +0 -157
- package/templates/typescript-auth-api-key/src/index.ts +0 -47
- package/templates/typescript-auth-api-key/src/modules/calculator/calculator.module.ts +0 -12
- package/templates/typescript-auth-api-key/src/modules/calculator/calculator.prompts.ts +0 -73
- package/templates/typescript-auth-api-key/src/modules/calculator/calculator.resources.ts +0 -60
- package/templates/typescript-auth-api-key/src/modules/calculator/calculator.tools.ts +0 -71
- package/templates/typescript-auth-api-key/src/modules/demo/demo.module.ts +0 -18
- package/templates/typescript-auth-api-key/src/modules/demo/demo.tools.ts +0 -155
- package/templates/typescript-auth-api-key/src/modules/demo/multi-auth.tools.ts +0 -123
- package/templates/typescript-auth-api-key/src/widgets/app/calculator-operations/page.tsx +0 -133
- package/templates/typescript-auth-api-key/src/widgets/app/calculator-result/page.tsx +0 -134
- package/templates/typescript-auth-api-key/src/widgets/app/layout.tsx +0 -14
- package/templates/typescript-auth-api-key/src/widgets/package.json +0 -24
- package/templates/typescript-auth-api-key/src/widgets/widget-manifest.json +0 -48
- package/templates/typescript-auth-api-key/tsconfig.json +0 -23
- package/templates/typescript-oauth/OAUTH_SETUP.md +0 -592
- package/templates/typescript-oauth/src/modules/demo/demo.module.ts +0 -16
- package/templates/typescript-oauth/src/modules/demo/demo.tools.ts +0 -190
- package/templates/typescript-oauth/src/widgets/app/calculator-operations/page.tsx +0 -133
- package/templates/typescript-oauth/src/widgets/app/calculator-result/page.tsx +0 -134
- package/templates/typescript-oauth/src/widgets/out/404.html +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/WU9THacVqL52RZbrZOLS1/_buildManifest.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/WU9THacVqL52RZbrZOLS1/_ssgManifest.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/117-eb57c7ef86f964a4.js +0 -2
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/app/_not-found/page-dcb83ba3e4d0aafd.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/app/calculator-operations/page-b8913a740073ea8a.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/app/calculator-result/page-ddaaab2fce95dea2.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/app/layout-cbd3ebdc4ecc5247.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/fd9d1056-749e5812300142af.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/framework-f66176bb897dc684.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/main-76df43fcef3db344.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/main-app-f9c40224d04023c5.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/_next/static/chunks/webpack-100b9e646d9c912e.js +0 -1
- package/templates/typescript-oauth/src/widgets/out/calculator-operations.html +0 -1
- package/templates/typescript-oauth/src/widgets/out/calculator-operations.txt +0 -7
- package/templates/typescript-oauth/src/widgets/out/calculator-result.html +0 -1
- package/templates/typescript-oauth/src/widgets/out/calculator-result.txt +0 -7
- package/templates/typescript-starter/src/widgets/app/calculator-operations/page.tsx +0 -133
- /package/templates/{typescript-auth-api-key → typescript-oauth}/src/health/system.health.ts +0 -0
- /package/templates/{typescript-auth-api-key → typescript-pizzaz}/src/widgets/next.config.js +0 -0
- /package/templates/{typescript-auth-api-key → typescript-pizzaz}/src/widgets/tsconfig.json +0 -0
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { withToolData } from 'nitrostack/widgets';
|
|
4
|
-
import * as styles from '../../styles/ecommerce';
|
|
5
|
-
|
|
6
|
-
interface AddressDeletedData {
|
|
7
|
-
message: string;
|
|
8
|
-
addressId?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function AddressDeletedWidget({ data }: { data: AddressDeletedData }) {
|
|
12
|
-
const { message, addressId } = data;
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div style={styles.containerStyle}>
|
|
16
|
-
<div style={{
|
|
17
|
-
...styles.cardStyle,
|
|
18
|
-
maxWidth: '500px',
|
|
19
|
-
margin: '0 auto',
|
|
20
|
-
}}>
|
|
21
|
-
<div style={{
|
|
22
|
-
textAlign: 'center',
|
|
23
|
-
paddingTop: styles.spacing.xl,
|
|
24
|
-
paddingBottom: styles.spacing.xl,
|
|
25
|
-
}}>
|
|
26
|
-
<div style={{
|
|
27
|
-
fontSize: '80px',
|
|
28
|
-
marginBottom: styles.spacing.lg,
|
|
29
|
-
opacity: 0.5,
|
|
30
|
-
}}>
|
|
31
|
-
📍
|
|
32
|
-
</div>
|
|
33
|
-
<h2 style={{
|
|
34
|
-
fontSize: styles.typography.fontSize['2xl'],
|
|
35
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
36
|
-
color: styles.colors.gray[900],
|
|
37
|
-
marginBottom: styles.spacing.sm,
|
|
38
|
-
}}>
|
|
39
|
-
{message}
|
|
40
|
-
</h2>
|
|
41
|
-
|
|
42
|
-
<div style={{
|
|
43
|
-
marginTop: styles.spacing.xl,
|
|
44
|
-
padding: styles.spacing.xl,
|
|
45
|
-
background: `${styles.colors.error}15`,
|
|
46
|
-
border: `1px solid ${styles.colors.error}30`,
|
|
47
|
-
borderRadius: styles.borderRadius.md,
|
|
48
|
-
}}>
|
|
49
|
-
<div style={{
|
|
50
|
-
display: 'flex',
|
|
51
|
-
alignItems: 'center',
|
|
52
|
-
justifyContent: 'center',
|
|
53
|
-
gap: styles.spacing.md,
|
|
54
|
-
marginBottom: styles.spacing.md,
|
|
55
|
-
}}>
|
|
56
|
-
<div style={{ fontSize: '40px' }}>⚠️</div>
|
|
57
|
-
<div style={{ textAlign: 'left' }}>
|
|
58
|
-
<div style={{
|
|
59
|
-
fontSize: styles.typography.fontSize.lg,
|
|
60
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
61
|
-
color: styles.colors.error,
|
|
62
|
-
}}>
|
|
63
|
-
Permanently Removed
|
|
64
|
-
</div>
|
|
65
|
-
<div style={{
|
|
66
|
-
fontSize: styles.typography.fontSize.sm,
|
|
67
|
-
color: styles.colors.gray[600],
|
|
68
|
-
}}>
|
|
69
|
-
This action cannot be undone
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
{addressId && (
|
|
75
|
-
<div style={{
|
|
76
|
-
marginTop: styles.spacing.md,
|
|
77
|
-
paddingTop: styles.spacing.md,
|
|
78
|
-
borderTop: `1px solid ${styles.colors.error}30`,
|
|
79
|
-
fontSize: styles.typography.fontSize.xs,
|
|
80
|
-
fontFamily: 'monospace',
|
|
81
|
-
color: styles.colors.gray[600],
|
|
82
|
-
wordBreak: 'break-all',
|
|
83
|
-
}}>
|
|
84
|
-
ID: {addressId}
|
|
85
|
-
</div>
|
|
86
|
-
)}
|
|
87
|
-
</div>
|
|
88
|
-
|
|
89
|
-
<div style={{
|
|
90
|
-
marginTop: styles.spacing.lg,
|
|
91
|
-
padding: styles.spacing.md,
|
|
92
|
-
background: `${styles.colors.success}15`,
|
|
93
|
-
borderRadius: styles.borderRadius.md,
|
|
94
|
-
fontSize: styles.typography.fontSize.sm,
|
|
95
|
-
color: styles.colors.gray[700],
|
|
96
|
-
}}>
|
|
97
|
-
➕ You can add a new address anytime
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export default withToolData<AddressDeletedData>(AddressDeletedWidget);
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { withToolData } from 'nitrostack/widgets';
|
|
4
|
-
import { AddressListData } from '../../types/tool-data';
|
|
5
|
-
import * as styles from '../../styles/ecommerce';
|
|
6
|
-
|
|
7
|
-
function AddressListWidget({ data }: { data: AddressListData }) {
|
|
8
|
-
const { addresses } = data;
|
|
9
|
-
|
|
10
|
-
if (!addresses || addresses.length === 0) {
|
|
11
|
-
return (
|
|
12
|
-
<div style={styles.containerStyle}>
|
|
13
|
-
<div style={styles.emptyStateStyle}>
|
|
14
|
-
<div style={{ fontSize: '64px', marginBottom: styles.spacing.lg }}>
|
|
15
|
-
🏠
|
|
16
|
-
</div>
|
|
17
|
-
<h3 style={{
|
|
18
|
-
fontSize: styles.typography.fontSize.xl,
|
|
19
|
-
fontWeight: styles.typography.fontWeight.semibold,
|
|
20
|
-
color: styles.colors.gray[700],
|
|
21
|
-
marginBottom: styles.spacing.sm,
|
|
22
|
-
}}>
|
|
23
|
-
No addresses saved
|
|
24
|
-
</h3>
|
|
25
|
-
<p style={styles.metaTextStyle}>
|
|
26
|
-
Add a delivery address to get started
|
|
27
|
-
</p>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div style={styles.containerStyle}>
|
|
35
|
-
<div style={styles.titleStyle}>
|
|
36
|
-
🏠 Your Addresses
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div style={{
|
|
40
|
-
display: 'grid',
|
|
41
|
-
gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',
|
|
42
|
-
gap: styles.spacing.lg,
|
|
43
|
-
}}>
|
|
44
|
-
{addresses.map((address) => (
|
|
45
|
-
<div
|
|
46
|
-
key={address.id}
|
|
47
|
-
style={{
|
|
48
|
-
...styles.cardStyle,
|
|
49
|
-
position: 'relative',
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
{address.is_default && (
|
|
53
|
-
<div style={{
|
|
54
|
-
position: 'absolute',
|
|
55
|
-
top: styles.spacing.md,
|
|
56
|
-
right: styles.spacing.md,
|
|
57
|
-
...styles.badgeStyle,
|
|
58
|
-
background: styles.colors.primary,
|
|
59
|
-
color: styles.colors.black,
|
|
60
|
-
}}>
|
|
61
|
-
⭐ Default
|
|
62
|
-
</div>
|
|
63
|
-
)}
|
|
64
|
-
|
|
65
|
-
<div style={{
|
|
66
|
-
marginBottom: styles.spacing.lg,
|
|
67
|
-
}}>
|
|
68
|
-
<h3 style={{
|
|
69
|
-
fontSize: styles.typography.fontSize.xl,
|
|
70
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
71
|
-
color: styles.colors.gray[900],
|
|
72
|
-
marginBottom: styles.spacing.xs,
|
|
73
|
-
}}>
|
|
74
|
-
{address.full_name}
|
|
75
|
-
</h3>
|
|
76
|
-
<div style={{
|
|
77
|
-
...styles.metaTextStyle,
|
|
78
|
-
marginBottom: styles.spacing.sm,
|
|
79
|
-
}}>
|
|
80
|
-
📞 {address.phone}
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
<div style={{
|
|
85
|
-
background: styles.colors.gray[50],
|
|
86
|
-
borderRadius: styles.borderRadius.md,
|
|
87
|
-
padding: styles.spacing.md,
|
|
88
|
-
marginBottom: styles.spacing.md,
|
|
89
|
-
}}>
|
|
90
|
-
<div style={{
|
|
91
|
-
fontSize: styles.typography.fontSize.base,
|
|
92
|
-
color: styles.colors.gray[800],
|
|
93
|
-
lineHeight: styles.typography.lineHeight.relaxed,
|
|
94
|
-
}}>
|
|
95
|
-
<div style={{ marginBottom: styles.spacing.xs }}>
|
|
96
|
-
{address.street}
|
|
97
|
-
</div>
|
|
98
|
-
<div style={{ marginBottom: styles.spacing.xs }}>
|
|
99
|
-
{address.city}, {address.state} {address.zip_code}
|
|
100
|
-
</div>
|
|
101
|
-
<div>
|
|
102
|
-
{address.country}
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<div style={{
|
|
108
|
-
display: 'flex',
|
|
109
|
-
gap: styles.spacing.sm,
|
|
110
|
-
justifyContent: 'flex-end',
|
|
111
|
-
}}>
|
|
112
|
-
<button style={{
|
|
113
|
-
...styles.buttonStyle,
|
|
114
|
-
padding: `${styles.spacing.sm} ${styles.spacing.md}`,
|
|
115
|
-
fontSize: styles.typography.fontSize.sm,
|
|
116
|
-
background: styles.colors.white,
|
|
117
|
-
color: styles.colors.gray[700],
|
|
118
|
-
border: `1px solid ${styles.colors.gray[300]}`,
|
|
119
|
-
}}>
|
|
120
|
-
Edit
|
|
121
|
-
</button>
|
|
122
|
-
{!address.is_default && (
|
|
123
|
-
<button style={{
|
|
124
|
-
...styles.buttonStyle,
|
|
125
|
-
padding: `${styles.spacing.sm} ${styles.spacing.md}`,
|
|
126
|
-
fontSize: styles.typography.fontSize.sm,
|
|
127
|
-
}}>
|
|
128
|
-
Set Default
|
|
129
|
-
</button>
|
|
130
|
-
)}
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
))}
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export default withToolData<AddressListData>(AddressListWidget);
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { withToolData } from 'nitrostack/widgets';
|
|
4
|
-
import * as styles from '../../styles/ecommerce';
|
|
5
|
-
|
|
6
|
-
interface Address {
|
|
7
|
-
id: string;
|
|
8
|
-
full_name: string;
|
|
9
|
-
street: string;
|
|
10
|
-
city: string;
|
|
11
|
-
state: string;
|
|
12
|
-
zip_code: string;
|
|
13
|
-
country: string;
|
|
14
|
-
phone: string;
|
|
15
|
-
is_default: boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface AddressUpdatedData {
|
|
19
|
-
message: string;
|
|
20
|
-
address?: Address;
|
|
21
|
-
addressId?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function AddressUpdatedWidget({ data }: { data: AddressUpdatedData }) {
|
|
25
|
-
const { message, address } = data;
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div style={styles.containerStyle}>
|
|
29
|
-
<div style={{
|
|
30
|
-
...styles.cardStyle,
|
|
31
|
-
maxWidth: '600px',
|
|
32
|
-
margin: '0 auto',
|
|
33
|
-
}}>
|
|
34
|
-
<div style={{
|
|
35
|
-
textAlign: 'center',
|
|
36
|
-
marginBottom: styles.spacing.xl,
|
|
37
|
-
}}>
|
|
38
|
-
<div style={{
|
|
39
|
-
width: '60px',
|
|
40
|
-
height: '60px',
|
|
41
|
-
margin: '0 auto 16px',
|
|
42
|
-
borderRadius: styles.borderRadius.full,
|
|
43
|
-
background: styles.colors.success,
|
|
44
|
-
display: 'flex',
|
|
45
|
-
alignItems: 'center',
|
|
46
|
-
justifyContent: 'center',
|
|
47
|
-
fontSize: '28px',
|
|
48
|
-
}}>
|
|
49
|
-
✓
|
|
50
|
-
</div>
|
|
51
|
-
<h2 style={{
|
|
52
|
-
fontSize: styles.typography.fontSize.xl,
|
|
53
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
54
|
-
color: styles.colors.gray[900],
|
|
55
|
-
marginBottom: styles.spacing.sm,
|
|
56
|
-
}}>
|
|
57
|
-
{message}
|
|
58
|
-
</h2>
|
|
59
|
-
<p style={styles.metaTextStyle}>
|
|
60
|
-
This address will be used for all future orders
|
|
61
|
-
</p>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
{address && (
|
|
65
|
-
<div style={{
|
|
66
|
-
position: 'relative',
|
|
67
|
-
background: styles.colors.gray[50],
|
|
68
|
-
borderRadius: styles.borderRadius.md,
|
|
69
|
-
padding: styles.spacing.xl,
|
|
70
|
-
border: `2px solid ${styles.colors.primary}`,
|
|
71
|
-
}}>
|
|
72
|
-
<div style={{
|
|
73
|
-
position: 'absolute',
|
|
74
|
-
top: styles.spacing.md,
|
|
75
|
-
right: styles.spacing.md,
|
|
76
|
-
...styles.badgeStyle,
|
|
77
|
-
background: styles.colors.primary,
|
|
78
|
-
color: styles.colors.black,
|
|
79
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
80
|
-
}}>
|
|
81
|
-
⭐ DEFAULT
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
<div style={{
|
|
85
|
-
display: 'flex',
|
|
86
|
-
alignItems: 'start',
|
|
87
|
-
gap: styles.spacing.md,
|
|
88
|
-
marginBottom: styles.spacing.lg,
|
|
89
|
-
}}>
|
|
90
|
-
<div style={{ fontSize: '32px' }}>👤</div>
|
|
91
|
-
<div>
|
|
92
|
-
<div style={{
|
|
93
|
-
fontSize: styles.typography.fontSize.lg,
|
|
94
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
95
|
-
color: styles.colors.gray[900],
|
|
96
|
-
}}>
|
|
97
|
-
{address.full_name}
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
<div style={{
|
|
103
|
-
display: 'flex',
|
|
104
|
-
flexDirection: 'column',
|
|
105
|
-
gap: styles.spacing.sm,
|
|
106
|
-
paddingLeft: styles.spacing['3xl'],
|
|
107
|
-
}}>
|
|
108
|
-
<div style={{
|
|
109
|
-
display: 'flex',
|
|
110
|
-
gap: styles.spacing.sm,
|
|
111
|
-
fontSize: styles.typography.fontSize.base,
|
|
112
|
-
color: styles.colors.gray[700],
|
|
113
|
-
}}>
|
|
114
|
-
<span>🏠</span>
|
|
115
|
-
<span>{address.street}</span>
|
|
116
|
-
</div>
|
|
117
|
-
<div style={{
|
|
118
|
-
display: 'flex',
|
|
119
|
-
gap: styles.spacing.sm,
|
|
120
|
-
fontSize: styles.typography.fontSize.base,
|
|
121
|
-
color: styles.colors.gray[700],
|
|
122
|
-
}}>
|
|
123
|
-
<span>📍</span>
|
|
124
|
-
<span>{address.city}, {address.state} {address.zip_code}</span>
|
|
125
|
-
</div>
|
|
126
|
-
<div style={{
|
|
127
|
-
display: 'flex',
|
|
128
|
-
gap: styles.spacing.sm,
|
|
129
|
-
fontSize: styles.typography.fontSize.base,
|
|
130
|
-
color: styles.colors.gray[700],
|
|
131
|
-
}}>
|
|
132
|
-
<span>🌍</span>
|
|
133
|
-
<span>{address.country}</span>
|
|
134
|
-
</div>
|
|
135
|
-
<div style={{
|
|
136
|
-
display: 'flex',
|
|
137
|
-
gap: styles.spacing.sm,
|
|
138
|
-
fontSize: styles.typography.fontSize.base,
|
|
139
|
-
color: styles.colors.gray[700],
|
|
140
|
-
fontFamily: 'monospace',
|
|
141
|
-
}}>
|
|
142
|
-
<span>📞</span>
|
|
143
|
-
<span>{address.phone}</span>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
)}
|
|
148
|
-
</div>
|
|
149
|
-
</div>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export default withToolData<AddressUpdatedData>(AddressUpdatedWidget);
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { withToolData } from 'nitrostack/widgets';
|
|
4
|
-
import * as styles from '../../styles/ecommerce';
|
|
5
|
-
|
|
6
|
-
interface CartClearedData {
|
|
7
|
-
message: string;
|
|
8
|
-
itemsRemoved: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function CartClearedWidget({ data }: { data: CartClearedData }) {
|
|
12
|
-
const { message, itemsRemoved } = data;
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div style={styles.containerStyle}>
|
|
16
|
-
<div style={{
|
|
17
|
-
...styles.cardStyle,
|
|
18
|
-
maxWidth: '500px',
|
|
19
|
-
margin: '0 auto',
|
|
20
|
-
}}>
|
|
21
|
-
<div style={{
|
|
22
|
-
textAlign: 'center',
|
|
23
|
-
paddingTop: styles.spacing.xl,
|
|
24
|
-
paddingBottom: styles.spacing.xl,
|
|
25
|
-
}}>
|
|
26
|
-
<div style={{
|
|
27
|
-
fontSize: '80px',
|
|
28
|
-
marginBottom: styles.spacing.lg,
|
|
29
|
-
opacity: 0.5,
|
|
30
|
-
}}>
|
|
31
|
-
🛒
|
|
32
|
-
</div>
|
|
33
|
-
<h2 style={{
|
|
34
|
-
fontSize: styles.typography.fontSize['2xl'],
|
|
35
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
36
|
-
color: styles.colors.gray[900],
|
|
37
|
-
marginBottom: styles.spacing.sm,
|
|
38
|
-
}}>
|
|
39
|
-
{message}
|
|
40
|
-
</h2>
|
|
41
|
-
|
|
42
|
-
<div style={{
|
|
43
|
-
marginTop: styles.spacing.xl,
|
|
44
|
-
padding: styles.spacing.xl,
|
|
45
|
-
background: styles.colors.gray[50],
|
|
46
|
-
borderRadius: styles.borderRadius.md,
|
|
47
|
-
}}>
|
|
48
|
-
<div style={{
|
|
49
|
-
display: 'flex',
|
|
50
|
-
alignItems: 'center',
|
|
51
|
-
justifyContent: 'center',
|
|
52
|
-
gap: styles.spacing.lg,
|
|
53
|
-
}}>
|
|
54
|
-
<div style={{ fontSize: '48px' }}>📦</div>
|
|
55
|
-
<div style={{ textAlign: 'left' }}>
|
|
56
|
-
<div style={{
|
|
57
|
-
fontSize: styles.typography.fontSize['3xl'],
|
|
58
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
59
|
-
color: styles.colors.gray[900],
|
|
60
|
-
}}>
|
|
61
|
-
{itemsRemoved}
|
|
62
|
-
</div>
|
|
63
|
-
<div style={styles.metaTextStyle}>
|
|
64
|
-
item{itemsRemoved !== 1 ? 's' : ''} removed
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
<div style={{
|
|
71
|
-
marginTop: styles.spacing.lg,
|
|
72
|
-
padding: styles.spacing.md,
|
|
73
|
-
background: `${styles.colors.success}15`,
|
|
74
|
-
borderRadius: styles.borderRadius.md,
|
|
75
|
-
fontSize: styles.typography.fontSize.sm,
|
|
76
|
-
color: styles.colors.gray[700],
|
|
77
|
-
}}>
|
|
78
|
-
✨ Your cart is now fresh and ready for shopping!
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export default withToolData<CartClearedData>(CartClearedWidget);
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { withToolData } from 'nitrostack/widgets';
|
|
4
|
-
import * as styles from '../../styles/ecommerce';
|
|
5
|
-
|
|
6
|
-
interface CartUpdateData {
|
|
7
|
-
message: string;
|
|
8
|
-
product?: string;
|
|
9
|
-
quantity?: number;
|
|
10
|
-
itemsRemoved?: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function CartUpdatedWidget({ data }: { data: CartUpdateData }) {
|
|
14
|
-
const { message, product, quantity, itemsRemoved } = data;
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<div style={styles.containerStyle}>
|
|
18
|
-
<div style={{
|
|
19
|
-
...styles.cardStyle,
|
|
20
|
-
maxWidth: '500px',
|
|
21
|
-
margin: '0 auto',
|
|
22
|
-
}}>
|
|
23
|
-
<div style={{
|
|
24
|
-
textAlign: 'center',
|
|
25
|
-
marginBottom: styles.spacing.xl,
|
|
26
|
-
}}>
|
|
27
|
-
<div style={{
|
|
28
|
-
width: '60px',
|
|
29
|
-
height: '60px',
|
|
30
|
-
margin: '0 auto 16px',
|
|
31
|
-
borderRadius: styles.borderRadius.full,
|
|
32
|
-
background: styles.colors.success,
|
|
33
|
-
display: 'flex',
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
justifyContent: 'center',
|
|
36
|
-
fontSize: '28px',
|
|
37
|
-
}}>
|
|
38
|
-
✓
|
|
39
|
-
</div>
|
|
40
|
-
<h2 style={{
|
|
41
|
-
fontSize: styles.typography.fontSize.xl,
|
|
42
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
43
|
-
color: styles.colors.gray[900],
|
|
44
|
-
marginBottom: styles.spacing.sm,
|
|
45
|
-
}}>
|
|
46
|
-
{message}
|
|
47
|
-
</h2>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
{product && (
|
|
51
|
-
<div style={{
|
|
52
|
-
padding: styles.spacing.lg,
|
|
53
|
-
background: styles.colors.gray[50],
|
|
54
|
-
borderRadius: styles.borderRadius.md,
|
|
55
|
-
marginBottom: styles.spacing.md,
|
|
56
|
-
}}>
|
|
57
|
-
<div style={{
|
|
58
|
-
fontSize: styles.typography.fontSize.sm,
|
|
59
|
-
color: styles.colors.gray[500],
|
|
60
|
-
marginBottom: styles.spacing.xs,
|
|
61
|
-
textTransform: 'uppercase',
|
|
62
|
-
letterSpacing: '0.5px',
|
|
63
|
-
fontWeight: styles.typography.fontWeight.semibold,
|
|
64
|
-
}}>
|
|
65
|
-
Product Updated
|
|
66
|
-
</div>
|
|
67
|
-
<div style={{
|
|
68
|
-
fontSize: styles.typography.fontSize.base,
|
|
69
|
-
fontWeight: styles.typography.fontWeight.semibold,
|
|
70
|
-
color: styles.colors.gray[900],
|
|
71
|
-
marginBottom: styles.spacing.sm,
|
|
72
|
-
}}>
|
|
73
|
-
{product}
|
|
74
|
-
</div>
|
|
75
|
-
{quantity !== undefined && (
|
|
76
|
-
<div style={{
|
|
77
|
-
display: 'flex',
|
|
78
|
-
alignItems: 'center',
|
|
79
|
-
gap: styles.spacing.sm,
|
|
80
|
-
}}>
|
|
81
|
-
<span style={styles.metaTextStyle}>New quantity:</span>
|
|
82
|
-
<div style={{
|
|
83
|
-
...styles.badgeStyle,
|
|
84
|
-
background: styles.colors.primary,
|
|
85
|
-
color: styles.colors.black,
|
|
86
|
-
fontWeight: styles.typography.fontWeight.bold,
|
|
87
|
-
}}>
|
|
88
|
-
{quantity}
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
)}
|
|
92
|
-
</div>
|
|
93
|
-
)}
|
|
94
|
-
|
|
95
|
-
{itemsRemoved !== undefined && itemsRemoved > 0 && (
|
|
96
|
-
<div style={{
|
|
97
|
-
padding: styles.spacing.lg,
|
|
98
|
-
background: `${styles.colors.error}15`,
|
|
99
|
-
border: `1px solid ${styles.colors.error}30`,
|
|
100
|
-
borderRadius: styles.borderRadius.md,
|
|
101
|
-
}}>
|
|
102
|
-
<div style={{
|
|
103
|
-
fontSize: styles.typography.fontSize.base,
|
|
104
|
-
fontWeight: styles.typography.fontWeight.semibold,
|
|
105
|
-
color: styles.colors.error,
|
|
106
|
-
}}>
|
|
107
|
-
{itemsRemoved} item{itemsRemoved !== 1 ? 's' : ''} removed from cart
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
)}
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export default withToolData<CartUpdateData>(CartUpdatedWidget);
|