@faststore/core 2.0.85-alpha.0 → 2.0.87-alpha.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/.turbo/turbo-build.log +4 -5
- package/CHANGELOG.md +6 -0
- package/package.json +4 -4
- package/src/components/sections/ProductDetails/ProductDetails.tsx +7 -5
- package/src/components/sections/ProductDetails/product-details.module.scss +0 -5
- package/src/components/ui/SkuSelector/Selectors.stories.mdx +5 -1
- package/src/components/ui/SkuSelector/Selectors.tsx +40 -54
- package/src/components/ui/SkuSelector/index.ts +0 -2
- package/src/sdk/cart/index.ts +2 -2
- package/.next/BUILD_ID +0 -1
- package/.next/build-manifest.json +0 -103
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/config.json +0 -7
- package/.next/cache/eslint/.cache_1gneedd +0 -1
- package/.next/cache/next-server.js.nft.json +0 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/export-marker.json +0 -1
- package/.next/images-manifest.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -1
- package/.next/react-loadable-manifest.json +0 -45
- package/.next/required-server-files.json +0 -1
- package/.next/routes-manifest.json +0 -1
- package/.next/server/chunks/104.js +0 -196
- package/.next/server/chunks/143.js +0 -106
- package/.next/server/chunks/154.js +0 -206
- package/.next/server/chunks/183.js +0 -72
- package/.next/server/chunks/247.js +0 -61
- package/.next/server/chunks/264.js +0 -67
- package/.next/server/chunks/280.js +0 -417
- package/.next/server/chunks/287.js +0 -79
- package/.next/server/chunks/312.js +0 -712
- package/.next/server/chunks/317.js +0 -125
- package/.next/server/chunks/350.js +0 -120
- package/.next/server/chunks/371.js +0 -1467
- package/.next/server/chunks/377.js +0 -82
- package/.next/server/chunks/394.js +0 -3801
- package/.next/server/chunks/439.js +0 -175
- package/.next/server/chunks/444.js +0 -464
- package/.next/server/chunks/465.js +0 -91
- package/.next/server/chunks/576.js +0 -72
- package/.next/server/chunks/608.js +0 -515
- package/.next/server/chunks/650.js +0 -216
- package/.next/server/chunks/664.js +0 -124
- package/.next/server/chunks/676.js +0 -32
- package/.next/server/chunks/732.js +0 -51
- package/.next/server/chunks/746.js +0 -237
- package/.next/server/chunks/849.js +0 -664
- package/.next/server/chunks/854.js +0 -72
- package/.next/server/chunks/859.js +0 -959
- package/.next/server/chunks/872.js +0 -378
- package/.next/server/chunks/881.js +0 -320
- package/.next/server/chunks/898.js +0 -240
- package/.next/server/chunks/914.js +0 -96
- package/.next/server/chunks/953.js +0 -674
- package/.next/server/chunks/98.js +0 -266
- package/.next/server/chunks/992.js +0 -570
- package/.next/server/chunks/font-manifest.json +0 -1
- package/.next/server/font-manifest.json +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/pages/404.js.nft.json +0 -1
- package/.next/server/pages/500.js.nft.json +0 -1
- package/.next/server/pages/[...slug].js +0 -633
- package/.next/server/pages/[...slug].js.nft.json +0 -1
- package/.next/server/pages/[slug]/p.js +0 -2586
- package/.next/server/pages/[slug]/p.js.nft.json +0 -1
- package/.next/server/pages/_app.js +0 -2113
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -304
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -164
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages/account.js.nft.json +0 -1
- package/.next/server/pages/api/graphql.js +0 -259
- package/.next/server/pages/api/graphql.js.nft.json +0 -1
- package/.next/server/pages/api/preview.js +0 -118
- package/.next/server/pages/api/preview.js.nft.json +0 -1
- package/.next/server/pages/checkout.js.nft.json +0 -1
- package/.next/server/pages/en-US/404.html +0 -81
- package/.next/server/pages/en-US/500.html +0 -81
- package/.next/server/pages/en-US/account.html +0 -81
- package/.next/server/pages/en-US/checkout.html +0 -81
- package/.next/server/pages/en-US/login.html +0 -81
- package/.next/server/pages/en-US/s.html +0 -81
- package/.next/server/pages/en-US.html +0 -81
- package/.next/server/pages/en-US.json +0 -1
- package/.next/server/pages/index.js +0 -428
- package/.next/server/pages/index.js.nft.json +0 -1
- package/.next/server/pages/login.js.nft.json +0 -1
- package/.next/server/pages/s.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -16
- package/.next/server/webpack-api-runtime.js +0 -229
- package/.next/server/webpack-runtime.js +0 -229
- package/.next/static/U30CqXXD1GphxOr478qYE/_buildManifest.js +0 -1
- package/.next/static/U30CqXXD1GphxOr478qYE/_ssgManifest.js +0 -1
- package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
- package/.next/static/chunks/153-a20e3f2da180607e.js +0 -1
- package/.next/static/chunks/29.8b3dad75b915d222.js +0 -1
- package/.next/static/chunks/337-cf283e91e431869b.js +0 -1
- package/.next/static/chunks/351-a4e28d64f48c5269.js +0 -1
- package/.next/static/chunks/380-efd3541ef85300d5.js +0 -1
- package/.next/static/chunks/608.59e69b83f35d9c44.js +0 -1
- package/.next/static/chunks/650.807852d1c36bfe44.js +0 -1
- package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
- package/.next/static/chunks/686.41582b9e75eaba89.js +0 -1
- package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
- package/.next/static/chunks/817-58eb9d4b3ee3be23.js +0 -1
- package/.next/static/chunks/843.fab5a00e170b4f11.js +0 -1
- package/.next/static/chunks/909.787de82e0ed9eea3.js +0 -1
- package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
- package/.next/static/chunks/main-9746772201fe3ac1.js +0 -1
- package/.next/static/chunks/pages/404-ba608a2a9f0c420a.js +0 -1
- package/.next/static/chunks/pages/500-910883c20541d9ce.js +0 -1
- package/.next/static/chunks/pages/[...slug]-51896262f6760bf1.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-08c1f443f7d84d0d.js +0 -1
- package/.next/static/chunks/pages/_app-0effc9759a3900cf.js +0 -1
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
- package/.next/static/chunks/pages/account-f19102933e6fd84c.js +0 -1
- package/.next/static/chunks/pages/checkout-f8cb7cb22225ef9d.js +0 -1
- package/.next/static/chunks/pages/index-912d65fde37706bb.js +0 -1
- package/.next/static/chunks/pages/login-0b9ea80d9fa0f91b.js +0 -1
- package/.next/static/chunks/pages/s-86fe1e3303388123.js +0 -1
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
- package/.next/static/chunks/webpack-dbb0d4f8be2c2abe.js +0 -1
- package/.next/static/css/2caa85943bafc7b1.css +0 -1
- package/.next/static/css/430b8cafbf7c23c1.css +0 -1
- package/.next/static/css/43d61b402f41569b.css +0 -1
- package/.next/static/css/6507cb48401e73a4.css +0 -1
- package/.next/static/css/9dd1d1084d254c66.css +0 -1
- package/.next/static/css/9e7c9877b9f78c63.css +0 -1
- package/.next/static/css/b2f16bd4b93e0aca.css +0 -1
- package/.next/static/css/bd743407c8049677.css +0 -1
- package/.next/static/media/brandless-neutral.76ddf63a.png +0 -0
- package/.next/trace +0 -64
- package/public/~partytown/debug/partytown-atomics.js +0 -556
- package/public/~partytown/debug/partytown-media.js +0 -374
- package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
- package/public/~partytown/debug/partytown-sw.js +0 -59
- package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
- package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
- package/public/~partytown/debug/partytown.js +0 -72
- package/public/~partytown/partytown-atomics.js +0 -2
- package/public/~partytown/partytown-media.js +0 -2
- package/public/~partytown/partytown-sw.js +0 -2
- package/public/~partytown/partytown.js +0 -2
- package/src/components/ui/SkuSelector/SkuSelector.stories.mdx +0 -345
- package/src/components/ui/SkuSelector/SkuSelector.tsx +0 -46
- package/src/components/ui/SkuSelector/sku-selector.module.scss +0 -172
- package/src/components/ui/SkuSelector/skuVariants.ts +0 -59
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
@import "src/styles/scaffold";
|
|
2
|
-
|
|
3
|
-
@mixin sku-selector-focus-ring {
|
|
4
|
-
@media not all and (min-resolution: .001dpcm) { // Target only Safari browsers
|
|
5
|
-
@supports (-webkit-appearance:none) {
|
|
6
|
-
// Use `focus` instead of `focus-visible` due to Safari's lack of support
|
|
7
|
-
&:focus + span {
|
|
8
|
-
border-color: var(--fs-border-color-active);
|
|
9
|
-
border-width: var(--fs-border-width-thick);
|
|
10
|
-
|
|
11
|
-
@include focus-ring;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&:focus-visible + span {
|
|
17
|
-
border-color: var(--fs-border-color-active);
|
|
18
|
-
border-width: var(--fs-border-width-thick);
|
|
19
|
-
|
|
20
|
-
@include focus-ring;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.fs-sku-selector {
|
|
25
|
-
// --------------------------------------------------------
|
|
26
|
-
// Design Tokens for Sku Selector
|
|
27
|
-
// --------------------------------------------------------
|
|
28
|
-
|
|
29
|
-
// Default properties
|
|
30
|
-
--fs-sku-selector-row-gap : var(--fs-spacing-1);
|
|
31
|
-
--fs-sku-selector-column-gap : var(--fs-sku-selector-row-gap);
|
|
32
|
-
--fs-sku-selector-text-size : var(--fs-text-size-1);
|
|
33
|
-
|
|
34
|
-
// Title
|
|
35
|
-
--fs-sku-selector-title-margin-bottom : var(--fs-spacing-0);
|
|
36
|
-
|
|
37
|
-
// Option
|
|
38
|
-
--fs-sku-selector-option-width : var(--fs-spacing-7);
|
|
39
|
-
--fs-sku-selector-option-height : var(--fs-sku-selector-option-width);
|
|
40
|
-
--fs-sku-selector-option-bkg-color-hover : var(--fs-color-primary-bkg-light);
|
|
41
|
-
|
|
42
|
-
--fs-sku-selector-option-border-width : var(--fs-border-width-thick);
|
|
43
|
-
--fs-sku-selector-option-border-color : var(--fs-color-neutral-7);
|
|
44
|
-
--fs-sku-selector-option-border-radius : var(--fs-border-radius);
|
|
45
|
-
--fs-sku-selector-option-border-color-hover : var(--fs-border-color-active);
|
|
46
|
-
|
|
47
|
-
--fs-sku-selector-option-checked-border-width : var(--fs-sku-selector-option-border-width);
|
|
48
|
-
--fs-sku-selector-option-checked-border-color : var(--fs-sku-selector-option-border-color-hover);
|
|
49
|
-
--fs-sku-selector-option-checked-box-shadow : 0 0 0 var(--fs-border-width-thickest) var(--fs-color-focus-ring-outline);
|
|
50
|
-
--fs-sku-selector-option-checked-bkg-color : var(--fs-sku-selector-option-bkg-color-hover);
|
|
51
|
-
|
|
52
|
-
--fs-sku-selector-option-disabled-width : var(--fs-border-width);
|
|
53
|
-
--fs-sku-selector-option-disabled-color : var(--fs-color-disabled-text);
|
|
54
|
-
--fs-sku-selector-option-disabled-border-color : var(--fs-border-color-disabled);
|
|
55
|
-
--fs-sku-selector-option-disabled-bkg-color : var(--fs-sku-selector-option-disabled-border-color);
|
|
56
|
-
|
|
57
|
-
--fs-sku-selector-option-transition-timing : var(--fs-transition-timing);
|
|
58
|
-
--fs-sku-selector-option-transition-function : ease;
|
|
59
|
-
|
|
60
|
-
// Image
|
|
61
|
-
--fs-sku-selector-image-width : var(--fs-spacing-6);
|
|
62
|
-
--fs-sku-selector-image-height : var(--fs-sku-selector-image-width);
|
|
63
|
-
--fs-sku-selector-image-border-radius : var(--fs-border-radius-small);
|
|
64
|
-
|
|
65
|
-
--fs-sku-selector-image-transition-timing : var(--fs-sku-selector-option-transition-timing);
|
|
66
|
-
--fs-sku-selector-image-transition-function : var(--fs-sku-selector-option-transition-function);
|
|
67
|
-
|
|
68
|
-
// --------------------------------------------------------
|
|
69
|
-
// Structural Styles
|
|
70
|
-
// --------------------------------------------------------
|
|
71
|
-
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-wrap: wrap;
|
|
74
|
-
row-gap: var(--fs-sku-selector-row-gap);
|
|
75
|
-
column-gap: var(--fs-sku-selector-column-gap);
|
|
76
|
-
font-size: var(--fs-sku-selector-text-size);
|
|
77
|
-
|
|
78
|
-
[data-fs-sku-selector-title] {
|
|
79
|
-
width: 100%;
|
|
80
|
-
margin-bottom: var(--fs-sku-selector-title-margin-bottom);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
[data-fs-radio-group-option] {
|
|
84
|
-
position: relative;
|
|
85
|
-
width: var(--fs-sku-selector-option-width);
|
|
86
|
-
height: var(--fs-sku-selector-option-height);
|
|
87
|
-
|
|
88
|
-
span {
|
|
89
|
-
position: relative;
|
|
90
|
-
display: flex;
|
|
91
|
-
align-items: center;
|
|
92
|
-
justify-content: center;
|
|
93
|
-
width: 100%;
|
|
94
|
-
height: 100%;
|
|
95
|
-
border: var(--fs-border-width) solid var(--fs-sku-selector-option-border-color);
|
|
96
|
-
border-radius: var(--fs-sku-selector-option-border-radius);
|
|
97
|
-
box-shadow: 0;
|
|
98
|
-
transition: box-shadow var(--fs-sku-selector-option-transition-timing) var(--fs-sku-selector-option-transition-function), background-color var(--fs-sku-selector-option-transition-timing) var(--fs-sku-selector-option-transition-function);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
[data-fs-sku-selector-option] {
|
|
102
|
-
position: absolute;
|
|
103
|
-
z-index: var(--fs-z-index-top);
|
|
104
|
-
width: 100%;
|
|
105
|
-
height: 100%;
|
|
106
|
-
opacity: 0;
|
|
107
|
-
|
|
108
|
-
@include sku-selector-focus-ring;
|
|
109
|
-
|
|
110
|
-
&:hover:not(:disabled):not(:checked) + span {
|
|
111
|
-
border-color: var(--fs-sku-selector-option-border-color-hover);
|
|
112
|
-
border-width: var(--fs-sku-selector-option-border-width);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&:checked + span {
|
|
116
|
-
border-color: var(--fs-sku-selector-option-checked-border-color);
|
|
117
|
-
border-width: var(--fs-sku-selector-option-checked-border-width);
|
|
118
|
-
box-shadow: var(--fs-sku-selector-option-checked-box-shadow);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&:disabled {
|
|
122
|
-
cursor: not-allowed;
|
|
123
|
-
|
|
124
|
-
+ span {
|
|
125
|
-
overflow: hidden;
|
|
126
|
-
color: var(--fs-sku-selector-option-disabled-color);
|
|
127
|
-
border-color: var(--fs-sku-selector-option-disabled-border-color);
|
|
128
|
-
|
|
129
|
-
&::after {
|
|
130
|
-
position: absolute;
|
|
131
|
-
width: var(--fs-sku-selector-option-disabled-width);
|
|
132
|
-
height: 160%;
|
|
133
|
-
content: "";
|
|
134
|
-
background-color: var(--fs-sku-selector-option-disabled-bkg-color);
|
|
135
|
-
transform: rotate(45deg);
|
|
136
|
-
transform-origin: center;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// --------------------------------------------------------
|
|
144
|
-
// Variants Styles
|
|
145
|
-
// --------------------------------------------------------
|
|
146
|
-
|
|
147
|
-
&[data-fs-sku-selector-variant="label"] [data-fs-sku-selector-option] {
|
|
148
|
-
&:hover:not(:disabled) + span { background-color: var(--fs-sku-selector-option-bkg-color-hover); }
|
|
149
|
-
|
|
150
|
-
&:checked + span { background-color: var(--fs-sku-selector-option-checked-bkg-color); }
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
&[data-fs-sku-selector-variant="image"] {
|
|
154
|
-
[data-fs-sku-selector-option-image] {
|
|
155
|
-
width: var(--fs-sku-selector-image-width);
|
|
156
|
-
height: var(--fs-sku-selector-image-height);
|
|
157
|
-
border-radius: var(--fs-sku-selector-image-border-radius);
|
|
158
|
-
transition: transform var(--fs-sku-selector-image-transition-timing) var(--fs-sku-selector-image-transition-function);
|
|
159
|
-
transform-origin: center center;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
[data-fs-sku-selector-option] {
|
|
163
|
-
&:hover:not(:disabled):not(:checked) + span [data-fs-sku-selector-option-image] {
|
|
164
|
-
transform: scale(.95);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&:checked + span [data-fs-sku-selector-option-image] {
|
|
168
|
-
transform: scale(.85);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { NextRouter } from 'next/router'
|
|
2
|
-
|
|
3
|
-
export type SkuVariantsByName = Record<
|
|
4
|
-
string,
|
|
5
|
-
Array<{ alt: string; src: string; label: string; value: string }>
|
|
6
|
-
>
|
|
7
|
-
|
|
8
|
-
export function getSkuSlug(
|
|
9
|
-
slugsMap: Record<string, string>,
|
|
10
|
-
selectedVariations: Record<string, string>,
|
|
11
|
-
dominantVariation: string
|
|
12
|
-
) {
|
|
13
|
-
const slugsMapKey = Object.entries(selectedVariations).flat().join('-')
|
|
14
|
-
|
|
15
|
-
if (slugsMapKey in slugsMap) {
|
|
16
|
-
return slugsMap[slugsMapKey]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const possibleVariants = Object.keys(slugsMap)
|
|
20
|
-
|
|
21
|
-
const firstVariationForDominantValue = possibleVariants.find((slug) =>
|
|
22
|
-
slug.includes(
|
|
23
|
-
`${dominantVariation}-${selectedVariations[dominantVariation]}`
|
|
24
|
-
)
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
return slugsMap[firstVariationForDominantValue ?? possibleVariants[0]]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function navigateToSku({
|
|
31
|
-
router,
|
|
32
|
-
slugsMap,
|
|
33
|
-
dominantSku,
|
|
34
|
-
selectorsState,
|
|
35
|
-
updatedVariationName,
|
|
36
|
-
updatedVariationValue,
|
|
37
|
-
}: {
|
|
38
|
-
router: NextRouter
|
|
39
|
-
dominantSku: string
|
|
40
|
-
slugsMap: Record<string, string>
|
|
41
|
-
selectorsState: Record<string, string>
|
|
42
|
-
updatedVariationName: string
|
|
43
|
-
updatedVariationValue: string
|
|
44
|
-
}) {
|
|
45
|
-
const whereTo = `/${getSkuSlug(
|
|
46
|
-
slugsMap,
|
|
47
|
-
{
|
|
48
|
-
...selectorsState,
|
|
49
|
-
[updatedVariationName]: updatedVariationValue,
|
|
50
|
-
},
|
|
51
|
-
dominantSku
|
|
52
|
-
)}/p`
|
|
53
|
-
|
|
54
|
-
if (whereTo === window.location.pathname) {
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
router.push(whereTo)
|
|
59
|
-
}
|