create-nymbal-app 0.4.0 → 0.6.0
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/index.d.ts +2 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/scaffold/project/astro/src/pages/index.astro +13 -15
- package/scaffold/templates/astro/_dot.node-version +1 -1
- package/scaffold/templates/astro/astro.config.mjs +23 -0
- package/scaffold/templates/astro/package.json +26 -26
- package/scaffold/templates/astro/src/components/SkipNav.astro +3 -1
- package/scaffold/templates/astro/src/elements/index.ts +11 -0
- package/scaffold/templates/astro/src/layouts/BaseLayout.astro +15 -4
- package/scaffold/templates/astro/src/lib/api.ts +162 -38
- package/scaffold/templates/astro/src/lib/chrome.ts +59 -0
- package/scaffold/templates/astro/src/lib/client.ts +4 -4
- package/scaffold/templates/astro/src/lib/fragments.ts +48 -0
- package/scaffold/templates/astro/src/lib/server-elements.ts +5 -0
- package/scaffold/templates/astro/src/middleware.ts +37 -0
- package/scaffold/templates/astro/src/pages/404.astro +3 -0
- package/scaffold/templates/astro/src/pages/account/addresses.astro +5 -97
- package/scaffold/templates/astro/src/pages/account/login.astro +7 -34
- package/scaffold/templates/astro/src/pages/account/orders/[orderNumber].astro +11 -3
- package/scaffold/templates/astro/src/pages/account/profile.astro +6 -56
- package/scaffold/templates/astro/src/pages/account/register.astro +7 -73
- package/scaffold/templates/astro/src/pages/alerts/confirm.astro +59 -0
- package/scaffold/templates/astro/src/pages/alerts/unsubscribe.astro +53 -0
- package/scaffold/templates/astro/src/pages/cart.astro +14 -7
- package/scaffold/templates/astro/src/pages/category/[slug].astro +25 -27
- package/scaffold/templates/astro/src/pages/checkout.astro +30 -94
- package/scaffold/templates/astro/src/pages/fragments/footer.astro +5 -2
- package/scaffold/templates/astro/src/pages/fragments/header.astro +12 -2
- package/scaffold/templates/astro/src/pages/fragments/nav.astro +8 -5
- package/scaffold/templates/astro/src/pages/fragments/product/[slug].astro +9 -10
- package/scaffold/templates/astro/src/pages/index.astro +25 -15
- package/scaffold/templates/astro/src/pages/order/[orderNumber].astro +34 -45
- package/scaffold/templates/astro/src/pages/product/[slug].astro +64 -34
- package/scaffold/templates/astro/src/pages/products/index.astro +16 -21
- package/scaffold/templates/astro/src/pages/search.astro +10 -11
- package/scaffold/templates/astro/src/scripts/init-client.ts +14 -0
- package/scaffold/templates/astro/src/scripts/order-status.ts +3 -1
- package/scaffold/templates/astro/src/scripts/pdp.ts +29 -21
- package/scaffold/templates/astro/src/scripts/plp.ts +15 -93
- package/scaffold/templates/astro/src/scripts/search.ts +7 -132
- package/scaffold/templates/astro/src/scripts/signed-in-redirect.ts +4 -0
- package/scaffold/templates/astro/src/styles/global.css +49 -45
- package/scaffold/templates/astro/src/styles/pages/account.css +4 -90
- package/scaffold/templates/astro/src/styles/pages/confirmation.css +6 -0
- package/scaffold/templates/astro/src/styles/pages/home.css +9 -100
- package/scaffold/templates/astro/src/styles/pages/pdp.css +5 -171
- package/scaffold/templates/astro/src/styles/pages/plp.css +3 -42
- package/scaffold/templates/astro/src/styles/pages/search.css +4 -110
- package/scaffold/templates/astro/src/styles/tokens.css +56 -0
- package/scaffold/templates/nextjs/_dot.node-version +1 -1
- package/scaffold/templates/nextjs/app/(catalog)/category/[slug]/page.tsx +74 -0
- package/scaffold/templates/nextjs/app/(catalog)/home/[key]/page.tsx +85 -0
- package/scaffold/templates/nextjs/app/(catalog)/layout.tsx +13 -0
- package/scaffold/templates/nextjs/app/(catalog)/not-found.tsx +7 -0
- package/scaffold/templates/nextjs/app/(catalog)/product/[slug]/page.tsx +201 -0
- package/scaffold/templates/nextjs/app/(catalog)/products/page.tsx +62 -0
- package/scaffold/templates/nextjs/app/(catalog)/search/SearchView.tsx +90 -0
- package/scaffold/templates/nextjs/app/(catalog)/search/page.tsx +46 -0
- package/scaffold/templates/nextjs/app/(shopper)/account/addresses/AddressesView.tsx +5 -0
- package/scaffold/templates/nextjs/app/(shopper)/account/addresses/page.tsx +17 -0
- package/scaffold/templates/nextjs/app/(shopper)/account/login/LoginView.tsx +28 -0
- package/scaffold/templates/nextjs/app/(shopper)/account/login/page.tsx +23 -0
- package/scaffold/templates/nextjs/app/{account → (shopper)/account}/orders/[orderNumber]/page.tsx +10 -3
- package/scaffold/templates/nextjs/app/(shopper)/account/profile/ProfileView.tsx +5 -0
- package/scaffold/templates/nextjs/app/(shopper)/account/profile/page.tsx +20 -0
- package/scaffold/templates/nextjs/app/(shopper)/account/register/RegisterView.tsx +26 -0
- package/scaffold/templates/nextjs/app/(shopper)/account/register/page.tsx +11 -0
- package/scaffold/templates/nextjs/app/(shopper)/alerts/AlertLinkForm.tsx +90 -0
- package/scaffold/templates/nextjs/app/(shopper)/alerts/LinkInvalid.tsx +19 -0
- package/scaffold/templates/nextjs/app/(shopper)/alerts/actions.ts +33 -0
- package/scaffold/templates/nextjs/app/(shopper)/alerts/confirm/page.tsx +19 -0
- package/scaffold/templates/nextjs/app/(shopper)/alerts/unsubscribe/page.tsx +17 -0
- package/scaffold/templates/nextjs/app/(shopper)/cart/CartView.tsx +5 -0
- package/scaffold/templates/nextjs/app/(shopper)/cart/page.tsx +22 -0
- package/scaffold/templates/nextjs/app/(shopper)/checkout/CheckoutView.tsx +34 -0
- package/scaffold/templates/nextjs/app/(shopper)/checkout/page.tsx +39 -0
- package/scaffold/templates/nextjs/app/(shopper)/layout.tsx +12 -0
- package/scaffold/templates/nextjs/app/(shopper)/not-found.tsx +6 -0
- package/scaffold/templates/nextjs/app/{order → (shopper)/order}/[orderNumber]/page.tsx +44 -9
- package/scaffold/templates/nextjs/app/error.tsx +3 -7
- package/scaffold/templates/nextjs/app/fragments/footer/route.ts +13 -0
- package/scaffold/templates/nextjs/app/fragments/header/[key]/route.ts +18 -0
- package/scaffold/templates/nextjs/app/fragments/nav/[key]/route.ts +23 -0
- package/scaffold/templates/nextjs/app/fragments/product/[slug]/route.ts +22 -0
- package/scaffold/templates/nextjs/app/globals.css +5 -23
- package/scaffold/templates/nextjs/app/layout.tsx +8 -5
- package/scaffold/templates/nextjs/app/not-found.tsx +9 -33
- package/scaffold/templates/nextjs/app/tokens.css +56 -0
- package/scaffold/templates/nextjs/components/client/ListingControls.tsx +87 -0
- package/scaffold/templates/nextjs/components/client/NymbalSetup.tsx +48 -6
- package/scaffold/templates/nextjs/components/client/OrderStatusRefresh.tsx +8 -2
- package/scaffold/templates/nextjs/components/client/ProductInteractive.tsx +47 -15
- package/scaffold/templates/nextjs/components/client/elements.tsx +17 -0
- package/scaffold/templates/nextjs/components/server/Header.tsx +33 -102
- package/scaffold/templates/nextjs/components/server/NotFoundView.tsx +39 -0
- package/scaffold/templates/nextjs/components/server/SkipNav.tsx +7 -3
- package/scaffold/templates/nextjs/elements/index.ts +12 -0
- package/scaffold/templates/nextjs/lib/api.ts +198 -62
- package/scaffold/templates/nextjs/lib/chrome.ts +40 -0
- package/scaffold/templates/nextjs/lib/fragments.ts +16 -0
- package/scaffold/templates/nextjs/lib/header.ts +39 -0
- package/scaffold/templates/nextjs/lib/render.ts +14 -0
- package/scaffold/templates/nextjs/next.config.mjs +41 -0
- package/scaffold/templates/nextjs/package.json +28 -27
- package/scaffold/templates/nextjs/styles/pages/account.module.css +0 -70
- package/scaffold/templates/nextjs/styles/pages/confirmation.module.css +6 -85
- package/scaffold/templates/nextjs/styles/pages/home.module.css +2 -103
- package/scaffold/templates/nextjs/styles/pages/pdp.module.css +3 -183
- package/scaffold/templates/nextjs/styles/pages/plp.module.css +9 -143
- package/scaffold/templates/nextjs/styles/pages/search.module.css +1 -145
- package/scaffold/templates/nextjs/tsconfig.dist.json +5 -0
- package/scaffold/templates/astro/src/components/AddressForm.astro +0 -107
- package/scaffold/templates/astro/src/components/Breadcrumb.astro +0 -20
- package/scaffold/templates/astro/src/components/CategoryNav.astro +0 -27
- package/scaffold/templates/astro/src/components/CheckoutSteps.astro +0 -29
- package/scaffold/templates/astro/src/components/Footer.astro +0 -108
- package/scaffold/templates/astro/src/components/Header.astro +0 -198
- package/scaffold/templates/astro/src/components/ImageGallery.astro +0 -42
- package/scaffold/templates/astro/src/components/OrderSummary.astro +0 -53
- package/scaffold/templates/astro/src/components/Pagination.astro +0 -13
- package/scaffold/templates/astro/src/components/PriceDisplay.astro +0 -25
- package/scaffold/templates/astro/src/components/ProductCard.astro +0 -44
- package/scaffold/templates/astro/src/components/RelatedProducts.astro +0 -28
- package/scaffold/templates/astro/src/components/ReviewForm.astro +0 -74
- package/scaffold/templates/astro/src/components/ReviewList.astro +0 -41
- package/scaffold/templates/astro/src/components/StockBadge.astro +0 -15
- package/scaffold/templates/astro/src/scripts/auth-forms.ts +0 -82
- package/scaffold/templates/astro/src/scripts/cart-page.ts +0 -118
- package/scaffold/templates/astro/src/scripts/checkout.ts +0 -271
- package/scaffold/templates/astro/src/scripts/image-gallery.ts +0 -22
- package/scaffold/templates/astro/src/scripts/profile-form.ts +0 -57
- package/scaffold/templates/astro/src/scripts/review-form.ts +0 -27
- package/scaffold/templates/astro/src/styles/pages/cart.css +0 -215
- package/scaffold/templates/astro/src/styles/pages/checkout.css +0 -270
- package/scaffold/templates/nextjs/app/account/addresses/page.tsx +0 -10
- package/scaffold/templates/nextjs/app/account/login/page.tsx +0 -23
- package/scaffold/templates/nextjs/app/account/profile/page.tsx +0 -10
- package/scaffold/templates/nextjs/app/account/register/page.tsx +0 -10
- package/scaffold/templates/nextjs/app/cart/page.tsx +0 -10
- package/scaffold/templates/nextjs/app/category/[slug]/page.tsx +0 -61
- package/scaffold/templates/nextjs/app/checkout/page.tsx +0 -17
- package/scaffold/templates/nextjs/app/page.tsx +0 -63
- package/scaffold/templates/nextjs/app/product/[slug]/page.tsx +0 -111
- package/scaffold/templates/nextjs/app/products/page.tsx +0 -40
- package/scaffold/templates/nextjs/app/search/page.tsx +0 -24
- package/scaffold/templates/nextjs/components/client/AddressManager.tsx +0 -181
- package/scaffold/templates/nextjs/components/client/CartPage.tsx +0 -121
- package/scaffold/templates/nextjs/components/client/CheckoutForm.tsx +0 -482
- package/scaffold/templates/nextjs/components/client/ImageGallery.tsx +0 -68
- package/scaffold/templates/nextjs/components/client/LoginForm.tsx +0 -89
- package/scaffold/templates/nextjs/components/client/MiniCartWrapper.tsx +0 -12
- package/scaffold/templates/nextjs/components/client/ProductGrid.tsx +0 -137
- package/scaffold/templates/nextjs/components/client/ProfileForm.tsx +0 -112
- package/scaffold/templates/nextjs/components/client/RegisterForm.tsx +0 -131
- package/scaffold/templates/nextjs/components/client/ReviewForm.tsx +0 -116
- package/scaffold/templates/nextjs/components/client/SearchBarWrapper.tsx +0 -27
- package/scaffold/templates/nextjs/components/client/SearchResults.tsx +0 -181
- package/scaffold/templates/nextjs/components/server/Breadcrumb.tsx +0 -36
- package/scaffold/templates/nextjs/components/server/CategoryNav.tsx +0 -29
- package/scaffold/templates/nextjs/components/server/CheckoutSteps.tsx +0 -60
- package/scaffold/templates/nextjs/components/server/Footer.module.css +0 -64
- package/scaffold/templates/nextjs/components/server/Footer.tsx +0 -79
- package/scaffold/templates/nextjs/components/server/Header.module.css +0 -147
- package/scaffold/templates/nextjs/components/server/OrderSummary.tsx +0 -79
- package/scaffold/templates/nextjs/components/server/PriceDisplay.tsx +0 -31
- package/scaffold/templates/nextjs/components/server/ProductCard.tsx +0 -59
- package/scaffold/templates/nextjs/components/server/RelatedProducts.tsx +0 -31
- package/scaffold/templates/nextjs/components/server/ReviewList.tsx +0 -62
- package/scaffold/templates/nextjs/styles/pages/cart.module.css +0 -240
- package/scaffold/templates/nextjs/styles/pages/checkout.module.css +0 -404
- /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/layout.tsx +0 -0
- /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/orders/page.tsx +0 -0
- /package/scaffold/templates/nextjs/app/{account → (shopper)/account}/page.tsx +0 -0
|
@@ -14,136 +14,7 @@
|
|
|
14
14
|
margin-bottom: var(--nymbal-spacing-sm);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
font-size: var(--nymbal-font-size-sm);
|
|
19
|
-
color: var(--nymbal-color-text-muted);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.queryTerm {
|
|
23
|
-
font-weight: var(--nymbal-font-weight-medium);
|
|
24
|
-
color: var(--nymbal-color-text);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.resultCount {
|
|
28
|
-
font-size: var(--nymbal-font-size-sm);
|
|
29
|
-
color: var(--nymbal-color-text-muted);
|
|
30
|
-
margin-bottom: var(--nymbal-spacing-md);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* ── Search Input ─────────────────────────────────────────────────── */
|
|
34
|
-
|
|
35
|
-
.searchInputWrapper {
|
|
36
|
-
max-width: 32rem;
|
|
37
|
-
margin-bottom: var(--nymbal-spacing-xl);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* ── Results Grid ─────────────────────────────────────────────────── */
|
|
41
|
-
|
|
42
|
-
.grid {
|
|
43
|
-
display: grid;
|
|
44
|
-
grid-template-columns: 1fr;
|
|
45
|
-
gap: var(--nymbal-spacing-md);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@media (min-width: 640px) {
|
|
49
|
-
.grid {
|
|
50
|
-
grid-template-columns: repeat(2, 1fr);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@media (min-width: 1024px) {
|
|
55
|
-
.grid {
|
|
56
|
-
grid-template-columns: repeat(4, 1fr);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.productCard {
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
background: var(--nymbal-color-surface);
|
|
64
|
-
border: 1px solid var(--nymbal-color-border);
|
|
65
|
-
border-radius: var(--nymbal-radius-lg);
|
|
66
|
-
overflow: hidden;
|
|
67
|
-
text-decoration: none;
|
|
68
|
-
color: var(--nymbal-color-text);
|
|
69
|
-
transition: box-shadow var(--nymbal-transition-fast),
|
|
70
|
-
transform var(--nymbal-transition-fast);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.productCard:hover {
|
|
74
|
-
box-shadow: var(--nymbal-shadow-md);
|
|
75
|
-
transform: translateY(-2px);
|
|
76
|
-
text-decoration: none;
|
|
77
|
-
color: var(--nymbal-color-text);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.productImage {
|
|
81
|
-
aspect-ratio: 1;
|
|
82
|
-
background-color: #f4f4f5;
|
|
83
|
-
overflow: hidden;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.productImage img {
|
|
87
|
-
width: 100%;
|
|
88
|
-
height: 100%;
|
|
89
|
-
object-fit: cover;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.productInfo {
|
|
93
|
-
padding: var(--nymbal-spacing-md);
|
|
94
|
-
display: flex;
|
|
95
|
-
flex-direction: column;
|
|
96
|
-
gap: var(--nymbal-spacing-xs);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.productName {
|
|
100
|
-
font-size: var(--nymbal-font-size-sm);
|
|
101
|
-
font-weight: var(--nymbal-font-weight-medium);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.productPrice {
|
|
105
|
-
font-size: var(--nymbal-font-size-sm);
|
|
106
|
-
font-weight: var(--nymbal-font-weight-bold);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/* ── Empty State ──────────────────────────────────────────────────── */
|
|
110
|
-
|
|
111
|
-
.empty {
|
|
112
|
-
text-align: center;
|
|
113
|
-
padding: 4rem var(--nymbal-spacing-lg);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.emptyIcon {
|
|
117
|
-
display: inline-flex;
|
|
118
|
-
align-items: center;
|
|
119
|
-
justify-content: center;
|
|
120
|
-
width: 4rem;
|
|
121
|
-
height: 4rem;
|
|
122
|
-
border-radius: 50%;
|
|
123
|
-
background-color: #f4f4f5;
|
|
124
|
-
color: var(--nymbal-color-text-muted);
|
|
125
|
-
margin-bottom: var(--nymbal-spacing-md);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.emptyIcon svg {
|
|
129
|
-
width: 2rem;
|
|
130
|
-
height: 2rem;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.emptyTitle {
|
|
134
|
-
font-size: var(--nymbal-font-size-lg);
|
|
135
|
-
font-weight: var(--nymbal-font-weight-medium);
|
|
136
|
-
margin-bottom: var(--nymbal-spacing-sm);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.emptyText {
|
|
140
|
-
font-size: var(--nymbal-font-size-sm);
|
|
141
|
-
color: var(--nymbal-color-text-muted);
|
|
142
|
-
max-width: 24rem;
|
|
143
|
-
margin-inline: auto;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/* ── Category filter and load more ───────────────────────────────── */
|
|
17
|
+
/* ── Category filter beside the results ──────────────────────────── */
|
|
147
18
|
|
|
148
19
|
.layout {
|
|
149
20
|
display: grid;
|
|
@@ -161,21 +32,6 @@
|
|
|
161
32
|
align-self: start;
|
|
162
33
|
}
|
|
163
34
|
|
|
164
|
-
.pagination {
|
|
165
|
-
display: flex;
|
|
166
|
-
justify-content: center;
|
|
167
|
-
margin-top: var(--nymbal-spacing-xl);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/* ── Loading ──────────────────────────────────────────────────────── */
|
|
171
|
-
|
|
172
|
-
.loading {
|
|
173
|
-
display: flex;
|
|
174
|
-
align-items: center;
|
|
175
|
-
justify-content: center;
|
|
176
|
-
min-height: 16rem;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
35
|
/* ── Suggestions ──────────────────────────────────────────────────── */
|
|
180
36
|
|
|
181
37
|
.suggestions {
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import '../styles/pages/checkout.css'
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
id: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const { id } = Astro.props
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<div class="address-grid" data-testid={`${id}-form`}>
|
|
12
|
-
<div class="form-group">
|
|
13
|
-
<label for={`${id}-firstName`}>First Name</label>
|
|
14
|
-
<input
|
|
15
|
-
type="text"
|
|
16
|
-
id={`${id}-firstName`}
|
|
17
|
-
name="firstName"
|
|
18
|
-
required
|
|
19
|
-
autocomplete="given-name"
|
|
20
|
-
data-testid={`${id}-firstName`}
|
|
21
|
-
/>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div class="form-group">
|
|
25
|
-
<label for={`${id}-lastName`}>Last Name</label>
|
|
26
|
-
<input
|
|
27
|
-
type="text"
|
|
28
|
-
id={`${id}-lastName`}
|
|
29
|
-
name="lastName"
|
|
30
|
-
required
|
|
31
|
-
autocomplete="family-name"
|
|
32
|
-
data-testid={`${id}-lastName`}
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div class="form-group full-width">
|
|
37
|
-
<label for={`${id}-addressLine1`}>Address Line 1</label>
|
|
38
|
-
<input
|
|
39
|
-
type="text"
|
|
40
|
-
id={`${id}-addressLine1`}
|
|
41
|
-
name="addressLine1"
|
|
42
|
-
required
|
|
43
|
-
autocomplete="address-line1"
|
|
44
|
-
data-testid={`${id}-addressLine1`}
|
|
45
|
-
/>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<div class="form-group full-width">
|
|
49
|
-
<label for={`${id}-addressLine2`}>Address Line 2 (optional)</label>
|
|
50
|
-
<input
|
|
51
|
-
type="text"
|
|
52
|
-
id={`${id}-addressLine2`}
|
|
53
|
-
name="addressLine2"
|
|
54
|
-
autocomplete="address-line2"
|
|
55
|
-
data-testid={`${id}-addressLine2`}
|
|
56
|
-
/>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<div class="form-group">
|
|
60
|
-
<label for={`${id}-city`}>City</label>
|
|
61
|
-
<input
|
|
62
|
-
type="text"
|
|
63
|
-
id={`${id}-city`}
|
|
64
|
-
name="city"
|
|
65
|
-
required
|
|
66
|
-
autocomplete="address-level2"
|
|
67
|
-
data-testid={`${id}-city`}
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<div class="form-group">
|
|
72
|
-
<label for={`${id}-region`}>State / County</label>
|
|
73
|
-
<input
|
|
74
|
-
type="text"
|
|
75
|
-
id={`${id}-region`}
|
|
76
|
-
name="region"
|
|
77
|
-
required
|
|
78
|
-
autocomplete="address-level1"
|
|
79
|
-
data-testid={`${id}-region`}
|
|
80
|
-
/>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div class="form-group">
|
|
84
|
-
<label for={`${id}-postalCode`}>Postcode</label>
|
|
85
|
-
<input
|
|
86
|
-
type="text"
|
|
87
|
-
id={`${id}-postalCode`}
|
|
88
|
-
name="postalCode"
|
|
89
|
-
required
|
|
90
|
-
autocomplete="postal-code"
|
|
91
|
-
data-testid={`${id}-postalCode`}
|
|
92
|
-
/>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div class="form-group">
|
|
96
|
-
<label for={`${id}-country`}>Country (2-letter code)</label>
|
|
97
|
-
<input
|
|
98
|
-
type="text"
|
|
99
|
-
id={`${id}-country`}
|
|
100
|
-
name="country"
|
|
101
|
-
required
|
|
102
|
-
autocomplete="country"
|
|
103
|
-
placeholder="GB"
|
|
104
|
-
data-testid={`${id}-country`}
|
|
105
|
-
/>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
interface Props {
|
|
3
|
-
items: Array<{ label: string; href?: string }>
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
const { items } = Astro.props
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
<nav class="pdp-breadcrumbs" aria-label="Breadcrumb" data-testid="breadcrumb">
|
|
10
|
-
{items.map((item, index) => (
|
|
11
|
-
<>
|
|
12
|
-
{index > 0 && <span class="separator" aria-hidden="true">/</span>}
|
|
13
|
-
{item.href && index < items.length - 1 ? (
|
|
14
|
-
<a href={item.href}>{item.label}</a>
|
|
15
|
-
) : (
|
|
16
|
-
<span class="current" aria-current="page">{item.label}</span>
|
|
17
|
-
)}
|
|
18
|
-
</>
|
|
19
|
-
))}
|
|
20
|
-
</nav>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import '../styles/pages/home.css'
|
|
3
|
-
import type { Category } from '@nymbalhq/types'
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
categories: Category[]
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const { categories } = Astro.props
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<div class="category-grid">
|
|
13
|
-
{categories.map((cat) => (
|
|
14
|
-
<a
|
|
15
|
-
href={`/category/${cat.slug}`}
|
|
16
|
-
class="category-card"
|
|
17
|
-
data-testid={`category-${cat.slug}`}
|
|
18
|
-
>
|
|
19
|
-
<span class="category-card-name">{cat.name}</span>
|
|
20
|
-
{cat.description && (
|
|
21
|
-
<span class="category-card-description" style="font-size: var(--nymbal-font-size-xs, 0.75rem); color: var(--nymbal-color-text-muted, #71717a); margin-top: var(--nymbal-spacing-xs, 0.25rem);">
|
|
22
|
-
{cat.description}
|
|
23
|
-
</span>
|
|
24
|
-
)}
|
|
25
|
-
</a>
|
|
26
|
-
))}
|
|
27
|
-
</div>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import '../styles/pages/checkout.css'
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
currentStep: 'contact' | 'shipping' | 'payment'
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const { currentStep } = Astro.props
|
|
9
|
-
const steps = ['contact', 'shipping', 'payment'] as const
|
|
10
|
-
const stepLabels = { contact: 'Contact', shipping: 'Shipping', payment: 'Payment' }
|
|
11
|
-
const currentIndex = steps.indexOf(currentStep)
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<div class="checkout-steps" data-testid="checkout-steps">
|
|
15
|
-
{steps.map((step, index) => {
|
|
16
|
-
const isCompleted = index < currentIndex
|
|
17
|
-
const isActive = step === currentStep
|
|
18
|
-
const stepClass = isCompleted ? 'checkout-step completed' : isActive ? 'checkout-step active' : 'checkout-step'
|
|
19
|
-
const dividerClass = index < currentIndex ? 'checkout-step-divider completed' : 'checkout-step-divider'
|
|
20
|
-
return (
|
|
21
|
-
<>
|
|
22
|
-
{index > 0 && <div class={dividerClass} aria-hidden="true"></div>}
|
|
23
|
-
<div class={stepClass} data-testid={`checkout-step-${step}`}>
|
|
24
|
-
<span>{stepLabels[step]}</span>
|
|
25
|
-
</div>
|
|
26
|
-
</>
|
|
27
|
-
)
|
|
28
|
-
})}
|
|
29
|
-
</div>
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
const currentYear = new Date().getFullYear()
|
|
3
|
-
---
|
|
4
|
-
<footer class="site-footer" data-testid="site-footer">
|
|
5
|
-
<div class="footer-container container">
|
|
6
|
-
<div class="footer-grid">
|
|
7
|
-
<div class="footer-column">
|
|
8
|
-
<h2 class="footer-heading">Shop</h2>
|
|
9
|
-
<ul class="footer-links">
|
|
10
|
-
<li><a href="/products">All Products</a></li>
|
|
11
|
-
<li><a href="/category/apparel">Apparel</a></li>
|
|
12
|
-
<li><a href="/category/home">Home</a></li>
|
|
13
|
-
<li><a href="/category/electronics">Electronics</a></li>
|
|
14
|
-
<li><a href="/category/books">Books</a></li>
|
|
15
|
-
</ul>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="footer-column">
|
|
19
|
-
<h2 class="footer-heading">Account</h2>
|
|
20
|
-
<ul class="footer-links">
|
|
21
|
-
<li><a href="/account/login">Login</a></li>
|
|
22
|
-
<li><a href="/account/register">Register</a></li>
|
|
23
|
-
<li><a href="/account/orders">Orders</a></li>
|
|
24
|
-
</ul>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<div class="footer-column">
|
|
28
|
-
<h2 class="footer-heading">About</h2>
|
|
29
|
-
<p class="footer-about">
|
|
30
|
-
Nymbal is a modern headless commerce platform built for developers.
|
|
31
|
-
Fast, flexible, and fully customisable.
|
|
32
|
-
</p>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div class="footer-bottom">
|
|
37
|
-
<p>© {currentYear} Nymbal. All rights reserved.</p>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</footer>
|
|
41
|
-
|
|
42
|
-
<style>
|
|
43
|
-
.site-footer {
|
|
44
|
-
background-color: var(--nymbal-color-primary, #18181b);
|
|
45
|
-
color: var(--nymbal-color-text-inverse, #fff);
|
|
46
|
-
margin-top: auto;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.footer-container {
|
|
50
|
-
padding-block: 3rem var(--nymbal-spacing-lg, 1.5rem);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.footer-grid {
|
|
54
|
-
display: grid;
|
|
55
|
-
grid-template-columns: 1fr;
|
|
56
|
-
gap: var(--nymbal-spacing-xl, 2rem);
|
|
57
|
-
margin-bottom: var(--nymbal-spacing-xl, 2rem);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@media (min-width: 641px) {
|
|
61
|
-
.footer-grid {
|
|
62
|
-
grid-template-columns: repeat(3, 1fr);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.footer-heading {
|
|
67
|
-
font-size: var(--nymbal-font-size-sm, 0.875rem);
|
|
68
|
-
font-weight: var(--nymbal-font-weight-bold, 700);
|
|
69
|
-
text-transform: uppercase;
|
|
70
|
-
letter-spacing: 0.05em;
|
|
71
|
-
margin-bottom: var(--nymbal-spacing-md, 1rem);
|
|
72
|
-
color: var(--nymbal-color-text-inverse, #fff);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.footer-links {
|
|
76
|
-
display: flex;
|
|
77
|
-
flex-direction: column;
|
|
78
|
-
gap: var(--nymbal-spacing-sm, 0.5rem);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.footer-links a {
|
|
82
|
-
font-size: var(--nymbal-font-size-sm, 0.875rem);
|
|
83
|
-
color: rgba(255, 255, 255, 0.7);
|
|
84
|
-
text-decoration: none;
|
|
85
|
-
transition: color var(--nymbal-transition-fast, 150ms) ease;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.footer-links a:hover {
|
|
89
|
-
color: var(--nymbal-color-text-inverse, #fff);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.footer-about {
|
|
93
|
-
font-size: var(--nymbal-font-size-sm, 0.875rem);
|
|
94
|
-
color: rgba(255, 255, 255, 0.7);
|
|
95
|
-
line-height: 1.6;
|
|
96
|
-
max-width: 28ch;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.footer-bottom {
|
|
100
|
-
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
|
101
|
-
padding-top: var(--nymbal-spacing-lg, 1.5rem);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.footer-bottom p {
|
|
105
|
-
font-size: var(--nymbal-font-size-xs, 0.75rem);
|
|
106
|
-
color: rgba(255, 255, 255, 0.5);
|
|
107
|
-
}
|
|
108
|
-
</style>
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { fetchCapabilities } from '../lib/api'
|
|
3
|
-
|
|
4
|
-
const capabilities = await fetchCapabilities()
|
|
5
|
-
const canSearch = capabilities?.search.capabilities.includes('search') ?? false
|
|
6
|
-
---
|
|
7
|
-
<header class="site-header" data-testid="site-header">
|
|
8
|
-
<div class="header-container container">
|
|
9
|
-
<a href="/" class="header-logo">Nymbal</a>
|
|
10
|
-
|
|
11
|
-
<label class="hamburger" for="nav-toggle" aria-label="Toggle navigation">
|
|
12
|
-
<span class="hamburger-line"></span>
|
|
13
|
-
<span class="hamburger-line"></span>
|
|
14
|
-
<span class="hamburger-line"></span>
|
|
15
|
-
</label>
|
|
16
|
-
<input type="checkbox" id="nav-toggle" class="nav-toggle visually-hidden" aria-label="Toggle navigation" />
|
|
17
|
-
|
|
18
|
-
<div class="header-nav-wrapper">
|
|
19
|
-
<nav class="header-nav" aria-label="Main navigation">
|
|
20
|
-
<a href="/category/apparel" class="nav-link">Apparel</a>
|
|
21
|
-
<a href="/category/home" class="nav-link">Home</a>
|
|
22
|
-
<a href="/category/electronics" class="nav-link">Electronics</a>
|
|
23
|
-
<a href="/category/books" class="nav-link">Books</a>
|
|
24
|
-
<a href="/products" class="nav-link">All Products</a>
|
|
25
|
-
</nav>
|
|
26
|
-
|
|
27
|
-
<div class="header-actions">
|
|
28
|
-
{canSearch && (
|
|
29
|
-
<nymbal-search-bar placeholder="Search products..." debounce-ms="300"></nymbal-search-bar>
|
|
30
|
-
)}
|
|
31
|
-
<a href="/account" class="header-account-link" aria-label="Account">
|
|
32
|
-
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
33
|
-
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" />
|
|
34
|
-
<circle cx="12" cy="7" r="4" />
|
|
35
|
-
</svg>
|
|
36
|
-
</a>
|
|
37
|
-
<nymbal-mini-cart></nymbal-mini-cart>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</header>
|
|
42
|
-
|
|
43
|
-
<style>
|
|
44
|
-
.site-header {
|
|
45
|
-
position: sticky;
|
|
46
|
-
top: 0;
|
|
47
|
-
z-index: var(--nymbal-z-index-sticky, 100);
|
|
48
|
-
background-color: var(--nymbal-color-surface, #fff);
|
|
49
|
-
border-bottom: 1px solid var(--nymbal-color-border, #e4e4e7);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.header-container {
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
gap: var(--nymbal-spacing-md, 1rem);
|
|
56
|
-
padding-block: var(--nymbal-spacing-sm, 0.5rem);
|
|
57
|
-
flex-wrap: wrap;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.header-logo {
|
|
61
|
-
font-size: var(--nymbal-font-size-lg, 1.125rem);
|
|
62
|
-
font-weight: var(--nymbal-font-weight-bold, 700);
|
|
63
|
-
color: var(--nymbal-color-primary, #18181b);
|
|
64
|
-
text-decoration: none;
|
|
65
|
-
letter-spacing: -0.02em;
|
|
66
|
-
flex-shrink: 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.header-logo:hover {
|
|
70
|
-
color: var(--nymbal-color-accent, #2563eb);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* Hamburger toggle */
|
|
74
|
-
.hamburger {
|
|
75
|
-
display: flex;
|
|
76
|
-
flex-direction: column;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
gap: 4px;
|
|
79
|
-
width: 28px;
|
|
80
|
-
height: 28px;
|
|
81
|
-
cursor: pointer;
|
|
82
|
-
margin-left: auto;
|
|
83
|
-
padding: 2px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.hamburger-line {
|
|
87
|
-
display: block;
|
|
88
|
-
width: 100%;
|
|
89
|
-
height: 2px;
|
|
90
|
-
background-color: var(--nymbal-color-primary, #18181b);
|
|
91
|
-
border-radius: 1px;
|
|
92
|
-
transition: transform var(--nymbal-transition-fast, 150ms) ease,
|
|
93
|
-
opacity var(--nymbal-transition-fast, 150ms) ease;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.nav-toggle:checked ~ .header-nav-wrapper {
|
|
97
|
-
display: flex;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.nav-toggle:checked ~ .hamburger .hamburger-line:nth-child(1) {
|
|
101
|
-
transform: translateY(6px) rotate(45deg);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.nav-toggle:checked ~ .hamburger .hamburger-line:nth-child(2) {
|
|
105
|
-
opacity: 0;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.nav-toggle:checked ~ .hamburger .hamburger-line:nth-child(3) {
|
|
109
|
-
transform: translateY(-6px) rotate(-45deg);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.header-nav-wrapper {
|
|
113
|
-
display: none;
|
|
114
|
-
flex-direction: column;
|
|
115
|
-
width: 100%;
|
|
116
|
-
gap: var(--nymbal-spacing-md, 1rem);
|
|
117
|
-
padding-block: var(--nymbal-spacing-sm, 0.5rem);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.header-nav {
|
|
121
|
-
display: flex;
|
|
122
|
-
flex-direction: column;
|
|
123
|
-
gap: var(--nymbal-spacing-xs, 0.25rem);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.nav-link {
|
|
127
|
-
display: block;
|
|
128
|
-
padding: var(--nymbal-spacing-xs, 0.25rem) var(--nymbal-spacing-sm, 0.5rem);
|
|
129
|
-
font-size: var(--nymbal-font-size-sm, 0.875rem);
|
|
130
|
-
font-weight: var(--nymbal-font-weight-medium, 500);
|
|
131
|
-
color: var(--nymbal-color-text, #18181b);
|
|
132
|
-
text-decoration: none;
|
|
133
|
-
border-radius: var(--nymbal-radius-sm, 0.25rem);
|
|
134
|
-
transition: background-color var(--nymbal-transition-fast, 150ms) ease,
|
|
135
|
-
color var(--nymbal-transition-fast, 150ms) ease;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.nav-link:hover {
|
|
139
|
-
background-color: var(--nymbal-color-border, #e4e4e7);
|
|
140
|
-
color: var(--nymbal-color-accent, #2563eb);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.header-actions {
|
|
144
|
-
display: flex;
|
|
145
|
-
align-items: center;
|
|
146
|
-
gap: var(--nymbal-spacing-sm, 0.5rem);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.header-account-link {
|
|
150
|
-
display: flex;
|
|
151
|
-
align-items: center;
|
|
152
|
-
justify-content: center;
|
|
153
|
-
width: 36px;
|
|
154
|
-
height: 36px;
|
|
155
|
-
color: var(--nymbal-color-text, #18181b);
|
|
156
|
-
text-decoration: none;
|
|
157
|
-
border-radius: var(--nymbal-radius-full, 9999px);
|
|
158
|
-
transition: background-color var(--nymbal-transition-fast, 150ms) ease,
|
|
159
|
-
color var(--nymbal-transition-fast, 150ms) ease;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.header-account-link:hover {
|
|
163
|
-
background-color: var(--nymbal-color-border, #e4e4e7);
|
|
164
|
-
color: var(--nymbal-color-accent, #2563eb);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/* Desktop layout */
|
|
168
|
-
@media (min-width: 769px) {
|
|
169
|
-
.hamburger {
|
|
170
|
-
display: none;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.header-container {
|
|
174
|
-
flex-wrap: nowrap;
|
|
175
|
-
padding-block: var(--nymbal-spacing-md, 1rem);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.header-nav-wrapper {
|
|
179
|
-
display: flex;
|
|
180
|
-
flex-direction: row;
|
|
181
|
-
align-items: center;
|
|
182
|
-
justify-content: space-between;
|
|
183
|
-
width: auto;
|
|
184
|
-
flex: 1;
|
|
185
|
-
padding-block: 0;
|
|
186
|
-
gap: var(--nymbal-spacing-lg, 1.5rem);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.header-nav {
|
|
190
|
-
flex-direction: row;
|
|
191
|
-
gap: var(--nymbal-spacing-xs, 0.25rem);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.nav-link {
|
|
195
|
-
padding: var(--nymbal-spacing-xs, 0.25rem) var(--nymbal-spacing-sm, 0.5rem);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
</style>
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import '../styles/pages/pdp.css'
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
images: Array<{ url: string; alt: string }>
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const { images } = Astro.props
|
|
9
|
-
const mainImage = images[0] ?? { url: 'https://picsum.photos/seed/placeholder/600/600', alt: 'Product image' }
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<div class="pdp-gallery" data-testid="product-gallery">
|
|
13
|
-
<img
|
|
14
|
-
src={mainImage.url}
|
|
15
|
-
alt={mainImage.alt}
|
|
16
|
-
class="pdp-main-image"
|
|
17
|
-
id="gallery-main-image"
|
|
18
|
-
width="600"
|
|
19
|
-
height="600"
|
|
20
|
-
/>
|
|
21
|
-
{images.length > 1 && (
|
|
22
|
-
<div class="pdp-thumbnails" id="gallery-thumbnails">
|
|
23
|
-
{images.map((img, i) => (
|
|
24
|
-
<img
|
|
25
|
-
src={img.url}
|
|
26
|
-
alt={img.alt}
|
|
27
|
-
class={`pdp-thumbnail ${i === 0 ? 'active' : ''}`}
|
|
28
|
-
data-index={i}
|
|
29
|
-
data-url={img.url}
|
|
30
|
-
data-alt={img.alt}
|
|
31
|
-
width="80"
|
|
32
|
-
height="80"
|
|
33
|
-
loading="lazy"
|
|
34
|
-
/>
|
|
35
|
-
))}
|
|
36
|
-
</div>
|
|
37
|
-
)}
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
import '../scripts/image-gallery.js'
|
|
42
|
-
</script>
|